(()=>{var e={482:function(e,t,n){var o,i,r;!function(s,a){"use strict";i=[n(550)],void 0===(r="function"==typeof(o=function(e){var t=/(^|@)\S+:\d+/,n=/^\s*at .*(\S+:\d+|\(native\))/m,o=/^(eval@)?(\[native code])?$/;return{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(n))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(e){return!!e.match(n)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var n=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),o=n.match(/ (\(.+\)$)/);n=o?n.replace(o[0],""):n;var i=this.extractLocation(o?o[1]:n),r=o&&n||void 0,s=["eval",""].indexOf(i[0])>-1?void 0:i[0];return new e({functionName:r,fileName:s,lineNumber:i[1],columnNumber:i[2],source:t})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(e){return!e.match(o)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e({functionName:t});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,o=t.match(n),i=o&&o[1]?o[1]:void 0,r=this.extractLocation(t.replace(n,""));return new e({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:t})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,o=t.message.split("\n"),i=[],r=2,s=o.length;r/,"$2").replace(/\([^)]*\)/g,"")||void 0;r.match(/\(([^)]*)\)/)&&(n=r.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new e({functionName:s,args:a,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})}),this)}}})?o.apply(t,i):o)||(e.exports=r)}()},550:function(e,t){var n,o,i;!function(r,s){"use strict";o=[],void 0===(i="function"==typeof(n=function(){function e(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var n=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],i=["fileName","functionName","source"],r=n.concat(o,i,["args"],["evalOrigin"]);function s(t){if(t)for(var n=0;n0?2===a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,u):this[a[0]]=a[1]:3===a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=u?u.replace(a[1],a[2]):r:this[a[0]]=u?a[1].call(this,u,a[2]):r:4===a.length&&(this[a[0]]=u?a[3].call(this,u.replace(a[1],a[2])):r):this[a]=u||r;d+=2}},Y=function(e,t){for(var n in t)if(typeof t[n]===c&&t[n].length>0){for(var o=0;o2&&(e[d]="iPad",e[f]=v),e},this.getEngine=function(){var e={};return e[p]=r,e[h]=r,X.call(e,o,y.engine),e},this.getOS=function(){var e={};return e[p]=r,e[h]=r,X.call(e,o,y.os),x&&!e[p]&&w&&"Unknown"!=w.platform&&(e[p]=w.platform.replace(/chrome os/i,B).replace(/macos/i,V)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(e){return o=typeof e===l&&e.length>500?W(e,500):e,this},this.setUA(o),this};Q.VERSION="1.0.37",Q.BROWSER=H([p,h,u]),Q.CPU=H([b]),Q.DEVICE=H([d,m,f,w,g,y,v,x,E]),Q.ENGINE=Q.OS=H([p,h]),typeof t!==a?(e.exports&&(t=e.exports=Q),t.UAParser=Q):n.amdO?(o=function(){return Q}.call(t,n,t,e))===r||(e.exports=o):typeof i!==a&&(i.UAParser=Q);var Z=typeof i!==a&&(i.jQuery||i.Zepto);if(Z&&!Z.ua){var ee=new Q;Z.ua=ee.getResult(),Z.ua.get=function(){return ee.getUA()},Z.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var n in t)Z.ua[n]=t[n]}}}("object"==typeof window?window:this)}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e="webPixelsManager",t="production",o="0.0.475",i="modern",r="7b7d009ewa2c1b8d4pecef99eam4ebee0fe",s="b7b7d009ewa2c1b8d4pecef99eam4ebee0fem.js",a="loggedConversion2",c="WebPixel::Render",l="web-pixels-manager-sandbox-container",u="product_added_to_cart",d="Added Product Next",p="product_removed_from_cart",f="payment_info_submitted";function m(){return window}let h="OFF";function b(e,t,n){const{jQuery:o}=m();o&&o(e).bind?o(e).bind(t,n):e.addEventListener&&e.addEventListener(t,n)}function w(e,t){"ON"===h&&console&&console.warn&&console.warn(`[pixel_shop_events_listener] Error in ${e}: ${t.message}`)}function g(e){b(window,"load",(()=>{for(const t of document.forms)e(t)}))}function v(e){const t=function(e){var t,n,o,i,r,s,a,c,l,u,d,p,f,m,h;const b=(null==(t=e.merchandise)?void 0:t.product.title)||void 0,w=(null==(n=e.merchandise)?void 0:n.title)||void 0,g=b&&w?`${b} - ${w}`:b||w||"";return e?{productId:null==(o=e.merchandise)||null==(i=o.product)?void 0:i.id,variantId:null==(r=e.merchandise)?void 0:r.id,name:g,sku:null==(s=e.merchandise)?void 0:s.sku,category:null==(a=e.merchandise)||null==(c=a.product)?void 0:c.type,brand:null==(l=e.merchandise)||null==(u=l.product)?void 0:u.vendor,variant:null==(d=e.merchandise)?void 0:d.title,price:null==(p=e.merchandise)||null==(f=p.price)?void 0:f.amount,quantity:e.quantity,currency:null==(m=e.merchandise)||null==(h=m.price)?void 0:h.currencyCode,cartToken:y(document.cookie).cart||void 0}:{}}(e);window.ShopifyAnalytics&&window.ShopifyAnalytics.lib&&"function"==typeof window.ShopifyAnalytics.lib.track&&window.ShopifyAnalytics.lib.track(d,{...t})}function y(e){const t={};for(const o of e.split(/ *; */)){const[e,i]=o.split("=");if(void 0!==e)try{t[decodeURIComponent(e)]=decodeURIComponent(i||"")}catch(n){continue}}return t}function x(e,t,n){if(t.length!==n.length)throw Error("Payload body and response have different number of items");t.forEach(((t,o)=>{let i=1;try{i=parseInt(n[o].quantity,10)||1}catch(r){w("handleBulkItemCartAddResponse",r)}_(e,t,i)}))}function E(e,t,n,o,i){const r=((null==(c=null==(l=m())?void 0:l.ShopifyAnalytics)?void 0:c.meta)||{}).currency,s={id:String("add"===i?t.id:t.variant_id),image:{src:t.image},price:{amount:t.presentment_price,currencyCode:r},product:{id:String(t.product_id),title:t.product_title,vendor:t.vendor,type:t.product_type,untranslatedTitle:t.untranslated_product_title,url:t.url},sku:t.sku,title:t.variant_title,untranslatedTitle:t.untranslated_variant_title},a={cost:{totalAmount:{amount:s.price.amount*n,currencyCode:r}},merchandise:s,quantity:n};var c,l;e(o,{cartLine:a}),o===u&&v(a)}function _(e,t,n,o="add"){E(e,t,n,u,o)}function k(e,t){const n=t.items_added,o=t.items_removed;n.forEach((t=>{_(e,t,null==t?void 0:t.quantity,"change")})),o.forEach((t=>{!function(e,t,n,o){E(e,t,n,p,"change")}(e,t,null==t?void 0:t.quantity)}))}function S(e){if(!e)return 1;try{return JSON.parse(e).quantity||1}catch(t){if(e instanceof FormData){if(e.has("quantity"))return Number(e.get("quantity"))}else{const t=e.split("&");for(const e of t){const t=e.split("=");if("quantity"===t[0])return Number(t[1])}}}return 1}class C{static handleXhrOpen(){}static handleXhrDone(e){try{const t=document.createElement("a");t.href=e.url;const n=t.pathname?t.pathname:e.url;C.ADD_TO_CART_REGEX.test(n)?C.parsePayloadResponse(e,(t=>{const n=Object.keys(t).find((e=>"items"===e));if(n){const i=t[n];let r;try{r=JSON.parse(e.body).items}catch(o){r=function(e,t){const n=new Array(t);for(let o=0;o{k(e.publish,t)}))}catch(t){w("handleXhrDone",t)}}static parseBlobToJson(e,t){const n=new FileReader;n.addEventListener("loadend",(()=>{t(JSON.parse(String.fromCharCode(...new Uint8Array(n.result))))})),n.readAsArrayBuffer(e)}static parsePayloadResponse(e,t){e.xhr.response instanceof Blob?C.parseBlobToJson(e.xhr.response,t):e.xhr.responseText&&t(JSON.parse(e.xhr.responseText))}constructor(e,t,n,o,i){this.oldOnReadyStateChange=void 0,this.xhr=void 0,this.url=void 0,this.method=void 0,this.body=void 0,this.publish=void 0,this.xhr=e,this.url=t,this.method=n,this.body=o,this.publish=i}onReadyStateChange(){this.xhr.readyState===XMLHttpRequest.DONE&&C.handleXhrDone({method:this.method,url:this.url,body:this.body,xhr:this.xhr,publish:this.publish}),this.oldOnReadyStateChange&&this.oldOnReadyStateChange.call(this.xhr,new Event("oldOnReadyStateChange"))}}function A(e,t){const n=e.fetch;function o(e){w("handleFetchRequest",e)}"function"==typeof n&&(e.fetch=function(...e){return n.apply(this,Array.prototype.slice.call(e)).then((e=>{if(!e.ok)return e;const n=document.createElement("a");n.href=e.url;const i=n.pathname?n.pathname:e.url;try{if(C.ADD_TO_CART_REGEX.test(i)){try{const n=arguments[1].body instanceof FormData?function(e){const t={};return e.forEach(((e,n)=>{T(n,e,t)})),t}(arguments[1].body):JSON.parse(arguments[1].body);if(Object.keys(n).includes("items"))return function(e,n){e.clone().json().then((e=>{const o=n.items,i=e.items;return x(t,i,o),e})).catch(o)}(e,n),e}catch(r){o(r)}!function(e,n){const i=S(n);e.clone().json().then((e=>_(t,e,i))).catch(o)}(e,arguments[1].body)}else C.CHANGE_TO_CART_REGEX.test(i)&&function(e){e.clone().json().then((e=>{k(t,e)})).catch(o)}(e)}catch(r){o(r)}return e}))})}function T(e,t,n){const[o,...i]=e.split(".").filter((e=>e));if(o&&i.length>0)return n[o]=n[o]||{},void T(i.join("."),t,n[o]);const r=/(\w+)?\[(\d+)?\](.+)?/.exec(e);if(r){const[e,o,i,s=""]=r;if(o)return n[o]=n[o]||[],void T(e.replace(o,""),t,n[o]);if(i){const e=s&&"["===s[0]?[]:{};return n[i]=n[i]||e,void T(s,t,n[i])}n.push(t)}else n[e]=t}function I(e,t){!function(e,t){const n=e.prototype.open,o=e.prototype.send;e.prototype.open=function(e,t){this._url=t,this._method=e,C.handleXhrOpen(),n.apply(this,arguments)},e.prototype.send=function(e){if(!(e instanceof Document)){const n=new C(this,this._url,this._method,e||"",t);this.addEventListener?this.addEventListener("readystatechange",n.onReadyStateChange.bind(n),!1):(n.oldOnReadyStateChange=this.onreadystatechange,this.onreadystatechange=n.onReadyStateChange)}o.call(this,e)}}(XMLHttpRequest,e),A(m(),e),g((n=>{const o=n.getAttribute("action");o&&o.indexOf("/cart/add")>=0&&b(n,"submit",(n=>{!function(e,t,n){const o=t||window.event;if(o.defaultPrevented||o.isDefaultPrevented&&o.isDefaultPrevented())return;const i=o.currentTarget||o.srcElement;if(i&&i instanceof Element&&(i.getAttribute("action")||i.getAttribute("href")))try{const t=function(e){let t;const n=e.querySelector('[name="id"]');return n instanceof HTMLSelectElement&&n.options?t=n.options[n.selectedIndex]:(n instanceof HTMLOptionElement||n instanceof HTMLInputElement)&&(t=n),t}(i);if(!t)return;const o=t.value,r=function(e){const t=e.querySelector('[name="quantity"]');return t instanceof HTMLInputElement?Number(t.value):1}(i),s=function(e,t){var n;const[o]=(null==(n=t.productVariants)?void 0:n.filter((t=>t.id===e)))||[];if(!o)throw new Error("Product variant not found");return o}(o,n),a={cost:{totalAmount:{amount:s.price.amount*r,currencyCode:s.price.currencyCode}},merchandise:s,quantity:r};e(u,{cartLine:a}),v(a)}catch(r){w("handleSubmitCartAdd",r)}}(e,n,t)}))}))}function N(e,t,n){var o;null!=n&&n.logLevel&&(o=n.logLevel,h=o),I(e,t),function(e,t){g((n=>{const o=n.querySelector('[name="previous_step"]');o&&o instanceof HTMLInputElement&&"payment_method"===o.value&&b(document.body,"submit",(n=>{!function(e,t,n){const o=t||window.event,i=o.target||o.srcElement;if(i&&i instanceof HTMLFormElement&&i.getAttribute("action")&&null!==i.getAttribute("data-payment-form"))try{const t=n.checkout;if(!t)throw new Error("Checkout data not found");e(f,{checkout:t})}catch(r){w("handleSubmitToPaymentAdd",r)}}(e,n,t)}))}))}(e,t)}C.ADD_TO_CART_REGEX=/^(?:\/[a-zA-Z]+(?:-[a-zA-Z]+)?)?\/cart\/add(?:\.js|\.json)?$/,C.CHANGE_TO_CART_REGEX=/^(?:\/[a-zA-Z]+(?:-[a-zA-Z]+)?)?\/cart\/change(?:\.js|\.json)?$/;const O={TRACKING_ACCEPTED:"trackingConsentAccepted",TRACKING_DECLINED:"trackingConsentDeclined",MARKETING_ACCEPTED:"firstPartyMarketingConsentAccepted",SALE_OF_DATA_ACCEPTED:"thirdPartyMarketingConsentAccepted",ANALYTICS_ACCEPTED:"analyticsConsentAccepted",PREFERENCES_ACCEPTED:"preferencesConsentAccepted",MARKETING_DECLINED:"firstPartyMarketingConsentDeclined",SALE_OF_DATA_DECLINED:"thirdPartyMarketingConsentDeclined",ANALYTICS_DECLINED:"analyticsConsentDeclined",PREFERENCES_DECLINED:"preferencesConsentDeclined",CONSENT_COLLECTED:"visitorConsentCollected",CONSENT_TRACKING_API_LOADED:"consentTrackingApiLoaded"},P="2.1",R={NO_VALUE:"",ACCEPTED:"1",DECLINED:"0"},D={PREFERENCES:"p",ANALYTICS:"a",MARKETING:"m",SALE_OF_DATA:"t"},L={MARKETING:"m",ANALYTICS:"a",PREFERENCES:"p",SALE_OF_DATA:"s"},$={MARKETING:"marketing",ANALYTICS:"analytics",PREFERENCES:"preferences",SALE_OF_DATA:"sale_of_data",EMAIL:"email"},M={HEADLESS_STOREFRONT:"headlessStorefront",ROOT_DOMAIN:"rootDomain",CHECKOUT_ROOT_DOMAIN:"checkoutRootDomain",STOREFRONT_ROOT_DOMAIN:"storefrontRootDomain",STOREFRONT_ACCESS_TOKEN:"storefrontAccessToken",IS_EXTENSION_TOKEN:"isExtensionToken",METAFIELDS:"metafields"},U=["v","con"];function j(e,t){if(null===e)return"null";if(Array.isArray(e))return`[${e.map((e=>j(e,!0))).join(",")}]`;if("object"==typeof e){let n=[];for(const t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&n.push(`${t}:${j(e[t],!0)}`);const o=n.join(",");return t?`{${o}}`:o}return"string"==typeof e?`"${e}"`:`${e}`}function z(e){return function(e){const t=document.cookie?document.cookie.split("; "):[];for(let n=0;ne===n[t]))}(Object.keys(t).filter((e=>"region"!==e&&"lim"!==e&&"cus"!==e&&"reg"!==e)),U))return e;var t}();if(!e)return;return e}catch{return}}const K="_cmp_a";function W(e){const t=z(K);if(!t)return!0;const n=t.purposes[e];return"boolean"!=typeof n||n}function X(){return W(D.PREFERENCES)}function Y(){return W(D.ANALYTICS)}function G(){return W(D.MARKETING)}function J(){return W(D.SALE_OF_DATA)}function Q(e,t){document.dispatchEvent(new CustomEvent(e,{detail:t||{}}))}const Z="_landing_page",ee="_orig_referrer";function te(e){const t=e.granular_consent;return{query:`query { consentManagement { cookies(${j({visitorConsent:{marketing:t.marketing,analytics:t.analytics,preferences:t.preferences,saleOfData:t.sale_of_data,...t.metafields&&{metafields:t.metafields}},origReferrer:e.referrer,landingPage:e.landing_page})}) { answersCookie trackingConsentCookie cookieDomain landingPageCookie origReferrerCookie } } }`,variables:{}}}function ne(e,t){const n=e.granular_consent,o=n.storefrontAccessToken||function(){const e=document.documentElement.querySelector("#shopify-features"),t="Could not find liquid access token";if(!e)return void console.warn(t);const n=JSON.parse(e.textContent||"").accessToken;if(n)return n;console.warn(t)}(),i=n.checkoutRootDomain||window.location.host,r=n.isExtensionToken?"Shopify-Storefront-Extension-Token":"x-shopify-storefront-access-token",s={headers:{"content-type":"application/json",[r]:o},body:JSON.stringify(te(e)),method:"POST"};return fetch(`https://${i}/api/unstable/graphql.json`,s).then((e=>{if(e.ok)return e.json();throw new Error("Server error")})).then((o=>{const i=31536e6,r=12096e5,s=o.data.consentManagement.cookies.cookieDomain,a="."+(n.checkoutRootDomain||s||window.location.hostname),c="."+(n.storefrontRootDomain||s||window.location.hostname),l=o.data.consentManagement.cookies.trackingConsentCookie,u=o.data.consentManagement.cookies.answersCookie,d=o.data.consentManagement.cookies.landingPageCookie,p=o.data.consentManagement.cookies.origReferrerCookie;return B(V,a,i,l),B(K,a,i,u),d&&p&&(B(Z,a,r,d),B(ee,a,r,p)),c!==a&&(B(V,c,i,l),B(K,c,i,u),d&&p&&(B(Z,c,r,d),B(ee,c,r,p))),void 0!==e.granular_consent&&function(e){const t=e[D.MARKETING],n=e[D.SALE_OF_DATA],o=e[D.ANALYTICS],i=e[D.PREFERENCES];!0===t?Q(O.MARKETING_ACCEPTED):!1===t&&Q(O.MARKETING_DECLINED),!0===n?Q(O.SALE_OF_DATA_ACCEPTED):!1===n&&Q(O.SALE_OF_DATA_DECLINED),!0===o?Q(O.ANALYTICS_ACCEPTED):!1===o&&Q(O.ANALYTICS_DECLINED),!0===i?Q(O.PREFERENCES_ACCEPTED):!1===i&&Q(O.PREFERENCES_DECLINED);const r=function(e){return{marketingAllowed:e[D.MARKETING],saleOfDataAllowed:e[D.SALE_OF_DATA],analyticsAllowed:e[D.ANALYTICS],preferencesAllowed:e[D.PREFERENCES],firstPartyMarketingAllowed:e[D.MARKETING],thirdPartyMarketingAllowed:e[D.SALE_OF_DATA]}}(e);Q(O.CONSENT_COLLECTED,r);const s=[o,i,t,n];s.every((e=>!0===e))&&Q(O.TRACKING_ACCEPTED),s.every((e=>!1===e))&&Q(O.TRACKING_DECLINED)}({[D.PREFERENCES]:X(),[D.ANALYTICS]:Y(),[D.MARKETING]:G(),[D.SALE_OF_DATA]:J()}),void 0!==t&&t(null,o),o})).catch((e=>{const n="Error while setting storefront API consent: "+e.message;if(void 0===t)throw{error:n};t({error:n})}))}function oe(){if(""===document.referrer)return!0;const e=document.createElement("a");return e.href=document.referrer,window.location.hostname!=e.hostname}function ie(){return!!function(e=null){return null===e&&(e=q()),void 0===e}()||G()&&Y()}function re(){return G()}function se(){return Y()}function ae(){return X()}function ce(){return J()}function le(e,t){return"object"==typeof e&&e.headlessStorefront&&!e.storefrontAccessToken?(console.warn("Headless consent has been updated. Please read shopify.dev/docs/api/customer-privacy to integrate."),function(e,t){function n(e,t=R.NO_VALUE){return!0===e?R.ACCEPTED:!1===e?R.DECLINED:t}const o={[L.ANALYTICS]:n(e[$.ANALYTICS],R.DECLINED),[L.MARKETING]:n(e[$.MARKETING],R.DECLINED),[L.PREFERENCES]:n(e[$.PREFERENCES],R.DECLINED),[L.SALE_OF_DATA]:n(e[$.SALE_OF_DATA])},i={v:P,reg:"",con:{CMP:o}},r=encodeURIComponent(JSON.stringify(i));return B(V,e.rootDomain,H,r),t(null),new Promise(((e,t)=>{}))}(e,t||(()=>{}))):function(e,t){if(function(e){if("boolean"!=typeof e&&"object"!=typeof e)throw TypeError("setTrackingConsent must be called with a boolean or object consent value");if("object"==typeof e){const t=Object.keys(e);if(0===t.length)throw TypeError("The submitted consent object is empty.");const n=[$.MARKETING,$.ANALYTICS,$.PREFERENCES,$.SALE_OF_DATA,$.EMAIL,M.ROOT_DOMAIN,M.CHECKOUT_ROOT_DOMAIN,M.STOREFRONT_ROOT_DOMAIN,M.STOREFRONT_ACCESS_TOKEN,M.HEADLESS_STOREFRONT,M.IS_EXTENSION_TOKEN,M.METAFIELDS];for(const e of t)if(!n.includes(e))throw TypeError(`The submitted consent object should only contain the following keys: ${n.join(", ")}. Extraneous key: ${e}.`)}}(e),void 0!==t&&"function"!=typeof t)throw TypeError("setTrackingConsent must be called with a callback function if the callback argument is provided");let n;!0===e||!1===e?(console.warn("Binary consent is deprecated. Please update to granular consent (shopify.dev/docs/api/consent-tracking)"),n={analytics:e,preferences:e,marketing:e}):n=e;const o=function(e){return e?oe()?document.referrer:"":null}(n.analytics),i=function(e){return e?oe()?window.location.pathname+window.location.search:"/":null}(n.analytics);return ne({granular_consent:n,...null!==o&&{referrer:o},...null!==i&&{landing_page:i}},t)}(e,t)}const ue="sh",de="shu",pe=["page_viewed","collection_viewed","product_viewed","product_variant_viewed","search_submitted","product_added_to_cart","checkout_started","checkout_completed","payment_info_submitted","checkout_contact_step_started","checkout_contact_info_submitted","checkout_address_info_submitted","checkout_shipping_step_started","checkout_shipping_info_submitted","checkout_payment_step_started","session_started"],fe="wpm",me="trekkie";let he,be;function we(e){return`${e||ue}-${function(){const e="xxxx-4xxx-xxxx-xxxxxxxxxxxx";let t="";try{const n=window.crypto,o=new Uint16Array(31);n.getRandomValues(o);let i=0;t=e.replace(/[x]/g,(e=>{const t=o[i];if("number"!=typeof t)throw new Error(`Event ID service: Invalid random number at index "${i}".`);const n=t%16;return i++,("x"===e?n:3&n|8).toString(16)})).toUpperCase()}catch(n){t=e.replace(/[x]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})).toUpperCase()}return`${function(){let e=0,t=0;e=(new Date).getTime()>>>0;try{t=performance.now()>>>0}catch(n){t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}()}-${t}`}()}`}function ge(){window.Shopify=window.Shopify||{},window.Shopify.evids||(he={},be={[fe]:{},[me]:{}},window.Shopify.evids=(...e)=>function(e,t){if(!function(e){return pe.includes(e)}(e)||(null==t?void 0:t.analyticsFramework)!==me&&(null==t?void 0:t.analyticsFramework)!==fe)return we(de);const n="string"==typeof(o=t.cacheKey)&&o?o:"default";var o;const i=function(e,t,n){var o;const i=be[t],r=null!=(o=i[e])?o:i[e]={},s=r[n];return r[n]="number"==typeof s?s+1:0}(e,t.analyticsFramework,n);return function(e,t,n){var o,i;const r=null!=(o=he[e])?o:he[e]={},s=null!=(i=r[n])?i:[];let a=s[t];return a||(a=we(),s.push(a)),r[n]=s,a}(e,i,n)}(...e))}const ve=new Set;function ye(e){return ve.has(e)}const xe="6a396365";class Ee extends Set{constructor(e,t){if(super(),this.maxSize=void 0,this.keep=void 0,Number.isFinite(e)&&!Number.isInteger(e)||e<=0)throw new Error("Invalid maxSize specified");this.maxSize=e,this.keep=t}push(e){if("oldest"===this.keep)this.sizethis.maxSize))for(const t of this)if(this.delete(t),this.size<=this.maxSize)break;return this}}const _e=(e,t,n)=>!0;class ke{constructor({bufferSize:e=50,replayKeep:t="oldest",subscribeAllKey:n,eligibility:o}={}){this.channelSubscribers=new Map,this.replayQueue=void 0,this.bufferSize=void 0,this.replayKeep=void 0,this.subscribeAllKey=void 0,this.eligibility=void 0,this.bufferSize=e,this.replayKeep=t,this.subscribeAllKey=n,this.replayQueue=new Ee(e,t),this.eligibility=null!=o?o:_e}publish(e,t,n={}){var o;if(this.subscribeAllKey&&e===this.subscribeAllKey)throw new Error(`Cannot publish to ${String(e)}`);this.replayQueue.push({name:e,payload:t,options:n});const i=(o,i)=>{this.eligibility(n,o,e)&&i.call({},{...t})};var r;return null==(o=this.channelSubscribers.get(e))||o.forEach(i),this.subscribeAllKey&&(null==(r=this.channelSubscribers.get(this.subscribeAllKey))||r.forEach(i)),!0}subscribe(e,t,n={}){const o=this.channelSubscribers.get(e)||new Map;return this.channelSubscribers.set(e,o.set(t,n)),this.replayQueue.forEach((({name:o,payload:i,options:r})=>{(e===o||this.subscribeAllKey&&e===this.subscribeAllKey)&&this.eligibility(r,n,o)&&t.call({},{...i})})),()=>o.delete(t)}}const Se={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Ce;const Ae=new Uint8Array(16);function Te(){if(!Ce&&(Ce="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ce))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ce(Ae)}const Ie=[];for(let n=0;n<256;++n)Ie.push((n+256).toString(16).slice(1));const Ne=function(e,t,n){if(Se.randomUUID&&!t&&!e)return Se.randomUUID();const o=(e=e||{}).random||(e.rng||Te)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return function(e,t=0){return Ie[e[t+0]]+Ie[e[t+1]]+Ie[e[t+2]]+Ie[e[t+3]]+"-"+Ie[e[t+4]]+Ie[e[t+5]]+"-"+Ie[e[t+6]]+Ie[e[t+7]]+"-"+Ie[e[t+8]]+Ie[e[t+9]]+"-"+Ie[e[t+10]]+Ie[e[t+11]]+Ie[e[t+12]]+Ie[e[t+13]]+Ie[e[t+14]]+Ie[e[t+15]]}(o)};let Oe=function(e){return e.App="APP",e.Custom="CUSTOM",e}({}),Pe=function(e){return e.Strict="STRICT",e.Lax="LAX",e.Open="OPEN",e}({});function Re(e){return"shopify-custom-pixel"===e.id?"shopify-pixel":e.type===Oe.Custom?"-1":e.apiClientId?`${e.apiClientId}`:void 0}let De=function(e){return e.Shopify="shopify",e.StorefrontRenderer="storefront-renderer",e.CheckoutOne="checkout-one",e.CheckoutOneSdk="checkout-one-sdk",e.Unknown="unknown",e}({}),Le=function(e){return e.Storefront="storefront",e.Checkout="checkout",e.Unknown="unknown",e}({}),$e=function(e){return e.WebPixelExtension="web-pixel-extension",e.CheckoutOneSdk="checkout-one-sdk",e.Unknown="unknown",e}({});const Me=(e,t,n)=>{const{pixelRuntimeConfig:o}=t||{},{apiClientId:i,restrictions:r}=o||{},{allowedEvents:s,disallowedEvents:a}=r||{},{sendTo:c}=e||{},l=c&&String(c)===String(i),u=c&&!l,d=!s||s.includes(n),p=a&&a.includes(n);return Boolean(d&&!p&&!u||l)};function Ue(e){if(e<=0||e>100)throw new Error("Invalid sampling percent");return 100*Math.random()<=e}var je=n(482),ze=n.n(je);class Fe extends Error{constructor(...e){super(...e),this.message="Excessive Stacktrace: May indicate infinite loop forming"}}var Be=n(47);class Ve extends Error{constructor(...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,Ve)}}const He={production:"https://notify.bugsnag.com",test:"https://localhost"},qe={severity:"error",context:"",unhandled:!0,library:"browser"},Ke={notify:(e,n)=>{try{var a;if(null!=n&&null!=(a=n.options)&&a.sampleRate&&!Ue(n.options.sampleRate))return;const d={...qe,...n};let p={errorClass:null==e?void 0:e.name,message:null==e?void 0:e.message,stacktrace:[],type:"browserjs"};try{p=function(e){if("string"!=typeof((null==(t=e)?void 0:t.stack)||(null==t?void 0:t.stacktrace)||(null==t?void 0:t["opera#sourceloc"]))||t.stack===`${t.name}: ${t.message}`)throw new Error("Error incompatible with error-stack-parser");var t;const n=ze().parse(e).reduce(((e,t)=>{const n=function({functionName:e,lineNumber:t,columnNumber:n}){const o=/^global code$/i.test((i=e)||"")?"global code":i;var i;return{file:`https://cdn.shopify.com/cdn/wpm/${s}`,method:o,lineNumber:t,columnNumber:n}}(t);try{return"{}"===JSON.stringify(n)?e:e.concat(n)}catch(o){return e}}),[]);return{errorClass:null==e?void 0:e.name,message:null==e?void 0:e.message,stacktrace:n,type:"browserjs"}}(e)}catch(l){try{p=function(e,t){let n="";const o={lineNumber:"1",columnNumber:"1",method:t.context,file:`https://cdn.shopify.com/cdn/wpm/${s}`};if(e.stackTrace||e.stack||e.description){n=e.stack.split("\n")[0];const t=e.stack.match(/([0-9]+):([0-9]+)/);if(t&&t.length>2&&(o.lineNumber=t[1],o.columnNumber=t[2],parseInt(o.lineNumber,10)>1e5))throw new Fe}return{errorClass:(null==e?void 0:e.name)||n,message:(null==e?void 0:e.message)||n,stacktrace:[o],type:"browserjs"}}(e,d)}catch(u){if(u instanceof Fe)return}}const f=function(n,{userAgent:s,context:a,severity:c,unhandled:l,library:u,hashVersionSandbox:d,sandboxUrl:p,pixelId:f,pixelType:m,runtimeContext:h,shopId:b,initConfig:w,notes:g}){var v,y;const{device:x,os:E,browser:_,engine:k}=function(t){try{return new Be.UAParser(t).getResult()}catch(e){return{ua:"",browser:{name:"",version:"",major:""},engine:{name:"",version:""},os:{name:"",version:""},device:{model:"",type:"",vendor:""},cpu:{architecture:""}}}}(s||(null==(v=self.navigator)?void 0:v.userAgent));return{payloadVersion:5,notifier:{name:"web-pixel-manager",version:o,url:"-"},events:[{exceptions:[n],context:a,severity:c,unhandled:l,app:{version:o},device:{manufacturer:x.vendor,model:x.model,osName:E.name,osVersion:E.version,browserName:_.name,browserVersion:_.version},metaData:{app:{library:u,browserTarget:i,env:t,hashVersion:r,hashVersionSandbox:d||"N/A",sandboxUrl:p||"N/A"},device:{userAgent:s||(null==(y=self.navigator)?void 0:y.userAgent),renderingEngineName:k.name,renderingEngineVersion:k.version},request:{shopId:b,shopUrl:self.location.href,pixelId:f,pixelType:m,runtimeContext:h},"Additional Notes":{initConfig:JSON.stringify(w),notes:g}}}]}}(p,d),m=He[t];var c;if(!m)return void(null==(c=console)||c.log(`[${t}]`,"Bugsnag notify:",f));fetch(m,{method:"POST",headers:{"Content-Type":"application/json","Bugsnag-Api-Key":"bcbc9f6762da195561967577c2d74ff8","Bugsnag-Payload-Version":"5"},body:JSON.stringify(f)}).catch((()=>{}))}catch(d){}}};function We(e){const t={};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=n.replace(/[A-Z]/g,(e=>`_${e}`)).toLowerCase(),i=e[n];t[o]=null!==i&&"object"==typeof i?We(i):i}return t}function Xe(e){return e.replace(/\/$/,"")}const Ye={},Ge={"pixel:register":{start:{name:"pixel:register:started",params:{pixelId:"",source:""}},end:{name:"pixel:register:completed",params:{pixelId:"",source:""}}},"page:session":{start:{name:"start",params:Ye},end:{name:"page:unload",params:Ye}},completed:{start:{name:"start",params:Ye},end:{name:"pixels:resolved",params:Ye}}};function Je(e,t=Ye){const n=Qe(e,"end",t),o=function(e,t){try{const n=Ze(e,"start",t),o=Ze(e,"end",t),i=function(e,t){return et(e,t)}(e,t),r=self.performance.measure(i,n,o);return{...r,duration:Math.round(r.duration),startTime:Math.round(r.startTime)}}catch(n){return null}}(e,t);return{mark:n,measurement:o}}function Qe(e,t,n){try{const o=Ze(e,t,n);return self.performance.mark(o),{name:o,params:n}}catch(o){return{name:null,params:n}}}function Ze(e,t,n){return et(Ge[e][t].name,n)}function et(e,t={}){const n=["wpm",e];return Object.keys(t).forEach((e=>{const o=t[e];o&&n.push(o)})),n.join(":")}const tt={test:"edge_test_click/1.0",load:"web_pixels_manager_load/3.1",init:"web_pixels_manager_init/3.2",register:"web_pixels_manager_pixel_register/3.6",subscriberEventEmit:"web_pixels_manager_subscriber_event_emit/4.0",eventPublish:"web_pixels_manager_event_publish/1.6",consentAccepted:"web_pixels_manager_consent_accepted/1.2",unload:"web_pixels_manager_unload/1.2",visitor:"web_pixels_manager_visitor/1.0",subscriberEventEmitDom:"web_pixels_manager_subscriber_event_emit_dom/2.0",subscriberEventEmitPrivacy:"web_pixels_manager_subscriber_event_emit_privacy/1.0",helperLoad:"web_pixels_helper_load/1.0",helperWindowButtonClick:"web_pixels_helper_window_button_click/1.0"};function nt(e,t){return{schemaId:tt[e],payload:t}}let ot="";function it(e=""){ot=Xe(e)}const rt="/unstable/produce_batch",st=500;let at="wellKnown";const ct=new Array;let lt;function ut(e,t=!1){const n={schema_id:e.schemaId,payload:We(e.payload),metadata:{event_created_at_ms:ft()}};ct.push(n),t?pt():void 0===lt&&(lt=setTimeout(pt,st))}function dt(e,t,n=!1){ut(nt(e,t),n)}function pt({skipXhr:e}={skipXhr:!1}){if(lt=void 0,0===ct.length)return;const t=[...ct];ct.length=0,function(e,t){if(0===e.length)return!1;const n={metadata:{event_sent_at_ms:ft()},events:e};!function(e,t){const n=`${{global:"https://monorail-edge.shopifysvc.com",wellKnown:`${ot}/.well-known/shopify/monorail`,staging:"https://monorail-edge-staging.shopifycloud.com",test:"https://localhost"}[at]}${rt}`;try{if(self.navigator.sendBeacon.bind(self.navigator)(n,e))return!0}catch(o){}if(!t){const t=new XMLHttpRequest;try{t.open("POST",n,!0),t.setRequestHeader("Content-Type","text/plain"),t.send(e)}catch(i){Ke.notify(i,{context:"v0/utilities/monorail/sendRequest",unhandled:!1})}}}(JSON.stringify(n),t)}(t,e)}function ft(){return(new Date).getTime()}class mt{constructor(e){this.maxSize=e,this.cache=new Map}get(e){if(!this.cache.has(e))return;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}has(e){return this.cache.has(e)}set(e,t){if(this.cache.size>=this.maxSize){const e=this.cache.keys().next().value;this.cache.delete(e)}return this.cache.set(e,t),this}delete(e){return this.cache.delete(e)}clear(){this.cache.clear()}}const ht=e=>"number"==typeof e?new mt(e):new Map,bt=(...e)=>JSON.stringify(e);function wt(e,{cache:t,cacheKey:n=bt}={}){function o(...t){const i=o.cache,r=n.apply(this,t);if(i.has(r))return i.get(r);{const n=e(...t);return i.set(r,n),n}}return o.cache=null!=t?t:ht(),o}const gt=wt(((e="")=>{const t=e.indexOf("=");return-1===t?[e.trim(),void 0]:[e.slice(0,t).trim(),e.slice(t+1).trim()]}),{cache:ht(100),cacheKey:(e="")=>e}),vt=wt(((e="")=>e.split(";").reduce(((e,t)=>{const[n,o]=gt(t);if(n)try{e[decodeURIComponent(n)]=decodeURIComponent(null!=o?o:"")}catch{e[n]=null!=o?o:""}return e}),Object.create(null))),{cache:ht(50),cacheKey:(e="")=>e});let yt=!1;const xt=[],Et=e=>{xt.push(e)};function _t(e){const t=e;xt.forEach((e=>{e(t)}))}let kt=!1;const St=["analytics","preferences","marketing","sale_of_data"];function Ct(e,t){return e?!t||Object.keys(e).every((n=>!e[n]||t[n])):ie()}function At(e){return new Promise(((t,n)=>{const o={analytics:se(),marketing:re(),preferences:ae(),sale_of_data:ce()};Ct(e,o)?t(!0):Et((n=>{(function(e,t){const n=e.detail;return Ct(t,{analytics:!0===(null==n?void 0:n.analyticsAllowed),marketing:!0===(null==n?void 0:n.marketingAllowed),preferences:!0===(null==n?void 0:n.preferencesAllowed),sale_of_data:!0===(null==n?void 0:n.saleOfDataAllowed)})})(n,e)&&t(!0)}))}))}const Tt=new Set;class It extends Error{constructor(e){super(e),this.name="VisitorError"}}let Nt,Ot;function Pt(){return Nt||(Nt=function(){let e;try{var t,n;e=null!=(t=window.Shopify)&&t.evids?null==(n=window.Shopify)?void 0:n.evids("session_started",{analyticsFramework:"wpm"}):Ne()}catch(o){e=Ne()}return e}()),Nt}const Rt=()=>(void 0===Ot&&(Ot=function(){let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};self.addEventListener("test",n,t),self.removeEventListener("test",n,t)}catch(t){return!1}return e}()),Ot),Dt={capture:!0,passive:!0};function Lt(e,t,n,o={}){const i=o.addEventListenerOptions?{...Dt,...o.addEventListenerOptions}:Dt;try{const r=function(e,{sampleRate:t,throttleDelay:n}={}){const o=n=>{try{e(n)}catch(o){Ke.notify(o,{context:"v0/createDomEventsListener/listenTo/handler",unhandled:!1,options:{sampleRate:null!=t?t:50}})}};return"number"==typeof n?function(e,t,{leading:n=!0,trailing:o=!0}={}){if(t<=0)throw new Error("The throttle function requires a positive wait time above zero.");if(!n&&!o)throw new Error("The throttle function requires at least one of leading or trailing to be true, otherwise, its callback will never be called.");let i,r,s,a=null,c=0;function l(){c=!1===n?0:(new Date).valueOf(),a=null,i&&(r=e.apply(s,i)),s=null,i=null}return function(...u){const d=(new Date).valueOf();c||!1!==n||(c=d);const p=t-(d-c);return s=this,i=u,p<=0||p>t?(a&&(clearTimeout(a),a=null),c=d,i&&(r=e.apply(s,i)),s=null,i=null):a||!1===o||(a=setTimeout(l,p)),r}}(o,n):o}(n,o);return e.addEventListener(t,r,Rt()?i:i.capture),()=>{e.removeEventListener(t,r,Rt()?i:i.capture)}}catch(r){Ke.notify(r,{context:"v0/createDomEventsListener/listenTo",unhandled:!1})}return()=>{}}const $t=new RegExp(["password","pass","pw","ssn","sin","social","security","cc","card","creditcard","cvv","cvc","cvn","billing","license","health","secret","unique"].map((e=>`^(.*[^a-z])?${e}([^a-z].*)?$`)).join("|"),"i"),Mt="******",Ut=["SCRIPT","IFRAME"],jt=e=>e instanceof HTMLElement&&(Ut.includes(e.tagName)||"exclude"===e.dataset.shopifyPrivacy),zt=["id","name","type"],Ft=e=>e instanceof HTMLElement&&"redact"===e.dataset.shopifyPrivacy||zt.some((t=>{const n=e.getAttribute(t);return"string"==typeof n&&n.match($t)})),Bt=(e,t)=>("value"in t&&"string"==typeof t.value&&Ft(e)&&(t.value=Mt),t),Vt=["number","string","boolean"];function Ht(e,t,n){const o=t.reduce(((t,o)=>(t[o]=function(e,t,n){var o,i;if(t in e){const n=e[t];if(Vt.includes(typeof n))return n}return null!=(o=null!=(i=e.getAttribute(t))?i:n)?o:null}(e,o,null==n?void 0:n[o]),t)),{});return Bt(e,o),o}const qt=[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLButtonElement],Kt=["id","name","tagName","type","value"];function Wt(e){return Ht(e,Kt)}let Xt=0;const Yt=new WeakMap;function Gt(e){if(!e)return-1;let t=Yt.get(e);return void 0===t&&(t=Xt,Yt.set(e,t),Xt+=1),t}const Jt=new WeakMap,Qt={id:null,name:null,tagName:null,type:null,value:null,href:null,className:"",style:null,clientHeight:0,clientLeft:0,clientTop:0,clientWidth:0,nodeType:1,scrollHeight:0,scrollLeft:0,scrollTop:0,scrollWidth:0,serializationId:-1},Zt=Object.keys(Qt);function en(e){const t=e instanceof Element?Ht(e,Zt,Qt):{...Qt,nodeType:e.nodeType};return e.nodeType===Node.TEXT_NODE&&(t.value=e.textContent),t.serializationId=Gt(e),t}function tn(e,t){return t.reduce(((t,n)=>(n in e&&(t[n]=e[n]),t)),{})}const nn=["id","href","name","tagName","type","value"];function on(e){return Ht(e,nn)}const rn=["screenX","screenY","pageX","pageY","offsetX","offsetY","movementX","movementY"],sn=rn.reduce(((e,t)=>(e[t]=0,e)),{});function an(e,t){return{element:en(t),...sn,...tn(e,rn)}}const cn=["action","id"],ln=[(e,{eventPrefix:t}={})=>Lt(window,"blur",(n=>{const o=null==n?void 0:n.target;if(!(o instanceof HTMLInputElement||o instanceof HTMLSelectElement||o instanceof HTMLTextAreaElement))return;const i=t?en(o):Wt(o);e(`${null!=t?t:""}input_blurred`,{element:i})})),(e,{eventPrefix:t}={})=>Lt(window,"change",(n=>{const o=null==n?void 0:n.target;if(!(o instanceof HTMLInputElement||o instanceof HTMLSelectElement||o instanceof HTMLTextAreaElement))return;const i=t?en(o):Wt(o);e(`${null!=t?t:""}input_changed`,{element:i})})),(e,{eventPrefix:t}={})=>Lt(self.window,"click",(n=>{const o=null==n?void 0:n.target;if(!(o instanceof Element))return;const i=t?an(n,o):function(e,t){return{element:on(t),...sn,...tn(e,rn)}}(n,o);e(`${null!=t?t:""}clicked`,i)}),{throttleDelay:50}),(e,{eventPrefix:t}={})=>Lt(window,"focus",(n=>{const o=null==n?void 0:n.target;if(!(o instanceof HTMLInputElement||o instanceof HTMLSelectElement||o instanceof HTMLTextAreaElement))return;const i=t?en(o):Wt(o);e(`${null!=t?t:""}input_focused`,{element:i})})),(e,{eventPrefix:t}={})=>Lt(window,"submit",(n=>{const o=null==n?void 0:n.target;if(!(o instanceof HTMLFormElement))return;const i={...Ht(o,cn),elements:[]},r=Array.from(o.elements).filter((e=>qt.some((t=>e instanceof t))&&!jt(e)));t?(Object.assign(i,en(o)),i.elements=r.map((e=>en(e)))):i.elements=r.map((e=>Wt(e))),e(`${null!=t?t:""}form_submitted`,{element:i})}))],un=(e,t)=>{const n=ln.map((n=>n(e,t)));return()=>{n.forEach((e=>e()))}};let dn=function(e){return e.Custom="custom",e.Dom="dom",e.Error="error",e.Standard="standard",e}({}),pn=function(e){return e.ExtendedDom="extended-dom",e.Meta="meta",e}({});function fn(){return/checkouts\/(.+)\/(thank_you|thank-you|post_purchase)$/.test(self.location.pathname)}const mn={string:"[object String]",number:"[object Number]",boolean:"[object Boolean]",undefined:"[object Undefined]",null:"[object Null]",object:"[object Object]"},hn=[mn.string,mn.number,mn.boolean,mn.undefined,mn.null],bn=e=>null===e?mn.null:void 0===e?mn.undefined:Object.prototype.toString.call(e);function wn(e){let t=null,n=null;function o(e){return bn(e)===mn.object}return void 0===e||o(e)?{isValid:function e(i,r="root"){if(Array.isArray(i))return i.every(((t,n)=>e(t,`${r}[${n}]`)));if(o(i))return Object.keys(i).every((t=>e(i[t],`${r}.${t}`)));const s=bn(i),a=hn.includes(s);return a||(n=r,t=`Value of type "${s}" at "${n}" must be one of the following types: ${hn.join(", ")}.`),a}(e,"root"),error:t,errorKey:n}:(n="root",t=`Value of type "${bn(e)}" at "${n}" must be an object.`,{isValid:!1,error:t,errorKey:n})}let gn,vn;function yn(){if(void 0!==gn)return gn;try{return window.localStorage.setItem("local-storage-test","test"),window.localStorage.removeItem("local-storage-test"),gn=!0,!0}catch(e){return gn=!1,!1}}function xn(){if(void 0!==vn)return vn;try{return window.sessionStorage.setItem("session-storage-test","test"),window.sessionStorage.removeItem("session-storage-test"),vn=!0,!0}catch(e){return vn=!1,!1}}const En=240,_n=300,kn=300,Sn=200,Cn="remote-ui::ready";function An(e,{terminate:t=!0,targetOrigin:n="*"}={}){var o;if("undefined"==typeof window)throw new Error("You can only run fromIframe() in a browser context, but no window was found.");const i=new WeakMap;let r;function s(t){t.source===e.contentWindow&&t.data===Cn&&(window.removeEventListener("message",s),r())}null===(o=e.contentWindow)||void 0===o||o.postMessage(Cn,n);const a=new Promise((e=>{r=e,window.addEventListener("message",s)}));return{async postMessage(t,o){var i;await a,null===(i=e.contentWindow)||void 0===i||i.postMessage(t,n,o)},addEventListener(t,n){const o=t=>{t.source===e.contentWindow&&n(t)};i.set(n,o),self.addEventListener(t,o)},removeEventListener(e,t){const n=i.get(t);null!=n&&(i.delete(t),self.removeEventListener(e,n))},terminate(){window.removeEventListener("message",s),t&&e.remove()}}}const Tn=Symbol.for("RemoteUi::Retain"),In=Symbol.for("RemoteUi::Release"),Nn=Symbol.for("RemoteUi::RetainedBy");class On{constructor(){this.memoryManaged=new Set}add(e){this.memoryManaged.add(e),e[Nn].add(this),e[Tn]()}release(){for(const e of this.memoryManaged)e[Nn].delete(this),e[In]();this.memoryManaged.clear()}}function Pn(e){return Boolean(e&&e[Tn]&&e[In])}function Rn(e,{deep:t=!0}={}){return Dn(e,t,new Map)}function Dn(e,t,n){const o=n.get(e);if(null!=o)return o;const i=Pn(e);if(i&&e[Tn](),n.set(e,i),t){if(Array.isArray(e)){const o=e.reduce(((e,o)=>Dn(o,t,n)||e),i);return n.set(e,o),o}if(Ln(e)){const o=Object.keys(e).reduce(((o,i)=>Dn(e[i],t,n)||o),i);return n.set(e,o),o}}return n.set(e,i),i}function Ln(e){if(null==e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null==t||t===Object.prototype}const $n="_@f";function Mn(e){const t=new Map,n=new Map,o=new Map;return{encode:function o(i,r=new Map){if(null==i)return[i];const s=r.get(i);if(s)return s;if("object"==typeof i){if(Array.isArray(i)){r.set(i,[void 0]);const e=[],t=[i.map((t=>{const[n,i=[]]=o(t,r);return e.push(...i),n})),e];return r.set(i,t),t}if(Ln(i)){r.set(i,[void 0]);const e=[],t=[Object.keys(i).reduce(((t,n)=>{const[s,a=[]]=o(i[n],r);return e.push(...a),{...t,[n]:s}}),{}),e];return r.set(i,t),t}}if("function"==typeof i){if(t.has(i)){const e=t.get(i),n=[{[$n]:e}];return r.set(i,n),n}const o=e.uuid();t.set(i,o),n.set(o,i);const s=[{[$n]:o}];return r.set(i,s),s}const a=[i];return r.set(i,a),a},decode:i,async call(e,t){const o=new On,r=n.get(e);if(null==r)throw new Error("You attempted to call a function that was already released.");try{const e=Pn(r)?[o,...r[Nn]]:[o];return await r(...i(t,e))}finally{o.release()}},release(e){const o=n.get(e);o&&(n.delete(e),t.delete(o))},terminate(){t.clear(),n.clear(),o.clear()}};function i(t,n){if("object"==typeof t){if(null==t)return t;if(Array.isArray(t))return t.map((e=>i(e,n)));if($n in t){const i=t[$n];if(o.has(i))return o.get(i);let r=0,s=!1;const a=()=>{r-=1,0===r&&(s=!0,o.delete(i),e.release(i))},c=()=>{r+=1},l=new Set(n),u=(...t)=>{if(s)throw new Error("You attempted to call a function that was already released.");if(!o.has(i))throw new Error("You attempted to call a function that was already revoked.");return e.call(i,t)};Object.defineProperties(u,{[In]:{value:a,writable:!1},[Tn]:{value:c,writable:!1},[Nn]:{value:l,writable:!1}});for(const e of l)e.add(u);return o.set(i,u),u}if(Ln(t))return Object.keys(t).reduce(((e,o)=>({...e,[o]:i(t[o],n)})),{})}return t}}const Un=0,jn=1,zn=2,Fn=3,Bn=5,Vn=6;function Hn(e,{uuid:t=qn,createEncoder:n=Mn,callable:o}={}){let i=!1,r=e;const s=new Map,a=new Map,c=function(e,t){let n;if(null==t){if("function"!=typeof Proxy)throw new Error("You must pass an array of callable methods in environments without Proxies.");const t=new Map;n=new Proxy({},{get(n,o){if(t.has(o))return t.get(o);const i=e(o);return t.set(o,i),i}})}else{n={};for(const o of t)Object.defineProperty(n,o,{value:e(o),writable:!1,configurable:!0,enumerable:!0})}return n}(p,o),l=n({uuid:t,release(e){u(Fn,[e])},call(e,n,o){const i=t(),r=f(i,o),[s,a]=l.encode(n);return u(Bn,[i,e,s],a),r}});return r.addEventListener("message",d),{call:c,replace(e){const t=r;r=e,t.removeEventListener("message",d),e.addEventListener("message",d)},expose(e){for(const t of Object.keys(e)){const n=e[t];"function"==typeof n?s.set(t,n):s.delete(t)}},callable(...e){if(null!=o)for(const t of e)Object.defineProperty(c,t,{value:p(t),writable:!1,configurable:!0,enumerable:!0})},terminate(){u(zn,void 0),m(),r.terminate&&r.terminate()}};function u(e,t,n){i||r.postMessage(t?[e,t]:[e],n)}async function d(e){const{data:t}=e;if(null!=t&&Array.isArray(t))switch(t[0]){case zn:m();break;case Un:{const e=new On,[o,i,r]=t[1],a=s.get(i);try{if(null==a)throw new Error(`No '${i}' method is exposed on this endpoint`);const[t,n]=l.encode(await a(...l.decode(r,[e])));u(jn,[o,void 0,t],n)}catch(n){const{name:e,message:t,stack:i}=n;throw u(jn,[o,{name:e,message:t,stack:i}]),n}finally{e.release()}break}case jn:{const[e]=t[1];a.get(e)(...t[1]),a.delete(e);break}case Fn:{const[e]=t[1];l.release(e);break}case Vn:{const[e]=t[1];a.get(e)(...t[1]),a.delete(e);break}case Bn:{const[e,o,i]=t[1];try{const t=await l.call(o,i),[n,r]=l.encode(t);u(Vn,[e,void 0,n],r)}catch(n){const{name:t,message:o,stack:i}=n;throw u(Vn,[e,{name:t,message:o,stack:i}]),n}break}}}function p(e){return(...n)=>{if(i)return Promise.reject(new Error("You attempted to call a function on a terminated web worker."));if("string"!=typeof e&&"number"!=typeof e)return Promise.reject(new Error(`Can’t call a symbol method on a remote endpoint: ${e.toString()}`));const o=t(),r=f(o),[s,a]=l.encode(n);return u(Un,[o,e,s],a),r}}function f(e,t){return new Promise(((n,o)=>{a.set(e,((e,i,r)=>{if(null==i)n(r&&l.decode(r,t));else{const e=new Error;Object.assign(e,i),o(e)}}))}))}function m(){var e;i=!0,s.clear(),a.clear(),null===(e=l.terminate)||void 0===e||e.call(l),r.removeEventListener("message",d)}}function qn(){return`${Kn()}-${Kn()}-${Kn()}-${Kn()}`}function Kn(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}const Wn=(e,t,{important:n=!1}={})=>Object.keys(t).forEach((o=>{const i=t[o],[r="",s=(n?"important":void 0)]=Array.isArray(i)?i:[i];e.style.setProperty(o,r,s)})),Xn=new Set;function Yn(e){if(!e)return null;try{return JSON.parse(atob(e))}catch(t){return Ke.notify(t,{context:"v0/createWebPixelsHelper/state/deserializeState",unhandled:!1,severity:"warning"}),null}}const Gn="webPixelDebug",Jn="Session storage is not available. The Pixel Helper experience may be degraded.";class Qn extends Error{constructor(...e){super(...e),this.name="HelperStateNotValidError",this.message="Helper state is not valid."}}function Zn(){const e=function(e){return{height:En,...e||{}}}(function(){const e=Yn(new URLSearchParams(self.location.search).get(Gn));return e||(xn()?Yn(sessionStorage.getItem(Gn)):null)}());if(!function(e){return!(!e||!e.pixel)&&("string"==typeof e.pixel.type&&("string"==typeof e.pixel.id&&"number"==typeof e.height))}(e))throw new Qn;return e}function eo(e){!function(e){if(!xn())return t=Jn,void(Xn.has(t)||(Xn.add(t),"console"in self&&console.warn(t)));var t;const n=function(e){try{return btoa(JSON.stringify(e))}catch(t){return Ke.notify(t,{context:"v0/createWebPixelsHelper/state/serializeState",unhandled:!1,severity:"warning"}),null}}(e);n&&sessionStorage.setItem(Gn,n)}(e)}const to="web-pixels-helper-sandbox-handle",no={height:"26px",width:"21px",top:"12px",left:"12px"},oo={height:"100%",width:"100%",top:"0px",left:"0px"};const io=(e,t)=>{const n=document.createElement(e);return Object.keys(t).forEach((e=>{const o=t[e];void 0!==o&&n.setAttribute(e,o)})),n};function ro({id:e,tagName:t,attributes:n,dataset:o,styles:i}){const r=document.querySelector(`${t}#${e}`);if(r)return[r,!1];const s=io(t,{...n,id:e});return o&&Object.keys(o).forEach((e=>{s.dataset[e]=o[e]})),Wn(s,i.props,i.options),[s,!0]}async function so({containerSpec:e,iframeSpec:t}){await new Promise((e=>{if(document.body)e();else{const t=()=>{"loading"!==document.readyState&&(e(),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}}));const[n,o]=ro({id:e.id,tagName:e.tagName,styles:{props:e.styles,options:{important:!0}},attributes:{tabIndex:"-1",...e.attributes},dataset:e.dataset});o&&document.body.appendChild(n);const i=t.attributes||{},[r,s]=ro({id:t.id,tagName:"iframe",styles:{props:t.styles,options:{important:!0}},attributes:{tabIndex:"-1",...i,name:t.id,src:t.src}});if(s){if(t.privileges){if(!function(e){return"sandbox"in e}(r))throw new Ve("browser does not support the sandbox attribute on IFrames");r.setAttribute("sandbox",t.privileges.join(" "))}n.appendChild(r)}return{container:n,iframe:r}}async function ao({state:e,extensionsBaseUrl:t,onHelperReady:n}){const o=await async function({extensionsBaseUrl:e}){const t=`${e}/web-pixels-helper/h${r}m.html`,{height:n}=Zn();return so({containerSpec:{id:"web-pixels-helper-sandbox-container",tagName:"dialog",attributes:{popover:"manual"},styles:{top:"max(0px, calc(100% - 770px))",bottom:"auto",right:"30px",left:"auto",width:"393px",height:`${n}px`,position:"fixed",border:"0",opacity:"0",margin:"0",padding:"0",background:"transparent",overflow:"hidden",visibility:"hidden",transform:"translate(0px, 0px)","border-radius":"16px","box-shadow":"rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 5px 8px 0px, rgba(0, 0, 0, 0.12) 0px 1px 14px 0px",transition:`opacity ${Sn}ms ease-in-out, height ${kn}ms ease-in-out, top ${kn}ms ease-in-out, box-shadow ${_n}ms`}},iframeSpec:{id:"web-pixels-helper-sandbox-iframe",src:t,styles:{border:"none",background:"#fff",clip:"initial",display:"inline",margin:"0",opacity:"1",padding:"0",visibility:"visible",width:"100%",height:"100%","border-radius":"16px"}}})}({extensionsBaseUrl:t}),i=Hn(An(o.iframe),{callable:["initializeHelper","logConsentGranted","logPixelRegister","logSubscribe","logEvent"]});return i.expose({...co(o,n,e)}),function(e){if(e.querySelector(`#${to}`))return;const t=document.createElement("div");var n;t.setAttribute("id",to),Wn(t,{display:"block",position:"absolute",cursor:"grab",background:"transparent",...no},{important:!0}),e.appendChild(t),(n={container:e,handle:t}).handle.addEventListener("mousedown",function({container:e,handle:t},n){function o(t){t.preventDefault();const o=25,i=self.innerHeight-25,r=25,s=self.innerWidth-25;if(t.clientYi||t.clientXs)return;n[1]=n[3]-t.clientX,n[2]=n[4]-t.clientY,n[3]=t.clientX,n[4]=t.clientY;const a=new DOMMatrix(getComputedStyle(e).transform),c=a.e,l=a.f,u=c-n[1],d=l-n[2];Wn(e,{transform:`translate(${u}px, ${d}px)`},{important:!0})}function i(e){Wn(t,no,{important:!0}),self.removeEventListener("mouseup",i),self.removeEventListener("mousemove",o)}return e=>{e.preventDefault(),n[3]=e.clientX,n[4]=e.clientY,self.addEventListener("mouseup",i),self.addEventListener("mousemove",o),Wn(t,oo,{important:!0})}}(n,{1:0,2:0,3:0,4:0}))}(o.container),i}function co(e,t,n){return{async setHelperReady(){e.container.showPopover(),Wn(e.container,{visibility:"visible",opacity:"1"},{important:!0}),t()},setHeight:({height:t})=>new Promise(((o,i)=>{try{Wn(e.container,{height:`${t}px`},{important:!0}),eo({...n,height:t}),o(!0)}catch(r){o(!1)}})),async proceedWithoutConsent(){try{const{success:e}=await le(St.reduce(((e,t)=>(e[t]=!0,e)),{}));return Boolean(e)}catch(e){return!1}},async setClipboard({text:e}){try{return self.navigator.clipboard.writeText(e),!0}catch(t){return!1}},async sendMonorailEvent({schemaKey:e,payload:t}){dt(e,t)}}}let lo=function(e){return e.Standard="standard",e.Advanced="advanced",e}({});const uo={extensionsBaseUrl:"",endpoint:null,replayQueue:[],message(e,t){try{this.endpoint?this.endpoint.call[e](t):this.replayQueue.push((()=>{this.endpoint.call[e](t)}))}catch(n){Ke.notify(n,{context:"v0/createWebPixelsHelper/message",unhandled:!1,severity:"warning"})}},init(e){try{this.extensionsBaseUrl=e.extensionsBaseUrl;const n=Zn(),r=e.webPixelsConfigList.find((e=>e.type===n.pixel.type&&e.id===n.pixel.id));if(function(e,t){return(e.pixel.type===Oe.Custom||e.pixel.type===Oe.App)&&!e.pixel.id.match(/shopify/i)&&void 0!==t&&e.pixel.id===t.id&&e.pixel.type===t.type}(n,r))try{eo(n);let t=!1;const{shopId:s,surface:a=De.Unknown}=e,c=nt("helperLoad",{version:o,pageUrl:self.location.href,surface:a,status:"loaded",bundleTarget:i,shopId:s});ao({state:n,extensionsBaseUrl:this.extensionsBaseUrl,onHelperReady:()=>{t||(ut(c),t=!0)}}).then((t=>{t&&(this.endpoint=t,this.message("initializeHelper",{pixelUid:{id:r.id,type:r.type},pixelName:r.name||"",config:e,collapsed:n.heighte())),this.replayQueue=[])})).catch((t=>{Ke.notify(t,{context:"v0/createWebPixelsHelper/init/createHelperSandbox",unhandled:!1,severity:"warning"});const{shopId:n,surface:r=De.Unknown}=e;dt("helperLoad",{version:o,pageUrl:self.location.href,surface:r,status:"helper-create-error",bundleTarget:i,shopId:n})}))}catch(t){Ke.notify(t,{context:"v0/createWebPixelsHelper/init/selectedPixelValid",unhandled:!1,severity:"warning"});const{shopId:n,surface:r=De.Unknown}=e;dt("helperLoad",{version:o,pageUrl:self.location.href,surface:r,status:"failed",bundleTarget:i,shopId:n})}}catch(t){if(!(t instanceof Qn)){Ke.notify(t,{context:"v0/createWebPixelsHelper/init",unhandled:!1,severity:"warning"});const{shopId:n,surface:r=De.Unknown}=e;dt("helperLoad",{version:o,pageUrl:self.location.href,surface:r,status:"helper-read-error",bundleTarget:i,shopId:n})}}}},po={all_events:pn.Meta,all_standard_events:pn.Meta,all_custom_events:pn.Meta,all_dom_events:pn.Meta,all_error_events:pn.Meta,checkout_address_info_submitted:dn.Standard,checkout_completed:dn.Standard,checkout_started:dn.Standard,payment_info_submitted:dn.Standard,collection_viewed:dn.Standard,checkout_contact_info_submitted:dn.Standard,page_viewed:dn.Standard,product_added_to_cart:dn.Standard,product_removed_from_cart:dn.Standard,product_viewed:dn.Standard,product_variant_viewed:dn.Standard,search_submitted:dn.Standard,cart_viewed:dn.Standard,checkout_shipping_info_submitted:dn.Standard,application_error:dn.Error,ui_extension_error:dn.Error,input_changed:dn.Dom,input_blurred:dn.Dom,input_focused:dn.Dom,form_submitted:dn.Dom,clicked:dn.Dom,dom_mouse_moved:pn.ExtendedDom,dom_window_resized:pn.ExtendedDom,dom_scroll:pn.ExtendedDom,dom_clipboard:pn.ExtendedDom,dom_selection_changed:pn.ExtendedDom,dom_available:pn.ExtendedDom,dom_changed:pn.ExtendedDom,dom_clicked:pn.ExtendedDom,dom_form_submitted:pn.ExtendedDom,dom_input_changed:pn.ExtendedDom,dom_input_blurred:pn.ExtendedDom,dom_input_focused:pn.ExtendedDom};function fo(e){return function(e){return e in po}(e)?po[e]:dn.Custom}function mo(e){return fo(e)===dn.Standard}function ho(e){return fo(e)===dn.Error}function bo(e){return fo(e)===dn.Dom}function wo(e){return fo(e)===pn.ExtendedDom}function go(){return{document:{location:{href:window.location.href,hash:window.location.hash,host:window.location.host,hostname:window.location.hostname,origin:window.location.origin,pathname:window.location.pathname,port:window.location.port,protocol:window.location.protocol,search:window.location.search},referrer:document.referrer,characterSet:document.characterSet,title:document.title},navigator:{language:navigator.language,cookieEnabled:navigator.cookieEnabled,languages:navigator.languages,userAgent:navigator.userAgent},window:{innerHeight:window.innerHeight,innerWidth:window.innerWidth,outerHeight:window.outerHeight,outerWidth:window.outerWidth,pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,location:{href:window.location.href,hash:window.location.hash,host:window.location.host,hostname:window.location.hostname,origin:window.location.origin,pathname:window.location.pathname,port:window.location.port,protocol:window.location.protocol,search:window.location.search},origin:window.origin,screen:{height:window.screen.height,width:window.screen.width},screenX:window.screenX,screenY:window.screenY,scrollX:window.scrollX,scrollY:window.scrollY}}}const vo=e=>{var t;return{...e,clientId:null!=(t=vt(document.cookie)._shopify_y)?t:"",timestamp:(new Date).toISOString(),context:go(),id:"string"==typeof e.id&&e.id.length>0?e.id:Ne()}};const yo="all_standard_events",xo="all_custom_events",Eo="all_dom_events",_o="all_error_events",ko=["application_error","ui_extension_error"];class So extends Error{constructor(e){super(e),this.name="PublishDomEventError"}}function Co(e){const t=new ke({bufferSize:Number.POSITIVE_INFINITY,subscribeAllKey:yo,eligibility:Me}),n=new ke({bufferSize:1e3,subscribeAllKey:xo,eligibility:Me}),r=new ke({bufferSize:1e3,replayKeep:"newest",subscribeAllKey:Eo,eligibility:Me}),s=new ke({bufferSize:1e3,subscribeAllKey:_o,eligibility:Me}),c=new ke({bufferSize:1e3,replayKeep:"newest",eligibility:Me});e.initData;let l=!1;return{publish(n,r,c){var u,d,p,f,m;if("string"!=typeof n)throw new Error("Expected event name to be a string, but got "+typeof n);if(!mo(n)&&!ho(n))return!1;if(ko.includes(n)&&!ye("a545847e"))return!1;if("checkout_completed"===n&&fn()&&"1"===vt(document.cookie)[a])return!1;const h=wn(r);if(!h.isValid)return console.error(h.error),!1;const b=function(e,t,n){let o;const i={analyticsFramework:"wpm"};try{var r,s;"product_added_to_cart"===e&&"cartLine"in n&&(i.cacheKey=function({cartLine:e}={cartLine:null}){const t=null==e?void 0:e.merchandise.product.id,n=null==e?void 0:e.merchandise.id;if(t&&n)return`${t}-${n}`}(n)),o=null==(r=window.Shopify)||null==(s=r.evids)?void 0:s.call(r,e,i)}catch{}return vo({id:o,name:e,data:n,type:po[e]})}(n,0,r),w=null==(u=b.data)||null==(d=u.checkout)?void 0:d.token;return dt("eventPublish",{version:o,bundleTarget:i,pageUrl:self.location.href,shopId:e.shopId,surface:e.surface||De.Unknown,eventName:b.name,eventType:b.type,extensionId:null==c||null==(p=c.extension)?void 0:p.extensionId,extensionAppId:null==c||null==(f=c.extension)?void 0:f.appId,extensionType:null==c||null==(m=c.extension)?void 0:m.type,userCanBeTracked:ie().toString(),shopPrefs:"unknown",eventId:b.id,checkoutToken:w,serverEventId:null==c?void 0:c.eventId}),function(e){"checkout_completed"===e&&function(){if(fn()){const e=self.location.pathname.split("/").slice(0,-1).join("/"),t=new Date;t.setMonth(t.getMonth()+2),document.cookie=`${a}=1; expires=${t}; path=${e}`}}()}(n),l||(l=!0,g=e.shopId,v=e.surface||De.Unknown,Tt.add((()=>function(e,t){yt||(yt=!0,dt("consentAccepted",{version:o,bundleTarget:i,shopId:e,surface:t,shopPrefs:"unknown"}))}(g,v)))),b.type===dn.Error?s.publish(b.name,b):t.publish(b.name,b);var g,v},publishCustomEvent(t,r,s){var a,c,l;if("string"!=typeof t)throw new Error("Expected event name to be a string, but got "+typeof t);if(!function(e){return fo(e)===dn.Custom}(t))return!1;const u=wn(r);if(!u.isValid)return console.error(u.error),!1;const d=function(e,t,n=null){return vo({name:e,customData:n,type:dn.Custom})}(t,0,r);return dt("eventPublish",{version:o,bundleTarget:i,pageUrl:self.location.href,shopId:e.shopId,surface:e.surface||De.Unknown,eventName:d.name,eventType:"custom",extensionId:null==s||null==(a=s.extension)?void 0:a.extensionId,extensionAppId:null==s||null==(c=s.extension)?void 0:c.appId,extensionType:null==s||null==(l=s.extension)?void 0:l.type,eventId:d.id}),n.publish(t,d,s)},publishDomEvent(e,t,n){if("string"!=typeof e){const t=JSON.stringify(e);throw new So(`Expected event name "${t}" to be a string, but got ${typeof e}`)}if(!bo(e)&&!wo(e))throw new So(`Event name "${e}" is not a supported DOM Event`);if(wo(e)&&!ye(xe))return!1;const o=wn(t);if(!o.isValid)throw new So(`Input Validation Error for event ${e}: ${o.error}\nPayload: ${JSON.stringify(t)}`);const i=function(e,t){return vo({name:e,data:t,type:dn.Dom})}(e,t);return wo(e)?c.publish(e,i):r.publish(e,i)},subscribe(a,l,u={}){const d=Ne(),p=async t=>{var n,r,s,c,p,f,m,h;if(e.surface===De.CheckoutOneSdk&&u.scope!==$e.CheckoutOneSdk)return;const b={configuration:null==(n=u.pixelRuntimeConfig)?void 0:n.configuration,eventPayloadVersion:u.schemaVersion||(null==(r=u.pixelRuntimeConfig)?void 0:r.eventPayloadVersion)||"unknown",id:(null==(s=u.pixelRuntimeConfig)?void 0:s.id)||"unknown",type:(null==(c=u.pixelRuntimeConfig)?void 0:c.type)||"unknown",runtimeContext:(null==(p=u.pixelRuntimeConfig)?void 0:p.runtimeContext)||"unknown",restrictions:null==(f=u.pixelRuntimeConfig)?void 0:f.restrictions,scriptVersion:(null==(m=u.pixelRuntimeConfig)?void 0:m.scriptVersion)||"unknown",apiClientId:null==(h=u.pixelRuntimeConfig)?void 0:h.apiClientId},w={pixelUid:{id:b.id,type:b.type},event:t,eventNameAsSubscribed:a,subscriptionId:d,status:"SUCCESS"};let g;try{await l.call(t,t),uo.message("logEvent",w)}catch(S){g=S,uo.message("logEvent",{...w,status:"FAIL",error:g})}const v=fo(t.name),y={version:o,bundleTarget:i,pageUrl:self.location.href,shopId:u.shopId,surface:u.surface,pixelId:b.id,pixelAppId:Re(b),pixelSource:b.type,pixelRuntimeContext:b.runtimeContext,pixelScriptVersion:b.scriptVersion,pixelConfiguration:b.configuration,pixelEventSchemaVersion:b.eventPayloadVersion,eventName:t.name,eventId:t.id},x=g?"FAILURE":"SUCCESS",E=g?String(g):void 0;if(v!==dn.Dom){let e;var _,k;mo(t.name)&&(e=null==t||null==(_=t.data)||null==(k=_.checkout)?void 0:k.token),dt("subscriberEventEmit",{...y,eventType:v,checkoutToken:e||void 0,status:x,errorMessage:E})}else Ue(1)&&dt("subscriberEventEmitDom",{...y,status:x,errorMessage:E})};if(wo(a))return c.subscribe(a,p,u);if("all_events"===a){const e=t.subscribe(yo,p,u),o=n.subscribe(xo,p,u),i=r.subscribe(Eo,p,u),a=s.subscribe(_o,p,u);return()=>{const t=e(),n=o(),r=i(),s=a();return t&&n&&r&&s}}return a===xo?n.subscribe(xo,p,u):a===yo||mo(a)?t.subscribe(a,p,u):a===Eo||bo(a)?r.subscribe(a,p,u):a===_o||ho(a)?s.subscribe(a,p,u):n.subscribe(a,p,u)}}}const Ao=["31014027265","28638674945","44186959873"];const To="wpm-test-cookie",Io=new Map;function No(){var e,t;const n=(null==(e=self)||null==(t=e.location)?void 0:t.hostname)||"",o=Io.get(n);if(o)return o;const i=n.split("."),r=[];return i.reverse().reduce(((e,t)=>{const n=""===e?t:`${t}.${e}`;return function(e){document.cookie=`${To}=1; path=/; domain=${e}`}(n),document.cookie.split(";").find((e=>e.includes(To)))||r.push(n),function(e){document.cookie=`${To}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=${e}`}(n),n}),""),Io.set(n,r),r}function Oo({eventBus:e,customerPrivacyEventBus:t,webPixelConfig:n,shopId:o,surface:i,initData:r,forRPC:s=!1}){let a={};try{a=n.configuration?JSON.parse(n.configuration):{}}catch(b){}const c=function(e){return e===De.Shopify||e===De.CheckoutOne||e===De.CheckoutOneSdk?Le.Checkout:e===De.StorefrontRenderer?Le.Storefront:Le.Unknown}(i);var l,u,d,p,f,m,h;return{analytics:{subscribe:(t,r,a)=>(s&&Rn(r),e.subscribe(t,r,{...a,pixelRuntimeConfig:n,shopId:o,surface:i,scope:$e.WebPixelExtension}))},browser:{cookie:{get:async e=>{var t;return e?null!=(t=vt(document.cookie)[e])?t:"":document.cookie},set:async(e,t)=>{if(t){const n=`${e}=${t}`;document.cookie=n}else document.cookie=e;return document.cookie}},sendBeacon:async(e,t="")=>{if(e.includes(self.location.origin)&&!e.match(/\/\.well-known\/shopify\/monorail\/unstable\/produce_batch/))return!1;const n=new window.Blob([t],{type:"text/plain"});return window.navigator.sendBeacon(e,n)},localStorage:{setItem:async(e,t)=>yn()?window.localStorage.setItem(e,t):Promise.resolve(),getItem:async e=>yn()?window.localStorage.getItem(e):Promise.resolve(null),key:async e=>yn()?window.localStorage.key(e):Promise.resolve(null),removeItem:async e=>yn()?window.localStorage.removeItem(e):Promise.resolve(),clear:async()=>yn()?window.localStorage.clear():Promise.resolve(),length:async()=>yn()?window.localStorage.length:Promise.resolve(0)},sessionStorage:{setItem:async(e,t)=>xn()?window.sessionStorage.setItem(e,t):Promise.resolve(),getItem:async e=>xn()?window.sessionStorage.getItem(e):Promise.resolve(null),key:async e=>xn()?window.sessionStorage.key(e):Promise.resolve(null),removeItem:async e=>xn()?window.sessionStorage.removeItem(e):Promise.resolve(),clear:async()=>xn()?window.sessionStorage.clear():Promise.resolve(),length:async()=>xn()?window.sessionStorage.length:Promise.resolve(0)}},settings:a,init:(l=r,{context:go(),data:{customer:(h=l.customer,h?{email:h.email,firstName:h.firstName,id:h.id,lastName:h.lastName,phone:h.phone,ordersCount:h.ordersCount}:null),cart:(u=l.cart,u?{id:null==u?void 0:u.id,cost:{totalAmount:{amount:null==u||null==(d=u.cost)||null==(p=d.totalAmount)?void 0:p.amount,currencyCode:null==u||null==(f=u.cost)||null==(m=f.totalAmount)?void 0:m.currencyCode}},lines:null==u?void 0:u.lines,totalQuantity:null==u?void 0:u.totalQuantity,attributes:null==u?void 0:u.attributes}:null),shop:l.shop},customerPrivacy:{analyticsProcessingAllowed:se(),marketingAllowed:re(),preferencesProcessingAllowed:ae(),saleOfDataAllowed:ce()}}),_pixelInfo:{...n,surface:i,surfaceNext:c},customerPrivacy:{subscribe:(e,r,a)=>(s&&Rn(r),t.subscribe(e,r,{...a,pixelRuntimeConfig:n,shopId:o,surface:i,scope:$e.WebPixelExtension}))}}}const Po=()=>{let e,t;return{promise:new Promise(((...n)=>{[e,t]=n})),resolve:e,reject:t}},Ro=1e3;class Do extends Error{constructor(e,t){super(e),this.url=void 0,this.name="WebWorkerTopLevelError",this.url=t}}let Lo;const $o=()=>(Lo||(Lo={localStorageItems:{...self.localStorage},sessionStorageItems:{...self.sessionStorage}}),Lo);class Mo extends Error{constructor(...e){super(...e),this.name="SandboxAlreadyCreatedError",this.message="Sandbox already created."}}class Uo extends Error{constructor(e,t){super(e),this.name="PixelInitializationError",this.stack=t}}class jo extends Error{constructor(...e){super(...e),this.name="InvalidExtensionPointError",this.message="Invalid Extension Point"}}class zo extends Error{constructor(...e){super(...e),this.name="PixelError"}}const Fo=new Map;async function Bo(t){var n;let s=!1,a=null;const{webPixelConfig:u,eventBus:d,shopId:p,surface:f}=t,m=u.id,h=u.type.toLowerCase();if(u.runtimeContext===Pe.Open&&!ye("5de24938"))return!1;var b,w;switch(u.restrictions||(u.restrictions=function(e,t){if(!e)return{};const n=function(e){return Ao.includes(String(e))}(e),o=t!==De.StorefrontRenderer;return n&&o?{allowedEvents:[],preventLoadingBeforeEvent:`shopify:app:pixels:load:${e}`}:n?{allowedEvents:[]}:{}}(String(u.apiClientId),f)),await Promise.all([(async()=>{await At(function(e){if(e)return St.reduce(((t,n)=>(t[n]=e.includes(n.toUpperCase()),t)),{})}(u.privacyPurposes)),uo.message("logConsentGranted",{pixelUid:{id:m,type:u.type}})})(),(b=(e,t)=>d.subscribe(e,t,{pixelRuntimeConfig:{apiClientId:"PIXEL-LOADER"}}),w=null==(n=u.restrictions)?void 0:n.preventLoadingBeforeEvent,new Promise(((e,t)=>{void 0===w?e(!0):b(w,(()=>{e(!0)}))})))]),Qe("pixel:register","start",{pixelId:m,source:h}),u.runtimeContext){case Pe.Lax:case Pe.Strict:try{s=await async function({webPixelConfig:e,eventBus:t,customerPrivacyEventBus:n,shopId:o,storefrontBaseUrl:s,surface:a,initData:c}){const u=`web-pixel-sandbox-${e.type}-${e.id}-${e.runtimeContext}-${r}`;if(e.runtimeContext===Pe.Lax&&document.getElementById(u)){const t=new Mo;throw Ke.notify(t,{pixelId:e.id,pixelType:e.type,runtimeContext:e.runtimeContext,shopId:o,context:"v0/createWebPixelSandbox/alreadyCreatedError",userAgent:self.navigator.userAgent,hashVersionSandbox:r,sandboxUrl:self.location.href||"unknown",options:{sampleRate:15}}),t}let d,p;switch(e.runtimeContext){case Pe.Strict:[d,p]=await async function({sandboxId:e,webPixelConfig:t,storefrontBaseUrl:n}){const o=t.id,s=[Xe(n),"/wpm",`@${r}`,`/web-pixel-${o}`,`@${t.scriptVersion}`,"/sandbox",`/worker.${i}.js`];n.match(/spin\.dev\/?/)&&s.push("?fast_storefront_renderer=1");const a=s.join(""),c=new Worker(a,{name:e,type:"classic",credentials:"omit"}),l=new Promise(((e,t)=>{const n=e=>{c.removeEventListener("error",n),null!=e&&e.filename&&null!=e&&e.lineno&&null!=e&&e.message?t(new Do(e.message,a)):t(new Error(`Failed to load web worker for pixel ${o} with url ${a}}`))};c.addEventListener("error",n)}));return[c,l]}({sandboxId:u,webPixelConfig:e,storefrontBaseUrl:s});break;case Pe.Lax:[d,p]=await async function({sandboxId:e,webPixelConfig:t,storefrontBaseUrl:n}){const{search:o}=self.location,s=t.id,a=t.type.toLowerCase(),c=[Xe(n),"/wpm",`@${r}`,`/${a}`,`/web-pixel-${s}`,`@${t.scriptVersion}`,"/sandbox",`/${i}`,/\.(js|json|xml)$/.test(self.location.pathname)?"":self.location.pathname,o];if(n.match(/spin\.dev\/?/)){const e=o.length?"&":"?";c.push(`${o}${e}fast_storefront_renderer=1`)}const{iframe:u}=await so({containerSpec:{id:l,tagName:"div",styles:{height:"0",width:"0",position:"fixed",visibility:"hidden",overflow:"hidden","z-index":"-100",margin:"0",padding:"0",border:"0"},attributes:{"aria-hidden":"true"},dataset:{shopifyPrivacy:"exclude"}},iframeSpec:{id:e,src:c.join(""),privileges:["allow-scripts","allow-forms"],styles:{height:"0",width:"0",visibility:"hidden"},attributes:{"aria-hidden":"true"}}}),{promise:d,reject:p}=Po();let f;const m=()=>{f=setTimeout((()=>{p(new Error(`Failed to load iframe for pixel ${s} with url ${c.join("")}}`))}),Ro)};u.addEventListener("load",m);const h=An(u);return h.addEventListener("message",(e=>{"remote-ui::ready"===e.data&&(clearTimeout(f),u.removeEventListener("load",m))})),[h,d]}({sandboxId:u,webPixelConfig:e,storefrontBaseUrl:s});break;default:throw new Error(`Unsupported runtime context: ${e.runtimeContext}`)}const f=Hn(d,{callable:["initialize"]}),m=Oo({eventBus:t,customerPrivacyEventBus:n,webPixelConfig:e,shopId:o,surface:a,initData:c,forRPC:!0}),h={self:{origin:{get:async()=>self.origin}},document:{referrer:{get:async()=>document.referrer}}},b=go();let w={status:"unknown",hashVersion:"unknown",sandboxUrl:"unknown"};const g=e.runtimeContext===Pe.Lax?$o():{localStorageItems:{},sessionStorageItems:{}},v=[f.call.initialize({pageTitle:self.document.title,webPixelConfig:e,shopId:o,webPixelApi:m,internalApi:h,cookie:self.document.cookie,cookieRestrictedDomains:No(),origin:self.origin,referrer:self.document.referrer,...g}).then((e=>{w=e})).catch((e=>{var t;throw new Uo(e.toString(),null!=(t=e.stack)?t:"")}))];if(p&&v.push(p),await Promise.race(v),r!==w.hashVersion){const t=new Error(`The main bundle hash (${r}) does not match the sandbox hash (${w.hashVersion})`);throw Ke.notify(t,{severity:"warning",pixelId:e.id,pixelType:e.type,runtimeContext:e.runtimeContext,context:"v0/createSandbox/hashMismatch",shopId:o,userAgent:b.navigator.userAgent||self.navigator.userAgent,hashVersionSandbox:w.hashVersion,sandboxUrl:w.sandboxUrl}),t}return!0}(t)}catch(E){a=E,s=!1}break;case Pe.Open:try{s=await async function({webPixelConfig:t,eventBus:n,customerPrivacyEventBus:o,shopId:s,storefrontBaseUrl:a,surface:l,initData:u}){var d;const{promise:p,resolve:f,reject:m}=Po(),{id:h,type:b}=t,w=`${h}-${b}`.toLowerCase();Fo.set(w,(()=>({webPixelApi:Oo({eventBus:n,customerPrivacyEventBus:o,webPixelConfig:t,shopId:s,surface:l,initData:u,forRPC:!0}),resolve:f,reject:m})));const g=a.match(/spin\.dev\/?/),v=[Xe(a),`/wpm@${r}`,`/${t.type.toLocaleLowerCase()}`,`/web-pixel-${h}@${t.scriptVersion}`,`/pixel.${i}.js`,g?"?fast_storefront_renderer=1":""].join("");if(!("createShopifyExtend"in(null!=(d=self[e])?d:{}))){const t=(e,t)=>{const n=Fo.get(`${e}-${t}`.toLowerCase());if(!n)return m(new Error(`No openPixelFn found for ${e}-${t}.`)),null;const{resolve:o,reject:i,webPixelApi:r}=n();return r||i(new Error(`No api found for pixel ${e}-${t}.`)),Object.freeze({extend:(e,t)=>{e!==c&&i(new jo);try{t.call(r,r),o(!0)}catch(E){i(new zo(E))}}})};Object.defineProperty(self,e,{value:{},enumerable:!0,writable:!1,configurable:!1}),Object.defineProperty(self[e],"createShopifyExtend",{value:t,enumerable:!0,writable:!1,configurable:!1})}var y;return await(y=v,new Promise(((e,t)=>{try{const n=document.createElement("script");n.src=y,n.async=!0,n.onload=()=>{e()},n.onerror=()=>{o(),t(new Error(`Failed to load script: ${y}`))};const o=()=>{n.onload=null,n.onerror=null,n.remove()};document.head.appendChild(n)}catch(E){t(E)}}))),p}(t)}catch(E){a=E,s=!1}break;default:{const e=new Error(`Invalid runtimeContext: ${u.runtimeContext}`);throw uo.message("logPixelRegister",{pixelUid:{id:m,type:u.type},status:"FAIL",errorType:"PixelRegistrationError",error:e}),e}}const g=Re(u),{measurement:v}=Je("pixel:register",{pixelId:m,source:h});a&&!s?uo.message("logPixelRegister",{pixelUid:{id:m,type:u.type},status:"FAIL",errorType:a instanceof Uo?"PixelInitializationError":"PixelRegistrationError",error:a}):s&&uo.message("logPixelRegister",{pixelUid:{id:m,type:u.type},status:"SUCCESS"});const y=a?"failed":"registered",x=a?a.message:void 0;return dt("register",{version:o,pageUrl:self.location.href,shopId:p,surface:f,pixelId:m,pixelAppId:g,pixelSource:u.type,pixelRuntimeContext:u.runtimeContext,pixelScriptVersion:u.scriptVersion,pixelConfiguration:null==u?void 0:u.configuration,pixelEventSchemaVersion:u.eventPayloadVersion,status:y,userCanBeTracked:ie().toString(),shopPrefs:"unknown",bundleTarget:i,errorMsg:x,duration:null==v?void 0:v.duration,startTime:null==v?void 0:v.startTime,sessionId:Pt()}),s}function Vo(e,t){return Lt(document,e,(n=>{var o;if(!(n instanceof Event&&n.type===e))return;const i=n.target;if(!(i instanceof Element))return;const r=en(i);t("dom_clipboard",{element:r,action:null!=(o=n.type)?o:"copy"})}),{throttleDelay:100})}const Ho=(e,t)=>Array.from(e).reduce(((e,n)=>(jt(n)||e.push(t(n)),e)),[]),qo=e=>{return{element:en(e),children:Ho(e.childNodes,qo),...(t=e,t?(Jt.has(t)||Jt.set(t,{parentSerializationId:Gt(t.parentNode),prevSiblingSerializationId:Gt(t.previousSibling)}),Jt.get(t)):{parentSerializationId:-1,prevSiblingSerializationId:-1})};var t},Ko=[e=>{let t=null;return Lt(self.window,"mousemove",(n=>{if(!(n instanceof MouseEvent))return;const o=null==n?void 0:n.target;if(!(o instanceof Element))return;const i=an(n,o);i.movementX=t?n.screenX-t.screenX:0,i.movementY=t?n.screenY-t.screenY:0,e("dom_mouse_moved",i),t=n}),{throttleDelay:50})},e=>Lt(self.window,"resize",(()=>{e("dom_window_resized",{innerHeight:self.window.innerHeight,innerWidth:self.window.innerWidth})}),{throttleDelay:100}),e=>Lt(self.window,"scroll",(t=>{if(!(t instanceof Event))return;const n=null==t?void 0:t.target;let o;if(n instanceof Document){var i;o=null!=(i=n.scrollingElement)?i:document.documentElement}else{if(!(n instanceof Element))return;o=n}e("dom_scroll",{scrollingElement:en(o)})}),{throttleDelay:100}),e=>{const t=[Vo("cut",e),Vo("paste",e),Vo("copy",e)];return()=>{t.forEach((e=>e()))}},e=>Lt(self.document,"selectionchange",(t=>{const n=document.activeElement;if(!(n instanceof Element)||jt(n))return;let o=null;var i;o=n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?Ft(n)?Mt:n.value.substring(n.selectionStart||0,n.selectionEnd||0):(null==(i=window.getSelection())?void 0:i.toString())||null,e("dom_selection_changed",{value:o,element:en(n)})}),{throttleDelay:250}),e=>{const t=()=>{const t=self.document.documentElement;if(!(t instanceof HTMLElement))return;const n=qo(t);e("dom_available",{root:n})};return"loading"!==document.readyState?(t(),()=>{}):Lt(self.window,"DOMContentLoaded",t)},e=>{const t=new MutationObserver((t=>{t.forEach((t=>{const n=Ho(t.addedNodes,qo),o=Ho(t.removedNodes,(e=>{const t=qo(e);var n;return n=e,Jt.delete(n),t})),i=[];"attributes"!==t.type||jt(t.target)||i.push(en(t.target)),0===n.length&&0===o.length&&0===i.length||e("dom_changed",{addedNodes:n,removedNodes:o,modifiedElements:i})}))}));return t.observe(document.body,{attributes:!0,attributeFilter:["style","class"],childList:!0,subtree:!0}),()=>{t.disconnect()}}],Wo=function(){const e=null!=(t=self.Shopify)&&t.Checkout?De.Shopify:null!=(n=self.Shopify)&&null!=(r=n.analytics)&&r.replayQueue?De.StorefrontRenderer:De.CheckoutOne;var t,n,r;const s=self.location.href,a=nt("load",{version:o,bundleTarget:i,pageUrl:s,status:"loading",surface:e}),c={publish:()=>!1,publishCustomEvent:()=>!1,publishDomEvent:()=>!1,visitor:()=>!1,subscribe:()=>()=>!1};try{const e=Pt();return a.payload.status="loaded",ut(a),{init(t){if(null!==self.location.href.match(/\/wpm@(.+)\/sandbox/))return c;const{shopId:n,surface:r=De.Unknown,initData:a,enabledBetaFlags:l}=t;let{webPixelsConfigList:u}=t||{};ge();const d=self.location.origin;it(d),function(e=[]){(Array.isArray(e)?e:[e]).forEach((e=>ve.add(e)))}(l),ye("4735909c")&&uo.init(t);const p=ie().toString(),f=nt("unload",{version:o,bundleTarget:i,pageUrl:s,shopId:n,surface:r,isCompleted:"false",runtimeErrorCaught:"false",userCanBeTracked:p,sessionId:e});var m;m=f,window.addEventListener("pagehide",(()=>{var e,t;m.payload.pageDuration=null==(e=Je("page:session"))||null==(t=e.measurement)?void 0:t.duration,ut(m),pt({skipXhr:!0})}));const h=Co(t),b=function(e){const t=new ke({bufferSize:1e3,subscribeAllKey:"all_customer_privacy_events",eligibility:Me});return{publish(e,n,o){if("string"!=typeof e)throw new Error("Expected event name to be a string, but got "+typeof e);if(e!==O.CONSENT_COLLECTED)throw new Error(`Expected event name to be a ${O.CONSENT_COLLECTED}, but got "${e}".`);return t.publish(e,n,o)},subscribe(n,r,s={}){if(n!==O.CONSENT_COLLECTED)throw new Error(`Event name "${n}" is not supported in the CustomerPrivacyEventBus.`);return t.subscribe(n,(t=>{var n,a,c,l,u,d,p,f;if(e===De.CheckoutOneSdk&&s.scope!==$e.CheckoutOneSdk)return;const m={configuration:null==(n=s.pixelRuntimeConfig)?void 0:n.configuration,eventPayloadVersion:s.schemaVersion||(null==(a=s.pixelRuntimeConfig)?void 0:a.eventPayloadVersion)||"unknown",id:(null==(c=s.pixelRuntimeConfig)?void 0:c.id)||"unknown",type:(null==(l=s.pixelRuntimeConfig)?void 0:l.type)||"unknown",runtimeContext:(null==(u=s.pixelRuntimeConfig)?void 0:u.runtimeContext)||"unknown",restrictions:null==(d=s.pixelRuntimeConfig)?void 0:d.restrictions,scriptVersion:(null==(p=s.pixelRuntimeConfig)?void 0:p.scriptVersion)||"unknown",apiClientId:null==(f=s.pixelRuntimeConfig)?void 0:f.apiClientId};r.call(t,t),dt("subscriberEventEmitPrivacy",{version:o,bundleTarget:i,pageUrl:self.location.href,shopId:s.shopId,surface:s.surface,pixelId:m.id,pixelAppId:Re(m),pixelSource:m.type,pixelRuntimeContext:m.runtimeContext,pixelScriptVersion:m.scriptVersion,pixelConfiguration:m.configuration,pixelEventSchemaVersion:m.eventPayloadVersion,eventName:O.CONSENT_COLLECTED,eventId:Ne()})}),s)}}}(r),w={severity:"warning",context:"v0/createWebPixelsManager/init",unhandled:!1,shopId:n,initConfig:t},g=nt("init",{version:o,bundleTarget:i,pageUrl:s,shopId:n,surface:r,status:"initializing",userCanBeTracked:p});try{var v,y;if(self.Shopify&&!0===self.Shopify.designMode)return self.console&&console.log("[WebPixelsManager] Prevented from executing in the Theme Editor"),c;if(/^web-pixel-sandbox/.test(self.name)){const e=new Ve("WebPixelsManager: browser library is being run in a sandbox");throw w.library="browser",Ke.notify(e,w),e}if(!n){const e=new Ve("WebPixelsManager: shopId is required");throw Ke.notify(e,w),e}if(!d){const e=new Ve("WebPixelsManager: storefrontBaseUrl is required");throw Ke.notify(e,w),e}if(!function(e){try{return new URL(e),!0}catch(t){return function(e){const t=new RegExp("^(https?:\\/\\/)((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)*[a-z]{1,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return Boolean(t.test(e))}(e)}}(d)){const e=new Ve(`WebPixelsManager: storefrontBaseUrl is not a valid absolute URL: ${d}`);throw Ke.notify(e,w),e}r===De.CheckoutOneSdk&&(u=[]);const e=u.reduce(((e,t)=>{var o,i;t.type=t.type.toUpperCase(),t.runtimeContext=null==(o=t.runtimeContext)?void 0:o.toUpperCase();const s=Bo({webPixelConfig:t,eventBus:h,customerPrivacyEventBus:b,shopId:n,storefrontBaseUrl:d,surface:r,initData:a});return null!=(i=t.restrictions)&&i.preventLoadingBeforeEvent?e.waiting.push(s):e.ready.push(s),e}),{ready:[],waiting:[]});if(Promise.all(e.ready).then((()=>function(e){const{measurement:t}=Je("completed");e.payload.isCompleted="true",e.payload.runTimeDuration=null==t?void 0:t.duration,e.payload.startTime=null==t?void 0:t.startTime}(f))).catch((e=>{self.console&&console.error("[Web Pixels]",e)})),Promise.all(e.waiting).catch((()=>{})),r!==De.CheckoutOne&&r!==De.CheckoutOneSdk&&(N(h.publish,a),ye("d04dc9f4")&&un(h.publishDomEvent.bind(h)),function(){if(!kt)try{document.addEventListener(O.CONSENT_COLLECTED,_t),kt=!0}catch(e){Ke.notify(e,{context:"v0/onConsentCollected/createOnConsentCollectedListener",unhandled:!1})}}(),Et((e=>{b.publish(O.CONSENT_COLLECTED,{customerPrivacy:{analyticsProcessingAllowed:e.detail.analyticsAllowed,marketingAllowed:e.detail.marketingAllowed,preferencesProcessingAllowed:e.detail.preferencesAllowed,saleOfDataAllowed:e.detail.saleOfDataAllowed}})}))),ye(xe)){const e=h.publishDomEvent.bind(h);E=e,Ko.map((e=>e(E))),un(e,{eventPrefix:"dom_"})}g.payload.status="initialized",ut(g);const t=(x={shopId:n,surface:r,pageUrl:s,clientId:null!=(v=vt(document.cookie)._shopify_y)?v:"",version:o,customerId:null==a||null==(y=a.customer)?void 0:y.id},{visitor:(e,t)=>function(e,t,n){const o=function(e,t){return e&&(e.email||e.phone)?null!=e&&e.email&&"string"!=typeof e.email?{valid:!1,error:"Email must be of type string"}:null!=e&&e.phone&&"string"!=typeof e.phone?{valid:!1,error:"Phone must be of type string"}:null!=t&&t.appId&&"string"!=typeof t.appId?{valid:!1,error:"appId must be of type string"}:null!=t&&t.apiClientId&&"string"!=typeof t.apiClientId?{valid:!1,error:"apiClientId must be of type string"}:{valid:!0}:{valid:!1,error:"Visitor must have one of phone or email"}}(t,n);if(!o.valid)throw new It(o.error||"Invalid input payload to visitorApi");const i={...e,...t,apiClientId:(null==n?void 0:n.appId)||(null==n?void 0:n.apiClientId)};return At({analytics:!0,marketing:!0,preferences:!1,sale_of_data:!1}).then((()=>dt("visitor",i))).catch((()=>Ke.notify("visitor error",{severity:"error",context:`v0/visitor-${e.surface}`,unhandled:!1,shopId:e.shopId}))),!0}(x,e,t)});return{publish:(e,t,n={})=>h.publish(e,t,n),publishCustomEvent:(e,t,n={})=>h.publishCustomEvent(e,t,n),publishDomEvent:(e,t,n={})=>h.publishDomEvent(e,t,n),subscribe:(e,t,o)=>h.subscribe(e,t,{...o,shopId:n,surface:r,scope:r===De.CheckoutOneSdk?$e.CheckoutOneSdk:void 0}),visitor:(e,n)=>t.visitor(e,n)}}catch(_){return _ instanceof Ve||Ke.notify(_,{context:"v0/init",shopId:n,initConfig:t}),self.console&&console.error(_),g.payload.status="failed",g.payload.errorMsg=null==_?void 0:_.message,ut(g),f.payload.runtimeErrorCaught="true",c}var x,E}}}catch(l){return l instanceof Ve||Ke.notify(l,{context:"v0/createWebPixelsManager"}),self.console&&console.error(l),a.payload.status="manager-create-error",a.payload.errorMsg=null==l?void 0:l.message,ut(a,!0),{init:()=>c}}}();self[e]=Wo})()})();