(function(){const E=(t=>{const n=e=>e.split("").reverse().join("");return n(atob(n(t)))})("==Aa0RHczpzLvEGcw5iehBndvl2Yl5ycpRXZ"),i="https://app.zapvoice.site".startsWith("__ZV_")?E:"https://app.zapvoice.site".replace(/\/$/,""),w=i+"/api/public/brand-settings",l="zv_brand_cache_v1",U=300*1e3,u="5514991238006",y=["https://api.whatsapp.com/send?phone=","https://wa.me/","https://web.whatsapp.com/send/?phone="],c=i+"/install",o=i+"/uninstall";let a="",p=c,h=o;function L(){try{globalThis.__ZV_SUPPORT_WHATSAPP_NUMBER=a,globalThis.__ZV_INSTALL_REDIRECT_URL=p,globalThis.__ZV_UNINSTALL_REDIRECT_URL=h}catch{}}function R(t,n){try{const e=new URL(t),r=new URL(n);return r.search=e.search,r.toString()}catch{return n}}function b(t,n){const e=n==="install"?p:h,r=n==="install"?c:o;if(!e||e===r)return t;const s=String(t??"");if(s.includes(r))return s.split(r).join(e);const f=n==="install"?"/install":"/uninstall";try{const A=new URL(s);if(A.pathname===f||A.pathname.endsWith(f))return R(s,e)}catch{}if(s.includes(f))try{return R(s,e)}catch{}return s}function N(t){if(typeof t!="string")return t;let n=t;if(n=n.split(u).join(a),!a)for(const e of y)n=n.split(e+u).join(e);return n=b(n,"install"),n=b(n,"uninstall"),n}try{const t=window.open;window.open=function(n,...e){try{return t.call(this,N(n),...e)}catch{return t.call(this,n,...e)}}}catch{}function _(t){try{(t||document).querySelectorAll("a[href]").forEach(e=>{const r=e.getAttribute("href");r&&(r.includes(u)||r.includes("/install")||r.includes("/uninstall")||r.includes(c)||r.includes(o))&&e.setAttribute("href",N(r))})}catch{}}function d(){if(!document.body){document.addEventListener("DOMContentLoaded",d,{once:!0});return}_(document);try{new MutationObserver(t=>{for(const n of t)n.addedNodes.forEach(e=>{e.nodeType===1&&_(e)})}).observe(document.body,{childList:!0,subtree:!0})}catch{}}function m(t){a=typeof t?.supportWhatsappNumber=="string"?t.supportWhatsappNumber:"",p=t?.installRedirectUrl||c,h=t?.uninstallRedirectUrl||o,L()}L();try{chrome.storage?.local?.get?.(l,t=>{const n=t?.[l];n?.brand&&m(n.brand),d()})}catch{d()}fetch(w,{cache:"no-store"}).then(t=>t.ok?t.json():null).then(t=>{if(!t)return;const n={supportWhatsappNumber:t?.support?.whatsappConfigured&&typeof t?.support?.whatsappNumber=="string"?t.support.whatsappNumber:"",installRedirectUrl:t?.redirects?.install||c,uninstallRedirectUrl:t?.redirects?.uninstall||o};m(n);try{chrome.storage?.local?.set?.({[l]:{at:Date.now(),brand:n}})}catch{}_(document)}).catch(()=>{})})();
