!function(){"use strict";var e={9414:function(e,t,n){var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EcommerceIntegration=t.PSEUDO_PAGE_EVENTS=t.TEST_PRODUCT_ADDED_TO_CART_SERVER_CHANGELOG=t.CHECKOUT_ONE_PAGE_VIEW=t.CHECKOUT_PAYMENT_STEP_STARTED=t.CHECKOUT_SHIPPING_INFO_SUBMITTED=t.CHECKOUT_SHIPPING_STEP_STARTED=t.CHECKOUT_ADDRESS_INFO_SUBMITTED=t.CHECKOUT_CONTACT_INFO_SUBMITTED=t.CHECKOUT_CONTACT_STEP_STARTED=t.ANALYTICS_ADDED_PAYMENT=t.ANALYTICS_PERFORMED_SEARCH=t.ANALYTICS_STARTED_ORDER_ONCE_PER_CHECKOUT=t.ANALYTICS_STARTED_ORDER=t.ANALYTICS_COMPLETED_ORDER=t.ANALYTICS_ADDED_PRODUCT_NEXT=t.ANALYTICS_ADDED_PRODUCT=t.ANALYTICS_VIEWED_PRODUCT_CATEGORY=t.ANALYTICS_VIEWED_PRODUCT=t.ANALYTICS_PAGE_VIEW=t.ANALYTICS_GENERIC_EVENT=t.analyticsEvents=void 0;var i=n(6573),a=n(9974),s=n(357),c=n(8416),u=n(1482);t.analyticsEvents={viewedProduct:/^[ _]?viewed[ _]?product[ _]?$/i,viewedProductCategory:/^[ _]?viewed[ _]?product[ _]?category[ _]?$/i,viewedProductVariant:/^[ _]?viewed[ _]?product[ _]?variant[ _]?$/i,addedProduct:/^[ _]?added[ _]?product[ _]?$/i,addedProductNext:/^[ _]?added[ _]?product[ _]?next[ _]?$/i,addedProductPermalinkTest:/^[ _]?added[ _]?product[ _]?permalink[ _]?test[ _]?$/i,completedOrder:/^[ _]?completed[ _]?order[ _]?$/i,startedOrder:/^[ _]?started[ _]?order[ _]?$/i,startedOrderRemote:/^[ _]?started[ _]?order[ _]?remote[ _]?$/i,startedOrderOncePerCheckout:/^[ _]?started[ _]?order[ _]?once[ _]?per[ _]?checkout[ _]?$/i,startedOrderOncePerCheckoutRemote:/^[ _]?started[ _]?order[ _]?once[ _]?per[ _]?checkout[ _]?remote[ _]?$/i,performedSearch:/^[ _]?performed[ _]?search[ _]?$/i,addedPayment:/^[ _]?added[ _]?payment[ _]?$/i,addedPaymentRemote:/^[ _]?added[ _]?payment[ _]?remote[ _]?$/i,checkoutContactStepStarted:/^[ _]?checkout[ _]?[ _]?contact[ _]?step[ _]?started[ _]?$/i,checkoutContactInfoSubmitted:/^[ _]?checkout[ _]?[ _]?contact[ _]?info[ _]?submitted[ _]?$/i,checkoutContactInfoSubmittedRemote:/^[ _]?checkout[ _]?[ _]?contact[ _]?info[ _]?submitted[ _]?remote[ _]?$/i,checkoutAddressInfoSubmitted:/^[ _]?checkout[ _]?[ _]?address[ _]?info[ _]?submitted[ _]?$/i,checkoutAddressInfoSubmittedRemote:/^[ _]?checkout[ _]?[ _]?address[ _]?info[ _]?submitted[ _]?remote[ _]?$/i,checkoutShippingStepStarted:/^[ _]?checkout[ _]?[ _]?shipping[ _]?step[ _]?started[ _]?$/i,checkoutShippingInfoSubmitted:/^[ _]?checkout[ _]?[ _]?shipping[ _]?info[ _]?submitted[ _]?$/i,checkoutShippingInfoSubmittedRemote:/^[ _]?checkout[ _]?[ _]?shipping[ _]?info[ _]?submitted[ _]?remote[ _]?$/i,checkoutPaymentStepStarted:/^[ _]?checkout[ _]?[ _]?payment[ _]?step[ _]?started[ _]?$/i,checkoutOnePageView:/^[ _]?checkout[ _]?[ _]?one[ _]?page[ _]?view[ _]?$/i,testProductAddedToCartServerChangelog:/^test[ _]?product[ _]?added[ _]?to[ _]?cart[ _]?server[ _]?changelog$/i},t.ANALYTICS_GENERIC_EVENT="genericEvent",t.ANALYTICS_PAGE_VIEW="pageView",t.ANALYTICS_VIEWED_PRODUCT="viewedProduct",t.ANALYTICS_VIEWED_PRODUCT_CATEGORY="viewedProductCategory",t.ANALYTICS_ADDED_PRODUCT="addedProduct",t.ANALYTICS_ADDED_PRODUCT_NEXT="addedProductNext",t.ANALYTICS_COMPLETED_ORDER="completedOrder",t.ANALYTICS_STARTED_ORDER="startedOrder",t.ANALYTICS_STARTED_ORDER_ONCE_PER_CHECKOUT="startedOrderOncePerCheckout",t.ANALYTICS_PERFORMED_SEARCH="performedSearch",t.ANALYTICS_ADDED_PAYMENT="addedPayment",t.CHECKOUT_CONTACT_STEP_STARTED="checkoutContactStepStarted",t.CHECKOUT_CONTACT_INFO_SUBMITTED="checkoutContactInfoSubmitted",t.CHECKOUT_ADDRESS_INFO_SUBMITTED="checkoutAddressInfoSubmitted",t.CHECKOUT_SHIPPING_STEP_STARTED="checkoutShippingStepStarted",t.CHECKOUT_SHIPPING_INFO_SUBMITTED="checkoutShippingInfoSubmitted",t.CHECKOUT_PAYMENT_STEP_STARTED="checkoutPaymentStepStarted",t.CHECKOUT_ONE_PAGE_VIEW="checkoutOnePageView",t.TEST_PRODUCT_ADDED_TO_CART_SERVER_CHANGELOG="testProductAddedToCartServerChangelog",t.PSEUDO_PAGE_EVENTS=[t.CHECKOUT_CONTACT_STEP_STARTED,t.CHECKOUT_SHIPPING_STEP_STARTED,t.CHECKOUT_PAYMENT_STEP_STARTED,t.CHECKOUT_ONE_PAGE_VIEW];var d=function(e){function n(t,n,o){var r=e.call(this,t,n,o)||this;return r.wrapTrack(),r.setPixelStub(),r}return r(n,e),n.prototype.wrapTrack=function(){var e=this.track;this.track=function(n){var o=n.event,r=!1;for(var i in t.analyticsEvents){var a=t.analyticsEvents[i];if(this[i]&&a.test(o)){this[i].apply(this,[n]),r=!0;break}}r||e.apply(this,Array.prototype.slice.call(arguments))}},n.prototype.addMonorailBatchEvent=function(e){if(s.default.appName&&s.default.appName in u.appNameToEcommerceEventSchemaId){var t=this.getEcommercePixelIds();i.addBatchEvent({schemaId:e.schemaId?e.schemaId:u.appNameToEcommerceEventSchemaId[s.default.appName],payload:a.objectAssignFilterUndefined({shop_id:s.default.shopId,partner_name:this.getEcommerceMetricsTag(),event_name:e.eventName,unique_token:s.default.uniqToken,visit_token:s.default.visitToken,integration_id:this.getIntegrationId()},{pixel_id:t&&t.length>0?t[0]:void 0,event_properties:e.eventProperties,checkout_token:s.default.checkoutToken,event_id:e.eventId})})}},n}(c.Integration);t.EcommerceIntegration=d},8416:function(e,t,n){var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&this.deferedEvents.forEach((function(e,n,o){var r=e[0],i=e[1];o.delete(n),t.callEvent(r,i)})))},e.prototype.emitEventOrAwaitConsent=function(e,t){this.hasConsent()?this.callEvent(e,t):this.deferedEvents.add([e,t])},e.prototype.callEvent=function(e,t){switch(e){case"page":this.page(t);break;case"track":this.track(t)}},e.prototype.checkoutOnePageView=function(e){if(e.properties.hasOwnProperty("page")){var t=e.properties;this.page(t.page)}},e.flatten=function(e){var t=o({},e);return t.properties={},o(o({},t),e.properties)},e.isEqual=function(e,t){for(var n in e)if(e[n]!==t[n])return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0},e}();t.Integration=a},1482:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.extractSchemaIdFromEventName=t.buyWithPrimePresenceSchemaId=t.trekkieAssetContextSchemaId=t.customStorefrontAnalyticsSchemaId=t.storefrontAnalyticsSchemaIdValidation=t.legacyStorefrontAnalyticsSchemaId=t.storefrontAnalyticsSchemaId=t.appNameToEcommerceEventSchemaId=t.appNameToPageViewSchemaId=void 0,t.appNameToPageViewSchemaId={admin:"trekkie_admin_page_view/1.0",appstore:"trekkie_appstore_page_view/1.2",blog:"trekkie_blog_page_view/1.2",brochure:"trekkie_brochure_page_view/1.3",checkout:"trekkie_checkout_page_view/1.2","collabs-merchants":"trekkie_collabs_merchants_page_view/1.0","compass-web":"trekkie_compass_web_page_view/1.2",creators:"trekkie_creators_page_view/2.0",delivery_app:"trekkie_delivery_app_page_view/1.0",docs:"trekkie_docs_page_view/1.2",development:"edge_test/1.0",exchange:"trekkie_exchange_page_view/1.2",experts:"trekkie_experts_page_view/1.0",handshake:"trekkie_handshake_page_view/1.0",fakestore:"trekkie_fakestore_page_view/1.0",identity:"trekkie_identity_page_view/1.2",linkpop:"trekkie_linkpop_page_view/2.0","marketing-misc":"trekkie_marketing_misc_page_view/1.2","oberlo-home":"trekkie_oberlo_home_page_view/1.3",opinions:"trekkie_opinions_page_view/1.2",partners:"trekkie_partners_page_view/1.2","shopify-ping-web":"trekkie_shopify_ping_web_page_view/1.0",portal:"trekkie_portal_page_view/1.0",storefront:"trekkie_storefront_page_view/1.2",testing:"edge_test/1.0",themestore:"trekkie_themestore_page_view/1.2","services-db":"trekkie_services_db_page_view/1.0"},t.appNameToEcommerceEventSchemaId={storefront:"trekkie_storefront_ecommerce_event_emit/4.0",checkout:"trekkie_checkout_ecommerce_event_emit/4.0",test:"edge_test_ecommerce_event_emit/1.0"},t.storefrontAnalyticsSchemaId="storefront_customer_tracking/5.6",t.legacyStorefrontAnalyticsSchemaId="storefront_customer_tracking/4.27",t.storefrontAnalyticsSchemaIdValidation="storefront_customer_tracking_validation/1.0",t.customStorefrontAnalyticsSchemaId="custom_storefront_customer_tracking/1.5",t.trekkieAssetContextSchemaId="trekkie_asset_context/1.1",t.buyWithPrimePresenceSchemaId="storefront_buy_with_prime_presence/1.0",t.extractSchemaIdFromEventName=function(e){var t=e.toLowerCase();if(0===t.lastIndexOf("monorail://")&&t.length>11)return t.substr(11)}},9965:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ConsentValuesV2=t.IntegrationTypes=t.ConsentPurposes=void 0;var o=n(2243);Object.defineProperty(t,"ConsentPurposes",{enumerable:!0,get:function(){return o.ConsentKeys}});var r,i=n(4842);Object.defineProperty(t,"IntegrationTypes",{enumerable:!0,get:function(){return i.IntegrationTypes}}),(r=t.ConsentValuesV2||(t.ConsentValuesV2={})).NO_VALUE="",r.ACCEPTED="1",r.DECLINED="0"},4842:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationTypes=void 0,(n=t.IntegrationTypes||(t.IntegrationTypes={})).ECOMMERCE="EcommerceIntegration",n.INTEGRATION="Integration"},3988:function(e,t,n){var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n2&&(c.line_number=l[1],c.column_number=l[2],parseInt(c.line_number,10)>1e5))return}this.sendObserveXhr(n,u,d,c,s,r,i,e.app_config,e.notes)}}},6573:function(e,t,n){var o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t10?{stringValue:"[max depth exceeded]"}:null==e?{stringValue:String(e)}:"string"==typeof e?{stringValue:e}:"number"==typeof e?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"==typeof e?{boolValue:e}:Array.isArray(e)?{arrayValue:{values:e.map((function(e){return a(e,t+1)}))}}:"object"==typeof e?{kvlistValue:{values:Object.entries(e).map((function(e){return{key:e[0],value:a(e[1],t+1)}}))}}:{stringValue:String(e)}}var s=function(){function e(e){this.pendingMetrics=[],this.pendingLogs=[],this.exporter=e,this.boundFlush=this.flush.bind(this),this.setupPageUnloadHandler()}return e.prototype.setupPageUnloadHandler=function(){window.addEventListener("pagehide",this.boundFlush)},e.prototype.scheduleFlush=function(){void 0===this.flushTimeoutId&&(this.flushTimeoutId=setTimeout(this.boundFlush,500))},e.prototype.counter=function(e){var t=e.name,n=e.value,r=e.unit,a=e.attributes;if(o.default.isEnabled(o.F_TREKKIE_OTEL_ENABLED)){this.pendingMetrics.length>=1e3&&this.flush();var s=1e6*(new Date).getTime();this.pendingMetrics.push({name:t,unit:r||"1",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:[{asDouble:n,startTimeUnixNano:s,timeUnixNano:s,attributes:i(null!=a?a:{})}]}}),this.scheduleFlush()}},e.prototype.log=function(e){var t=e.message,n=e.severity,s=e.severityText,c=e.attributes;if(o.default.isEnabled(o.F_TREKKIE_OTEL_ENABLED)){this.pendingLogs.length>=1e3&&this.flush();var u=1e6*(new Date).getTime();this.pendingLogs.push({timeUnixNano:u,observedTimeUnixNano:u,severityNumber:null!=n?n:r.SeverityNumber.INFO,severityText:s,body:a(t),attributes:i(null!=c?c:{})}),this.scheduleFlush()}},e.prototype.flush=function(){void 0!==this.flushTimeoutId&&(clearTimeout(this.flushTimeoutId),this.flushTimeoutId=void 0);var e=!0,t=!0;if(this.pendingMetrics.length>0){var n=this.pendingMetrics;this.pendingMetrics=[],e=this.exporter.exportMetrics(n)}if(this.pendingLogs.length>0){var o=this.pendingLogs;this.pendingLogs=[],t=this.exporter.exportLogs(o)}return e&&t},e.prototype.destroy=function(){window.removeEventListener("pagehide",this.boundFlush),void 0!==this.flushTimeoutId&&(clearTimeout(this.flushTimeoutId),this.flushTimeoutId=void 0)},e}();t.OTelClient=s},8218:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.OTelExporter=void 0;var o=n(9974),r="trekkie-otel",i="1.0.0",a=function(){function e(e,t){this.baseUrl=e.replace(/\/v1\/(metrics|logs)\/?$/,""),this.serviceName=t}return e.prototype.exportMetrics=function(e){var t={resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:this.serviceName}}]},scopeMetrics:[{scope:{name:r,version:i,attributes:[]},metrics:e}]}]},n=new Blob([JSON.stringify(t)],{type:"application/json"});return!!o.isSendBeaconSupported()&&navigator.sendBeacon(this.baseUrl+"/v1/metrics",n)},e.prototype.exportLogs=function(e){var t={resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:this.serviceName}}]},scopeLogs:[{scope:{name:r,version:i,attributes:[]},logRecords:e}]}]},n=new Blob([JSON.stringify(t)],{type:"application/json"});return!!o.isSendBeaconSupported()&&navigator.sendBeacon(this.baseUrl+"/v1/logs",n)},e}();t.OTelExporter=a},4689:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createOtelClient=void 0;var o=n(4052),r=n(8218);t.createOtelClient=function(){var e=new r.OTelExporter("https://otlp-http-production.shopifysvc.com","trekkie");return new o.OTelClient(e)}},7179:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SeverityNumber=t.OTelExporter=t.OTelClient=t.otelClient=void 0;var o=n(4689);t.otelClient=o.createOtelClient();var r=n(4052);Object.defineProperty(t,"OTelClient",{enumerable:!0,get:function(){return r.OTelClient}});var i=n(8218);Object.defineProperty(t,"OTelExporter",{enumerable:!0,get:function(){return i.OTelExporter}});var a=n(6366);Object.defineProperty(t,"SeverityNumber",{enumerable:!0,get:function(){return a.SeverityNumber}})},6366:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SeverityNumber=void 0,(n=t.SeverityNumber||(t.SeverityNumber={}))[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.TRACE=1]="TRACE",n[n.TRACE2=2]="TRACE2",n[n.TRACE3=3]="TRACE3",n[n.TRACE4=4]="TRACE4",n[n.DEBUG=5]="DEBUG",n[n.DEBUG2=6]="DEBUG2",n[n.DEBUG3=7]="DEBUG3",n[n.DEBUG4=8]="DEBUG4",n[n.INFO=9]="INFO",n[n.INFO2=10]="INFO2",n[n.INFO3=11]="INFO3",n[n.INFO4=12]="INFO4",n[n.WARN=13]="WARN",n[n.WARN2=14]="WARN2",n[n.WARN3=15]="WARN3",n[n.WARN4=16]="WARN4",n[n.ERROR=17]="ERROR",n[n.ERROR2=18]="ERROR2",n[n.ERROR3=19]="ERROR3",n[n.ERROR4=20]="ERROR4",n[n.FATAL=21]="FATAL",n[n.FATAL2=22]="FATAL2",n[n.FATAL3=23]="FATAL3",n[n.FATAL4=24]="FATAL4"},7956:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getRemoteEventName=t.isRemoteProduct=void 0;var o=n(5263);t.isRemoteProduct=function(e){var t;if(null==e||"object"!=typeof e)return!1;if("remote"in e&&"boolean"==typeof e.remote)return e.remote;if(null===(t=e)||void 0===t?void 0:t.variantId){var n=o.getProductFromMeta(e.variantId);if(n&&"remote"in n&&"boolean"==typeof n.remote)return n.remote}return!1},t.getRemoteEventName=function(e){return"remote_"+e}},6848:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getRequestId=void 0;var o=n(2729),r={page_rendered:"z",product_page_rendered:"x",collection_page_rendered:"c",search_submitted:"b"};function i(e,t){if(r[t])return"ri-"+function(e){for(var t=e.replace(/-/g,""),n=[],o=0;o>>0},e.prototype.createKey=function(e,t,n){return e+":"+t+":"+this.hashString(n)},e.prototype.add=function(e){if(!r.some((function(t){return e.stack.includes(t)}))){var t=this.createKey(e.operation,e.property,e.stack);this.flushedKeys.has(t)||(this.queue.set(t,e),this.config.maxQueueSize&&this.queue.size>=this.config.maxQueueSize&&this.flush())}},e.prototype.limitFlushedKeysSize=function(){if(this.flushedKeys.size>this.config.maxFlushedKeysSize)for(var e=this.flushedKeys.size-this.config.maxFlushedKeysSize,t=this.flushedKeys.values(),n=0;n=100||100*Math.random()>>0;try{t=performance.now()>>>0}catch(e){t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}t.UniqueIdManager=c,t.buildToken=u,t.hexTime=d},9974:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isSendBeaconSupported=t.isPseudoPageEvent=t.canonical=t.isUnstableBrowserVersion=t.UNSTABLE_BROWSER_VERSION_SET=t.objectAssignFilterUndefined=void 0;var o=n(2164),r=n(9414),i=n(8533),a=/^https?:\/\//;t.objectAssignFilterUndefined=function(e,t){for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e},t.UNSTABLE_BROWSER_VERSION_SET=new Set(["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134"]),t.isUnstableBrowserVersion=function(){return t.UNSTABLE_BROWSER_VERSION_SET.has(o.virtualWindow().userAgent())},t.canonical=function(){for(var e=i.virtualDocument().getElementsByTagName("link"),t=0;t0?null===(s=null==d?void 0:d.variants[0])||void 0===s?void 0:s.id:void 0,f=(null===(u=null===(c=window.ShopifyAnalytics)||void 0===c?void 0:c.meta)||void 0===u?void 0:u.selectedVariantId)||p,v={schemaId:l.buyWithPrimePresenceSchemaId,payload:o(o(o({shop_id:r},e.data&&{event_message:e.data}),d&&{product_id:d.id}),f&&{product_variant_id:Number(f)})};a.produce([v])}}catch(e){_.reportError("buyWithPrimeError",e)}}))},e.prototype.getNavigationType=function(){try{var e="PerformanceNavigationTiming",t=p.getNavigationTypeExperimental();return t||(t=p.getNavigationTypeLegacy(),e="performance.navigation"),t?{navigationType:t,navigationApi:e}:{navigationType:"unknown",navigationApi:"unknown"}}catch(e){s.reportError("navigation_api_error",e)}return{navigationType:"error",navigationApi:"error"}},e.prototype.initialize=function(e,t,n){this.loadIntegrations(e,t,n)},e.prototype.getS2SEventId=function(e,t,n){var o,r,i,a;void 0===e&&(e=void 0),void 0===t&&(t={});var s={navigationApi:this.navigationInfo.navigationApi,navigationType:this.navigationInfo.navigationType},c="Added Product Next"===e?"Added Product":e,u=h.WebPixelEventNameMap[c];try{if("product_added_to_cart"===u&&(null===(o=window.Shopify)||void 0===o?void 0:o.evids)){var l=function(e){if(e.productId&&e.variantId)return e.productId.toString()+"-"+e.variantId.toString()}(t),p=null!==(r=A[e])&&void 0!==r?r:A.default;a=window.Shopify.evids(u,{analyticsFramework:p,cacheKey:l})}else a="checkout_completed"===u&&n?n:(null===(i=window.Shopify)||void 0===i?void 0:i.evids)&&u?window.Shopify.evids(u,{analyticsFramework:"trekkie"}):d.buildToken()}catch(e){a=d.buildToken()}return{s2sMetadata:s,eventId:"string"==typeof a&&a.length>0?a:d.buildToken()}},e.prototype.loadIntegrations=function(e,t,n){var o=this,r=this.waitFor(e.length,(function(){try{n()}catch(e){s.reportError("readyCallback",e)}o.allIntegrationsHaveLoaded=!0,o.flushMonorailEventsIfLoaded()}));e.forEach((function(e){var n=e[0],i=e[1];try{if(t[n]&&"object"==typeof t[n]){var a=new i({},t[n],r);a.initializeOrAwaitConsent(),o.integrations.push(a),"Trekkie"===a.name()&&(o.trekkie=a,window.ShopifyAnalytics=window.ShopifyAnalytics||{},window.ShopifyAnalytics.lib=window.ShopifyAnalytics.lib||{},window.ShopifyAnalytics.lib.trekkie=o.trekkie)}else r()}catch(e){r(),s.reportError("loadIntegration",e)}})),this.addConsentCollectedListener()},e.prototype.lockIntegrationsObject=function(){try{Object.defineProperty(this,"integrations",o(o({},Object.getOwnPropertyDescriptor(this,"integrations")),{value:this.integrations,configurable:!1,writable:!1}))}catch(e){s.reportError("lockIntegrationsObject",e)}},e.prototype.handleConsentCollected=function(e){v.default.refreshVisitorTokens(),this.integrations.forEach((function(t){t.onConsentCollected(e)})),a.flushBatchEvents()},e.prototype.addConsentCollectedListener=function(){document.addEventListener(u.TrackingEvents.CONSENT_COLLECTED,this.handleConsentCollectedBinded)},e.prototype.removeConsentCollectedListener=function(){document.removeEventListener(u.TrackingEvents.CONSENT_COLLECTED,this.handleConsentCollectedBinded)},e.prototype.identify=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t={});var o=this.getS2SEventId();e instanceof Object&&(t=e,e="");for(var r=0,i=this.integrations;r0?e:e+i.search();var t=i.href(),n=t.indexOf("#");return-1===n?t:t.slice(0,n)},e.prototype.constructTrackArgs=function(e,t,n){if(void 0===t&&(t={}),f.isPseudoPageEvent(e)){var r=t,i=r.name,a=r.path;if(i&&a){var s=this.generatePageObject(i,{path:a},n.eventId,n.s2sMetadata);return o(o({},t),{page:s})}}return t},e.prototype.destroy=function(){this.removeConsentCollectedListener(),m.otelClient.destroy(),g.removeShopifyAnalyticsProxy()},e}();t.Tricorder=T,t.replayAnalyticsQueue=function(e,t){y.markShimQueueReady(!0);for(var n=0,o=t;n"undefined"==typeof window,f=()=>"undefined"!=typeof __CtaTestEnv__&&"true"===__CtaTestEnv__;class _{}_.warn=e=>{f()||console.warn(e)},_.error=e=>{f()||console.error(e)},_.info=e=>{f()||console.info(e)},_.debug=e=>{f()||console.debug(e)},_.trace=e=>{f()||console.trace(e)};const v=_;function h(e,t){if(null===e)return"null";if(Array.isArray(e))return`[${e.map((e=>h(e,!0))).join(",")}]`;if("object"==typeof e){let n=[];for(const t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&""!==e[t]&&n.push(`${t}:${h(e[t],!0)}`);const o=n.join(",");return t?`{${o}}`:o}return"string"==typeof e?JSON.stringify(e):`${e}`}function E(e){try{return decodeURIComponent(e)}catch(e){return""}}function y(e){if(!e)return;const t=Math.max(...Object.keys(e).map((e=>parseInt(e,10))))+1;let n="";for(let o=0;oe));if(o)try{sessionStorage.setItem("consentHeader",o)}catch{}return o}let N;function b(){var e,t;const n=null===(e=performance)||void 0===e||null===(t=e.getEntriesByType)||void 0===t?void 0:t.call(e,"resource");let o=N;for(let e=n.length-1;e>=0;e--){let t=O(n[e]);if(t){o=t;break}}return N=o,o}function O(e){var t,n;if(e)return null===(t=e.serverTiming)||void 0===t||null===(n=t.find((e=>e.name==I)))||void 0===n?void 0:n.description}function P(){return window}function R(){var e,t;const n=P();return!0===(null==n||null===(e=n.Shopify)||void 0===e||null===(t=e.customerPrivacy)||void 0===t?void 0:t.backendConsentEnabled)}function D(){var e,t;const n=P();return null==n||null===(e=n.Shopify)||void 0===e||null===(t=e.customerPrivacy)||void 0===t?void 0:t.serverTimingSupportVerified}const M="_cs";let L;function U(){if(p())return L;{var e,t;const n=null===(e=window.Shopify)||void 0===e||null===(t=e.customerPrivacy)||void 0===t?void 0:t.injectedConsent;return n?E(n):void 0}}function x(){var e;p()?L=void 0:null!==(e=window.Shopify)&&void 0!==e&&e.customerPrivacy&&(window.Shopify.customerPrivacy.injectedConsent=void 0)}function F(){V(r.CONSENT_TRACKING_API_LOADED)}function V(e,t){if(!p())try{document.dispatchEvent(new CustomEvent(e,{detail:t||{}}))}catch(t){console.error(`[Shopify Customer Privacy] Error in event listener for "${e}":`,t)}}function j(e){const t=e[u.MARKETING],n=e[u.SALE_OF_DATA],o=e[u.ANALYTICS],i=e[u.PREFERENCES];!0===t?V(r.MARKETING_ACCEPTED):!1===t&&V(r.MARKETING_DECLINED),!0===n?V(r.SALE_OF_DATA_ACCEPTED):!1===n&&V(r.SALE_OF_DATA_DECLINED),!0===o?V(r.ANALYTICS_ACCEPTED):!1===o&&V(r.ANALYTICS_DECLINED),!0===i?V(r.PREFERENCES_ACCEPTED):!1===i&&V(r.PREFERENCES_DECLINED);const a=function(e){return{marketingAllowed:e[u.MARKETING],saleOfDataAllowed:e[u.SALE_OF_DATA],analyticsAllowed:e[u.ANALYTICS],preferencesAllowed:e[u.PREFERENCES],firstPartyMarketingAllowed:e[u.MARKETING],thirdPartyMarketingAllowed:e[u.SALE_OF_DATA]}}(e);V(r.CONSENT_COLLECTED,a);const s=[o,i,t,n];s.every((e=>!0===e))&&V(r.TRACKING_ACCEPTED),s.every((e=>!1===e))&&V(r.TRACKING_DECLINED)}function K(e){var t,n;!function(e){var t;p()?L=e:(null!==(t=window.Shopify)&&void 0!==t&&t.customerPrivacy||(window.Shopify=window.Shopify||{},window.Shopify.customerPrivacy={}),window.Shopify.customerPrivacy.injectedConsent=e)}(e),p()||(null!==(t=window.Shopify)&&void 0!==t&&null!==(n=t.customerPrivacy)&&void 0!==n&&n.cachedConsent&&(window.Shopify.customerPrivacy.cachedConsent=void 0),j({[u.PREFERENCES]:J(),[u.ANALYTICS]:X(),[u.MARKETING]:Z(),[u.SALE_OF_DATA]:ee()}))}function B(){let e;if(e=p()?U():function(){var e,t;const n=null===(e=window.Shopify)||void 0===e||null===(t=e.customerPrivacy)||void 0===t?void 0:t.cachedConsent;return n?E(n):void 0}()||U()||new URLSearchParams(window.location.search).get(M)||T(g)||function(){let e;if(e=R()&&w(b)||w(k),!e){let e;try{e=sessionStorage.getItem("consentHeader")}catch{}return e||void 0}try{e=decodeURIComponent(e)}catch{}return e}(),void 0!==e)return function(e){if("%"==e.slice(0,1))try{e=decodeURIComponent(e)}catch{}const t=e.slice(0,1);return"{"==t?function(e){var t;let n;try{n=JSON.parse(e)}catch{return}if(n.v===i&&null!==(t=n.con)&&void 0!==t&&t.CMP)return n}(e):"3"==t?function(e){const t=e.slice(1).split("_"),[n,o,r,i,s]=t;let l,p;try{l=t[5]?JSON.parse(t.slice(5).join("_")):void 0}catch{}if(s){const e=s.replace(/\*/g,"/").replace(/-/g,"+"),t=atob(e);let n="";for(let e=0;ee.slice(0,t)+"-"+e.slice(t)),n)}function f(e){const t=n.split(".")[0];return t.includes(e.toLowerCase())?c.DECLINED:t.includes(e.toUpperCase())?c.ACCEPTED:c.NO_VALUE}function _(e){return n.includes(e.replace("t","s").toUpperCase())}return{v:a,con:{CMP:{[d.ANALYTICS]:f(d.ANALYTICS),[d.PREFERENCES]:f(d.PREFERENCES),[d.MARKETING]:f(d.MARKETING),[d.SALE_OF_DATA]:f(d.SALE_OF_DATA)}},region:o||"",cus:l,purposes:{[u.ANALYTICS]:_(u.ANALYTICS),[u.PREFERENCES]:_(u.PREFERENCES),[u.MARKETING]:_(u.MARKETING),[u.SALE_OF_DATA]:_(u.SALE_OF_DATA)},sale_of_data_region:"t"==i,display_banner:"t"==r,consent_id:p}}(e):void 0}(e)}function H(){try{let e=B();if(!e)return;return e}catch{return}}function G(){return{m:z(d.MARKETING),a:z(d.ANALYTICS),p:z(d.PREFERENCES),s:z(d.SALE_OF_DATA)}}function Y(){return G()[d.SALE_OF_DATA]}function W(e=null){return null===e&&(e=H()),void 0===e}function q(e){switch(e){case c.ACCEPTED:return s.ACCEPTED;case c.DECLINED:return s.DECLINED;default:return s.NO_VALUE}}function $(e){switch(e){case d.ANALYTICS:return l.ANALYTICS;case d.MARKETING:return l.MARKETING;case d.PREFERENCES:return l.PREFERENCES;case d.SALE_OF_DATA:return l.SALE_OF_DATA}}function z(e){const t=H();if(!t)return c.NO_VALUE;const n=t.con.CMP;return n?n[e]:c.NO_VALUE}function Q(e){const t=H();if(!t||!t.purposes)return!0;const n=t.purposes[e];return"boolean"!=typeof n||n}function J(){return Q(u.PREFERENCES)}function X(){return Q(u.ANALYTICS)}function Z(){return Q(u.MARKETING)}function ee(){return Q(u.SALE_OF_DATA)}function te(){const e=H();return!!e&&"boolean"==typeof e.display_banner&&e.display_banner}function ne(){const e=H();return e&&e.sale_of_data_region||!1}const oe="v0.2";function re(e){return`${e.origin}${t=e.pathname,t.replace(/\/$/,"")}`;var t}function ie(e){return e.startsWith("http://")||e.startsWith("https://")}function ae(e){const t=e.granular_consent;return{query:`query { consentManagement { cookies(${h({visitorConsent:{marketing:t.marketing,analytics:t.analytics,preferences:t.preferences,saleOfData:t.sale_of_data,...t.metafields&&{metafields:t.metafields}},...t.email&&{visitorEmail:t.email},origReferrer:e.referrer,landingPage:e.landing_page})}) { trackingConsentCookie cookieDomain landingPageCookie origReferrerCookie } customerAccountUrl } }`,variables:{}}}function se(e){return e.granular_consent.headlessStorefront}function ce(e,t){const n=t.granular_consent;let o="",r={};if(n.customerAccountRequestInfo)o=n.customerAccountRequestInfo.url,r=n.customerAccountRequestInfo.headers;else{const t=n.storefrontAccessToken||function(){try{const e=document.documentElement.querySelector("#shopify-features"),t="Could not find liquid access token";if(!e)return void v.warn(t);const n=e.textContent;if(!n)return void v.warn(t);let o;try{o=JSON.parse(n).accessToken}catch{return void v.warn(t)}return o||void v.warn(t)}catch{return void v.warn("Could not find liquid access token")}}();o=`${/^(localhost|127\.0\.0\.1)(:|$)/.test(e)?"http:":"https:"}//${e}/api/unstable/graphql.json`;const i=n.isExtensionToken?"Shopify-Storefront-Extension-Token":"x-shopify-storefront-access-token";r={[i]:t}}const i={headers:{"content-type":"application/json",...r,...f()?{"x-test-payload":JSON.stringify(t)}:{}},body:JSON.stringify(ae(t)),method:"POST"};let a;try{a=fetch(o,i)}catch(e){a=Promise.reject(e)}return a.then((e=>{if(e.ok)return e.json();{const t=new Error("Server error");throw t.cause={status:e.status},t}}))}function ue(e,t,n){const o=t.granular_consent.checkoutRootDomain||window.location.host;let r=[];return r.push(ce(o,t).then((e=>{var o,r;const i=e.data.consentManagement.cookies.cookieDomain,a=e.data.consentManagement.cookies.trackingConsentCookie,s=null!==(o=null===(r=e.data.consentManagement)||void 0===r?void 0:r.customerAccountUrl)&&void 0!==o?o:"";var c,d;if(a&&(c=a,null!==(d=window.Shopify)&&void 0!==d&&d.customerPrivacy||(window.Shopify=window.Shopify||{},window.Shopify.customerPrivacy={}),window.Shopify.customerPrivacy.cachedConsent=c),se(t)&&!R()){const e=31536e6,n=t.granular_consent,o=i||n.checkoutRootDomain||window.location.hostname,r=n.storefrontRootDomain||i||window.location.hostname;S(g,o,e,a),r!==o&&S(g,r,e,a)}return void 0!==t.granular_consent&&j({[u.PREFERENCES]:J(),[u.ANALYTICS]:X(),[u.MARKETING]:Z(),[u.SALE_OF_DATA]:ee()}),function(e,t){if(!e)return;const n=function(e){const t=new URL(e,window.location.origin),n=ie(e)?re(t):re(t).replace(window.location.origin,""),o=document.querySelectorAll(`a[href^="${n}"]`),r=document.querySelectorAll(`a[href*="${window.location.hostname}/customer_authentication"]`),i=new Set,a=[];for(let e=0;e{var t;const o="Error while setting storefront API consent: "+e.message,r=null===(t=e.cause)||void 0===t?void 0:t.status,i={error:o};if(void 0!==r&&(i.statusCode=r),void 0===n)throw i;n(i)}))}const de=[l.MARKETING,l.ANALYTICS,l.PREFERENCES,l.SALE_OF_DATA],le=[...de,l.EMAIL,"rootDomain","checkoutRootDomain","storefrontRootDomain","storefrontAccessToken","headlessStorefront","isExtensionToken","metafields","customerAccountRequestInfo"],pe=de.map((e=>`"${e}"`)).join(", "),fe="https://shopify.dev/docs/api/customer-privacy";function _e(e,t){if(p())throw new Error("setTrackingConsent is not supported in Node.js environments. This function requires browser APIs (XHR, cookies, window) and can only be called client-side.");const n=new C;if(X()&&n.produce("setTrackingConsent",oe),function(e){if("boolean"!=typeof e&&"object"!=typeof e)throw new o(`setTrackingConsent received an invalid argument of type "${typeof e}". Expected an object with consent keys. Example: setTrackingConsent({ analytics: true, marketing: false }). See ${fe} for documentation.`);if("object"==typeof e){const t=Object.keys(e);if(0===t.length)throw new o(`The submitted consent object is empty. Expected at least one consent key: ${pe}. Example: setTrackingConsent({ analytics: true, marketing: false }). See ${fe} for documentation.`);for(const e of t)if(!le.includes(e))throw new o(`The submitted consent object contains an invalid key: "${e}". Valid keys are: ${pe}. Example: setTrackingConsent({ analytics: true, marketing: false }). See ${fe} for documentation.`)}}(e),void 0!==t&&"function"!=typeof t)throw new o(`setTrackingConsent received an invalid callback of type "${typeof t}". The second argument must be a function if provided. Example: setTrackingConsent({ analytics: true }, (error, result) => { ... }). See ${fe} for documentation.`);const r=function(e){if(!e)return null;try{return Ee()?document.referrer:""}catch{return""}}(e.analytics),i=function(e){if(!e)return null;if(!Ee())return"/";try{return window.location.pathname+window.location.search}catch{return"/"}}(e.analytics);return ue(0,{granular_consent:e,...null!==r&&{referrer:r},...null!==i&&{landing_page:i}},t)}function ve(){const e=new C;if(X()&&e.produce("getTrackingConsent",oe),W())return s.NO_VALUE;const t=G();return t[d.MARKETING]===c.ACCEPTED&&t[d.ANALYTICS]===c.ACCEPTED?s.ACCEPTED:t[d.MARKETING]===c.DECLINED||t[d.ANALYTICS]===c.DECLINED?s.DECLINED:s.NO_INTERACTION}function he(){return function(){const e=H();return W(e)?"":e.region||""}()}function Ee(){try{if(""===document.referrer)return!0;const e=document.createElement("a");return e.href=document.referrer,window.location.hostname!=e.hostname}catch{return!0}}function ye(){return!!W()||Z()&&X()}function me(){return ne()?"string"==typeof navigator.globalPrivacyControl?"1"!==navigator.globalPrivacyControl:"boolean"==typeof navigator.globalPrivacyControl?!navigator.globalPrivacyControl:null:null}function ge(){return te()&&ve()===s.NO_INTERACTION}function Te(){return!1===me()?s.DECLINED:(e=Y(),W()?s.NO_VALUE:e===c.NO_VALUE?s.NO_INTERACTION:q(e));var e}function Ae(){return!0}function Se(e){return function(e){const t=H();if(W(t)||!t.cus)return;const n=t.cus[encodeURIComponent(e)];return n?decodeURIComponent(n):n}(e)}function Ce(){return function(){const e=H();if(!W(e)&&e.cus)return Object.entries(e.cus).map((([e,t])=>({key:decodeURIComponent(e),value:decodeURIComponent(t)})))}()}function Ie(){const e={},t=G();for(const n of Object.keys(t))e[$(n)]=q(t[n]);return e}function we(){return function(){const e=H();return e&&e.consent_id||""}()}const ke={},Ne=/^https?:\/\/([^/]+)(\/api\/(?:unstable|2\d{3}-\d{2})\/graphql\.json(?=$|\?))?/;function be(e,t){if(R()){const e=function(e){try{var t,n;const i=null===(t=performance)||void 0===t||null===(n=t.getEntriesByType)||void 0===n?void 0:n.call(t,"resource");if(i){const t=window.location.host;for(let n=i.length-1;n>=0;n--){var o,r;const a=i[n];if("fetch"!==a.initiatorType)continue;const s=a.name.match(Ne);if(!s)continue;const[,c,u]=s;if(!(c===t||u&&(null==c?void 0:c.endsWith(`.${t}`))))continue;const d=null===(o=a.serverTiming)||void 0===o||null===(r=o.find((t=>t.name===e)))||void 0===r?void 0:r.description;if(d)return ke[e]=d,d}}return ke[e]}catch{return ke[e]}}(t);if(e)return e}const n=function(e){try{var t,n,o,r;return null===(t=performance)||void 0===t||null===(n=t.getEntriesByType("navigation")[0])||void 0===n||null===(o=n.serverTiming)||void 0===o||null===(r=o.find((t=>t.name==e)))||void 0===r?void 0:r.description}catch{return}}(t);return n||function(e){try{var t,n,o,r;return null===(t=document.cookie)||void 0===t||null===(n=t.split(";"))||void 0===n||null===(o=n.find((t=>t.includes(e))))||void 0===o||null===(r=o.split("=")[1])||void 0===r?void 0:r.trim()}catch{return}}(e)}function Oe(){return be("_shopify_y","_y")}function Pe(){return be("_shopify_s","_s")}function Re(e){return(...t)=>{try{return e(...t)}catch(e){throw e instanceof o||function(e,t,n){try{var o;!function(e){const t=new XMLHttpRequest;t.open("POST","https://error-analytics-production.shopifysvc.com",!0),t.setRequestHeader("Content-Type","application/json"),t.setRequestHeader("Bugsnag-Api-Key","95ba910bcec4542ef2a0b64cd7ca666c"),t.setRequestHeader("Bugsnag-Payload-Version","5");const n=function(e){var t;const n=function(e){return e?e.stackTrace||e.stack||e.description||e.name:void 0}(e.error);let o,r;if(null!==(t=e.error)&&void 0!==t&&t.name){var i,a;o=e.error.name,r=null!==(i=null===(a=e.error)||void 0===a?void 0:a.message)&&void 0!==i?i:""}else{const t=(n||"unknown error").split("\n")[0],i=t.indexOf(":");var s,c,u;i>0?(o=t.substring(0,i).trim(),r=t.substring(i+1).trim()):(o=t.trim()||"unknown error",r=(null===(s=e.error)||void 0===s?void 0:s.message)||(null===(c=e.error)||void 0===c?void 0:c.error)||(null===(u=e.error)||void 0===u?void 0:u.toString())||"No error message available")}return JSON.stringify({payloadVersion:5,notifier:{name:"ConsentTrackingAPI",version:"latest",url:"-"},events:[{exceptions:[{errorClass:o,message:r,stacktrace:[{file:"consent-tracking-api.js",lineNumber:"1",method:n}],type:"browserjs"}],context:e.context||"general",app:{id:"ConsentTrackingAPI",version:"latest"},metaData:{request:{shopId:e.shopId,shopUrl:window.location.href},device:{userAgent:window.navigator.userAgent},"Additional Notes":e.notes},unhandled:!1}]})}(e);t.send(n)}({error:e,context:null!=t?t:"",shopId:De()||(null===(o=window.Shopify)||void 0===o?void 0:o.shop),notes:null!=n?n:""})}catch(e){}}(e),e}}}function De(){try{var e;const t=null===(e=document.getElementById("shopify-features"))||void 0===e?void 0:e.textContent;return t?JSON.parse(t).shopId:null}catch(e){return null}}function Me(){return Z()}function Le(){return X()}function Ue(){return J()}function xe(){return ee()}const Fe=({useBugsnagReporting:e})=>{Y()!=c.DECLINED&&!1===me()&&_e({sale_of_data:!1},(()=>!1));const t={analyticsProcessingAllowed:X,currentVisitorConsent:Ie,doesMerchantSupportGranularConsent:Ae,firstPartyMarketingAllowed:Me,getCCPAConsent:Te,getRegion:he,getTrackingConsent:ve,getTrackingConsentMetafield:Se,marketingAllowed:Me,preferencesProcessingAllowed:J,saleOfDataAllowed:xe,saleOfDataRegion:ne,setTrackingConsent:_e,shouldShowBanner:te,shouldShowGDPRBanner:ge,thirdPartyMarketingAllowed:xe,userCanBeTracked:ye,consentId:we,unstable:{},__metadata__:{name:"@shopify/consent-tracking-api",version:oe,description:"Shopify Consent Tracking API"}};if(!e)return t;const n=["unstable"];for(const e in t)t.hasOwnProperty(e)&&(t[e]=n.includes(e)?t[e]:Re(t[e]));return t};function Ve(e={useBugsnagReporting:!1}){return Fe(e)}const je="p";function Ke(e){try{return y(e.version)===je}catch{return!1}}function Be(e){var t;if(!e)return;if("p"!==String.fromCharCode(null==e||null===(t=e.version)||void 0===t?void 0:t[0]))return;let n="",o="";const r=e.analyticsAllowed?"A":"a",i=e.preferencesAllowed?"P":"p",a=e.marketingAllowed?"M":"m",s=e.saleOfDataAllowed?"S":"s";function c(e){return!0===e?"t":!1===e?"f":""}0===e.analyticsConsent?n+=r:o+=r,0===e.marketingConsent?n+=a:o+=a,0===e.preferencesConsent?n+=i:o+=i,0===e.saleOfDataConsent?n+=s:o+=s;let u=`3${o}.${n}_${y(e.region)}_${c(e.shouldShowBanner)}_${c(e.saleOfDataRegion)}_${m(e.consentId)||""}_${0===Object.keys(e.metafields).length?"":JSON.stringify(e.metafields)}`;return u=u.replace(/_*$/,""),u}const He=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Ge(e){return!!e&&He.test(e.trim().toLowerCase())}function Ye(){return crypto.randomUUID()}const We=31536e6,qe=18e5;function $e(e,t){if(!p())throw new Error("handleTrackingTokens is only supported in Node.js environments. ");if(!X()&&!Z())return;const{shopifyY:n,shopifyS:o,shopifyYExpiry:r,shopifySExpiry:i}=e(),a=Date.now(),s=r<=a,c=i<=a;t({shopifyY:Ge(n)&&!s?n:Ye(),shopifyS:Ge(o)&&!c?o:Ye(),shopifyYExpiry:a+We,shopifySExpiry:a+qe})}},9671:function(e,t,n){n.r(t),n.d(t,{setupEventIdService:function(){return f}});const o="sh",r="shu",i=["page_viewed","collection_viewed","product_viewed","search_submitted","product_added_to_cart","product_added_to_cart_next","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"],a="wpm",s="trekkie",c="trekkie-next",u="trekkie-parity";let d,l;function p(e){return`${e||o}-${function(){const e="xxxx-4xxx-xxxx-xxxxxxxxxxxx";let t="";try{const n=window.crypto,o=new Uint16Array(31);n.getRandomValues(o);let r=0;t=e.replace(/[x]/g,(e=>{const t=o[r];if("number"!=typeof t)throw new Error(`Event ID service: Invalid random number at index "${r}".`);const n=t%16;return r++,("x"===e?n:3&n|8).toString(16)})).toUpperCase()}catch{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{t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}()}-${t}`}()}`}function f(){window.Shopify=window.Shopify||{},!window.Shopify.evids&&(d={},l={[a]:{},[s]:{},[c]:{},[u]:{}},window.Shopify.evids=(...e)=>function(e,t){if(!function(e){return i.includes(e)}(e)||(null==t?void 0:t.analyticsFramework)!==s&&(null==t?void 0:t.analyticsFramework)!==a&&(null==t?void 0:t.analyticsFramework)!==c&&(null==t?void 0:t.analyticsFramework)!==u)return p(r);const n=function(e){return"string"==typeof e&&e?e:"default"}(t.cacheKey),o=function(e,t,n){const o=l[t],r=o[e]??(o[e]={}),i=r[n];return r[n]="number"==typeof i?i+1:0}(e,t.analyticsFramework,n);return function(e,t,n){const o=d[e]??(d[e]={}),r=o[n]??[];let i=r[t];return i||(i=p(),r.push(i)),o[n]=r,i}(e,o,n)}(...e))}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e,t=n(1074),o=n(1037),r=n(357),i="trekkie",a=[],s=n(2319);a.push(["Trekkie",s.Trekkie]);var c=n(3988);a.push(["S2S",c.S2S]);try{var u=null===(e=window[i])||void 0===e?void 0:e.config;if(u){o.setGlobalSerializedAppConfig(JSON.stringify(u));var d=window[i],l=window.trekkie=new t.Tricorder(a,u,(function(){window[i]=l,window._visit={tag:function(){},multitrackToken:function(){r.default.uniqToken}},l.user=function(){return{traits:function(){return{uniqToken:r.default.uniqToken}}}},t.replayAnalyticsQueue(l,d)}))}}catch(e){o.reportError("index_storefront",e)}}()}();