(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(":root{--dots-whatsapp-borderColor: #009600;--dots-whatsapp-color: #00a000;--dots-whatsapp-box-shadow-color: #007b00;--dots-webchat-borderColor: #2242d4;--dots-webchat-color: #2242d4;--dots-root-borderColor: #ff5022;--dots-root-color: #ff5022}#chat-dots{font-family:Roboto,sans-serif;flex-direction:column;gap:6px;position:fixed;z-index:20000}.dots{display:none;cursor:pointer;width:68px;height:68px;border-radius:100%;padding:0;box-shadow:1px 1px 2px var(--dots-root-color)}.dots-close{display:none;justify-content:center;align-items:center;background-color:#fff;border:solid 1px rgb(221,221,221);box-shadow:1px 1px 2px #b0b0b0}.dots-close img{width:30px;height:30px}.dots-open{display:flex;border:solid 1px var(--dots-root-borderColor);background-color:var(--dots-root-color);justify-content:center;align-items:center;animation:pulse 1.8s infinite;animation-delay:.9s;-webkit-animation-delay:.9s}.dots-open img{width:42px;height:42px}.dots-open-root{display:flex;justify-content:center;align-items:center;cursor:pointer;gap:8px}.dots-open-title{display:flex;justify-content:center;align-items:center;font-size:14px;line-height:21px;background:#fff;opacity:.9;box-shadow:1px 1px 1px 1px #b0b0b0;padding:6px 12px;color:#000;font-weight:600;border-radius:8px}.dots-wpp{border:solid 1px var(--dots-whatsapp-borderColor);background-color:var(--dots-whatsapp-color);box-shadow:1px 1px 2px var(--dots-whatsapp-box-shadow-color);z-index:10000}.dots-wpp .dots-wpp-cta{display:flex;justify-content:center;align-items:center;width:100%;height:100%;color:#fff}.dots-wpp a{display:flex;justify-content:center;align-items:center;width:100%;height:100%;color:#fff;border-radius:100%}.dots-chat{border:solid 1px var(--dots-webchat-borderColor);background-color:var(--dots-webchat-color);box-shadow:1px 1px 2px var(--dots-webchat-color);justify-content:center;align-items:center}.dots-chat img{width:42px;height:42px}.dots-ripple{position:absolute;width:68px;height:68px;right:0;background-color:var(--dots-root-color);border:solid 1px var(--dots-root-borderColor);animation:ripple 1.8s infinite;border-radius:100%;z-index:-1}.dots-ripple:nth-child(1){animation-delay:.3s;-webkit-animation-delay:.3s}.dots-ripple:nth-child(2){animation-delay:.6s;-webkit-animation-delay:.6s}#mundiale-chat-open-iframe{display:none!important}@keyframes ripple{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(1.35);transform:scale(1.35)}}@keyframes pulse{0%{transform:scale(1)}50%{transform:scale(1.1)}to{transform:scale(1)}}")),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); (function(l,p){typeof exports=="object"&&typeof module<"u"?module.exports=p():typeof define=="function"&&define.amd?define(p):(l=typeof globalThis<"u"?globalThis:l||self,l.snippet=p())})(this,function(){"use strict";const l={Android(){return!!navigator.userAgent.match(/Android/i)},BlackBerry(){return!!navigator.userAgent.match(/BlackBerry/i)},iOS(){return!!navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera(){return!!navigator.userAgent.match(/Opera Mini/i)},Windows(){return!!navigator.userAgent.match(/IEMobile/i)},detect(){return l.Android()?{isMobile:!0,device:"Android"}:l.BlackBerry()?{isMobile:!0,device:"BlackBerry"}:l.iOS()?{isMobile:!0,device:"iOS"}:l.Opera()?{isMobile:!0,device:"Opera"}:l.Windows()?{isMobile:!0,device:"Windows"}:{isMobile:!1,device:"unknown"}}},{isMobile:p,device:v}=l.detect();function Y(){const n=document.querySelector("#mundiale-chat-container #mundiale-chat-iframe");n&&(n.style.bottom="0px",n.style.right="0px",n.setAttribute("title","Mundiale WebChat"))}class r{static getEasterDay(t){const e=Math.floor,a=t%19,o=e(t/100),s=(o-e(o/4)-e((8*o+13)/25)+19*a+15)%30,c=s-e(s/28)*(1-e(29/(s+1))*e((21-a)/11)),d=(t+e(t/4)+c+2-o+e(o/4))%7,M=c-d,i=3+e((M+40)/44),u=M+28-31*e(i/4);return new Date(t,i-1,u)}static addDays(t,e){const a=new Date(t);return a.setDate(a.getDate()+e),a}static handleDateFormat(t){return`${String(t.getDate())}/${String(t.getMonth()+1)}`}static isHoliday(t){const e=r.handleDateFormat(t);if(["1/1","21/4","1/5","7/9","12/10","2/11","15/11","25/12"].includes(e))return!0;const o=r.getEasterDay(new Date(t).getFullYear()),s=r.handleDateFormat(o),c=r.handleDateFormat(r.addDays(o,-47)),d=r.handleDateFormat(r.addDays(o,-2)),M=r.handleDateFormat(r.addDays(o,60));return[s,c,M,d].includes(e)}static createDate(){const t=new Date().toLocaleString("en-US",{timeZone:"America/Sao_Paulo"});return new Date(t)}static getWeekDay(t){if(r.isHoliday(t))return"HOLIDAY";const e=t.getDay();return["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"][e]}static convertTimeToMinutes(t){const e=t.split(":"),a=parseInt(e[0],10),o=parseInt(e[1],10);return a*60+o}}const U=n=>{if(!n)return!0;const t=r.createDate(),e=n.days,a=r.getWeekDay(t),o=e[a];if(typeof o=="boolean")return o;const s=r.convertTimeToMinutes(`${t.getHours()}:${t.getMinutes()}`),c=r.convertTimeToMinutes(o.deactivate),d=r.convertTimeToMinutes(o.activate);return d>=c?s>=d||s=d&&s((n==null?void 0:n.isActive)||!1)&&!U(n);let A,f,E;function x(n){var a,o;E=!1;let t="unknown";const e=window.navigator;e&&e.connection&&e.connection.downlink&&(t=`${e.connection.downlink.toString()} MB`),(o=(a=window.mundialeSdk)==null?void 0:a.mundialeChat)==null||o.sendPayloadMessage({type:"text",content:{text:" "},metadata:{page:window.location.href,campaign:n.name,isMobile:p?"true":"false",device:p?v||"undefined":"PC",downlink:t,userAgent:e.userAgent,openEvent:f?"true":"false",isGreeting:!0}})}function Q(n){return new Promise(t=>{setTimeout(()=>t(null),n)})}function T(n,t){var e;f=n,(e=window.mundialeSdk)!=null&&e.mundialeChat&&!window.mundialeSdk.mundialeChat.widget.isOpen&&(E===!0&&x(t),window.mundialeSdk.mundialeChat.toggleChat())}function W(n){const t=Array.from(document.querySelectorAll(".mundiale-open-webchat")||[]);for(const e of t)e.addEventListener("click",()=>{T(!1,n)})}function Z(n){var a;const t=(a=n.webchat.autoOpen)==null?void 0:a.desktop,e=C(n.afterHour);t&&!e&&setTimeout(()=>{T(!0,n)},t*1e3)}async function B({onOpen:n,campaignConfig:t}){await Promise.race([import("https://webchat-sdk.mundiale.com.br/bundle.js"),Q(5*60*1e3)]);const e=document.querySelector(".dots-chat");if(!e||(e.setAttribute("is-loading","true"),typeof window.MundialeChat>"u"))return;const a=t.webchat.chatKey;if(!a)return;A=new window.MundialeChat().withChannelKey(a).withoutBottomCalc(),A.build(),window.addEventListener("message",s=>{var c,d,M;s.origin==="https://webchat.mundiale.com.br"&&((c=s.data)==null?void 0:c.code)==="Mundiale-SendFirstMessage"&&(E=!0,(M=(d=window.mundialeSdk)==null?void 0:d.mundialeChat)!=null&&M.widget.isOpen&&x(t))},!1),e.addEventListener("click",()=>{T(!1,t),n&&n()}),e.removeAttribute("is-loading");const o=document.querySelector(".dots-close");o&&o.style.display!=="none"&&(e.style.display=o.style.display),window.mundialeSdk&&(window.mundialeSdk.mundialeChat=A,window.mundialeSdk.openWebchat=()=>T(!1,t)),W(t),Z(t),Y()}async function P(n,t){try{if(!t)return null;const e=await fetch(`${t}/generate-code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:n})});if(e.ok){const{code:a}=await e.json();if(a&&typeof a=="string")return a}return null}catch{return null}}function g({phone:n,text:t}){return`https://api.whatsapp.com/send?1=pt_BR&phone=${n}&text=${t}`}function O(n,t){const e=document.getElementById("cta-wpp-click");if(e&&e.setAttribute("href",n),t)return;const a=document.querySelectorAll(".mundiale-open-whatsapp");for(let s=0;s{await k({campaignConfig:n,phone:t,text:e,API_CODE_GENERATOR_URL:a})})}const G=` `,R="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pjxzdmcgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0aXRsZS8+PGcgZGF0YS1uYW1lPS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Y0LjI2NyAxMjkuMDczIDE1Ni45MjEgMTE1LjY3MyAxNTYuMjQ1IDExNC44OTNDMTUzLjE0NyAxMTEuMzIgMTQ2LjgwNyAxMTAuMTUzIDE0Mi4xMDUgMTEyLjI5MVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=";let m,j,N,y,w;function $(){j&&m&&(j.style.display="none",m.style.display="flex",N&&(N.style.display="flex"),y&&y.getAttribute("is-loading")===null&&(y.style.display="flex"),w&&(w.style.display="none"))}function J(n,t){const e=document.createElement("div");e.className="dots-open-root",j=e;const a=document.createElement("div");a.className="dots-open dots";const o=document.createElement("img");o.alt="Abrir opções de chat",o.src=z;const s=document.createElement("div");return s.className="dots-open-title",s.innerText=n||"Atendimento Online",a.appendChild(o),e.onclick=$,t==="left"?(e.appendChild(a),e.appendChild(s)):(e.appendChild(s),e.appendChild(a)),e}function S(){j&&m&&(j.style.display="flex",m.style.display="none",N&&(N.style.display="none"),y&&(y.style.display="none"),w&&(w.style.display="flex"))}function q(){const n=document.createElement("div");n.className="dots-close dots",m=n;const t=document.createElement("img");return t.alt="Fechar opções de chat",t.src=R,n.setAttribute("display","none"),n.appendChild(t),n.onclick=S,n}function V(n,t){const e=document.createElement("div");e.className="dots-wpp dots",N=e;const a=document.createElement("div");a.className="dots-wpp-cta",a.innerHTML=G;const o=a.querySelector("svg");o&&(o.classList.add("tag-manager"),o.setAttribute("data-tag-manager-event","convertion"),o.setAttribute("data-tag-manager-type","whatsapp"),o.setAttribute("data-tag-manager-component","snippet"));const s=document.createElement("a");return s.href=g({phone:t,text:n}),s.target="_blank",s.rel="noopener noreferrer",s.id="cta-wpp-click",s.ariaLabel="Clique aqui para ser atendido pelo WhatsApp",s.className="tag-manager open-whatsapp",s.setAttribute("data-tag-manager-event","convertion"),s.setAttribute("data-tag-manager-type","whatsapp"),s.setAttribute("data-tag-manager-component","snippet"),s.appendChild(a),e.appendChild(s),e}function X(){const n=document.createElement("div");n.className="dots-chat dots tag-manager",y=n,n.setAttribute("data-tag-manager-event","convertion"),n.setAttribute("data-tag-manager-type","webchat"),n.setAttribute("data-tag-manager-component","snippet");const t=document.createElement("img");return t.src=z,t.id="cta-chat-click",t.alt="Clique aqui para ser atendido pelo chat web",t.className="tag-manager",t.setAttribute("data-tag-manager-event","convertion"),t.setAttribute("data-tag-manager-type","webchat"),t.setAttribute("data-tag-manager-component","snippet"),n.appendChild(t),n}function H(){const n=document.createElement("div");n.className="dots-ripple";for(let t=0;t<2;t+=1){const e=document.createElement("div");e.className="dots-ripple",n.appendChild(e)}return w=n,n}async function K({campaign:n,text:t,phone:e,title:a,position:o,includeWhatsapp:s,includeWebchat:c,startHidden:d=!1}){const M=[];if(s&&M.push(V(t,e)),c&&M.push(X()),M.length===0)throw new Error("No chat options provided");if(M.length>1){const i=document.createElement("div");i.id="chat-dots",i.className="dots-root",i.style.display=d?"none":"flex",i.style.bottom=o.bottom,i.style.setProperty(o.side,o.horizontal);const u=J(a,o.side),I=q();for(const h of M)i.appendChild(h);const L=H();i.appendChild(u),i.appendChild(I),i.appendChild(L);const D=g({phone:e,text:t});window.mundialeSdk={version:"1.0.0",campaign:n,displaySnippet:h=>{h===void 0?i.style.display=i.style.display==="flex"?"none":"flex":i.style.display=h?"flex":"none"},openWhatsapp:()=>{window.open(D,"_blank")},whatsappHref:D},document.body.appendChild(i)}else{const i=M[0];i.style.display=d?"none":"flex",i.style.position="fixed",i.style.bottom=o.bottom,i.style.setProperty(o.side,o.horizontal);const u=g({phone:e,text:t});window.mundialeSdk={version:"1.0.0",campaign:n,displaySnippet:I=>{i.style.display=I?"flex":"none"},openWhatsapp:()=>{window.open(u,"_blank")},whatsappHref:u},document.body.appendChild(i)}}function _(n){const t=n.style.whatsappDots;t&&(document.documentElement.style.setProperty("--dots-whatsapp-borderColor",t.borderColor),document.documentElement.style.setProperty("--dots-whatsapp-color",t.color),document.documentElement.style.setProperty("--dots-whatsapp--shadow-color",t.boxShadowColor));const e=n.style.webchatDots;document.documentElement.style.setProperty("--dots-webchat-borderColor",e.borderColor),document.documentElement.style.setProperty("--dots-webchat-color",e.color);const a=n.style.rootDots;document.documentElement.style.setProperty("--dots-root-borderColor",a.borderColor),document.documentElement.style.setProperty("--dots-root-color",a.color)}async function b(n){const t=window.location.hostname.replace(/^www\./,""),e=`${t}${window.location.pathname}`,a=n.campaigns[e]||n.campaigns[t]||n.campaigns[n.defaultCampaign],o=a.whatsapp.phoneNumber,s=(a.whatsapp.text||"Olá 😉").trim();_(a);const{type:c,afterHour:d}=a,M=["whatsapp","dots"].includes(c),i=c==="webchat"||c==="dots"&&!p,{title:u,position:I,startHidden:L}=a.style;await K({campaign:a.name,text:s,phone:o,title:u,position:I,includeWhatsapp:M,includeWebchat:i,startHidden:d?C(d):!!L});const D=[];M&&D.push(F({campaignConfig:a,phone:o,text:s,API_CODE_GENERATOR_URL:n.env.API_CODE_GENERATOR_URL})),i&&D.push(B({campaignConfig:a,onOpen:S})),await Promise.all(D)}return window&&(window.mundialeSnippet=b),b});