/*! For license information please see vendor.abe0f2edaba39511481a.js.LICENSE.txt */ (self.webpackChunkui=self.webpackChunkui||[]).push([[8],{65:(e,t,n)=>{var r=n(185);function o(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}e.exports=r(o),e.exports.strict=r(i),o.proto=o((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return o(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})}))},224:(e,t,n)=>{"use strict";var r=n(14),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,c=r.useLayoutEffect,s=r.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return c((function(){o.value=n,o.getSnapshot=t,l(o)&&u({inst:o})}),[e,n,t]),a((function(){return l(o)&&u({inst:o}),e((function(){l(o)&&u({inst:o})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},222:(e,t,n)=>{"use strict";var r=n(14),o=n(223),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,c=r.useRef,s=r.useEffect,l=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=c(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=l((function(){function e(e){if(!s){if(s=!0,a=e,e=r(e),void 0!==o&&p.hasValue){var t=p.value;if(o(t,e))return c=t}return c=e}if(t=c,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(a=e,c=n)}var a,c,s=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]}),[t,n,r,o]);var y=a(e,d[0],d[1]);return s((function(){p.hasValue=!0,p.value=y}),[y]),u(y),y}},223:(e,t,n)=>{"use strict";e.exports=n(224)},221:(e,t,n)=>{"use strict";e.exports=n(222)},185:e=>{e.exports=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){r[e]=t[e]})),r;function r(){for(var e=new Array(arguments.length),n=0;n{"use strict";n.r(t),n.d(t,{create:()=>p,createStore:()=>o,default:()=>y,useStore:()=>u});const r=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,o,i);return i},o=e=>e?r(e):r;var i=n(14),a=n(221);const{useDebugValue:c}=i.default,{useSyncExternalStoreWithSelector:s}=a,l=e=>e;function u(e,t=l,n){const r=s(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return c(r),r}const d=e=>{const t="function"==typeof e?o(e):e,n=(e,n)=>u(t,e,n);return Object.assign(n,t),n},p=e=>e?d(e):d;var y=e=>p(e)},26:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.initBentoAnalytics=t.logCollectionView=t.loadShopifyAccount=void 0,t.logViewCart=async function(){const e=(0,m.uuid)();await(0,m.callOrlyTagHooks)("viewCart",e)},t.logViewContent=async function(e){const n=(0,m.uuid)(),r=[(0,d.logGoogleViewContent)(e,n),(0,f.logSnapchatViewContent)(e,n)];await(0,t.loadShopifyAccount)();const o=[(0,m.callOrlyTagHooks)("viewContent",e,n),(0,p.logOutsmartlyViewedProduct)(e,n),(0,p.logOutsmartlySelectedVariant)(e,n),(0,u.logFacebookViewContent)(e,n)];await Promise.allSettled([...r,...o])},t.logClickContent=async function(e,t,n=0){const r=window.__APP_CONFIG__.eventId||(0,m.uuid)();await(0,m.callOrlyTagHooks)("clickContent",e,t,n,r)},t.logSignUp=async function(e){const t=(0,m.uuid)();await Promise.allSettled([(0,m.callOrlyTagHooks)("signUp",e,t)])},t.logSignIn=async function(e){const t=(0,m.uuid)();await Promise.allSettled([(0,m.callOrlyTagHooks)("signIn",e,t)])},t.logSearch=async function(e,t){const n=(0,m.uuid)();await Promise.allSettled([(0,m.callOrlyTagHooks)("search",e,t,n)])};const o=n(184),i=n(59),a=n(66),c=n(186),s=n(187),l=n(236),u=n(238),d=n(188),p=n(189),y=n(60),f=n(190),m=n(8),g=r(n(65)),v={loggedIn:!1,id:"",email:"",phone:"",first_name:"",last_name:"",city:"",country:"",countryCode:"",zip:"",address1:"",address2:"",hashedEmail:"",loyaltylion_has_account:!1,loyaltylion_token:"",loyaltylion_auth_token:"",province:"",provinceCode:"",rechargeHash:"",date:"",tags:"",orderValue:"",orderId:"",theme:void 0};async function w(e,t){const n=await(0,m.getCartComponents)(e);await Promise.allSettled(n.map(b).flatMap((e=>[(0,m.callOrlyTagHooks)("addToCart",e,t),(0,u.logAddToCartFacebook)(e,t),(0,y.logAddToCartPinterest)(e,t),(0,f.logAddToCartSnapchat)(e,t),(0,d.logAddToCartGoogleAnalytics)(e,t)])))}async function _(e,t){await(0,m.callOrlyTagHooks)("removeFromCart",e,t)}async function h(){const e=window.__APP_CONFIG__.eventId||(0,m.uuid)(),n=(0,t.loadShopifyAccount)(),r=n.then((async e=>{await async function(e){await Promise.allSettled([(0,m.callOrlyTagHooks)("loadAccount",e),new Promise((t=>{(0,f.loadSnapchat)(e),t()}))])}(e)}));await Promise.allSettled([(0,m.callOrlyTagHooks)("pageView",e,n),(0,d.logGooglePageView)(e,n),(0,f.logSnapchatPageView)(e,n),(0,p.logOutsmartlyPageView)(e,n),(0,y.logPinterestPageView)(e,n),(0,u.logFacebookPageView)(e,n),r])}t.loadShopifyAccount=(0,g.default)((async()=>{const e=window.__APP_CONFIG__.ANALYTICS.accountEndpoint??"/api/account";try{return await fetch(e).then((e=>e.json())).catch((t=>(console.error("loadShopifyAccount from endpoint failed.\n",`Tried to fetch from: ${e}\n.`,"Returning a default account...\nerror:\n",JSON.stringify(t,Object.getOwnPropertyNames(t),2)),v)))}catch(t){return console.warn(`Error loading account from '${e}', returning default account instead.\n`,"You can change default account endpoint on window.__APP_CONFIG__.ANALYTICS.accountEndpoint.\n",JSON.stringify(t,Object.getOwnPropertyNames(t),2)),v}})),t.logCollectionView=(0,g.default)((async(e,t)=>{const n=(0,m.uuid)();await Promise.allSettled([(0,m.callOrlyTagHooks)("collectionView",e,t,n),(0,y.logPinterestCollectionView)(e,t,n),(0,d.logGoogleCollectionView)(e,t,n)])}));const C=async(e,t)=>{const n=await fetch(e,t),r=await n.json();return queueMicrotask((()=>function(e,t,n){if(!(0,m.isPartialShopifyCartWithItems)(n)){if(!(0,m.isShopifyCartError)(n))throw new Error("unexpected response, no `items` and not a ShopifyCartError");return n}const r=(0,m.normalizeCart)(n),o=t.get("x-event-id")??(0,m.uuid)();e.startsWith("/cart/add.js")?S(r,o):e.startsWith("/cart/change.js")||e.startsWith("/cart/update.js")?I(r,o):e.startsWith("/cart/clear.js")?I(r,o,!0):e.startsWith("/cart.json")?(0,m.updateCart)(r):console.error(`Unknown URL: ${e}`)}(e,n.headers,r))),r},A=(e,t)=>{if(!e)return t;const n=Math.abs(e.quantity-t.quantity);if(0===n)return console.warn("item quantity not changed"),t;const r=n*t.final_price,o=n*t.original_price,i=Math.round(100*(o-r))/100,a=Math.abs(t.line_price-e.line_price),c=i;return{...t,quantity:n,final_line_price:r,line_price:a,original_line_price:o,line_level_total_discount:i,total_discount:c,discounts:[],line_level_discount_allocations:[]}},S=(e,t)=>{const n=(0,m.getOldCart)(),[r,o]=((e,t)=>{if(!e)return[t,t.items];const n=e.items,r=(0,m.getItemCounts)(n),o=(0,m.getItemCounts)(t.items),i=[];for(const[e,t]of o.entries()){const o=r.get(e),a=o?.quantity||0,c=t.quantity-a;if(c>0){i.push(A(o,t));const e=n.findIndex((e=>e.id===t.id));-1===e?n.push(t):n[e]=t}else c<0&&console.error("TODO: handle out of sync cart state")}return[{...e,items:n},i]})(n,e);(0,m.updateCart)(r);for(const e of o)w({...e},t).catch((e=>{console.error(e)}))};function b(e){try{const t=e.properties,n=t._olpid??e.product_id.toString(),r=t._olvid??e.variant_id.toString();return{...e,product_id:Number.parseInt(n.toString()),variant_id:Number.parseInt(r.toString())}}catch{return e}}const I=(e,t,n)=>{const r=(0,m.getOldCart)();if(!r)return void(0,m.updateCart)(e);const o=(0,m.getItemCounts)(r.items),i=(0,m.getItemCounts)(e.items),a=[],c=[];for(const[e,t]of i.entries()){const n=o.get(e),r=n?.quantity||0,i=t.quantity-r;i>0?a.push(A(n,t)):i<0&&c.push(A(n,t))}for(const[e,t]of o.entries())i.has(e)||c.push(t);(0,m.updateCart)(e);for(const e of a)w(e,t).catch((e=>{console.error(e)}));for(const e of c)_(e,t).catch((e=>{console.error(e)}));n&&async function(e,t){await(0,m.callOrlyTagHooks)("clearCart",e,t)}(c,t).catch((e=>{console.error(e)}))};t.initBentoAnalytics=(0,g.default)((async e=>{if("undefined"==typeof window)return void console.warn("initBentoAnalytics: window not defined, NOP.");if(!window.__APP_CONFIG__)return void console.warn("initBentoAnalytics: No window.__APP_CONFIG__ found.");if(!window.__APP_CONFIG__.ANALYTICS)return void console.warn("initBentoAnalytics: No window.__APP_CONFIG__.ANALYTICS found.");window.__APP_CONFIG__.fetchCartJSON=C;const t={elevar:i.initElevar};for(const n of(0,m.entries)(e))if(n){const[e,r]=n;r&&t[e]()}(0,o.initAnglerAI)(),(0,a.initKlaviyo)(),(0,c.initListrak)(),(0,s.initShopify)(),(0,l.initTikTok)();try{await async function(){await Promise.allSettled([(0,m.callOrlyTagHooks)("loadScript"),new Promise((e=>{(0,d.loadGoogleAnalytics)(),e()}))])}().then(h)}catch(e){console.log(e)}}))},246:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useViewContent=function(e){(0,r.useEffect)((()=>{(0,o.logViewContent)(e).catch((e=>{console.error(e)}))}),[e.product_id,e.variant_id])},t.useCollectionView=function(e,t){(0,r.useEffect)((()=>{(0,o.logCollectionView)(e,t).catch((e=>{console.error(e)}))}),[e,t])};const r=n(2),o=n(26)},234:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadScriptWithDelay=t.loadScript=t.initBentoAnalytics=t.logViewContent=t.logViewCart=t.logSignUp=t.logSignIn=t.logSearch=t.logCollectionView=t.logClickContent=t.useCollectionView=t.useViewContent=t.useOutsmartlyErrorReporting=t.logOutsmartlyError=t.loadImapactRadius=t.loadAttn=t.loadIntellipse=t.loadKlaviyoSubscribe=t.loadKlaviyo=t.loadLoyaltyLion=t.loadSnapchat=t.loadPinterest=t.loadGoogleAnalytics=t.initShopify=t.initListrak=t.initElevar=t.initAnglerAI=void 0;var r=n(184);Object.defineProperty(t,"initAnglerAI",{enumerable:!0,get:function(){return r.initAnglerAI}});var o=n(59);Object.defineProperty(t,"initElevar",{enumerable:!0,get:function(){return o.initElevar}});var i=n(186);Object.defineProperty(t,"initListrak",{enumerable:!0,get:function(){return i.initListrak}});var a=n(187);Object.defineProperty(t,"initShopify",{enumerable:!0,get:function(){return a.initShopify}});var c=n(188);Object.defineProperty(t,"loadGoogleAnalytics",{enumerable:!0,get:function(){return c.loadGoogleAnalytics}});var s=n(60);Object.defineProperty(t,"loadPinterest",{enumerable:!0,get:function(){return s.loadPinterest}});var l=n(190);Object.defineProperty(t,"loadSnapchat",{enumerable:!0,get:function(){return l.loadSnapchat}});var u=n(241);Object.defineProperty(t,"loadLoyaltyLion",{enumerable:!0,get:function(){return u.loadLoyaltyLion}});var d=n(66);Object.defineProperty(t,"loadKlaviyo",{enumerable:!0,get:function(){return d.loadKlaviyo}}),Object.defineProperty(t,"loadKlaviyoSubscribe",{enumerable:!0,get:function(){return d.loadKlaviyoSubscribe}});var p=n(243);Object.defineProperty(t,"loadIntellipse",{enumerable:!0,get:function(){return p.loadIntellipse}});var y=n(244);Object.defineProperty(t,"loadAttn",{enumerable:!0,get:function(){return y.loadAttn}});var f=n(245);Object.defineProperty(t,"loadImapactRadius",{enumerable:!0,get:function(){return f.loadImapactRadius}});var m=n(189);Object.defineProperty(t,"logOutsmartlyError",{enumerable:!0,get:function(){return m.logOutsmartlyError}}),Object.defineProperty(t,"useOutsmartlyErrorReporting",{enumerable:!0,get:function(){return m.useOutsmartlyErrorReporting}});var g=n(246);Object.defineProperty(t,"useViewContent",{enumerable:!0,get:function(){return g.useViewContent}}),Object.defineProperty(t,"useCollectionView",{enumerable:!0,get:function(){return g.useCollectionView}});var v=n(26);Object.defineProperty(t,"logClickContent",{enumerable:!0,get:function(){return v.logClickContent}}),Object.defineProperty(t,"logCollectionView",{enumerable:!0,get:function(){return v.logCollectionView}}),Object.defineProperty(t,"logSearch",{enumerable:!0,get:function(){return v.logSearch}}),Object.defineProperty(t,"logSignIn",{enumerable:!0,get:function(){return v.logSignIn}}),Object.defineProperty(t,"logSignUp",{enumerable:!0,get:function(){return v.logSignUp}}),Object.defineProperty(t,"logViewCart",{enumerable:!0,get:function(){return v.logViewCart}}),Object.defineProperty(t,"logViewContent",{enumerable:!0,get:function(){return v.logViewContent}}),Object.defineProperty(t,"initBentoAnalytics",{enumerable:!0,get:function(){return v.initBentoAnalytics}});var w=n(8);Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return w.loadScript}}),Object.defineProperty(t,"loadScriptWithDelay",{enumerable:!0,get:function(){return w.loadScriptWithDelay}})},184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initAnglerAI=function(){"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",u],["removeFromCart",d],["collectionView",f],["pageView",c],["viewCart",p],["viewContent",s],["search",m],["loadScript",i]))};const r=n(26),o=n(8),i=async e=>{if(!window.__APP_CONFIG__.ANALYTICS.ANGLER)return;const{WORKSPACE_ID:t,TOKEN:n}=window.__APP_CONFIG__.ANALYTICS.ANGLER;t&&n?(await(0,o.loadScriptAsync)({id:"angler",src:"https://static.getangler.ai/dist/analytics/_latest.min.js"}),window.anglerai?.init({token:n,workspaceId:t})):console.warn("Angler AI not configured - missing workspaceId or token")},a=async(e,t,n)=>{if(!window.anglerai||!window.__APP_CONFIG__.ANALYTICS.ANGLER)return;const i=(s=await(0,r.loadShopifyAccount)(),{id:s?.id||void 0,email:s?.email||void 0,firstName:s?.first_name||void 0,lastName:s?.last_name||void 0,phone:s?.phone||void 0,ordersCount:void 0,dob:void 0}),a=(()=>{const e=(0,o.getOldCart)();if(e)return{id:e.token,totalQuantity:e.items.reduce(((e,t)=>e+(t.quantity||0)),0),cost:{totalAmount:{amount:e.total_price,currencyCode:e.currency||"USD"}},lines:e.items.map((t=>({merchandise:{id:t.variant_id.toString(),image:{src:t.image},price:{amount:t.price,currencyCode:e.currency||"USD"},product:{id:t.product_id.toString(),title:t.product_title,vendor:t.vendor,type:t.product_type,url:t.url},sku:t.sku,title:t.variant_title},quantity:t.quantity||0})))}})(),c={eventName:e,eventId:n||(0,o.uuid)(),data:{cart:a,customer:i,...t}};var s;window.anglerai.sendEvent(c)},c=async e=>{await a("page_viewed",{},e)},s=async(e,t)=>{const[n,r]=(0,o.buildProductAndVariant)(e),i=r.price||n.price;await a("product_viewed",{productVariant:{id:r.id,image:{src:e.image},price:{amount:i?Number.parseFloat(i):void 0,currencyCode:"USD"},product:{id:n.id,title:n.title,vendor:n.vendor,type:n.productType,url:n.url},sku:r.sku,title:r.title}},t)},l=e=>{const[t,n]=(0,o.buildProductAndVariant)(e),r=n.price||t.price;return{cartLine:{merchandise:{id:n.id,image:{src:t.image},price:{amount:r?Number.parseFloat(r):void 0,currencyCode:"USD"},product:{id:t.id,title:t.title,vendor:t.vendor,type:t.productType,url:t.url},sku:n.sku,title:n.title},quantity:e.quantity||1}}},u=async(e,t)=>{await a("product_added_to_cart",l(e),t)},d=async(e,t)=>{await a("product_removed_from_cart",l(e),t)},p=async e=>{await a("cart_viewed",{},e)},y=e=>e.map((e=>{const t=e.selected_variant;return{id:t?.id?.toString()||e.product.id?.toString(),image:{src:t?.image?.src||e.product.image?.src},price:{amount:t?.price||e.product.price||0,currencyCode:"USD"},product:{id:e.product.id?.toString(),title:e.product.title,vendor:e.product.vendor,type:e.product.type,url:e.product.url},sku:t?.sku,title:t?.title}})),f=async(e,t,n)=>{const r={collection:{id:e.id.toString(),title:e.title,productVariants:y(t)}};await a("collection_viewed",r,n)},m=async(e,t,n)=>{await a("search_submitted",{searchResult:{query:e,productVariants:y(t)}},n)}},244:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadAttn=function(){const{ATTN_ID:e,ATTN_DELAY:t=10}=window.__APP_CONFIG__.ANALYTICS;e&&(0,r.loadScriptWithDelay)({src:`//cdn.attn.tv/${e}/dtag.js`,id:"attn-script",timeout:1e3*t,anonymous:!1})};const r=n(8)},59:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.initElevar=function(){"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",f],["removeFromCart",m],["clickContent",v],["collectionView",g],["pageView",y],["viewCart",h],["viewContent",_],["loadScript",c],["search",C]))};const o=n(26),i=n(8),a=r(n(65));async function c(){try{await(0,i.waitForShopifyY)(),await fetch("/static-489c224a/elevar/live.html").then((e=>e.text())).then((e=>{const t=document.createRange().createContextualFragment(e);document.body.append(t)})),window.ElevarPushToDataLayer||(window.ElevarPushToDataLayer=e=>(window.ElevarDataLayer=window.ElevarDataLayer??[],window.ElevarDataLayer.push(e)))}catch(e){throw new Error("loadElevar error:"+JSON.stringify(e,Object.getOwnPropertyNames(e),2))}}async function s(e){const t=e??await(0,o.loadShopifyAccount)(),n=(0,i.getOldCart)(),r=n?.items.map(((e,t)=>({name:e.title,id:e.id.toString(),category:e.product_type||"unknown",brand:e.vendor,variant:e.variant_title,price:e.final_line_price.toString(),quantity:e.quantity.toString(),product_id:e.product_id.toString(),variant_id:e.variant_id.toString(),compare_at_price:e.original_line_price.toString(),image:(0,i.toFQDNURL)(e.image),inventory:"",list:"",url:(0,i.normalizeURL)(e.url),position:t,properties:e.properties})))??[];return{user:{customer_address_1:t.address1||void 0,customer_address_2:t.address2||void 0,customer_city:t.city||void 0,customer_country:t.country||void 0,customer_email:t.email||void 0,customer_first_name:t.first_name||void 0,customer_id:t.id||void 0,customer_last_name:t.last_name||void 0,customer_order_count:void 0,customer_phone:t.phone||void 0,customer_province:t.province||void 0,customer_province_code:t.provinceCode||void 0,customer_tags:t.tags||void 0,customer_total_spent:t.orderValue||void 0,customer_zip:t.zip||void 0,user_consent:void 0,visitor_type:t.loggedIn?"logged_in":"guest"},cart:{items:r,total:n?.total_price?.toString()??""}}}const l=async e=>{const t=(0,i.readCookie)("cart_currency")||(0,i.readCookie)("cartCurrency");return t&&""!==t?t:(e??await(0,o.loadShopifyAccount)()).currency||"USD"},u=(e,t)=>{const n=new URL(t?.url||window.location.href),r=n.pathname+n.search;return e.map(((e,t)=>{const n=e.selected_variant?.id||e.product.id,o=e.selected_variant?.price??e.product.price,a=e.selected_variant?.compare_at_price??e.product.compare_at_price,c=e.selected_variant?.inventory_quantity;return{id:e.selected_variant?.sku??n?.toString(),name:e.product.title,list:r,brand:e.product.vendor,category:e.product.type||"unknown",variant:e.selected_variant?.title,variant_id:e.selected_variant?.id?.toString(),position:t+1,price:o?.toFixed(2),quantity:c?c.toString():"1",product_id:e.product.id?.toString(),compare_at_price:a?.toFixed(2)??o?.toFixed(2),url:(0,i.normalizeURL)(e.selected_variant?.url||e.product.url)}}))};function d(e){const t=e.price.toFixed(2),n=e.original_price.toFixed(2),r=e.position??0,o=document.referrer?new URL(document.referrer):void 0;return{id:e.sku,name:e.product_title,price:t,image:(0,i.toFQDNURL)(e.image),brand:e.vendor,category:e.product_type||"unknown",compare_at_price:n===t||"0.00"===n?t:n,product_id:e.product_id.toString(),variant_id:e.variant_id.toString(),variant:e.variant_title,inventory:e.inventory?.toString(),list:o?`${o.pathname}${o.search}`:"",position:r+1,quantity:e.quantity.toString(),url:(0,i.normalizeURL)(e.url),properties:e.properties}}function p(e,t,n=0){const r=e.selected_variant?.price??e.product.price,o=e.selected_variant?.compare_at_price??e.product.compare_at_price,a=e.selected_variant?.image??e.product.image,c=new URL(t?.url||window.location.href),s=c.pathname+c.search;return{id:e.selected_variant?.sku||e.product.id?.toString(),name:e.product.title,price:r?.toFixed(2),image:(0,i.toFQDNURL)(a?.src),brand:e.product.vendor,category:e.product.type||"unknown",compare_at_price:o===r||0===o?r?.toFixed(2):o?.toFixed(2),product_id:e.product.id?.toString(),variant_id:e.selected_variant?.id?.toString(),variant:e.selected_variant?.title,inventory:e.selected_variant?.inventory_quantity?.toString(),list:s,position:n+1,quantity:e.quantity?.toString(),url:(0,i.normalizeURL)(e.selected_variant?.url||e.product.url)}}const y=async(e,t)=>{const n=await t,r=await l(n),{user:o,cart:i}=await s(n);window.ElevarPushToDataLayer?.({event:"dl_user_data",eventId:e,cart_total:i.total,user_properties:o,ecommerce:{currencyCode:r,cart_contents:{products:i.items}}})},f=async(e,t=(0,i.uuid)())=>{const n=d(e),r=await l(),{user:o}=await s();window.ElevarPushToDataLayer?.({event:"dl_add_to_cart",eventId:t,user_properties:o,ecommerce:{currencyCode:r,add:{actionField:{list:document.referrer?new URL(document.referrer).pathname:"",action:"add"},products:[n]}}})},m=async(e,t=(0,i.uuid)())=>{const n=d(e),r=await l(),{user:o}=await s();window.ElevarPushToDataLayer?.({event:"dl_remove_from_cart",eventId:t,user_properties:o,ecommerce:{currencyCode:r,remove:{actionField:{list:"Shopping Cart"},products:[n]}}})},g=async(e,t,n=(0,i.uuid)())=>{const r=await l(),{user:o}=await s(),a=u(t,e);window.ElevarPushToDataLayer?.({event:"dl_view_item_list",eventId:n,user_properties:o,ecommerce:{currencyCode:r,impressions:a}})},v=async(e,t,n=0,r=(0,i.uuid)())=>{const{user:o}=await s(),a=await l(),c=new URL(e.url||window.location.href),u=`${c.pathname}${c.search}`,d=[p(t,e,n)];window.ElevarPushToDataLayer?.({event:"dl_select_item",eventId:r,user_properties:o,ecommerce:{currencyCode:a,click:{actionField:{list:u,action:"click"},products:d}}})},w=(0,a.default)((async e=>{const t=(0,i.cartItemToBentoAnalyticsItem)(e),n=document.referrer?new URL(document.referrer):void 0;await v({id:-1,title:n?`${n.pathname}${n.search}`:"",url:(0,i.normalizeURL)(document.referrer)},t,0)})),_=async(e,t=(0,i.uuid)())=>{document.referrer&&await w(e);const n=document.referrer||window.location.href?new URL(document.referrer||window.location.href):void 0,r=await l(),o=p((0,i.cartItemToBentoAnalyticsItem)(e));o.inventory||console.error("Please attach an inventory value to cartItem for logViewContent events.");const{user:a}=await s(),c=[o];window.ElevarPushToDataLayer?.({event:"dl_view_item",eventId:t,user_properties:a,ecommerce:{currencyCode:r,detail:{actionField:{list:n?`${n.pathname}${n.search}`:"",action:"detail"},products:c}}})},h=async(e=(0,i.uuid)())=>{const t=await l();await y(e,(0,o.loadShopifyAccount)());const{user:n,cart:r}=await s();var a;window.ElevarPushToDataLayer?.({event:"dl_view_cart",eventId:e,user_properties:n,ecommerce:{currencyCode:t,actionField:{list:"Shopping Cart"},impressions:(a=r.items??[],a.map(((e,t)=>({...e,position:t+1,list:"Shopping Cart"}))))},cart_total:r.total})},C=async(e,t,n=(0,i.uuid)())=>{const r=await l(),{user:o}=await s(),a=new URL(window.location.href);a.searchParams.set("query",e),window.ElevarPushToDataLayer?.({event:"dl_view_search_results",eventId:n,user_properties:o,ecommerce:{currencyCode:r,actionField:{list:"search results"},impressions:u(t,{title:"search results test",url:(0,i.normalizeURL)(a.toString()),id:-1})}})}},238:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logFacebookPageView=t.logFacebookViewContent=t.logAddToCartFacebook=void 0;const r=n(8),o=n(239);function i(){const{USE_FB_SDK:e,FB_INIT:t}=window.__APP_CONFIG__.ANALYTICS;return!e||t?t:(window.__APP_CONFIG__.ANALYTICS.FB_INIT=(async()=>{const{FB_ID:e}=window.__APP_CONFIG__.ANALYTICS;if(e&&((0,o.loadFacebookSdk)(),window.fbq)){(0,r.ccpa_dns)()?window.fbq("dataProcessingOptions",["LDU"],1,1e3):window.fbq("dataProcessingOptions",[]);const t=await l();window.fbq("init",e,t)}})(),window.__APP_CONFIG__.ANALYTICS.FB_INIT)}function a(e,t){const n=`${e.title??""} - ${t.title??""}`;return[`&cd[content_ids]=${t.id??""}`,"&cd[content_type]=product_group",`&cd[content_name]=${window.encodeURIComponent(n)}`,`&cd[currency]=${(0,r.readCookie)("cartCurrency")??"USD"}`,`&cd[value]=${window.encodeURIComponent(t.price??"0")}`,e.productType?`&cd[content_category]=${e.productType}`:"","&cd[num_items]=1"]}function c(e,t){const n=`${e.title??""} - ${t.title??""}`;return{content_ids:void 0===e.content_ids?t.id?[t.id]:[]:e.content_ids,content_type:"product",content_name:n,curency:(0,r.readCookie)("cartCurrency")??"USD",value:Number.parseFloat(t.price??"0"),content_category:e.productType}}async function s(e){const t=(0,r.readCookie)("_shopify_y"),n=(0,r.readCookie)("_fbp"),o=(0,r.readCookie)("_fbc"),i=await async function(){const e=await l();return e?await Promise.all(Object.entries(e).map((async([e,t])=>t&&"string"==typeof t?`&ud[${e}]=${window.encodeURIComponent(await(0,r.sha256)(t))}`:""))):[]}(),a=`${document.location.pathname}${document.location.search}`;return[`&dl=${window.encodeURIComponent(a)}`,`&eid=${e}`,n?`&fbp=${window.encodeURIComponent(n)}`:"",o?`&fbc=${window.encodeURIComponent(o)}`:"",t?`&external_id[0]=${window.encodeURIComponent(t)}`:"",...i,(0,r.ccpa_dns)()?"&dpo=LDU&dpoco=1&dpost=1000":"&dpo="].join("")}async function l(){const e=await window.__APP_CONFIG__.account;if(e?.id)return{em:e.email,fn:e.first_name,ln:e.last_name,ph:e.phone?.replace(/\D+/g,"")}}t.logAddToCartFacebook=async(e,t)=>{const{FB_ID:n,USE_FB_SDK:o}=window.__APP_CONFIG__.ANALYTICS;if(!n)return;const[l,u]=(0,r.buildProductAndVariant)(e);if(await i(),o&&window.fbq?.loaded)window.fbq("track","AddToCart",c(l,u),{eventID:t});else try{(0,r.imagePixel)([`https://www.facebook.com/tr/?id=${n}`,"&ev=AddToCart",await s(t),...a(l,u)].join(""))}catch(e){console.error(e)}},t.logFacebookViewContent=async(e,t)=>{const{FB_ID:n,USE_FB_SDK:o}=window.__APP_CONFIG__.ANALYTICS;if(!n)return;const[l,u]=(0,r.buildProductAndVariant)(e);try{if(await i(),o&&window.fbq?.loaded)return void window.fbq("track","ViewContent",c(l,u),{eventID:t});(0,r.imagePixel)([`https://www.facebook.com/tr/?id=${n}`,"&ev=ViewContent",await s(t),...a(l,u)].join(""))}catch(e){console.error(e)}},t.logFacebookPageView=async e=>{const{FB_ID:t,USE_FB_SDK:n}=window.__APP_CONFIG__.ANALYTICS;if(t)if(await i(),n&&window.fbq?.loaded)window.fbq("track","PageView");else try{(0,r.imagePixel)(`https://www.facebook.com/tr/?id=${t}&ev=PageView${await s(e)}`)}catch(e){console.error(e)}}},188:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logGoogleCollectionView=t.logGoogleViewContent=t.logAddToCartGoogleAnalytics=t.logGooglePageView=t.loadGoogleAnalytics=void 0;const r=n(8);t.loadGoogleAnalytics=()=>{const{GA_ID:e,GA_USE_GTM:t}=window.__APP_CONFIG__.ANALYTICS;e&&(window.gtag||(window.gtag=function(...e){window.dataLayer=window.dataLayer||[],window.dataLayer.push(e)},window.gtag("js",new Date)),t?function(e,t,n,r,o){e[r]=e[r]||[],e[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var i=t.getElementsByTagName(n)[0],a=t.createElement(n);a.async=!0,a.src="https://www.googletagmanager.com/gtm.js?id="+o,i.parentNode.insertBefore(a,i)}(window,document,"script","dataLayer",e):(0,r.loadScript)({src:`https://www.googletagmanager.com/gtag/js?id=${e}`,id:"google-analytics",defer:!1,async:!0}))};let o="";function i(e,t,n={},r=!0){void 0!==window.gtag&&window.gtag("event",e,{...n,currency:"USD",items:t,non_interaction:r})}function a(e,t,n){return{item_id:e.selected_variant?.sku||e.product.id?.toString()||"",item_name:[e.product.title,e.selected_variant?.title].filter((e=>!!e)).join(" "),item_category:e.product.type??"",price:e.product.price,item_brand:e.product.vendor,item_list_id:t.url,item_list_name:t.title,item_variant:e.selected_variant?.id?.toString(),index:n,quantity:e.quantity||1,affiliation:void 0,coupon:void 0,discount:void 0,location_id:void 0}}t.logGooglePageView=()=>{const{GA_ID:e,ADDITIONAL_GA:t}=window.__APP_CONFIG__.ANALYTICS;if(!e)return;const n=`${document.location.pathname}${document.location.search}`,i=window.gtag;if(i&&o!==n&&(o=n,(0,r.ccpa_dns)()&&i("set",{restricted_data_processing:!0}),i("config",e,{page_path:n}),t))for(const e of t)i("config",e,{page_path:n})},t.logAddToCartGoogleAnalytics=e=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&i("add_to_cart",[a((0,r.cartItemToBentoAnalyticsItem)(e),{title:document.title,id:-1,url:window.location.toString()})],{},!1)},t.logGoogleViewContent=e=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&i("view_item",[a((0,r.cartItemToBentoAnalyticsItem)(e),{title:document.title,id:-1,url:window.location.toString()})])},t.logGoogleCollectionView=(e,t)=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&i("view_item_list",t.map(((t,n)=>a(t,e,n))))}},245:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImapactRadius=function(){const{IMPACTRADIUS_ENABLED:e=!1,IMPACTRADIUS_DELAY:t=5}=window.__APP_CONFIG__.ANALYTICS;e&&(0,r.loadScriptWithDelay)({src:"//d.impactradius-event.com/A2248058-8d0a-428f-b528-d1484c8157851.js",id:"impact-radius-script",timeout:1e3*t,anonymous:!1})};const r=n(8)},243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadIntellipse=function(){const{ANALYTICS:{INTELLIPSE_ENABLED:e=!1,INTELLIPSE_DELAY:t=10},SHOP_NAME:n}=window.__APP_CONFIG__;e&&(0,r.loadScriptWithDelay)({src:`https://bootstrap.production.intellipse.com/bootstrap.js?shop=${n}.myshopify.com`,id:"intellipse-script",timeout:1e3*t,anonymous:!1})};const r=n(8)},66:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadKlaviyoSubscribe=t.loadKlaviyo=void 0,t.initKlaviyo=function(){a()&&"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",i],["viewContent",o],["loadScript",t.loadKlaviyo]))};const r=n(8);t.loadKlaviyo=()=>{const{ANALYTICS:{KLAVIYO_ID:e,KLAVIYO_DELAY:t=2},SHOP_NAME:n}=window.__APP_CONFIG__;e&&(function(){if(!window.klaviyo){window._klOnsite=window._klOnsite||[];try{window.klaviyo=new Proxy({},{get:function(e,t){return"push"===t?function(){var e;(e=window._klOnsite).push.apply(e,arguments)}:function(){for(var e=arguments.length,n=new Array(e),r=0;r{if(!a())return;const[n]=(0,r.buildProductAndVariant)(e),o=`${document.location.pathname}${document.location.search}`,i={Name:n.title,ProductID:n.id,ImageURL:n.image,URL:o,Brand:n.vendor,Price:n.price,CompareAtPrice:n.compareAtPrice??void 0},c={Name:i.Name,ProductID:i.ProductID,Handle:i.URL,Brand:i.Brand,Price:i.Price,ImageUrl:i.ImageURL,Metadata:{Brand:i.Brand,Price:i.Price,CompareAtPrice:i.CompareAtPrice},event_id:`${t}_${Date.now().toString()}`};window.klaviyo.push(["track","Viewed Product",c]);const s={Name:i.Name,ProductID:i.ProductID,Handle:i.URL,Brand:i.Brand,Price:i.Price,ImageUrl:i.ImageURL,Metadata:{Brand:i.Brand,Price:i.Price,CompareAtPrice:i.CompareAtPrice},event_id:`${t}_${Date.now().toString()}`};window.klaviyo.push(["trackViewedItem",s]),window.geq?.event("Viewed Product Reclaim",s)},i=(e,t)=>{if(!a())return;const[n,o]=(0,r.buildProductAndVariant)(e),i=(0,r.getCurrentPrice)(n,o),c=(0,r.getCartValue)(i),s={Name:n.title,ProductID:n.id,ImageURL:n.image,Handle:n.handle,Brand:n.vendor,Price:i,Properties:e.properties,$value:c,$event_id:`${t}_${Date.now().toString()}`};window.klaviyo.push(["track","Added to Cart",s]),window.geq?.addToCart(s)};function a(){const{KLAVIYO_ID:e}=window.__APP_CONFIG__.ANALYTICS;return!!e}t.loadKlaviyoSubscribe=()=>{const{KLAVIYO_DELAY:e=0}=window.__APP_CONFIG__.ANALYTICS,t={src:"//www.klaviyo.com/media/js/public/klaviyo_subscribe.js",id:"klaviyo-subscribe-script",timeout:1e3*e,anonymous:!1,successCallback:()=>{window.KlaviyoSubscribe?window.KlaviyoSubscribe.attachToForms("#footer_email_signup",{hide_form_on_success:!0}):console.warn("KlaviyoSubscribe not found")}};(0,r.loadScriptWithDelay)(t)}},186:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initListrak=function(){"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",u],["removeFromCart",l],["pageView",c],["viewContent",s],["loadScript",o]))};const r=n(8),o=async()=>{if(!window.__APP_CONFIG__.ANALYTICS.LISTRAK)return;const{MERCHANT_ID:e,VERSION:t}=window.__APP_CONFIG__.ANALYTICS.LISTRAK;await(0,r.loadScriptAsync)({id:"ltkSDK",src:`https://cdn.listrakbi.com/scripts/script.js?m=${e}&v=${t}`}),await new Promise(((e,t)=>{const n=()=>{window._ltk_util?window._ltk_util.ready(e):t(new Error("Could not find _ltk_util"))};window._ltk?n():document.addEventListener("ltkAsyncListener",(()=>{n()}))}))},i=()=>{if(!window._ltk?.SCA)return;console.log("sendListrakCartEvent");const e=(0,r.getOldCart)();let t=0;for(const n of e?.items??[]){const{sku:e,quantity:r,final_price:o,title:i,image:a,url:c}=n;window._ltk.SCA.AddItemWithLinks(e,r,o.toFixed(2),i,a,c),t+=o*r}window._ltk.SCA.Total=t,window._ltk.SCA.Submit()},a=e=>{if(window.__APP_CONFIG__.ANALYTICS.LISTRAK&&window._ltk)switch(e.name){case"addToCart":window._ltk.Activity.AddProductAddedToCart(e.data.sku),i();break;case"removeFromCart":i();break;case"viewContent":window._ltk.Activity.AddProductBrowse(e.data.sku);break;case"clearCart":window._ltk.SCA.ClearCart();break;case"pageView":window._ltk.Activity.AddPageBrowse();break;default:(0,r.assertNever)(e)}},c=()=>{a({name:"pageView"})},s=e=>{const t=d(e);t&&a({name:"viewContent",data:{sku:t}})},l=()=>{a({name:"removeFromCart"})},u=e=>{const t=d(e);t&&a({name:"addToCart",data:{sku:t}})};function d(e){return e.sku||e.variant_id?.toString()||e.product_id?.toString()}},239:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadFacebookSdk=function(){var e,t,n,r,o,i;e=window,t=document,n="script",e.fbq||(r=e.fbq=function(){r.callMethod?r.callMethod.apply(r,arguments):r.queue.push(arguments)},e._fbq||(e._fbq=r),r.push=r,r.loaded=!0,r.version="2.0",r.queue=[],(o=t.createElement(n)).async=!0,o.src="https://connect.facebook.net/en_US/fbevents.js",(i=t.getElementsByTagName(n)[0]).parentNode.insertBefore(o,i))}},237:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadTikTokScript=function(e){!function(t,n,r){t.TiktokAnalyticsObject=r;var o=t[r]=t[r]||[];o.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],o.setAndDefer=function(e,t){e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadLoyaltyLion=function(e){return new Promise(((t,n)=>{if(window.loyaltylion&&(window.loyaltylion=window.lion=void 0,function(){for(const e of document.querySelectorAll("[data-lion-react-container]"))e.remove();for(const e of document.querySelectorAll("#loyaltylion"))e.remove()}()),!e.loyaltylion_token||!window.__APP_CONFIG__.ANALYTICS.LOYALTYLION_ENABLED)return console.log("LoyaltyLion wasn't loaded because it isn't enabled for this site."),void t();"function"==typeof window.requestIdleCallback?window.requestIdleCallback((()=>{o(e,t,n)})):setTimeout((()=>{o(e,t,n)}),0)}))};const r=n(242);function o({loggedIn:e,id:t,email:n,first_name:o,last_name:i,loyaltylion_has_account:a,loyaltylion_token:c,rechargeHash:s,loyaltylion_auth_token:l,date:u},d,p){try{(0,r.loadScript)(),a&&e&&n?window.loyaltylion?.init({token:c??"",customer:{id:t??"",email:n,name:`${o??""} ${i??""}`,rechargeHash:s??""},auth:{date:u??"",token:l??""}}):window.loyaltylion?.init({token:c??""}),window.loyaltylion?.on("ready",(()=>{setTimeout((()=>{d()}),0)}))}catch(e){console.error("Could not load LoyaltyLion",JSON.stringify(e,Object.getOwnPropertyNames(e),2)),p(e)}}},242:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadScript=function(){!function(e,t){function n(t){var n=e.getElementsByTagName("script")[0],r=e.createElement("script");r.src=t,r.crossOrigin="",r.onload=e=>{e.target.parentNode.removeChild(e.target)},n.parentNode.insertBefore(r,n)}if(!t.isLoyaltyLion){window.loyaltylion=t,void 0===window.lion&&(window.lion=t),t.version=2,t.isLoyaltyLion=!0;var r=new Date,o=r.getFullYear().toString()+r.getMonth().toString()+r.getDate().toString();n("https://sdk.loyaltylion.net/static/2/loader.js?t="+o);var i=!1;t.init=function(e){if(i)throw new Error("Cannot call lion.init more than once");i=!0;var a=t._token=e.token;if(!a)throw new Error("Token must be supplied to lion.init");for(var c=[],s="_push configure bootstrap shutdown on removeListener authenticateCustomer".split(" "),l=0;l(window.addEventListener("unhandledrejection",i),window.addEventListener("error",i),()=>{window.removeEventListener("unhandledrejection",i),window.removeEventListener("error",i)})),[])},t.logOutsmartlyError=i;const r=n(2),o=n(8);function i(e,t){const{postLogger:n,rid:r,vid:o,startTimestamp:i,headTimestamp:a}=window.__APP_CONFIG__;if(n){const c=Math.floor(window.performance.now());n({table:"error",row:{rid:r,vid:o,timelineMark:i+c,elapsedTime:c,headTimestamp:a,source:t??location.pathname,message:"message"in e?e.message:JSON.stringify(e.reason),error:"stack"in e?e.stack:JSON.stringify(e,Object.getOwnPropertyNames(e),2)}})}}function a(e,t){const{postLogger:n,startTimestamp:r,rid:o,vid:i}=window.__APP_CONFIG__;if(!n)return;const a=Math.floor(window.performance.now());n({table:"outcome",row:{rid:o,vid:i,outcome:e,timelineMark:r+a,elapsedTime:a,pathname:window.location.pathname,metadata:t}})}function c(e,t){return[{key:"eventId",value:t},{key:"handle",value:e.handle},{key:"title",value:e.title},{key:"productId",value:e.id},{key:"productType",value:e.productType??"NA"},{key:"imageUrl",value:e.image??"NA"},{key:"vendor",value:e.vendor??"NA"},{key:"price",value:e.price},{key:"compareAtPrice",value:e.compareAtPrice??e.price}].filter((e=>void 0!==e.value))}function s(e){return e.selectedOptions?e.selectedOptions.map((({name:e="NA",value:t="NA"})=>({key:e,value:t}))):e.optionMap?[{key:"Color",value:e.optionMap.Color},{key:"Size",value:e.optionMap.Size}]:[]}t.logOutsmartlyPageView=e=>{const{postLogger:t,rid:n,vid:r,startTimestamp:o}=window.__APP_CONFIG__;if(!t)return;const i=Math.floor(window.performance.now());t({table:"outcome",row:{outcome:"PageView",rid:n,vid:r,timelineMark:o+i,elapsedTime:i,pathname:location.pathname,entryDepth:window.scrollY,scrollTopOnEntry:window.scrollY,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,documentHeight:0,metadata:[{key:"eventId",value:e}]}})},t.logOutsmartlyViewedProduct=(e,t)=>{const[n]=(0,o.buildProductAndVariant)(e);"undefined"!=typeof window&&a("ViewProduct",c(n,t))},t.logOutsmartlySelectedVariant=(e,t)=>{const[n,r]=(0,o.buildProductAndVariant)(e);"undefined"!=typeof window&&a("ViewProductVariant",[...c(n,t),{key:"variantId",value:r.id??""},{key:"eventId",value:t},...s(r)])}},60:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.logPinterestCollectionView=t.logAddToCartPinterest=t.logPinterestPageView=t.loadPinterest=void 0;const o=r(n(240)),i=n(8);t.loadPinterest=()=>{const{PINTEREST_ID:e}=window.__APP_CONFIG__.ANALYTICS;if(e)try{(0,o.default)(e),(new Image).src=`https://ct.pinterest.com/v3/?tid=${e}&noscript=1`}catch(e){console.error(e)}},t.logPinterestPageView=async(e,t)=>{const{PINTEREST_ID:n}=window.__APP_CONFIG__.ANALYTICS;if(!n)return;const r=await t;if(r)(new Image).src=["https://ct.pinterest.com/v3/?event=PageVisit",`&tid=${n}`,r.loggedIn&&r.hashedEmail?`&pd[em]=${r.hashedEmail}`:""].join("");else try{window.pintrk("track","checkout"),(new Image).src=`https://ct.pinterest.com/v3/?tid=${n}&event=pageview&noscript=1`}catch(e){console.error(e)}},t.logAddToCartPinterest=e=>{const{PINTEREST_ID:t}=window.__APP_CONFIG__.ANALYTICS;if(!t)return;const[n,r]=(0,i.buildProductAndVariant)(e);(new Image).src=["https://ct.pinterest.com/v3/?event=AddToCart",`&tid=${t}`,`&ed[line_items][0][product_id]=${n.id??""}`,`&ed[line_items][0][product_variant_id]=${r.id??""}`,`&ed[line_items][0][product_price]=${r.price??""}`,"&ed[line_items][0][product_quantity]=1",`&ed[line_items][0][product_name]=${window.encodeURIComponent(`${n.title??""} - ${r.title??""}`)}`].join("")},t.logPinterestCollectionView=()=>{const{PINTEREST_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&((new Image).src=["https://ct.pinterest.com/v3/?event=ViewCategory",`&tid=${e}`].join(""))}},240:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){!function(){if(!window.pintrk){window.pintrk=function(){window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var e=window.pintrk;e.queue=[],e.version="3.0";var t=document.createElement("script");t.async=!0,t.src="https://s.pinimg.com/ct/core.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)}}(),window.pintrk("load",e),window.pintrk("page")}},187:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initShopify=function(){"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",p],["collectionView",m],["pageView",f],["viewContent",y]))};const r=n(8),o=n(235),i=n(26);function a(){const e=document.querySelector('link[rel="canonical"]')?.getAttribute("href")??"";if(e)return e.indexOf("?")>0?e:e+window.location.search;const t=window.location.href,n=t.indexOf("#");return-1===n?t:t.slice(0,n)}const c=[{pattern:/^\/$/,type:o.AnalyticsPageType.home},{pattern:/^\/products/,type:o.AnalyticsPageType.product},{pattern:/^\/collections\/?$/,type:o.AnalyticsPageType.listCollections},{pattern:/^\/collections/,type:o.AnalyticsPageType.collection},{pattern:/-policy|terms-of-service/,type:o.AnalyticsPageType.policy},{pattern:/^\/account\/login/,type:o.AnalyticsPageType.customersLogin},{pattern:/^\/account\/register/,type:o.AnalyticsPageType.customersRegister},{pattern:/^\/account\/addresses/,type:o.AnalyticsPageType.customersAddresses},{pattern:/^\/account\/reset/,type:o.AnalyticsPageType.customersResetPassword},{pattern:/^\/account\/orders/,type:o.AnalyticsPageType.customersOrder},{pattern:/^\/account/,type:o.AnalyticsPageType.customersAccount},{pattern:/^\/cart/,type:o.AnalyticsPageType.cart},{pattern:/^\/search/,type:o.AnalyticsPageType.search},{pattern:/^\/password/,type:o.AnalyticsPageType.password},{pattern:/^\/content/,type:o.AnalyticsPageType.article}];function s(){const e=window.location.pathname,t=c.find((({pattern:t})=>t.test(e)));return t?.type||o.AnalyticsPageType.page}function l(){const e=(0,r.readCookie)("cart");return e?`gid://shopify/Cart/${e}`:""}function u(){const{SHOP_ID:e}=window.__APP_CONFIG__;return`gid://shopify/Shop/${e.toString()}`}async function d(e){const t=(0,o.getClientBrowserParameters)(),n=await async function(e){const t=await e||await(0,i.loadShopifyAccount)();return t?{account:t,customerId:t.id?`gid://shopify/Customer/${t.id}`:void 0,currency:t.currency||"USD"}:{account:void 0,customerId:void 0,currency:"USD"}}(e);return{...t,...n,canonicalUrl:a(),shopId:u(),cartId:l(),shopifySalesChannel:o.ShopifySalesChannel.headless,ccpaEnforced:(0,r.ccpa_dns)(),gdprEnforced:!1,hasUserConsent:!0,analyticsAllowed:!0,marketingAllowed:!0,saleOfDataAllowed:!0}}const p=async e=>{const t={...await d(),...g(e,!0)};await(0,o.sendShopifyAnalytics)({eventName:o.AnalyticsEventName.ADD_TO_CART,payload:t})},y=async e=>{const t={...await d(),...g(e,!1),pageType:s()};await(0,o.sendShopifyAnalytics)({eventName:o.AnalyticsEventName.PRODUCT_VIEW,payload:t})},f=async(e,t)=>{const n={...await d(t),pageType:s()};await(0,o.sendShopifyAnalytics)({eventName:o.AnalyticsEventName.PAGE_VIEW,payload:n})},m=async(e,t)=>{const n=await d(),r=function(e){return{products:e.map((({product:e,quantity:t,selected_variant:n})=>({productGid:`gid://shopify/Product/${e.id?.toString()??""}`,name:e.title||n?.title||"",price:n?.price?.toFixed(2)??"0.00",quantity:t,variantGid:n?.id?`gid://shopify/ProductVariant/${n.id.toString()}`:void 0,variantName:n?.title,brand:e.vendor||"",sku:n?.sku,category:""})))}}(t),i={...n,...r,collectionHandle:e.url,collectionId:e.id.toString(),pageType:s()};await(0,o.sendShopifyAnalytics)({eventName:o.AnalyticsEventName.COLLECTION_VIEW,payload:i})};function g(e,t=!1){const[n,o]=(0,r.buildProductAndVariant)(e),i=[n.title,o.title].join(" - "),a=(0,r.getCurrentPrice)(n,o),c=(0,r.getCartValue)(a,t);return{products:[{productGid:`gid://shopify/Product/${n.id??""}`,name:i,price:a.toFixed(2),quantity:n.quantity,variantGid:o.id?`gid://shopify/ProductVariant/${o.id.toString()}`:void 0,variantName:o.title,brand:o.brand||"",sku:o.sku,category:""}],totalValue:c}}},190:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logAddToCartSnapchat=t.logSnapchatViewContent=t.logSnapchatPageView=t.loadSnapchat=void 0;const r=n(8);t.loadSnapchat=e=>{const{SNAPCHAT_ID:t,SNAPCHAT_DELAY:n=0}=window.__APP_CONFIG__.ANALYTICS;if(t){if(!window.snaptr){const e=(...t)=>{e.handleRequest?e.handleRequest.apply(e,t):e.queue.push(t)};e.queue=[],window.snaptr=e}(0,r.loadScriptWithDelay)({src:"//sc-static.net/scevent.min.js",id:"snapchat-script",timeout:1e3*n,anonymous:!1}),window.snaptr&&window.snaptr("init",t,{user_email:e.email})}},t.logSnapchatPageView=()=>{const{SNAPCHAT_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&window.snaptr&&window.snaptr("track","PAGE_VIEW")},t.logSnapchatViewContent=e=>{const{SNAPCHAT_ID:t}=window.__APP_CONFIG__.ANALYTICS;if(!t||!window.snaptr)return;const[n,o]=(0,r.buildProductAndVariant)(e);window.snaptr("track","VIEW_CONTENT",{currency:"USD",item_category:n.id,item_ids:o.id,description:`${n.title??""} - ${o.title??""}`,price:o.price})},t.logAddToCartSnapchat=e=>{const[t,n]=(0,r.buildProductAndVariant)(e),{SNAPCHAT_ID:o}=window.__APP_CONFIG__.ANALYTICS;o&&window.snaptr&&window.snaptr("track","ADD_CART",{currency:"USD",item_category:t.id,item_ids:n.id,description:`${t.title??""} - ${n.title??""}`,price:n.price})}},236:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initTikTok=function(){if("undefined"==typeof window)return;const{TIKTOK_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",a],["viewContent",c],["loadScript",i]))};const r=n(8),o=n(237),i=()=>{const{TIKTOK_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&void 0===window.ttq&&(0,o.loadTikTokScript)(e)},a=(e,t)=>{const[n,o]=(0,r.buildProductAndVariant)(e);try{void 0!==window.ttq&&window.ttq.track("AddToCart",...s(n,o,t))}catch(e){console.log(e)}},c=(e,t)=>{const[n,o]=(0,r.buildProductAndVariant)(e);try{void 0!==window.ttq&&window.ttq.track("ViewContent",...s(n,o,t))}catch(e){console.log(e)}};function s(e,t,n){return[{content_id:e.id,content_type:"product",content_name:`${e.title??""} - ${t.title??""}`,quantity:1,price:t.price,curency:(0,r.readCookie)("cartCurrency")??"USD"},{event_id:n}]}},8:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cartItemToBentoAnalyticsItem=t.getItemCounts=t.getCartValue=t.getCurrentPrice=t.getOldCart=t.updateCart=t.normalizeCart=t.buildProductAndVariant=void 0,t.loadScriptAsync=async function(e){return new Promise(((t,n)=>{i({...e,successCallback:t,errorCallback:n})}))},t.loadScript=i,t.loadScriptWithDelay=function(e){const{src:t,id:n,successCallback:r=()=>{},useRequestIdleCallback:a=!1}=e;if(document.querySelector(`#${n}`))"function"==typeof window.requestIdleCallback?window.requestIdleCallback(r):window.setTimeout(r,0);else if(a&&"function"==typeof window.requestIdleCallback)window.requestIdleCallback((()=>{i(e)}));else{const n=e.timeout||window.scriptDelayTime||1e4;o[t]=window.setTimeout(i,n,e)}},t.readCookie=a,t.entries=function(e){return Object.entries(e)},t.callOrlyTagHooks=async function(e,...t){const n=(window._orlyTags??[]).filter((([t])=>t===e)).map((async([,n])=>{try{return await n(...t)}catch(n){const r=new Error(`callOrlyTagHooks: error in type: ${e}\nparams: ${JSON.stringify(t,void 0,2)}\nerror: ${JSON.stringify(n,Object.getOwnPropertyNames(n),2)}`);return console.error(r),r}}));await Promise.allSettled(n)},t.getCartComponents=async function(e){try{const t=e.properties._olbid;if(!t)return[e];const n=await fetch("/pages/cart-json"),r=(await n.json()).items.find((e=>Object.fromEntries(e.properties)._olbid===t));return r?c(r.item_components):[e]}catch(t){return console.log(t),[e]}},t.isShopifyCartItem=s,t.isShopifyCartError=function(e){return"object"!=typeof e||null===e?(console.log("not even an object!"),!1):"string"==typeof e.message},t.isShopifyCart=function(e){return l(e)&&"string"==typeof e.token},t.isPartialShopifyCartWithItems=l,t.waitForShopifyY=async function(){await(0,r.loadShopifyAccount)().catch((e=>{console.error("Could not load accout before getting _shopify_y",e)}));const e=a("_shopify_y");return e||console.error("_shopify_y should be defined"),e},t.uuid=function(){const e="xxxx-4xxx-xxxx-xxxxxxxxxxxx";let t="";try{const n=window.crypto||window.msCrypto,r=new Uint16Array(31);n.getRandomValues(r);let o=0;t=e.replace(/[x]/g,(function(e){for(let e=[],t=1;t>>0}catch(t){e=(new Date).getTime()>>>0}try{t=performance.now()>>>0}catch(e){t=0}const n=Math.abs(e+t).toString(16).toLowerCase();return"00000000".substring(0,8-n.length)+n}()+"-"+t},t.sha256=async function(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t);return[...new Uint8Array(n)].map((e=>e.toString(16).padStart(2,"0"))).join("")},t.imagePixel=function(e){const t=new Image;t.height=1,t.width=1,t.setAttribute("style","display:none;"),t.src=e,document.body.append(t)},t.ccpa_dns=function(){return/__ccpa_dns=true/.test(document.cookie)},t.assertNever=function(e){throw new Error("Unhandled case:",e)},t.toFQDNURL=p,t.normalizeURL=y;const r=n(26),o={};function i(e){const{src:t,id:n,anonymous:r=!0,defer:i=!0,async:a=!1,successCallback:c,errorCallback:s}=e;if(o[t]&&window.clearTimeout(o[t]),document.querySelector(`#${n}`))return;const l=document.createElement("script");l.src=t,l.defer=i,l.id=n,l.async=a,r&&(l.crossOrigin="anonymous"),c&&l.addEventListener("load","function"==typeof window.requestIdleCallback?()=>window.requestIdleCallback(c):c),s&&l.addEventListener("error","function"==typeof window.requestIdleCallback?()=>window.requestIdleCallback(s):s),document.body.append(l)}function a(e){const t=decodeURIComponent(document.cookie).match(/[^\s,;=]+=[^\s,;=]+/g);if(t)for(const n of t){const[t,r]=n.split("=");if(t===e)return r}}t.buildProductAndVariant=e=>[{id:e.product_id?.toString(),handle:e.handle,title:e.product_title,tags:[],price:e.price?.toString(),compareAtPrice:e.original_price?.toString(),vendor:e.vendor,productType:e.product_type,image:p(e.image),quantity:e.quantity},{id:e.variant_id?.toString(),sku:e.sku,brand:e.vendor,title:e.variant_title,price:e.price?.toString(),selectedOptions:e.options_with_values}];const c=e=>e.map((e=>({...e,price:e.price/100,original_price:e.original_price/100,final_line_price:e.final_line_price/100,final_price:e.final_price/100,original_line_price:e.original_line_price/100,line_price:e.line_price/100,discounted_price:e.discounted_price/100,line_level_total_discount:e.line_level_total_discount/100,total_discount:e.total_discount/100,variant_title:e.variant_title||e.variant_options.join(" / ")||"Default Title",url:y(e.url)})));function s(e){const t=e;return"string"==typeof t.key&&"number"==typeof t.quantity}function l(e){if("object"!=typeof e||null===e)return console.log("not even an object!"),!1;const{items:t}=e;return Array.isArray(t)&&t.every((e=>s(e)))}t.normalizeCart=e=>{const n=(0,t.getOldCart)(),r=c(e.items);return{...e,items:r,total_price:void 0===e.total_price?n?.total_price||0:e.total_price/100,total_discount:void 0===e.total_discount?n?.total_discount||0:e.total_discount/100,original_total_price:void 0===e.original_total_price?n?.original_total_price||0:e.original_total_price/100,items_subtotal_price:void 0===e.items_subtotal_price?n?.item_count||0:e.items_subtotal_price/100}};const u="outsmartly-shopify-cart";t.updateCart=e=>{window.localStorage.setItem(u,JSON.stringify(e))},t.getOldCart=()=>{const e=window.localStorage.getItem(u)||"";if(!e||0===e.length)return;const t=(e=>{try{return JSON.parse(e)}catch(t){console.error("Could not parse as JSON:",e,"\nerror:",t)}})(e);return l(t)?t:void 0},t.getCurrentPrice=(e,t)=>{const n=t?.price||e?.price;return Number.parseFloat(n||"0")},t.getCartValue=(e,n=!1)=>{const r=(0,t.getOldCart)(),o=e||0;return r?.total_price||n?o:0},t.getItemCounts=e=>{const t=new Map;for(const n of e){const e=t.get(n.id);e?e.quantity+=n.quantity:t.set(n.id,{...n})}return t},t.cartItemToBentoAnalyticsItem=e=>{const t={src:p(e.featured_image?.url),alt:e.featured_image?.alt,width:e.featured_image?.width,aspect_ratio:e.featured_image?.aspect_ratio};return{product:{id:e.product_id,compare_at_price:e.original_price,price:e.price,selectedOptions:[],title:e.product_title,url:y(e.url),vendor:e.vendor,type:e.product_type,image:t},selected_variant:{id:e.variant_id,compare_at_price:e.original_price,price:e.price,sku:e.sku,url:y(e.url),inventory_quantity:1,title:e.variant_title,image:t},quantity:e.quantity}};const d=e=>{try{return new URL(e)}catch{}};function p(e){if(void 0!==e)return d(e)?e:new URL(e,window.location.origin).toString()}function y(e){return void 0!==e&&window.__APP_CONFIG__.ANALYTICS.useFQDN?p(e):e}},235:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AddToCartButton:()=>Ee,AnalyticsEventName:()=>Oe,AnalyticsPageType:()=>ke,BuyNowButton:()=>et,CartCheckoutButton:()=>tt,CartCost:()=>at,CartLineProvider:()=>lt,CartLineQuantity:()=>ut,CartLineQuantityAdjustButton:()=>dt,CartProvider:()=>we,ExternalVideo:()=>ft,IMAGE_FRAGMENT:()=>Ot,Image:()=>kt,MediaFile:()=>Ht,ModelViewer:()=>Yt,Money:()=>it,ProductPrice:()=>zt,ProductProvider:()=>Ae,RichText:()=>Jt,SHOPIFY_S:()=>ie,SHOPIFY_STOREFRONT_ID_HEADER:()=>te,SHOPIFY_STOREFRONT_S_HEADER:()=>re,SHOPIFY_STOREFRONT_Y_HEADER:()=>ne,SHOPIFY_Y:()=>oe,ShopPayButton:()=>tn,ShopifyProvider:()=>Q,ShopifySalesChannel:()=>Ne,Video:()=>Bt,createStorefrontClient:()=>Y,customerAccountApiCustomScalars:()=>yt,decodeEncodedVariant:()=>vt,flattenConnection:()=>L,getAdjacentAndFirstAvailableVariants:()=>Tt,getClientBrowserParameters:()=>Xe,getProductOptions:()=>Et,getShopifyCookies:()=>le,isOptionValueCombinationInEncodedVariant:()=>gt,mapSelectedProductOptionToObject:()=>_t,parseGid:()=>De,parseMetafield:()=>Wt,sendShopifyAnalytics:()=>Je,storefrontApiCustomScalars:()=>pt,useCart:()=>ve,useCartLine:()=>st,useLoadScript:()=>Gt,useMoney:()=>nt,useProduct:()=>Se,useSelectedOptionInUrlParam:()=>sn,useShop:()=>X,useShopifyCookies:()=>dn});var r,o,i=n(14),a=n(0);function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(o=r||(r={}))[o.NotStarted=0]="NotStarted",o[o.Running=1]="Running",o[o.Stopped=2]="Stopped";var s={type:"xstate.init"};function l(e){return void 0===e?[]:[].concat(e)}function u(e){return{type:"xstate.assign",assignment:e}}function d(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function p(e){return function(t){return e===t}}function y(e){return"string"==typeof e?{type:e}:e}function f(e,t){return{value:e,context:t,actions:[],changed:!1,matches:p(e)}}function m(e,t,n){var r=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},r);return"function"==typeof e.assignment?t=e.assignment(r,n):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](r,n):e.assignment[o]})),r=t,!1}return!0})),r,o]}function g(e,t){void 0===t&&(t={});var n=c(m(l(e.states[e.initial].entry).map((function(e){return d(e,t.actions)})),e.context,s),2),r=n[0],o=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:p(e.initial)},transition:function(t,n){var r,o,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,u=a.context,g=y(n),v=e.states[s];if(v.on){var w=l(v.on[g.type]);try{for(var _=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(w),h=_.next();!h.done;h=_.next()){var C=h.value;if(void 0===C)return f(s,u);var A="string"==typeof C?{target:C}:C,S=A.target,b=A.actions,I=void 0===b?[]:b,P=A.cond,T=void 0===P?function(){return!0}:P,E=void 0===S,O=null!=S?S:s,k=e.states[O];if(T(u,g)){var N=c(m((E?l(I):[].concat(v.exit,I,k.entry).filter((function(e){return e}))).map((function(e){return d(e,i._options.actions)})),u,g),3),L=N[0],x=N[1],D=N[2],R=null!=S?S:s;return{value:R,context:x,actions:L,changed:S!==s||L.length>0||D,matches:p(R)}}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(o=_.return)&&o.call(_)}finally{if(r)throw r.error}}}return f(s,u)}};return i}var v,w,_,h,C=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))},A=i.useLayoutEffect,S={exports:{}},b={},I={exports:{}},P={};var T=(h||(h=1,S.exports=function(){if(_)return b;_=1;var e=i.default,t=(w||(w=1,I.exports=function(){if(v)return P;v=1;var e=i.default,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function c(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var i=t(),s=n({inst:{value:i,getSnapshot:t}}),l=s[0].inst,u=s[1];return o((function(){l.value=i,l.getSnapshot=t,c(l)&&u({inst:l})}),[e,i,t]),r((function(){return c(l)&&u({inst:l}),e((function(){c(l)&&u({inst:l})}))}),[e]),a(i),i};return P.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,P}()),I.exports),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,c=e.useMemo,s=e.useDebugValue;return b.useSyncExternalStoreWithSelector=function(e,t,i,l,u){var d=o(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c((function(){function e(e){if(!a){if(a=!0,r=e,e=l(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var i=l(e);return void 0!==u&&u(t,i)?t:(r=e,o=i)}var r,o,a=!1,c=void 0===i?null:i;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,i,l,u]);var y=r(e,d[0],d[1]);return a((function(){p.hasValue=!0,p.value=y}),[y]),s(y),y},b}()),S.exports),E=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function O(e){return e}var k=function(e){var t;return e.subscribe((function(e){t=e})).unsubscribe(),t};var N=function(e,t){return!1===t.changed};function L(e){if(!e){const t=`flattenConnection(): needs a 'connection' to flatten, but received '${e??""}' instead.`;return console.error(t+" Returning an empty array"),[]}return"nodes"in e?e.nodes:"edges"in e&&Array.isArray(e.edges)?e.edges.map((e=>{if(!(null==e?void 0:e.node))throw new Error("flattenConnection(): Connection edges must contain nodes");return e.node})):[]}const x=e=>`\n mutation CartLineAdd(\n $cartId: ID!\n $lines: [CartLineInput!]!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,D=e=>`\n mutation CartCreate(\n $input: CartInput!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartCreate(input: $input) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,R=e=>`\n mutation CartLineRemove(\n $cartId: ID!\n $lines: [ID!]!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartLinesRemove(cartId: $cartId, lineIds: $lines) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,V=e=>`\n mutation CartLineUpdate(\n $cartId: ID!\n $lines: [CartLineUpdateInput!]!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,U=e=>`\n mutation CartNoteUpdate(\n $cartId: ID!\n $note: String!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,$=e=>`\n mutation CartBuyerIdentityUpdate(\n $cartId: ID!\n $buyerIdentity: CartBuyerIdentityInput!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,j=e=>`\n mutation CartAttributesUpdate(\n $attributes: [AttributeInput!]!\n $cartId: ID!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartAttributesUpdate(attributes: $attributes, cartId: $cartId) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,F=e=>`\n mutation CartDiscountCodesUpdate(\n $cartId: ID!\n $discountCodes: [String!]\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,q=e=>`\n query CartQuery(\n $id: ID!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cart(id: $id) {\n ...CartFragment\n }\n }\n\n ${e}\n`,M="\n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n cost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPrice {\n ...MoneyFragment\n }\n price {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n id\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n cost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n applicable\n }\n }\n\n fragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n }\n fragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n }\n",G="2025-01",B=e=>e.includes("mock.shop");function Y({storeDomain:e,privateStorefrontToken:t,publicStorefrontToken:n,storefrontApiVersion:r=G,contentType:o}){if(!e)throw new Error(K+"`storeDomain` is required when creating a new Storefront client in production.");r!==G&&z(`The Storefront API version that you're using is different than the version this build of Hydrogen React is targeting.\nYou may run into unexpected errors if these versions don't match. Received version: "${r}"; expected version "${G}"`);const i=t=>{const n=(null==t?void 0:t.storeDomain)??e;return n.includes("://")?n:`https://${n}`};return{getShopifyDomain:i,getStorefrontApiUrl(e){const t=i(e),n=t+(t.endsWith("/")?"api":"/api");return B(t)?n:`${n}/${(null==e?void 0:e.storefrontApiVersion)??r}/graphql.json`},getPrivateTokenHeaders(n){if(!t&&!(null==n?void 0:n.privateStorefrontToken)&&!B(e))throw new Error(K+"You did not pass in a `privateStorefrontToken` while using `createStorefrontClient()` or `getPrivateTokenHeaders()`");return{"content-type":"graphql"===((null==n?void 0:n.contentType)??o)?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":r,"Shopify-Storefront-Private-Token":(null==n?void 0:n.privateStorefrontToken)??t??"",...(null==n?void 0:n.buyerIp)?{"Shopify-Storefront-Buyer-IP":n.buyerIp}:{}}},getPublicTokenHeaders(t){if(!n&&!(null==t?void 0:t.publicStorefrontToken)&&!B(e))throw new Error(K+"You did not pass in a `publicStorefrontToken` while using `createStorefrontClient()` or `getPublicTokenHeaders()`");return H((null==t?void 0:t.contentType)??o??"json",r,(null==t?void 0:t.publicStorefrontToken)??n??"")}}}function H(e,t,n){return{"content-type":"graphql"===e?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":t,"X-Shopify-Storefront-Access-Token":n}}const W=new Set,K="[h2:error:createStorefrontClient] ",z=(e,t="warn")=>{W.has(e)||(console[t](`[h2:${t}:createStorefrontClient] `+e),W.add(e))},Z={storeDomain:"test",storefrontToken:"abc123",storefrontApiVersion:G,countryIsoCode:"US",languageIsoCode:"EN",getStorefrontApiUrl:()=>"",getPublicTokenHeaders:()=>({}),getShopifyDomain:()=>""},J=(0,i.createContext)(Z);function Q({children:e,...t}){if(!(t.countryIsoCode&&t.languageIsoCode&&t.storeDomain&&t.storefrontToken&&t.storefrontApiVersion))throw new Error("Please provide the necessary props to ''");t.storefrontApiVersion!==G&&console.warn(`: This version of Hydrogen React is built for Shopify's Storefront API version ${G}, but it looks like you're using version ${t.storefrontApiVersion}. There may be issues or bugs if you use a mismatched version of Hydrogen React and the Storefront API.`);const n=(0,i.useMemo)((()=>{function e(e){const n=(null==e?void 0:e.storeDomain)??t.storeDomain;return n.includes("://")?n:`https://${n}`}return{...t,getPublicTokenHeaders:e=>H(e.contentType,t.storefrontApiVersion,e.storefrontToken??t.storefrontToken),getShopifyDomain:e,getStorefrontApiUrl(n){const r=e({storeDomain:(null==n?void 0:n.storeDomain)??t.storeDomain});return`${r}${r.endsWith("/")?"":"/"}api/${(null==n?void 0:n.storefrontApiVersion)??t.storefrontApiVersion}/graphql.json`}}}),[t]);return(0,a.jsx)(J.Provider,{value:n,children:e})}function X(){const e=(0,i.useContext)(J);if(!e)throw new Error("'useShop()' must be a descendent of ");return e}const ee="shopifyCartId",te="Shopify-Storefront-Id",ne="Shopify-Storefront-Y",re="Shopify-Storefront-S",oe="_shopify_y",ie="_shopify_s";var ae=new Set(["domain","path","max-age","expires","samesite","secure","httponly"]);const ce="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function se(){let e="";try{const t=window.crypto,n=new Uint16Array(31);t.getRandomValues(n);let r=0;e=ce.replace(/[x]/g,(e=>{const t=n[r]%16;return r++,("x"===e?t:3&t|8).toString(16)})).toUpperCase()}catch(t){e=ce.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(e){t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}()}-${e}`}function le(e){const t=function(e){let t,n,r,o,i={},a=0,c=e.split(/;\s*/g);for(;anull==e?void 0:e.cart}),"onCartActionEntry","onCartActionOptimisticUI",e],on:{RESOLVE:{target:(null==t?void 0:t.resolveTarget)||"idle",actions:[u({prevCart:e=>null==e?void 0:e.lastValidCart,cart:(e,t)=>{var n;return null==(n=null==t?void 0:t.payload)?void 0:n.cart},rawCartResult:(e,t)=>{var n;return null==(n=null==t?void 0:t.payload)?void 0:n.rawCartResult},errors:e=>{}})]},ERROR:{target:(null==t?void 0:t.errorTarget)||"error",actions:[u({prevCart:e=>null==e?void 0:e.lastValidCart,cart:e=>null==e?void 0:e.lastValidCart,errors:(e,t)=>{var n;return null==(n=null==t?void 0:t.payload)?void 0:n.errors}})]},CART_COMPLETED:{target:"cartCompleted",actions:u({prevCart:e=>{},cart:e=>{},lastValidCart:e=>{},rawCartResult:e=>{},errors:e=>{}})}},exit:["onCartActionComplete",...(null==t?void 0:t.exitActions)||[]]}}const de={CART_FETCH:{target:"cartFetching"},CART_CREATE:{target:"cartCreating"},CART_SET:{target:"idle",actions:[u({rawCartResult:(e,t)=>t.payload.cart,cart:(e,t)=>fe(t.payload.cart)})]}},pe={CARTLINE_ADD:{target:"cartLineAdding"},CARTLINE_UPDATE:{target:"cartLineUpdating"},CARTLINE_REMOVE:{target:"cartLineRemoving"},NOTE_UPDATE:{target:"noteUpdating"},BUYER_IDENTITY_UPDATE:{target:"buyerIdentityUpdating"},CART_ATTRIBUTES_UPDATE:{target:"cartAttributesUpdating"},DISCOUNT_CODES_UPDATE:{target:"discountCodesUpdating"}};function ye({numCartLines:e,onCartActionEntry:t,onCartActionOptimisticUI:n,onCartActionComplete:o,data:a,cartFragment:c,countryCode:l,languageCode:d}){const{cartFetch:f,cartCreate:m,cartLineAdd:v,cartLineUpdate:w,cartLineRemove:_,noteUpdate:h,buyerIdentityUpdate:S,cartAttributesUpdate:b,discountCodesUpdate:I}=function({numCartLines:e,cartFragment:t,countryCode:n="US",languageCode:r="EN"}){const o=function(){const{storefrontId:e,getPublicTokenHeaders:t,getStorefrontApiUrl:n}=X();return(0,i.useCallback)((({query:r,variables:o})=>{const i=t({contentType:"json"});e&&(i[te]=e);const a=le(document.cookie);return i[ne]=a[oe],i[re]=a[ie],fetch(n(),{method:"POST",headers:i,body:JSON.stringify({query:r.toString(),variables:o})}).then((e=>e.json())).catch((e=>({data:void 0,errors:null==e?void 0:e.toString()})))}),[t,e,n])}(),a=(0,i.useCallback)((i=>o({query:q(t),variables:{id:i,numCartLines:e,country:n,language:r}})),[o,t,e,n,r]),c=(0,i.useCallback)((i=>o({query:D(t),variables:{input:i,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),s=(0,i.useCallback)(((i,a)=>o({query:x(t),variables:{cartId:i,lines:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),l=(0,i.useCallback)(((i,a)=>o({query:V(t),variables:{cartId:i,lines:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),u=(0,i.useCallback)(((i,a)=>o({query:R(t),variables:{cartId:i,lines:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),d=(0,i.useCallback)(((i,a)=>o({query:U(t),variables:{cartId:i,note:a,numCartLines:e,country:n,language:r}})),[o,t,e,n,r]),p=(0,i.useCallback)(((i,a)=>o({query:$(t),variables:{cartId:i,buyerIdentity:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),y=(0,i.useCallback)(((i,a)=>o({query:j(t),variables:{cartId:i,attributes:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),f=(0,i.useCallback)(((i,a)=>o({query:F(t),variables:{cartId:i,discountCodes:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]);return(0,i.useMemo)((()=>({cartFetch:a,cartCreate:c,cartLineAdd:s,cartLineUpdate:l,cartLineRemove:u,noteUpdate:d,buyerIdentityUpdate:p,cartAttributesUpdate:y,discountCodesUpdate:f,cartFragment:t})),[a,c,s,l,u,d,p,y,f,t])}({numCartLines:e,cartFragment:c,countryCode:l,languageCode:d}),P=(0,i.useMemo)((()=>{return g({id:"Cart",initial:(e=a)?"idle":"uninitialized",context:{cart:e&&fe(e)},states:{uninitialized:{on:de},cartCompleted:{on:de},initializationError:{on:de},idle:{on:{...de,...pe}},error:{on:{...de,...pe}},cartFetching:ue("cartFetchAction",{errorTarget:"initializationError"}),cartCreating:ue("cartCreateAction",{errorTarget:"initializationError"}),cartLineRemoving:ue("cartLineRemoveAction"),cartLineUpdating:ue("cartLineUpdateAction"),cartLineAdding:ue("cartLineAddAction"),noteUpdating:ue("noteUpdateAction"),buyerIdentityUpdating:ue("buyerIdentityUpdateAction"),cartAttributesUpdating:ue("cartAttributesUpdateAction"),discountCodesUpdating:ue("discountCodesUpdateAction")}});var e}),[a]),[L,M,G]=function(e,t){var n,o,a=(0,i.useRef)(),c=E((n=function(){var n=[],o=function(e){var t=e.initialState,n=r.NotStarted,o=new Set,i={_machine:e,send:function(i){n===r.Running&&(t=e.transition(t,i),C(t,y(i)),o.forEach((function(e){return e(t)})))},subscribe:function(e){return o.add(e),e(t),{unsubscribe:function(){return o.delete(e)}}},start:function(o){if(o){var a="object"==typeof o?o:{context:e.config.context,value:o};t={value:a.value,actions:[],context:a.context,matches:p(a.value)}}else t=e.initialState;return n=r.Running,C(t,s),i},stop:function(){return n=r.Stopped,o.clear(),i},get state(){return t},get status(){return n}};return i}(g(e.config,t||e._options)),i=o.send;return o.send=function(e){o.status!==r.NotStarted?(i(e),a.current=o.state):n.push(e)},[o,n]},(o=i.useRef()).current||(o.current={v:n()}),o.current.v),2),l=c[0],u=c[1];A((function(){t&&(l._machine._options=t)}));var d=function(e){var t=(0,i.useCallback)((function(){return k(e)}),[e]),n=(0,i.useCallback)((function(t){return e.subscribe(t).unsubscribe}),[e]);return[T.useSyncExternalStoreWithSelector(n,t,t,O,N),e.send,e]}(l);return(0,i.useEffect)((function(){return l.start(a.current),u.forEach(l.send),a.current=l.state,function(){l.stop()}}),[]),d}(P,{actions:{cartFetchAction:async(e,t)=>{var n;if("CART_FETCH"!==t.type)return;const{data:r,errors:o}=await f(null==(n=null==t?void 0:t.payload)?void 0:n.cartId),i=me(t,null==r?void 0:r.cart,o);M(i)},cartCreateAction:async(e,t)=>{var n;if("CART_CREATE"!==t.type)return;const{data:r,errors:o}=await m(null==t?void 0:t.payload),i=me(t,null==(n=null==r?void 0:r.cartCreate)?void 0:n.cart,o);M(i)},cartLineAddAction:async(e,t)=>{var n,r;if("CARTLINE_ADD"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await v(e.cart.id,t.payload.lines),a=me(t,null==(r=null==o?void 0:o.cartLinesAdd)?void 0:r.cart,i);M(a)},cartLineUpdateAction:async(e,t)=>{var n,r;if("CARTLINE_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await w(e.cart.id,t.payload.lines),a=me(t,null==(r=null==o?void 0:o.cartLinesUpdate)?void 0:r.cart,i);M(a)},cartLineRemoveAction:async(e,t)=>{var n,r;if("CARTLINE_REMOVE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await _(e.cart.id,t.payload.lines),a=me(t,null==(r=null==o?void 0:o.cartLinesRemove)?void 0:r.cart,i);M(a)},noteUpdateAction:async(e,t)=>{var n,r;if("NOTE_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await h(e.cart.id,t.payload.note),a=me(t,null==(r=null==o?void 0:o.cartNoteUpdate)?void 0:r.cart,i);M(a)},buyerIdentityUpdateAction:async(e,t)=>{var n,r;if("BUYER_IDENTITY_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await S(e.cart.id,t.payload.buyerIdentity),a=me(t,null==(r=null==o?void 0:o.cartBuyerIdentityUpdate)?void 0:r.cart,i);M(a)},cartAttributesUpdateAction:async(e,t)=>{var n,r;if("CART_ATTRIBUTES_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await b(e.cart.id,t.payload.attributes),a=me(t,null==(r=null==o?void 0:o.cartAttributesUpdate)?void 0:r.cart,i);M(a)},discountCodesUpdateAction:async(e,t)=>{var n,r;if("DISCOUNT_CODES_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await I(e.cart.id,t.payload.discountCodes),a=me(t,null==(r=null==o?void 0:o.cartDiscountCodesUpdate)?void 0:r.cart,i);M(a)},...t&&{onCartActionEntry:(e,n)=>{(function(e){return"CART_CREATE"===e.type||"CARTLINE_ADD"===e.type||"CARTLINE_UPDATE"===e.type||"CARTLINE_REMOVE"===e.type||"NOTE_UPDATE"===e.type||"BUYER_IDENTITY_UPDATE"===e.type||"CART_ATTRIBUTES_UPDATE"===e.type||"DISCOUNT_CODES_UPDATE"===e.type})(n)&&t(e,n)}},...n&&{onCartActionOptimisticUI:u(((e,t)=>n(e,t)))},...o&&{onCartActionComplete:(e,t)=>{(function(e){return"RESOLVE"===e.type||"ERROR"===e.type||"CART_COMPLETED"===e.type})(t)&&o(e,t)}}}});return(0,i.useMemo)((()=>[L,M,G]),[L,M,G])}function fe(e){return{...e,lines:L(null==e?void 0:e.lines),note:e.note??void 0}}function me(e,t,n){return n?{type:"ERROR",payload:{errors:n,cartActionEvent:e}}:t?{type:"RESOLVE",payload:{cart:fe(t),rawCartResult:t,cartActionEvent:e}}:{type:"CART_COMPLETED",payload:{cartActionEvent:e}}}const ge=(0,i.createContext)(null);function ve(){const e=(0,i.useContext)(ge);if(!e)throw new Error("Expected a Cart Context, but no Cart Context was found");return e}function we({children:e,numCartLines:t,onCreate:n,onLineAdd:r,onLineRemove:o,onLineUpdate:c,onNoteUpdate:s,onBuyerIdentityUpdate:l,onAttributesUpdate:u,onDiscountCodesUpdate:d,onCreateComplete:p,onLineAddComplete:y,onLineRemoveComplete:f,onLineUpdateComplete:m,onNoteUpdateComplete:g,onBuyerIdentityUpdateComplete:v,onAttributesUpdateComplete:w,onDiscountCodesUpdateComplete:_,data:h,cartFragment:C=M,customerAccessToken:A,countryCode:S,languageCode:b}){var I,P,T,E,O,k,N;const L=X();if(!L)throw new Error(" needs to be a descendant of ");S=(S??L.countryIsoCode??"US").toUpperCase(),b=(b??L.languageIsoCode??"EN").toUpperCase(),S&&(S=S.toUpperCase());const[x,D]=(0,i.useState)(S),[R,V]=(0,i.useState)(A),U=(0,i.useRef)(!1);x===S&&R===A||(D(S),V(A),U.current=!1);const[$,j]=ye({numCartLines:t,data:h,cartFragment:C,countryCode:S,languageCode:b,onCartActionEntry(e,t){try{switch(t.type){case"CART_CREATE":return null==n?void 0:n();case"CARTLINE_ADD":return null==r?void 0:r();case"CARTLINE_REMOVE":return null==o?void 0:o();case"CARTLINE_UPDATE":return null==c?void 0:c();case"NOTE_UPDATE":return null==s?void 0:s();case"BUYER_IDENTITY_UPDATE":return null==l?void 0:l();case"CART_ATTRIBUTES_UPDATE":return null==u?void 0:u();case"DISCOUNT_CODES_UPDATE":return null==d?void 0:d()}}catch(e){console.error("Cart entry action failed",e)}},onCartActionOptimisticUI(e,t){var n,r,o,i;if(!e.cart)return{...e};switch(t.type){case"CARTLINE_REMOVE":return{...e,cart:{...e.cart,lines:null==(r=null==(n=null==e?void 0:e.cart)?void 0:n.lines)?void 0:r.filter((e=>(null==e?void 0:e.id)&&!t.payload.lines.includes(null==e?void 0:e.id)))}};case"CARTLINE_UPDATE":return{...e,cart:{...e.cart,lines:null==(i=null==(o=null==e?void 0:e.cart)?void 0:o.lines)?void 0:i.map((e=>{const n=t.payload.lines.find((({id:t})=>t===(null==e?void 0:e.id)));return n&&n.quantity?{...e,quantity:n.quantity}:e}))}}}return{...e}},onCartActionComplete(e,t){const n=t.payload.cartActionEvent;try{if("RESOLVE"===t.type)switch(n.type){case"CART_CREATE":return null==p?void 0:p();case"CARTLINE_ADD":return null==y?void 0:y();case"CARTLINE_REMOVE":return null==f?void 0:f();case"CARTLINE_UPDATE":return null==m?void 0:m();case"NOTE_UPDATE":return null==g?void 0:g();case"BUYER_IDENTITY_UPDATE":return function(e,t){var n,r;return!(!t.payload.buyerIdentity.countryCode||(null==(r=null==(n=e.cart)?void 0:n.buyerIdentity)?void 0:r.countryCode)===t.payload.buyerIdentity.countryCode)}(e,n)&&(U.current=!0),null==v?void 0:v();case"CART_ATTRIBUTES_UPDATE":return null==w?void 0:w();case"DISCOUNT_CODES_UPDATE":return null==_?void 0:_()}}catch(e){console.error("onCartActionComplete failed",e)}}}),F=(0,i.useRef)(!1),[q,G]=(0,i.useState)(!1),B=$.matches("cartCompleted"),Y=("idle"===$.value||"error"===$.value||"cartCompleted"===$.value)&&S!==(null==(T=null==(P=null==(I=null==$?void 0:$.context)?void 0:I.cart)?void 0:P.buyerIdentity)?void 0:T.countryCode)&&!$.context.errors,H=(0,i.useRef)(!1);(0,i.useEffect)((()=>{if(!F.current&&!H.current){if(!h&&he("localStorage")){H.current=!0;try{const e=window.localStorage.getItem(ee);e&&j({type:"CART_FETCH",payload:{cartId:e}})}catch(e){console.warn("error fetching cartId"),console.warn(e)}}F.current=!0,G(!0)}}),[h,F,j]),(0,i.useEffect)((()=>{Y&&!U.current&&j({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:{countryCode:S,customerAccessToken:A}}})}),[S,A,Y,U,j]);const W=(0,i.useCallback)((e=>{if(!F.current)return console.warn("Cart isn't ready yet");j(e)}),[j]);(0,i.useEffect)((()=>{var e,t,n;if((null==(t=null==(e=null==$?void 0:$.context)?void 0:e.cart)?void 0:t.id)&&he("localStorage"))try{window.localStorage.setItem(ee,null==(n=$.context.cart)?void 0:n.id)}catch(e){console.warn("Failed to save cartId to localStorage",e)}}),[null==(O=null==(E=null==$?void 0:$.context)?void 0:E.cart)?void 0:O.id]),(0,i.useEffect)((()=>{if(B&&he("localStorage"))try{window.localStorage.removeItem(ee)}catch(e){console.warn("Failed to delete cartId from localStorage",e)}}),[B]);const K=(0,i.useCallback)((e=>{var t,n;S&&!(null==(t=e.buyerIdentity)?void 0:t.countryCode)&&(null==e.buyerIdentity&&(e.buyerIdentity={}),e.buyerIdentity.countryCode=S),A&&!(null==(n=e.buyerIdentity)?void 0:n.customerAccessToken)&&(null==e.buyerIdentity&&(e.buyerIdentity={}),e.buyerIdentity.customerAccessToken=A),W({type:"CART_CREATE",payload:e})}),[S,A,W]),z=function(e){const[t,n]=(0,i.useTransition)(),[r,o]=(0,i.useState)(e),a=(0,i.useRef)(!1);t&&(a.current=!0);const c=(0,i.useRef)(!1);return!t&&a.current&&(c.current=!0),(0,i.useEffect)((()=>{n((()=>{c.current||o(e)}))}),[e]),c.current?e:r}($),Z=(0,i.useMemo)((()=>{var e,t,n,r;return{...(null==(e=null==z?void 0:z.context)?void 0:e.cart)??{lines:[],attributes:[]},status:_e(z.value),error:null==(t=null==z?void 0:z.context)?void 0:t.errors,totalQuantity:(null==(r=null==(n=null==z?void 0:z.context)?void 0:n.cart)?void 0:r.totalQuantity)??0,cartCreate:K,cartReady:q,linesAdd(e){var t,n;(null==(n=null==(t=null==z?void 0:z.context)?void 0:t.cart)?void 0:n.id)?W({type:"CARTLINE_ADD",payload:{lines:e}}):K({lines:e})},linesRemove(e){W({type:"CARTLINE_REMOVE",payload:{lines:e}})},linesUpdate(e){W({type:"CARTLINE_UPDATE",payload:{lines:e}})},noteUpdate(e){W({type:"NOTE_UPDATE",payload:{note:e}})},buyerIdentityUpdate(e){W({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:e}})},cartAttributesUpdate(e){W({type:"CART_ATTRIBUTES_UPDATE",payload:{attributes:e}})},discountCodesUpdate(e){W({type:"DISCOUNT_CODES_UPDATE",payload:{discountCodes:e}})},cartFragment:C}}),[K,q,null==(k=null==z?void 0:z.context)?void 0:k.cart,null==(N=null==z?void 0:z.context)?void 0:N.errors,z.value,C,W]);return(0,a.jsx)(ge.Provider,{value:Z,children:e})}function _e(e){switch(e){case"uninitialized":case"initializationError":return"uninitialized";case"idle":case"cartCompleted":case"error":return"idle";case"cartFetching":return"fetching";case"cartCreating":return"creating";case"cartLineAdding":case"cartLineRemoving":case"cartLineUpdating":case"noteUpdating":case"buyerIdentityUpdating":case"cartAttributesUpdating":case"discountCodesUpdating":return"updating"}}function he(e){let t;try{t=window[e];const n="__storage_test__";return t.setItem(n,n),t.removeItem(n),!0}catch(e){return!(!(e instanceof DOMException)||22!==e.code&&1014!==e.code&&"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||!t||0===t.length)}}const Ce=(0,i.createContext)(null);function Ae({children:e,data:t,initialVariantId:n}){const r=(0,i.useMemo)((()=>L(t.variants??{})),[t.variants]);if(!(o=r)||!Array.isArray(o))throw new Error(" requires 'product.variants.nodes' or 'product.variants.edges'");var o;const c=(0,i.useMemo)((()=>function(e){const t=e.reduce(((e,t)=>{var n;if(!t.selectedOptions)throw new Error("'getOptions' requires 'variant.selectedOptions'");return null==(n=null==t?void 0:t.selectedOptions)||n.forEach((t=>{e[(null==t?void 0:t.name)??""]=e[(null==t?void 0:t.name)??""]||new Set,e[(null==t?void 0:t.name)??""].add((null==t?void 0:t.value)??"")})),e}),{});return Object.keys(t).map((e=>({name:e,values:Array.from(t[e])})))}(r)),[r]),[s,l]=(0,i.useState)((()=>Ie(n,r))),[u,d]=(0,i.useState)((()=>Pe(s)));(0,i.useEffect)((()=>{const e=Ie(n,r);l(e),d(Pe(e))}),[n,r]);const p=(0,i.useCallback)(((e,t)=>{d((n=>{const o={...n,[e]:t};return l(be(r,o)),o}))}),[d,r]),y=(0,i.useCallback)(((e,t)=>{const n=be(r,{...u,[e]:t});return(null==n?void 0:n.availableForSale)??!0}),[u,r]),f=(0,i.useMemo)((()=>L(t.sellingPlanGroups??{}).map((e=>({...e,sellingPlans:L((null==e?void 0:e.sellingPlans)??{})})))),[t.sellingPlanGroups]),[m,g]=(0,i.useState)(void 0),v=(0,i.useMemo)((()=>{var e,t;if(s&&m){if(!(null==(e=s.sellingPlanAllocations)?void 0:e.nodes)&&!(null==(t=s.sellingPlanAllocations)?void 0:t.edges))throw new Error(": You must include 'sellingPlanAllocations.nodes' or 'sellingPlanAllocations.edges' in your variants in order to calculate selectedSellingPlanAllocation");return L(s.sellingPlanAllocations).find((e=>{var t;return(null==(t=null==e?void 0:e.sellingPlan)?void 0:t.id)===m.id}))}}),[s,m]),w=(0,i.useMemo)((()=>({product:t,variants:r,variantsConnection:t.variants,options:c,selectedVariant:s,setSelectedVariant:l,selectedOptions:u,setSelectedOption:p,setSelectedOptions:d,isOptionInStock:y,selectedSellingPlan:m,setSelectedSellingPlan:g,selectedSellingPlanAllocation:v,sellingPlanGroups:f,sellingPlanGroupsConnection:t.sellingPlanGroups})),[t,y,c,u,m,v,s,f,p,r]);return(0,a.jsx)(Ce.Provider,{value:w,children:e})}function Se(){const e=(0,i.useContext)(Ce);if(!e)throw new Error("'useProduct' must be a child of ");return e}function be(e,t){var n,r;if(e.length&&(null==(r=null==(n=null==e?void 0:e[0])?void 0:n.selectedOptions)?void 0:r.length)===Object.keys(t).length)return null==e?void 0:e.find((e=>Object.entries(t).every((([t,n])=>{var r;return null==(r=null==e?void 0:e.selectedOptions)?void 0:r.some((e=>(null==e?void 0:e.name)===t&&(null==e?void 0:e.value)===n))}))))}function Ie(e,t){if(e){const n=t.find((t=>(null==t?void 0:t.id)===e));return n||console.warn(" received a 'initialVariantId' prop, but could not actually find a variant with that ID"),n}return null===e?null:void 0===e?t.find((e=>null==e?void 0:e.availableForSale))||t[0]:void 0}function Pe(e){return(null==e?void 0:e.selectedOptions)?e.selectedOptions.reduce(((e,t)=>(e[(null==t?void 0:t.name)??""]=(null==t?void 0:t.value)??"",e)),{}):{}}function Te(e){const{as:t,onClick:n,defaultOnClick:r,children:o,buttonRef:c,...s}=e,l=(0,i.useCallback)((e=>{if(n){const t=n(e);if("boolean"==typeof t&&!1===t||(null==e?void 0:e.defaultPrevented))return}null==r||r(e)}),[r,n]),u=t||"button";return(0,a.jsx)(u,{ref:c,onClick:l,...s,children:o})}function Ee(e){const[t,n]=(0,i.useState)(!1),{variantId:r,quantity:o=1,attributes:c,sellingPlanId:s,onClick:l,children:u,accessibleAddingToCartLabel:d,...p}=e,{status:y,linesAdd:f}=ve(),{selectedVariant:m}=Se(),g=r??(null==m?void 0:m.id)??"",v=null===r||""===g||null===m||t||p.disabled;(0,i.useEffect)((()=>{t&&"idle"===y&&n(!1)}),[y,t]);const w=(0,i.useCallback)((()=>{n(!0),f([{quantity:o,merchandiseId:g||"",attributes:c,sellingPlanId:s}])}),[f,o,g,c,s]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Te,{...p,disabled:v,onClick:l,defaultOnClick:w,children:u}),d?(0,a.jsx)("p",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},role:"alert","aria-live":"assertive",children:t?d:null}):null]})}const Oe={PAGE_VIEW:"PAGE_VIEW",ADD_TO_CART:"ADD_TO_CART",PAGE_VIEW_2:"PAGE_VIEW_2",COLLECTION_VIEW:"COLLECTION_VIEW",PRODUCT_VIEW:"PRODUCT_VIEW",SEARCH_VIEW:"SEARCH_VIEW"},ke={article:"article",blog:"blog",captcha:"captcha",cart:"cart",collection:"collection",customersAccount:"customers/account",customersActivateAccount:"customers/activate_account",customersAddresses:"customers/addresses",customersLogin:"customers/login",customersOrder:"customers/order",customersRegister:"customers/register",customersResetPassword:"customers/reset_password",giftCard:"gift_card",home:"index",listCollections:"list-collections",forbidden:"403",notFound:"404",page:"page",password:"password",product:"product",policy:"policy",search:"search"},Ne={hydrogen:"hydrogen",headless:"headless"},Le={hydrogen:"6167201",headless:"12875497473"};function xe(e,t){return{schema_id:e,payload:t,metadata:{event_created_at_ms:Date.now()}}}function De(e){const t={id:"",resource:null,resourceId:null,search:"",searchParams:new URLSearchParams,hash:""};if("string"!=typeof e)return t;try{const{search:n,searchParams:r,pathname:o,hash:i}=new URL(e),a=o.split("/"),c=a[a.length-1],s=a[a.length-2];if(!c||!s)return t;return{id:`${c}${n}${i}`||"",resource:s??null,resourceId:c||null,search:n,searchParams:r,hash:i}}catch{return t}}function Re(e,t){return"object"!=typeof e?{}:(Object.entries(e).forEach((([e,n])=>{n&&(t[e]=n)})),t)}const Ve="trekkie_storefront_page_view/1.4",Ue="myshopify.dev";function $e(e){const t=e,{id:n,resource:r}=De(t.resourceId),o=r?r.toLowerCase():void 0;return[xe(Ve,Re({pageType:t.pageType,customerId:parseInt(De(t.customerId).id||"0"),resourceType:o,resourceId:parseInt(n)},je(t)))]}function je(e){return{appClientId:e.shopifySalesChannel?Le[e.shopifySalesChannel]:Le.headless,isMerchantRequest:Fe(e.url),hydrogenSubchannelId:e.storefrontId||e.hydrogenSubchannelId||"0",isPersistentCookie:e.hasUserConsent,uniqToken:e.uniqueToken,visitToken:e.visitToken,microSessionId:se(),microSessionCount:1,url:e.url,path:e.path,search:e.search,referrer:e.referrer,title:e.title,shopId:parseInt(De(e.shopId).id),currency:e.currency,contentLanguage:e.acceptedLanguage||"en"}}function Fe(e){if("string"!=typeof e)return!1;const t=new URL(e).hostname;return-1!==t.indexOf(Ue)||"localhost"===t}const qe="2025.1.3",Me="custom_storefront_customer_tracking/1.2",Ge="page_rendered",Be="collection_page_rendered",Ye="product_page_rendered",He="product_added_to_cart",We="search_submitted";function Ke(e){return{canonical_url:e.canonicalUrl||e.url,customer_id:parseInt(De(e.customerId).id||"0")}}function ze(e){return{source:e.shopifySalesChannel||Ne.headless,asset_version_id:e.assetVersionId||qe,hydrogenSubchannelId:e.storefrontId||e.hydrogenSubchannelId||"0",is_persistent_cookie:e.hasUserConsent,deprecated_visit_token:e.visitToken,unique_token:e.uniqueToken,event_time:Date.now(),event_id:se(),event_source_url:e.url,referrer:e.referrer,user_agent:e.userAgent,navigation_type:e.navigationType,navigation_api:e.navigationApi,shop_id:parseInt(De(e.shopId).id),currency:e.currency,ccpa_enforced:e.ccpaEnforced||!1,gdpr_enforced:e.gdprEnforced||!1,gdpr_enforced_as_string:e.gdprEnforced?"true":"false",analytics_allowed:e.analyticsAllowed||!1,marketing_allowed:e.marketingAllowed||!1,sale_of_data_allowed:e.saleOfDataAllowed||!1}}function Ze(e){return e?e.map((e=>{const t=Re({variant_gid:e.variantGid,category:e.category,sku:e.sku,product_id:parseInt(De(e.productGid).id),variant_id:parseInt(De(e.variantGid).id)},{product_gid:e.productGid,name:e.name,variant:e.variantName||"",brand:e.brand,price:parseFloat(e.price),quantity:Number(e.quantity||0)});return JSON.stringify(t)})):[]}function Je(e,t){const{eventName:n,payload:r}=e;if(!r.hasUserConsent)return Promise.resolve();let o=[];const i=r;return n===Oe.PAGE_VIEW?o=o.concat($e(i),function(e){const t=e,n=Ke(t),r=t.pageType,o=[];switch(o.push(xe(Me,Re({event_name:Ge,...n},ze(t)))),r){case ke.collection:o.push(xe(Me,Re({event_name:Be,...n,collection_name:t.collectionHandle,collection_id:parseInt(De(t.collectionId).id)},ze(t))));break;case ke.product:o.push(xe(Me,Re({event_name:Ye,...n,products:Ze(t.products),total_value:t.totalValue},ze(t))));break;case ke.search:o.push(xe(Me,Re({event_name:We,...n,search_string:t.searchString},ze(t))))}return o}(i)):n===Oe.ADD_TO_CART?o=o.concat(function(e){const t=e,n=De(t.cartId);return[xe(Me,Re({event_name:He,customerId:t.customerId,cart_token:(null==n?void 0:n.id)?`${n.id}`:null,total_value:t.totalValue,products:Ze(t.products),customer_id:parseInt(De(t.customerId).id||"0")},ze(t)))]}(r)):n===Oe.PAGE_VIEW_2?o=o.concat($e(i),function(e){const t=e,n=Ke(t);return[xe(Me,Re({event_name:Ge,...n},ze(t)))]}(i)):n===Oe.COLLECTION_VIEW?o=o.concat(function(e){const t=e,n=Ke(t);return[xe(Me,Re({event_name:Be,...n,collection_name:t.collectionHandle,collection_id:parseInt(De(t.collectionId).id)},ze(t)))]}(i)):n===Oe.PRODUCT_VIEW?o=o.concat(function(e){const t=e,n=Ke(t);return[xe(Me,Re({event_name:Ye,...n,products:Ze(t.products),total_value:t.totalValue},ze(t)))]}(i)):n===Oe.SEARCH_VIEW&&(o=o.concat(function(e){const t=e,n=Ke(t);return[xe(Me,Re({event_name:We,...n,search_string:t.searchString},ze(t)))]}(i))),o.length?function(e,t){if("undefined"!=typeof window&&window.navigator&&/Chrome-Lighthouse/.test(window.navigator.userAgent))return Promise.resolve();const n={events:e,metadata:{event_sent_at_ms:Date.now()}};try{return fetch(t?`https://${t}/.well-known/shopify/monorail/unstable/produce_batch`:"https://monorail-edge.shopifysvc.com/unstable/produce_batch",{method:"post",headers:{"content-type":"text/plain"},body:JSON.stringify(n)}).then((e=>{if(!e.ok)throw new Error("Response failed");return e.text()})).then((e=>{e&&JSON.parse(e).result.forEach((e=>{200!==e.status&&console.error(Qe,"\n\n",e.message)}))})).catch((e=>{console.error(Qe,e)}))}catch(e){return Promise.resolve()}}(o,t):Promise.resolve()}const Qe="sendShopifyAnalytics request is unsuccessful";function Xe(){if("undefined"==typeof document&&(console.error("getClientBrowserParameters should only be used within the useEffect callback or event handlers"),1))return{uniqueToken:"",visitToken:"",url:"",path:"",search:"",referrer:"",title:"",userAgent:"",navigationType:"",navigationApi:""};const[e,t]=function(){try{let e="PerformanceNavigationTiming",t=function(){try{const e=(null==performance?void 0:performance.getEntriesByType)&&(null==performance?void 0:performance.getEntriesByType("navigation"));if(e&&e[0]){const e=window.performance.getEntriesByType("navigation")[0].type;return e&&e.toString()}}catch(e){}}();return t||(t=function(){var e,t;try{if(PerformanceNavigation&&null!==(null==(e=null==performance?void 0:performance.navigation)?void 0:e.type)&&void 0!==(null==(t=null==performance?void 0:performance.navigation)?void 0:t.type)){const e=performance.navigation.type;switch(e){case PerformanceNavigation.TYPE_NAVIGATE:return"navigate";case PerformanceNavigation.TYPE_RELOAD:return"reload";case PerformanceNavigation.TYPE_BACK_FORWARD:return"back_forward";default:return`unknown: ${e}`}}}catch(e){}}(),e="performance.navigation"),t?[t,e]:["unknown","unknown"]}catch(e){}return["error","error"]}(),n=le(document.cookie);return{uniqueToken:n[oe],visitToken:n[ie],url:location.href,path:location.pathname,search:location.search,referrer:document.referrer,title:document.title,userAgent:navigator.userAgent,navigationType:e,navigationApi:t}}function et(e){const{cartCreate:t,checkoutUrl:n}=ve(),[r,o]=(0,i.useState)(!1),{quantity:c,variantId:s,sellingPlanId:l,onClick:u,attributes:d,children:p,...y}=e;(0,i.useEffect)((()=>{r&&n&&(window.location.href=n)}),[r,n]);const f=(0,i.useCallback)((()=>{o(!0),t({lines:[{quantity:c??1,merchandiseId:s,attributes:d,sellingPlanId:l}]})}),[t,c,s,d,l]);return(0,a.jsx)(Te,{disabled:r??y.disabled,...y,onClick:u,defaultOnClick:f,children:p})}function tt(e){const[t,n]=(0,i.useState)(!1),{status:r,checkoutUrl:o}=ve(),{children:c,...s}=e;return(0,i.useEffect)((()=>{t&&o&&"idle"===r&&(window.location.href=o)}),[t,r,o]),(0,a.jsx)(Te,{...s,disabled:t||s.disabled,onClick:()=>n(!0),children:c})}function nt(e){const{countryIsoCode:t,languageIsoCode:n}=X(),r=n.includes("_")?n.replace("_","-"):`${n}-${t}`;if(!r)throw new Error("useMoney(): Unable to get 'locale' from 'useShop()', which means that 'locale' was not passed to ''. 'locale' is required for 'useMoney()' to work");const o=parseFloat(e.amount),{defaultFormatter:a,nameFormatter:c,narrowSymbolFormatter:s,withoutTrailingZerosFormatter:l,withoutCurrencyFormatter:u,withoutTrailingZerosOrCurrencyFormatter:d}=(0,i.useMemo)((()=>{const t={style:"currency",currency:e.currencyCode};return{defaultFormatter:ot(r,t),nameFormatter:ot(r,{...t,currencyDisplay:"name"}),narrowSymbolFormatter:ot(r,{...t,currencyDisplay:"narrowSymbol"}),withoutTrailingZerosFormatter:ot(r,{...t,minimumFractionDigits:0,maximumFractionDigits:0}),withoutCurrencyFormatter:ot(r),withoutTrailingZerosOrCurrencyFormatter:ot(r,{minimumFractionDigits:0,maximumFractionDigits:0})}}),[e.currencyCode,r]),p=e=>"currency"===e.type,y=(0,i.useMemo)((()=>({original:()=>e,currencyCode:()=>e.currencyCode,localizedString:()=>a().format(o),parts:()=>a().formatToParts(o),withoutTrailingZeros:()=>o%1==0?l().format(o):a().format(o),withoutTrailingZerosAndCurrency:()=>o%1==0?d().format(o):u().format(o),currencyName:()=>{var t;return(null==(t=c().formatToParts(o).find(p))?void 0:t.value)??e.currencyCode},currencySymbol:()=>{var t;return(null==(t=a().formatToParts(o).find(p))?void 0:t.value)??e.currencyCode},currencyNarrowSymbol:()=>{var e;return(null==(e=s().formatToParts(o).find(p))?void 0:e.value)??""},amount:()=>a().formatToParts(o).filter((e=>["decimal","fraction","group","integer","literal"].includes(e.type))).map((e=>e.value)).join("")})),[e,o,c,a,s,u,l,d]);return(0,i.useMemo)((()=>new Proxy(y,{get:(e,t)=>{var n;return null==(n=Reflect.get(e,t))?void 0:n.call(null)}})),[y])}const rt=new Map;function ot(e,t){const n=JSON.stringify([e,t]);return function(){let r=rt.get(n);return r||(r=new Intl.NumberFormat(e,t),rt.set(n,r)),r}}function it({data:e,as:t,withoutCurrency:n,withoutTrailingZeros:r,measurement:o,measurementSeparator:i="/",...c}){if("string"!=typeof(s=e).amount||!s.amount||"string"!=typeof s.currencyCode||!s.currencyCode)throw new Error(" needs a valid 'data' prop that has 'amount' and 'currencyCode'");var s;const l=nt(e),u=t??"div";let d=l.localizedString;return(n||r)&&(d=n&&!r?l.amount:!n&&r?l.withoutTrailingZeros:l.withoutTrailingZerosAndCurrency),(0,a.jsxs)(u,{...c,children:[d,o&&o.referenceUnit&&(0,a.jsxs)(a.Fragment,{children:[i,o.referenceUnit]})]})}function at(e){const{cost:t}=ve(),{amountType:n="total",children:r,...o}=e;let i;return"total"==n?i=null==t?void 0:t.totalAmount:"subtotal"==n?i=null==t?void 0:t.subtotalAmount:"tax"==n?i=null==t?void 0:t.totalTaxAmount:"duty"==n&&(i=null==t?void 0:t.totalDutyAmount),null==i?null:(0,a.jsx)(it,{...o,data:i,children:r})}const ct=(0,i.createContext)(null);function st(){const e=(0,i.useContext)(ct);if(null==e)throw new Error("Expected a cart line context but none was found");return e}function lt({children:e,line:t}){return(0,a.jsx)(ct.Provider,{value:t,children:e})}function ut(e){const t=st(),{as:n,...r}=e,o=n||"span";return(0,a.jsx)(o,{...r,children:t.quantity})}function dt(e){const{status:t,linesRemove:n,linesUpdate:r}=ve(),o=st(),{children:c,adjust:s,onClick:l,...u}=e,d=(0,i.useCallback)((()=>{if("remove"===s)return void n([(null==o?void 0:o.id)??""]);const e="decrease"===s?((null==o?void 0:o.quantity)??0)-1:((null==o?void 0:o.quantity)??0)+1;if(e<=0)return void n([(null==o?void 0:o.id)??""]);const t={id:(null==o?void 0:o.id)??"",quantity:e,attributes:(null==o?void 0:o.attributes)??[]};r([t])}),[s,null==o?void 0:o.attributes,null==o?void 0:o.id,null==o?void 0:o.quantity,n,r]),p=u.disabled;return(0,a.jsx)(Te,{...u,onClick:l,defaultOnClick:d,disabled:void 0!==p?p:"idle"!==t,children:c})}const pt={DateTime:"string",Decimal:"string",HTML:"string",URL:"string",Color:"string",UnsignedInt64:"string"},yt={DateTime:"string",Decimal:"string",HTML:"string",ISO8601DateTime:"string",URL:"string",UnsignedInt64:"string"},ft=(0,i.forwardRef)(((e,t)=>{const{data:n,options:r,id:o=n.id,frameBorder:i="0",allow:c="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:s=!0,loading:l="lazy",...u}=e;if(!n.embedUrl)throw new Error(" requires the 'embedUrl' property");let d=n.embedUrl;if(r){const e=new URL(n.embedUrl);for(const[t,n]of Object.entries(r))void 0!==n&&e.searchParams.set(t,n.toString());d=e.toString()}return(0,a.jsx)("iframe",{...u,id:o??n.embedUrl,title:n.alt??n.id??"external video",frameBorder:i,allow:c,allowFullScreen:s,src:d,loading:l,ref:t})})),mt={OPTION:":",END_OF_PREFIX:",",SEQUENCE_GAP:" ",RANGE:"-"},gt=(()=>{const e=new Map;return function(t,n){var r;if(0===t.length)return!1;if(!e.has(n)){const t=new Set;for(const e of vt(n)){t.add(e.join(","));for(let n=0;ne.replace(/^v1_/,"");function _t(e){return Object.assign({},...e.map((e=>({[e.name]:e.value}))))}function ht(e){return JSON.stringify(_t(e))}function Ct(e){return Array.isArray(e)?JSON.stringify(Object.assign({},...e.map((e=>({[e.name]:e.value}))))):JSON.stringify(e)}const At=["options","selectedOrFirstAvailableVariant","adjacentVariants"],St=["handle","encodedVariantExistence","encodedVariantAvailability"];function bt(e){return console.error(`[h2:error:getProductOptions] product.${e} is missing. Make sure you query for this field from the Storefront API.`),!1}function It(e,t=!1){var n;let r=!0;const o=Object.keys(e);if((t?[...At,...St]:At).forEach((e=>{o.includes(e)||(r=bt(e))})),e.options){const o=null==e?void 0:e.options[0];if(t&&!(null==o?void 0:o.name)&&(r=bt("options.name")),null==(n=null==e?void 0:e.options[0])?void 0:n.optionValues){let n=e.options[0].optionValues[0];t&&!(null==n?void 0:n.name)&&(r=bt("options.optionValues.name")),n=e.options[0].optionValues.filter((e=>!!(null==e?void 0:e.firstSelectableVariant)))[0],(null==n?void 0:n.firstSelectableVariant)&&(r=Pt(n.firstSelectableVariant,"options.optionValues.firstSelectableVariant",r,t))}else r=bt("options.optionValues")}return e.selectedOrFirstAvailableVariant&&(r=Pt(e.selectedOrFirstAvailableVariant,"selectedOrFirstAvailableVariant",r,t)),e.adjacentVariants&&e.adjacentVariants[0]&&(r=Pt(e.adjacentVariants[0],"adjacentVariants",r,t)),r?e:{}}function Pt(e,t,n,r){var o;let i=n;if(r&&!(null==(o=e.product)?void 0:o.handle)&&(i=bt(`${t}.product.handle`)),e.selectedOptions){const n=e.selectedOptions[0];(null==n?void 0:n.name)||(i=bt(`${t}.selectedOptions.name`)),(null==n?void 0:n.value)||(i=bt(`${t}.selectedOptions.value`))}else i=bt(`${t}.selectedOptions`);return i}function Tt(e){const t=It(e);if(!t.options)return[];const n={};t.options.map((e=>{var t;null==(t=e.optionValues)||t.map((e=>{if(e.firstSelectableVariant){const t=ht(e.firstSelectableVariant.selectedOptions);n[t]=e.firstSelectableVariant}}))})),t.adjacentVariants.map((e=>{const t=ht(e.selectedOptions);n[t]=e}));const r=t.selectedOrFirstAvailableVariant;if(r){const e=ht(r.selectedOptions);n[e]=r}return Object.values(n)}function Et(e){const t=It(e,!0);if(!t.options)return[];const{options:n,selectedOrFirstAvailableVariant:r,adjacentVariants:o,encodedVariantExistence:i,encodedVariantAvailability:a,handle:c}=t,s=null==r?void 0:r.selectedOptions.map((e=>e.name)),l=n.filter((e=>s&&s.indexOf(e.name)>=0)),u=function(e){return Object.assign({},...e.map((e=>({[e.name]:Object.assign({},...(null==e?void 0:e.optionValues)?e.optionValues.map(((e,t)=>({[e.name]:t}))):[])}))))}(n),d=function(e){return Object.assign({},...e.map((e=>{const t=Ct(e.selectedOptions||[]);return{[t]:e}})))}(r?[r,...o]:o),p=_t(r?r.selectedOptions:[]),y=l.map(((e,t)=>({...e,optionValues:e.optionValues.map((n=>{var r;const o={...p};o[e.name]=n.name;const s=Ct(o||[]),l=function(e,t){return Object.keys(e).map((n=>t[n]?t[n][e[n]]:null)).filter((e=>null!==e))}(o||[],u),y=l.slice(0,t+1),f=gt(y,i||""),m=gt(y,a||""),g=d[s]||n.firstSelectableVariant;let v={};g&&(v=_t(g.selectedOptions||[]));const w=new URLSearchParams(v),_=(null==(r=null==g?void 0:g.product)?void 0:r.handle)||c;return{...n,variant:g,handle:_,variantUriQuery:w.toString(),selected:p[e.name]===n.name,exists:f,available:m,isDifferentProduct:_!==c}}))})));return y}const Ot="#graphql\n fragment Image on Image {\n altText\n url\n width\n height\n }\n",kt=i.forwardRef((({alt:e,aspectRatio:t,crop:n="center",data:r,decoding:o="async",height:c="auto",loader:s=Dt,loading:l="lazy",sizes:u,src:d,srcSetOptions:p={intervals:15,startingWidth:200,incrementSize:200,placeholderWidth:100},width:y="100%",...f},m)=>{const g=i.useMemo((()=>{const e=(null==r?void 0:r.width)&&(null==r?void 0:r.height)?null==r?void 0:r.width:void 0,t=(null==r?void 0:r.width)&&(null==r?void 0:r.height)?null==r?void 0:r.height:void 0;return{width:e,height:t,unitsMatch:Boolean(Rt(e,t))}}),[r]),v=i.useMemo((()=>{const n=Vt((y||"100%").toString()),o=`${n.number}${n.unit}`,i=null==c,a=i?null:Vt(c.toString()),s=a?`${a.number}${a.unit}`:"";return{width:o,height:i?"auto":s,src:d||(null==r?void 0:r.url),alt:(null==r?void 0:r.altText)&&!e?null==r?void 0:r.altText:e||"",aspectRatio:t||(g.unitsMatch?[Ut(g.width),Ut(g.height)].join("/"):void 0)}}),[y,c,d,r,e,t,g,null==f?void 0:f.key]),{intervals:w,startingWidth:_,incrementSize:h,placeholderWidth:C}=p,A=i.useMemo((()=>function(e="100%",t,n,r){const o=Array.from({length:t},((e,t)=>t*r+n)),i=Array.from({length:3},((t,n)=>(n+1)*(Ut(e)??0)));return $t(e)?i:o}(y,w,_,h)),[y,w,_,h]);return $t(v.width)?(0,a.jsx)(Nt,{aspectRatio:t,crop:n,decoding:o,height:c,imageWidths:A,loader:s,loading:l,normalizedProps:v,passthroughProps:f,ref:m,width:y,data:r}):(0,a.jsx)(Lt,{aspectRatio:t,crop:n,decoding:o,imageWidths:A,loader:s,loading:l,normalizedProps:v,passthroughProps:f,placeholderWidth:C,ref:m,sizes:u,data:r})})),Nt=i.forwardRef((({aspectRatio:e,crop:t,decoding:n,height:r,imageWidths:o,loader:c=Dt,loading:s,normalizedProps:l,passthroughProps:u,width:d,data:p},y)=>{const f=i.useMemo((()=>{const n=Ut(d),i=Ut(r),a=e||(Rt(l.width,l.height)?[n,i].join("/"):l.aspectRatio?l.aspectRatio:void 0),s=void 0===o?void 0:qt(o,a,t,{width:(null==p?void 0:p.width)??void 0,height:(null==p?void 0:p.height)??void 0}),u=i||(a&&n?n*(Ft(a)??1):void 0);return{width:n,aspectRatio:a,height:u,srcSet:jt(l.src,s,c),src:c({src:l.src,width:n,height:u,crop:"auto"===l.height?void 0:t})}}),[e,t,p,r,o,c,l,d]);return(0,a.jsx)("img",{ref:y,alt:l.alt,decoding:n,height:f.height,loading:s,src:f.src,srcSet:f.srcSet,width:f.width,style:{aspectRatio:f.aspectRatio,...u.style},...u})})),Lt=i.forwardRef((({crop:e,decoding:t,imageWidths:n,loader:r=Dt,loading:o,normalizedProps:c,passthroughProps:s,placeholderWidth:l,sizes:u,data:d},p)=>{const y=i.useMemo((()=>{const t=void 0===n?void 0:qt(n,c.aspectRatio,e,{width:(null==d?void 0:d.width)??void 0,height:(null==d?void 0:d.height)??void 0}),o=c.aspectRatio&&l?l*(Ft(c.aspectRatio)??1):void 0;return{placeholderHeight:o,srcSet:jt(c.src,t,r),src:r({src:c.src,width:l,height:o,crop:e})}}),[e,d,n,r,c,l]);return(0,a.jsx)("img",{ref:p,alt:c.alt,decoding:t,height:y.placeholderHeight,loading:o,sizes:u,src:y.src,srcSet:y.srcSet,width:l,...s,style:{width:c.width,aspectRatio:c.aspectRatio,...s.style}})})),xt="https://placeholder.shopify.com";function Dt({src:e,width:t,height:n,crop:r}){if(!e)return"";const o=new URL(e,xt);return t&&o.searchParams.append("width",Math.round(t).toString()),n&&o.searchParams.append("height",Math.round(n).toString()),r&&o.searchParams.append("crop",r),o.href.replace(xt,"")}function Rt(e="100%",t="auto"){return Vt(e.toString()).unit===Vt(t.toString()).unit}function Vt(e){const t=e.replace(/[0-9.]/g,""),n=parseFloat(e.replace(t,""));return{unit:""===t?void 0===n?"auto":"px":t,number:n}}function Ut(e){if(void 0===e)return;const{unit:t,number:n}=Vt(e.toString());switch(t){case"em":case"rem":return 16*n;case"px":case"":return n;default:return}}function $t(e){return"number"==typeof e||/\d(px|em|rem)$/.test(e)}function jt(e,t,n=Dt){return e?0!==(null==t?void 0:t.length)&&t?t.map(((r,o)=>`${n({src:e,width:r.width,height:r.height,crop:r.crop})} ${3===t.length?`${o+1}x`:`${r.width??0}w`}`)).join(", "):e:""}function Ft(e){if(!e)return;const[t,n]=e.split("/");return 1/(Number(t)/Number(n))}function qt(e,t,n="center",r){if(e)return e.map((e=>({width:e,height:t?e*(Ft(t)??1):void 0,crop:n}))).filter((({width:e,height:t})=>!((null==r?void 0:r.width)&&e>r.width||(null==r?void 0:r.height)&&t&&t>r.height)))}const Mt={};function Gt(e,t){const[n,r]=(0,i.useState)("loading");return(0,i.useEffect)((()=>{(function(e,t){const n=Mt[e];if(n)return n;const r=new Promise(((n,r)=>{const o=document.createElement("script");(null==t?void 0:t.module)?o.type="module":o.type="text/javascript",o.src=e,o.onload=()=>{n(!0)},o.onerror=()=>{r(!1)},"head"===(null==t?void 0:t.in)?document.head.appendChild(o):document.body.appendChild(o);const i=null==t?void 0:t.attributes;i&&Object.keys(i).forEach((e=>{o.setAttribute(e,i[e])}))}));return Mt[e]=r,r})(e,t).then((()=>r("done"))).catch((()=>r("error")))}),[e]),n}const Bt=(0,i.forwardRef)(((e,t)=>{var n;const{data:r,previewImageOptions:o,id:c=r.id,playsInline:s=!0,controls:l=!0,sourceProps:u={},...d}=e,p=Dt({src:(null==(n=r.previewImage)?void 0:n.url)??"",...o});if(!r.sources)throw new Error("