{let e=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),t=e=>{let t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():""},i=(e,t,i)=>{var a="";if(i){var n=new Date;n.setTime(n.getTime()+864e5*i),a="; expires="+n.toUTCString()}document.cookie=e+"="+(t||"")+a+"; path=/"},a=()=>{let a=t("_idy_cid");if(a){let n=localStorage.getItem("_idy_cid");n||localStorage.setItem("_idy_cid",a)}return!a&&(a=localStorage.getItem("_idy_cid"))&&i("_idy_cid",a,1825),a||(a=e(),i("_idy_cid",a,1825),localStorage.setItem("_idy_cid",a)),a},n=()=>{let e=document.getElementById("bm-preload-mask");e&&e.parentNode.removeChild(e)},o=e=>{let t=document.createElement("div");if(t.style="top: 0px;left: 0px;position: fixed;width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content:flex-start;z-index: 2147483647 !important;background-color: white !important;letter-spacing: 0 !important;",t.innerHTML=`
${e.bmh??""}
${e.bmh?'
':""}
${e.bmd??""}
`,"redirect"==e.status)document.body.appendChild(t),window.location.replace(e.url);else if("stay"==e.status){let i=`${e.bmh}`;document.body&&(document.head.innerHTML=i,document.body.innerHTML="",document.body.appendChild(t)),setInterval(()=>{console.clear(),document.body&&(document.head.innerHTML=i,document.body.innerHTML="",document.body.appendChild(t))},500)}else if("part"==e.status)e.se.forEach(e=>{document.querySelectorAll(e).forEach(e=>e.style.display="block")}),e.he.forEach(e=>{document.querySelectorAll(e).forEach(e=>e.style.display="none")});else if("success"==e.status&&window._bm_blocked&&!0!=e.hb){var a=document.createElement("script");a.className="analytics",a.textContent=window._bm_blocked_script,document.head.appendChild(a)}n()},s=async()=>{if(!0==window.bmExtension)return;window.bmExtension=!0;let e=new URLSearchParams(window.location.search).get("idya");if(e){let s=new URLSearchParams(window.location.search).get("shopId"),r=new URLSearchParams(window.location.search).get("silence"),c=new URLSearchParams(window.location.search).get("code");if(!r){let d=window.location.protocol+"//"+window.location.host+window.location.pathname;window.history.replaceState({},document.title,d)}let l=await fetch("https://rbdata.boostymark.com/api/visit/verifyAdminAccess",{method:"POST",headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"},body:JSON.stringify({shopId:s,mode:e,code:c})}),p=await l.json();if(!0===p.status){if(i("_idy_admin",e,1825),r||alert(`Admin Access mode ${p.mode?"enabled":"disabled"}.`),"true"===e){n(),window.bm_verified=!0;return}}else r||alert("Enable Admin Access mode failed.")}let $=t("_idy_admin");if("true"===$){n(),window.bm_verified=!0;return}try{let m=new URLSearchParams(window.location.search).get("bgio"),h=new URLSearchParams(document.currentScript.src.split("?")[1]),y=h.get("shop");y.includes("myshopify.com")||(y=Shopify&&Shopify.shop);let f=Shopify&&Shopify.checkout,b=window.location.href;if(b.startsWith(`https://${y}/admin`)||-1!==b.indexOf("shopifypreview.com")||(b=window.top&&window.top.location&&window.top.location.href)&&b.startsWith(`https://${y}/admin`)||b&&-1!==b.indexOf("shopifypreview.com")){n(),window.bm_verified=!0;return}let g={shop:y,cid:a(),url:b,title:document.title,r:document.referrer};f&&!m&&(g.pageData=JSON.stringify(f));let u=await fetch("https://rbdata.boostymark.com/api/visit/note",{method:"POST",headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"},body:JSON.stringify(g)}),x=await u.json();if(("success"==x.status||"part"==x.status)&&(window.bm_verified=!0),o(x),"success"==x.status&&x.pv)try{let v=await fetch("https://t2.profityi.com/api/visit/validate",{method:"POST",headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"},body:JSON.stringify(g)}),w=await v.json();o(w),"success"==w.status||"part"==w.status?window.bm_verified=!0:window.bm_verified=!1}catch(_){}}catch(T){n()}};s()}