/*! For license information please see vendor.ead0879ea793120e51fd.js.LICENSE.txt */ (self.webpackChunkui=self.webpackChunkui||[]).push([[68],{21:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.initBentoAnalytics=t.logCollectionView=t.loadShopifyAccount=t.DEFAULT_SHOPIFY_ACCOUNT_DATA=void 0,t.logViewCart=async function(){const e=(0,y.uuid)();await(0,y.callOrlyTagHooks)("viewCart",e)},t.logViewContent=async function(e){const n=(0,y.uuid)(),o=[(0,l.logGoogleViewContent)(e,n),(0,p.logSnapchatViewContent)(e,n)];await(0,t.loadShopifyAccount)();const r=[(0,y.callOrlyTagHooks)("viewContent",e,n),(0,d.logOutsmartlyViewedProduct)(e,n),(0,d.logOutsmartlySelectedVariant)(e,n),(0,s.logFacebookViewContent)(e,n)];await Promise.allSettled([...o,...r])},t.loadScript=h,t.loadAccount=w,t.logClickContent=async function(e,t,n=0){const o=window.__APP_CONFIG__.eventId||(0,y.uuid)();await(0,y.callOrlyTagHooks)("clickContent",e,t,n,o)},t.logSignUp=async function(e){const t=(0,y.uuid)();await Promise.allSettled([(0,y.callOrlyTagHooks)("signUp",e,t)])},t.logSignIn=async function(e){const t=(0,y.uuid)();await Promise.allSettled([(0,y.callOrlyTagHooks)("signIn",e,t)])},t.logSearch=async function(e,t){const n=(0,y.uuid)();await Promise.allSettled([(0,y.callOrlyTagHooks)("search",e,t,n)])};const r=n(14),a=n(94),i=n(178),c=n(249),s=n(251),l=n(179),d=n(180),u=n(29),p=n(182),y=n(11),m=o(n(35));async function f(e,t){const n=await(0,y.getCartComponents)(e);await Promise.allSettled(n.map(A).flatMap((e=>[(0,y.callOrlyTagHooks)("addToCart",e,t),(0,s.logAddToCartFacebook)(e,t),(0,u.logAddToCartPinterest)(e,t),(0,p.logAddToCartSnapchat)(e,t),(0,l.logAddToCartGoogleAnalytics)(e,t)])))}async function g(e,t){await(0,y.callOrlyTagHooks)("removeFromCart",e,t)}async function v(){const e=window.__APP_CONFIG__.eventId||(0,y.uuid)(),n=(0,t.loadShopifyAccount)(),o=n.then((async e=>{await w(e)}));await Promise.allSettled([(0,y.callOrlyTagHooks)("pageView",e,n),(0,l.logGooglePageView)(e,n),(0,p.logSnapchatPageView)(e,n),(0,d.logOutsmartlyPageView)(e,n),(0,u.logPinterestPageView)(e,n),(0,s.logFacebookPageView)(e,n),o])}async function h(){await Promise.allSettled([(0,y.callOrlyTagHooks)("loadScript"),new Promise((e=>{(0,l.loadGoogleAnalytics)(),e()}))])}async function w(e){await Promise.allSettled([(0,y.callOrlyTagHooks)("loadAccount",e),new Promise((t=>{(0,p.loadSnapchat)(e),t()}))])}t.DEFAULT_SHOPIFY_ACCOUNT_DATA={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},t.loadShopifyAccount=(0,m.default)((async()=>{const e=window.__APP_CONFIG__.ANALYTICS.accountEndpoint??"/api/account";try{return await fetch(e).then((e=>e.json())).catch((n=>(console.error("loadShopifyAccount from endpoint failed.\n",`Tried to fetch from: ${e}\n.`,"Returning a default account...\n",`error: ${JSON.stringify(n,Object.getOwnPropertyNames(n),2)}`),t.DEFAULT_SHOPIFY_ACCOUNT_DATA)))}catch(n){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(n,Object.getOwnPropertyNames(n),2)}`),t.DEFAULT_SHOPIFY_ACCOUNT_DATA}})),t.logCollectionView=(0,m.default)((async(e,t)=>{const n=(0,y.uuid)();await Promise.allSettled([(0,y.callOrlyTagHooks)("collectionView",e,t,n),(0,u.logPinterestCollectionView)(e,t,n),(0,l.logGoogleCollectionView)(e,t,n)])}));const _=async(e,t)=>{const n=await fetch(e,t),o=await n.json();return queueMicrotask((()=>function(e,t,n){if(!(0,y.isShopifyCart)(n)){if(!(0,y.isShopifyCartError)(n))throw new Error("unexpected response, not a ShopifyCart or ShopifyCartError");return n}const o=(0,y.normalizeCart)(n),r=t.get("x-event-id")??(0,y.uuid)();e.startsWith("/cart/add.js")?C(o,r):e.startsWith("/cart/change.js")||e.startsWith("/cart/update.js")?S(o,r):e.startsWith("/cart.json")?(0,y.updateCart)(o):console.error(`Unknown URL: ${e}`)}(e,n.headers,o))),o},C=(e,t)=>{const n=(0,y.getOldCart)();if(!n)return void(0,y.updateCart)(e);const o=new Map(n.items.map((e=>[e.key,e])));e.items.forEach((e=>{const n=o.get(e.key),r=n?.quantity||0,a=e.quantity-r;f({...e,quantity:a},t).catch((e=>{console.error(e)}))}))};function A(e){try{const t=e.properties,n=t._olpid??e.product_id.toString(),o=t._olvid??e.variant_id.toString();return{...e,product_id:Number.parseInt(n.toString()),variant_id:Number.parseInt(o.toString())}}catch{return e}}const S=(e,t)=>{const n=(0,y.getOldCart)();if(!n)return void(0,y.updateCart)(e);const o=(0,y.getItemCounts)(n.items),r=(0,y.getItemCounts)(e.items);for(const[e,n]of r.entries()){const r=o.get(e),a=r?.quantity||0,i=n.quantity-a;i>0?f({...n,quantity:i},t).catch((e=>{console.error(e)})):i<0&&g({...n,quantity:-i},t).catch((e=>{console.error(e)}))}for(const[e,n]of o.entries())r.has(e)||g(n,t).catch((e=>{console.error(e)}));(0,y.updateCart)(e)};t.initBentoAnalytics=(0,m.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=_;const t={elevar:r.initElevar};for(const n of(0,y.entries)(e))if(n){const[e,o]=n;o&&t[e]()}(0,a.initKlaviyo)(),(0,i.initShopify)(),(0,c.initTikTok)();try{await h().then(v)}catch(e){console.log(e)}}))},258:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useViewContent=function(e){(0,o.useEffect)((()=>{(0,r.logViewContent)(e).catch((e=>{console.error(e)}))}),[e.product_id,e.variant_id])},t.useCollectionView=function(e,t){(0,o.useEffect)((()=>{(0,r.logCollectionView)(e,t).catch((e=>{console.error(e)}))}),[e,t])};const o=n(2),r=n(21)},247:(e,t,n)=>{"use strict";t.a=void 0;n(14),n(178),n(179),n(29),n(182),n(253),n(94),n(255),n(256),n(257),n(180),n(258);var o=n(21);Object.defineProperty(t,"a",{enumerable:!0,get:function(){return o.initBentoAnalytics}});n(11)},256:(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,o.loadScriptWithDelay)({src:`//cdn.attn.tv/${e}/dtag.js`,id:"attn-script",timeout:1e3*t,anonymous:!1})};const o=n(11)},14:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.logElevarSearch=t.logElevarViewCart=t.logElevarViewContent=t.logElevarClickContent=t.logElevarCollectionView=t.logElevarRemoveFromCart=t.logElevarAddToCart=t.logElevarPageView=void 0,t.initElevar=function(){"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",t.logElevarAddToCart],["removeFromCart",t.logElevarRemoveFromCart],["clickContent",t.logElevarClickContent],["collectionView",t.logElevarCollectionView],["pageView",t.logElevarPageView],["viewCart",t.logElevarViewCart],["viewContent",t.logElevarViewContent],["loadScript",c],["search",t.logElevarSearch]))},t.loadElevar=c;const r=n(21),a=n(11),i=o(n(35));async function c(){try{await(0,a.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,r.loadShopifyAccount)(),n=(0,a.getOldCart)(),o=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:e.image,inventory:"",list:"",url: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:o,total:n?.total_price.toString()??""}}}const l=async e=>{const t=(0,a.readCookie)("cart_currency")||(0,a.readCookie)("cartCurrency");return t&&""!==t?t:(e??await(0,r.loadShopifyAccount)()).currency||"USD"},d=(e,t)=>{const n=new URL(t?.url||window.location.href),o=n.pathname+n.search;return e.map(((e,t)=>{const n=e.selected_variant?.id||e.product.id,r=e.selected_variant?.price??e.product.price,a=e.selected_variant?.compare_at_price??e.product.compare_at_price,i=e.selected_variant?.inventory_quantity;return{id:e.selected_variant?.sku??n?.toString(),name:e.product.title,list:o,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:r?.toFixed(2),quantity:i?i.toString():"1",product_id:e.product.id?.toString(),compare_at_price:a?.toFixed(2)??r?.toFixed(2),url:e.selected_variant?.url||e.product.url}}))};function u(e){const t=e.price.toFixed(2),n=e.original_price.toFixed(2),o=e.position??0,r=document.referrer?new URL(document.referrer):void 0;return{id:e.sku,name:e.product_title,price:t,image: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:r?`${r.pathname}${r.search}`:"",position:o+1,quantity:e.quantity.toString(),url:e.url,properties:e.properties}}function p(e,t,n=0){const o=e.selected_variant?.price??e.product.price,r=e.selected_variant?.compare_at_price??e.product.compare_at_price,a=e.selected_variant?.image??e.product.image,i=new URL(t?.url||window.location.href),c=i.pathname+i.search;return{id:e.selected_variant?.sku||e.product.id?.toString(),name:e.product.title,price:o?.toFixed(2),image:a?.src,brand:e.product.vendor,category:e.product.type||"unknown",compare_at_price:r===o||0===r?o?.toFixed(2):r?.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:c,position:n+1,quantity:e.quantity?.toString(),url:e.selected_variant?.url||e.product.url}}t.logElevarPageView=async(e,t)=>{const n=await t,o=await l(n),{user:r,cart:a}=await s(n);window.ElevarPushToDataLayer?.({event:"dl_user_data",eventId:e,cart_total:a.total,user_properties:r,ecommerce:{currencyCode:o,cart_contents:{products:a.items}}})},t.logElevarAddToCart=async(e,t=(0,a.uuid)())=>{const n=u(e),o=await l(),{user:r}=await s();window.ElevarPushToDataLayer?.({event:"dl_add_to_cart",eventId:t,user_properties:r,ecommerce:{currencyCode:o,add:{actionField:{list:document.referrer?new URL(document.referrer).pathname:"",action:"add"},products:[n]}}})},t.logElevarRemoveFromCart=async(e,t=(0,a.uuid)())=>{const n=u(e),o=await l(),{user:r}=await s();window.ElevarPushToDataLayer?.({event:"dl_remove_from_cart",eventId:t,user_properties:r,ecommerce:{currencyCode:o,remove:{actionField:{list:"Shopping Cart"},products:[n]}}})},t.logElevarCollectionView=async(e,t,n=(0,a.uuid)())=>{const o=await l(),{user:r}=await s(),i=d(t,e);window.ElevarPushToDataLayer?.({event:"dl_view_item_list",eventId:n,user_properties:r,ecommerce:{currencyCode:o,impressions:i}})},t.logElevarClickContent=async(e,t,n=0,o=(0,a.uuid)())=>{const{user:r}=await s(),i=await l(),c=new URL(e.url||window.location.href),d=`${c.pathname}${c.search}`,u=[p(t,e,n)];window.ElevarPushToDataLayer?.({event:"dl_select_item",eventId:o,user_properties:r,ecommerce:{currencyCode:i,click:{actionField:{list:d,action:"click"},products:u}}})};const y=(0,i.default)((async e=>{const n=(0,a.cartItemToBentoAnalyticsItem)(e),o=document.referrer?new URL(document.referrer):void 0;await(0,t.logElevarClickContent)({id:-1,title:o?`${o.pathname}${o.search}`:"",url:document.referrer},n,0)}));t.logElevarViewContent=async(e,t=(0,a.uuid)())=>{document.referrer&&await y(e);const n=document.referrer||window.location.href?new URL(document.referrer||window.location.href):void 0,o=await l(),r=p((0,a.cartItemToBentoAnalyticsItem)(e));r.inventory||console.error("Please attach an inventory value to cartItem for logViewContent events.");const{user:i}=await s(),c=[r];window.ElevarPushToDataLayer?.({event:"dl_view_item",eventId:t,user_properties:i,ecommerce:{currencyCode:o,detail:{actionField:{list:n?`${n.pathname}${n.search}`:"",action:"detail"},products:c}}})},t.logElevarViewCart=async(e=(0,a.uuid)())=>{const n=await l();await(0,t.logElevarPageView)(e,(0,r.loadShopifyAccount)());const{user:o,cart:i}=await s();var c;window.ElevarPushToDataLayer?.({event:"dl_view_cart",eventId:e,user_properties:o,ecommerce:{currencyCode:n,actionField:{list:"Shopping Cart"},impressions:(c=i.items??[],c.map(((e,t)=>({...e,position:t+1,list:"Shopping Cart"}))))},cart_total:i.total})},t.logElevarSearch=async(e,t,n=(0,a.uuid)())=>{const o=await l(),{user:r}=await s(),i=new URL(window.location.href);i.searchParams.set("query",e),window.ElevarPushToDataLayer?.({event:"dl_view_search_results",eventId:n,user_properties:r,ecommerce:{currencyCode:o,actionField:{list:"search results"},impressions:d(t,{title:"search results test",url:i.toString(),id:-1})}})}},251:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logFacebookPageView=t.logFacebookViewContent=t.logAddToCartFacebook=void 0;const o=n(11),r=n(252);function a(){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,r.loadFacebookSdk)(),window.fbq)){(0,o.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 i(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,o.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,o.readCookie)("cartCurrency")??"USD",value:Number.parseFloat(t.price??"0"),content_category:e.productType}}async function s(e){const t=(0,o.readCookie)("_shopify_y"),n=(0,o.readCookie)("_fbp"),r=(0,o.readCookie)("_fbc"),a=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,o.sha256)(t))}`:""))):[]}(),i=`${document.location.pathname}${document.location.search}`;return[`&dl=${window.encodeURIComponent(i)}`,`&eid=${e}`,n?`&fbp=${window.encodeURIComponent(n)}`:"",r?`&fbc=${window.encodeURIComponent(r)}`:"",t?`&external_id[0]=${window.encodeURIComponent(t)}`:"",...a,(0,o.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:r}=window.__APP_CONFIG__.ANALYTICS;if(!n)return;const[l,d]=(0,o.buildProductAndVariant)(e);if(await a(),r&&window.fbq?.loaded)window.fbq("track","AddToCart",c(l,d),{eventID:t});else try{(0,o.imagePixel)([`https://www.facebook.com/tr/?id=${n}`,"&ev=AddToCart",await s(t),...i(l,d)].join(""))}catch(e){console.error(e)}},t.logFacebookViewContent=async(e,t)=>{const{FB_ID:n,USE_FB_SDK:r}=window.__APP_CONFIG__.ANALYTICS;if(!n)return;const[l,d]=(0,o.buildProductAndVariant)(e);try{if(await a(),r&&window.fbq?.loaded)return void window.fbq("track","ViewContent",c(l,d),{eventID:t});(0,o.imagePixel)([`https://www.facebook.com/tr/?id=${n}`,"&ev=ViewContent",await s(t),...i(l,d)].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 a(),n&&window.fbq?.loaded)window.fbq("track","PageView");else try{(0,o.imagePixel)(`https://www.facebook.com/tr/?id=${t}&ev=PageView${await s(e)}`)}catch(e){console.error(e)}}},179:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logGoogleCollectionView=t.logGoogleClickContent=t.logGoogleViewContent=t.logAddToCartGoogleAnalytics=t.event=t.logGooglePageView=t.loadGoogleAnalytics=void 0;const o=n(11);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,o,r){e[o]=e[o]||[],e[o].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var a=t.getElementsByTagName(n)[0],i=t.createElement(n);i.async=!0,i.src="https://www.googletagmanager.com/gtm.js?id="+r,a.parentNode.insertBefore(i,a)}(window,document,"script","dataLayer",e):(0,o.loadScript)({src:`https://www.googletagmanager.com/gtag/js?id=${e}`,id:"google-analytics",defer:!1,async:!0}))};let r="";function a(e,t,n={},o=!0){void 0!==window.gtag&&window.gtag("event",e,{...n,currency:"USD",items:t,non_interaction:o})}function i(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}`,a=window.gtag;if(a&&r!==n&&(r=n,(0,o.ccpa_dns)()&&a("set",{restricted_data_processing:!0}),a("config",e,{page_path:n}),t))for(const e of t)a("config",e,{page_path:n})},t.event=({action:e,category:t,label:n,value:o,non_interaction:r})=>{window.gtag&&window.gtag("event",e,{event_category:t,event_label:n,value:o,non_interaction:r})},t.logAddToCartGoogleAnalytics=e=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&a("add_to_cart",[i((0,o.cartItemToBentoAnalyticsItem)(e),{title:document.title,id:-1,url:window.location.toString()})],{},!1)},t.logGoogleViewContent=e=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&a("view_item",[i((0,o.cartItemToBentoAnalyticsItem)(e),{title:document.title,id:-1,url:window.location.toString()})])},t.logGoogleClickContent=(e,t,n=0)=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&a("select_content",[i(t,e,n)],{content_type:"product"})},t.logGoogleCollectionView=(e,t)=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&a("view_item_list",t.map(((t,n)=>i(t,e,n))))}},257:(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,o.loadScriptWithDelay)({src:"//d.impactradius-event.com/A2248058-8d0a-428f-b528-d1484c8157851.js",id:"impact-radius-script",timeout:1e3*t,anonymous:!1})};const o=n(11)},255:(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,o.loadScriptWithDelay)({src:`https://bootstrap.production.intellipse.com/bootstrap.js?shop=${n}.myshopify.com`,id:"intellipse-script",timeout:1e3*t,anonymous:!1})};const o=n(11)},94:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadKlaviyoSubscribe=t.loadKlaviyo=void 0,t.initKlaviyo=function(){i()&&"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",a],["viewContent",r],["loadScript",t.loadKlaviyo]))};const o=n(11);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),o=0;o{if(!i())return;const[n]=(0,o.buildProductAndVariant)(e),r=`${document.location.pathname}${document.location.search}`,a={Name:n.title,ProductID:n.id,ImageURL:n.image,URL:r,Brand:n.vendor,Price:n.price,CompareAtPrice:n.compareAtPrice??void 0},c={Name:a.Name,ProductID:a.ProductID,Handle:a.URL,Brand:a.Brand,Price:a.Price,ImageUrl:a.ImageURL,Metadata:{Brand:a.Brand,Price:a.Price,CompareAtPrice:a.CompareAtPrice},event_id:`${t}_${Date.now().toString()}`};window.klaviyo.push(["track","Viewed Product",c]);const s={Name:a.Name,ProductID:a.ProductID,Handle:a.URL,Brand:a.Brand,Price:a.Price,ImageUrl:a.ImageURL,Metadata:{Brand:a.Brand,Price:a.Price,CompareAtPrice:a.CompareAtPrice},event_id:`${t}_${Date.now().toString()}`};window.klaviyo.push(["trackViewedItem",s]),window.geq?.event("Viewed Product Reclaim",s)},a=(e,t)=>{if(!i())return;const[n,r]=(0,o.buildProductAndVariant)(e),a=(0,o.getCurrentPrice)(n,r),c=(0,o.getCartValue)(a),s={Name:n.title,ProductID:n.id,ImageURL:n.image,Handle:n.handle,Brand:n.vendor,Price:a,Properties:e.properties,$value:c,$event_id:`${t}_${Date.now().toString()}`};window.klaviyo.push(["track","Added to Cart",s]),window.geq?.addToCart(s)};function i(){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};(0,o.loadScriptWithDelay)(t,(()=>{window.KlaviyoSubscribe?window.KlaviyoSubscribe.attachToForms("#footer_email_signup",{hide_form_on_success:!0}):console.warn("KlaviyoSubscribe not found")}))}},252:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadFacebookSdk=function(){var e,t,n,o,r,a;e=window,t=document,n="script",e.fbq||(o=e.fbq=function(){o.callMethod?o.callMethod.apply(o,arguments):o.queue.push(arguments)},e._fbq||(e._fbq=o),o.push=o,o.loaded=!0,o.version="2.0",o.queue=[],(r=t.createElement(n)).async=!0,r.src="https://connect.facebook.net/en_US/fbevents.js",(a=t.getElementsByTagName(n)[0]).parentNode.insertBefore(r,a))}},250:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadTikTokScript=function(e){!function(t,n,o){t.TiktokAnalyticsObject=o;var r=t[o]=t[o]||[];r.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],r.setAndDefer=function(e,t){e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}};for(var a=0;a{"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((()=>{r(e,t,n)})):setTimeout((()=>{r(e,t,n)}),0)}))};const o=n(254);function r({loggedIn:e,id:t,email:n,first_name:r,last_name:a,loyaltylion_has_account:i,loyaltylion_token:c,rechargeHash:s,loyaltylion_auth_token:l,date:d},u,p){try{(0,o.loadScript)(),i&&e&&n?window.loyaltylion?.init({token:c??"",customer:{id:t??"",email:n,name:`${r??""} ${a??""}`,rechargeHash:s??""},auth:{date:d??"",token:l??""}}):window.loyaltylion?.init({token:c??""}),window.loyaltylion?.on("ready",(()=>{setTimeout((()=>{u()}),0)}))}catch(e){console.error(`Could not load LoyaltyLion: ${JSON.stringify(e)}`),p(e)}}},254:(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],o=e.createElement("script");o.src=t,o.crossOrigin="",o.onload=e=>{e.target.parentNode.removeChild(e.target)},n.parentNode.insertBefore(o,n)}if(!t.isLoyaltyLion){window.loyaltylion=t,void 0===window.lion&&(window.lion=t),t.version=2,t.isLoyaltyLion=!0;var o=new Date,r=o.getFullYear().toString()+o.getMonth().toString()+o.getDate().toString();n("https://sdk.loyaltylion.net/static/2/loader.js?t="+r);var a=!1;t.init=function(e){if(a)throw new Error("Cannot call lion.init more than once");a=!0;var i=t._token=e.token;if(!i)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",a),window.addEventListener("error",a),()=>{window.removeEventListener("unhandledrejection",a),window.removeEventListener("error",a)})),[])},t.logOutsmartlyError=a;const o=n(2),r=n(11);function a(e,t){const{postLogger:n,rid:o,vid:r,startTimestamp:a,headTimestamp:i}=window.__APP_CONFIG__;if(n){const c=Math.floor(window.performance.now());n({table:"error",row:{rid:o,vid:r,timelineMark:a+c,elapsedTime:c,headTimestamp:i,source:t??location.pathname,message:"message"in e?e.message:JSON.stringify(e.reason),error:"stack"in e?e.stack:JSON.stringify(e)}})}}function i(e,t){const{postLogger:n,startTimestamp:o,rid:r,vid:a}=window.__APP_CONFIG__;if(!n)return;const i=Math.floor(window.performance.now());n({table:"outcome",row:{rid:r,vid:a,outcome:e,timelineMark:o+i,elapsedTime:i,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:o,startTimestamp:r}=window.__APP_CONFIG__;if(!t)return;const a=Math.floor(window.performance.now());t({table:"outcome",row:{outcome:"PageView",rid:n,vid:o,timelineMark:r+a,elapsedTime:a,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,r.buildProductAndVariant)(e);"undefined"!=typeof window&&i("ViewProduct",c(n,t))},t.logOutsmartlySelectedVariant=(e,t)=>{const[n,o]=(0,r.buildProductAndVariant)(e);"undefined"!=typeof window&&i("ViewProductVariant",[...c(n,t),{key:"variantId",value:o.id??""},{key:"eventId",value:t},...s(o)])}},29:function(e,t,n){"use strict";var o=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 r=o(n(181)),a=n(11);t.loadPinterest=()=>{const{PINTEREST_ID:e}=window.__APP_CONFIG__.ANALYTICS;if(e)try{(0,r.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 o=await t;if(o)(new Image).src=["https://ct.pinterest.com/v3/?event=PageVisit",`&tid=${n}`,o.loggedIn&&o.hashedEmail?`&pd[em]=${o.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,o]=(0,a.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]=${o.id??""}`,`&ed[line_items][0][product_price]=${o.price??""}`,"&ed[line_items][0][product_quantity]=1",`&ed[line_items][0][product_name]=${window.encodeURIComponent(`${n.title??""} - ${o.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(""))}},181:e=>{"use strict";e.exports=function(e){!function(e){if(!window.pintrk){window.pintrk=function(){window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var t=window.pintrk;t.queue=[],t.version="3.0";var n=document.createElement("script");n.async=!0,n.src="https://s.pinimg.com/ct/core.js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(n,o)}}(),window.pintrk("load",e),window.pintrk("page")}},178:(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",f],["pageView",m],["viewContent",y]))};const o=n(11),r=n(248),a=n(21);function i(){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:r.AnalyticsPageType.home},{pattern:/^\/products/,type:r.AnalyticsPageType.product},{pattern:/^\/collections\/?$/,type:r.AnalyticsPageType.listCollections},{pattern:/^\/collections/,type:r.AnalyticsPageType.collection},{pattern:/-policy|terms-of-service/,type:r.AnalyticsPageType.policy},{pattern:/^\/account\/login/,type:r.AnalyticsPageType.customersLogin},{pattern:/^\/account\/register/,type:r.AnalyticsPageType.customersRegister},{pattern:/^\/account\/addresses/,type:r.AnalyticsPageType.customersAddresses},{pattern:/^\/account\/reset/,type:r.AnalyticsPageType.customersResetPassword},{pattern:/^\/account\/orders/,type:r.AnalyticsPageType.customersOrder},{pattern:/^\/account/,type:r.AnalyticsPageType.customersAccount},{pattern:/^\/cart/,type:r.AnalyticsPageType.cart},{pattern:/^\/search/,type:r.AnalyticsPageType.search},{pattern:/^\/password/,type:r.AnalyticsPageType.password},{pattern:/^\/content/,type:r.AnalyticsPageType.article}];function s(){const e=window.location.pathname,t=c.find((({pattern:t})=>t.test(e)));return t?.type||r.AnalyticsPageType.page}function l(){const e=(0,o.readCookie)("cart");return e?`gid://shopify/Cart/${e}`:""}function d(){const{SHOP_ID:e}=window.__APP_CONFIG__;return`gid://shopify/Shop/${e.toString()}`}async function u(e){const t=(0,r.getClientBrowserParameters)(),n=await async function(e){const t=await e||await(0,a.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:i(),shopId:d(),cartId:l(),shopifySalesChannel:r.ShopifySalesChannel.headless,ccpaEnforced:(0,o.ccpa_dns)(),gdprEnforced:!1,hasUserConsent:!0,analyticsAllowed:!0,marketingAllowed:!0,saleOfDataAllowed:!0}}const p=async e=>{const t={...await u(),...g(e,!0)};await(0,r.sendShopifyAnalytics)({eventName:r.AnalyticsEventName.ADD_TO_CART,payload:t})},y=async e=>{const t={...await u(),...g(e,!1),pageType:s()};await(0,r.sendShopifyAnalytics)({eventName:r.AnalyticsEventName.PRODUCT_VIEW,payload:t})},m=async(e,t)=>{const n={...await u(t),pageType:s()};await(0,r.sendShopifyAnalytics)({eventName:r.AnalyticsEventName.PAGE_VIEW,payload:n})},f=async(e,t)=>{const n=await u(),o=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),a={...n,...o,collectionHandle:e.url,collectionId:e.id.toString(),pageType:s()};await(0,r.sendShopifyAnalytics)({eventName:r.AnalyticsEventName.COLLECTION_VIEW,payload:a})};function g(e,t=!1){const[n,r]=(0,o.buildProductAndVariant)(e),a=[n.title,r.title].join(" - "),i=(0,o.getCurrentPrice)(n,r),c=(0,o.getCartValue)(i,t);return{products:[{productGid:`gid://shopify/Product/${n.id??""}`,name:a,price:i.toFixed(2),quantity:n.quantity,variantGid:r.id?`gid://shopify/ProductVariant/${r.id.toString()}`:void 0,variantName:r.title,brand:r.brand||"",sku:r.sku,category:""}],totalValue:c}}},182:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logAddToCartSnapchat=t.logSnapchatViewContent=t.logSnapchatPageView=t.loadSnapchat=void 0;const o=n(11);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,o.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,r]=(0,o.buildProductAndVariant)(e);window.snaptr("track","VIEW_CONTENT",{currency:"USD",item_category:n.id,item_ids:r.id,description:`${n.title??""} - ${r.title??""}`,price:r.price})},t.logAddToCartSnapchat=e=>{const[t,n]=(0,o.buildProductAndVariant)(e),{SNAPCHAT_ID:r}=window.__APP_CONFIG__.ANALYTICS;r&&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})}},249:(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",i],["viewContent",c],["loadScript",a]))};const o=n(11),r=n(250),a=()=>{const{TIKTOK_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&void 0===window.ttq&&(0,r.loadTikTokScript)(e)},i=(e,t)=>{const[n,r]=(0,o.buildProductAndVariant)(e);try{void 0!==window.ttq&&window.ttq.track("AddToCart",...s(n,r,t))}catch(e){console.log(e)}},c=(e,t)=>{const[n,r]=(0,o.buildProductAndVariant)(e);try{void 0!==window.ttq&&window.ttq.track("ViewContent",...s(n,r,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,o.readCookie)("cartCurrency")??"USD"},{event_id:n}]}},11:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cartItemToBentoAnalyticsItem=t.getItemCounts=t.getCartValue=t.getCurrentPrice=t.getOldCart=t.updateCart=t.safeParse=t.normalizeCart=t.buildProductAndVariant=void 0,t.loadScript=a,t.loadScriptWithDelay=function(e,t=(()=>{})){const{src:n,id:o,useRequestIdleCallback:i=!1}=e;if(document.querySelector(`#${o}`))"function"==typeof window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,0);else if(i&&"function"==typeof window.requestIdleCallback)window.requestIdleCallback((()=>{a(e,t)}));else{const o=e.timeout||window.scriptDelayTime||1e4;r[n]=window.setTimeout(a,o,e,t)}},t.readCookie=i,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 o=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(o),o}}));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"),o=(await n.json()).items.find((e=>Object.fromEntries(e.properties)._olbid===t));return o?c(o.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=l,t.waitForShopifyY=async function(){await(0,o.loadShopifyAccount)().catch((e=>{console.error("Could not load accout before getting _shopify_y",e)}));const e=i("_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,o=new Uint16Array(31);n.getRandomValues(o);let r=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.cancellableFetch=function(e,t={}){const n=new AbortController,{signal:o}=n;return{response:fetch(e,{...t,signal:o}),cancel:()=>{n.abort()}}},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)};const o=n(21),r={};function a(e,t=(()=>{})){const{src:n,id:o,anonymous:a=!0,defer:i=!0,async:c=!1}=e;if(r[n]&&window.clearTimeout(r[n]),document.querySelector(`#${o}`))return;const s=document.createElement("script");s.src=n,s.defer=i,s.id=o,s.async=c,a&&(s.crossOrigin="anonymous"),s.addEventListener("load","function"==typeof window.requestIdleCallback?()=>window.requestIdleCallback(t):t),document.body.append(s)}function i(e){const t=decodeURIComponent(document.cookie).match(/[^\s,;=]+=[^\s,;=]+/g);if(t)for(const n of t){const[t,o]=n.split("=");if(t===e)return o}}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: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:.01*e.price,original_price:.01*e.original_price,final_line_price:.01*e.final_line_price,final_price:.01*e.final_price,original_line_price:.01*e.original_line_price,line_price:.01*e.line_price,variant_title:e.variant_title||e.variant_options.join(" / ")||"Default Title"})));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=>({...e,items:c(e.items),total_price:.01*e.total_price,total_discount:.01*e.total_discount,original_total_price:.01*e.original_total_price,items_subtotal_price:.01*e.items_subtotal_price}),t.safeParse=e=>{try{return JSON.parse(e)}catch(t){console.error("Could not parse as JSON:",e,"\nerror:",t)}};const d="outsmartly-shopify-cart";t.updateCart=e=>{window.localStorage.setItem(d,JSON.stringify(e))},t.getOldCart=()=>{const e=window.localStorage.getItem(d)||"";if(!e||0===e.length)return;const n=(0,t.safeParse)(e);return l(n)?n:void 0},t.getCurrentPrice=(e,t)=>{const n=t?.price||e?.price;return Number.parseFloat(n||"0")},t.getCartValue=(e,n=!1)=>{const o=(0,t.getOldCart)(),r=e||0;return o?.total_price||n?r: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: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: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:e.url,inventory_quantity:1,title:e.variant_title,image:t},quantity:e.quantity}}},35:(e,t,n)=>{var o=n(183);function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function a(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=o(r),e.exports.strict=o(a),r.proto=r((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return a(this)},configurable:!0})}))},183: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){o[e]=t[e]})),o;function o(){for(var e=new Array(arguments.length),n=0;n{"use strict";n.r(t),n.d(t,{AddToCartButton:()=>Ee,AnalyticsEventName:()=>Oe,AnalyticsPageType:()=>ke,BuyNowButton:()=>et,CartCheckoutButton:()=>tt,CartCost:()=>it,CartLineProvider:()=>lt,CartLineQuantity:()=>dt,CartLineQuantityAdjustButton:()=>ut,CartProvider:()=>he,ExternalVideo:()=>mt,IMAGE_FRAGMENT:()=>Ot,Image:()=>kt,MediaFile:()=>Ht,ModelViewer:()=>Bt,Money:()=>at,ProductPrice:()=>Kt,ProductProvider:()=>Ae,RichText:()=>Jt,SHOPIFY_S:()=>ae,SHOPIFY_STOREFRONT_ID_HEADER:()=>te,SHOPIFY_STOREFRONT_S_HEADER:()=>oe,SHOPIFY_STOREFRONT_Y_HEADER:()=>ne,SHOPIFY_Y:()=>re,ShopPayButton:()=>tn,ShopifyProvider:()=>Q,ShopifySalesChannel:()=>xe,Video:()=>Yt,createStorefrontClient:()=>B,customerAccountApiCustomScalars:()=>yt,decodeEncodedVariant:()=>vt,flattenConnection:()=>N,getAdjacentAndFirstAvailableVariants:()=>bt,getClientBrowserParameters:()=>Xe,getProductOptions:()=>Et,getShopifyCookies:()=>le,isOptionValueCombinationInEncodedVariant:()=>gt,mapSelectedProductOptionToObject:()=>wt,parseGid:()=>Le,parseMetafield:()=>Wt,sendShopifyAnalytics:()=>Je,storefrontApiCustomScalars:()=>pt,useCart:()=>ve,useCartLine:()=>st,useLoadScript:()=>Gt,useMoney:()=>nt,useProduct:()=>Se,useSelectedOptionInUrlParam:()=>sn,useShop:()=>X,useShopifyCookies:()=>un});var o,r,a=n(5),i=n(0);function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}(r=o||(o={}))[r.NotStarted=0]="NotStarted",r[r.Running=1]="Running",r[r.Stopped=2]="Stopped";var s={type:"xstate.init"};function l(e){return void 0===e?[]:[].concat(e)}function d(e){return{type:"xstate.assign",assignment:e}}function u(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 m(e,t){return{value:e,context:t,actions:[],changed:!1,matches:p(e)}}function f(e,t,n){var o=t,r=!1;return[e.filter((function(e){if("xstate.assign"===e.type){r=!0;var t=Object.assign({},o);return"function"==typeof e.assignment?t=e.assignment(o,n):Object.keys(e.assignment).forEach((function(r){t[r]="function"==typeof e.assignment[r]?e.assignment[r](o,n):e.assignment[r]})),o=t,!1}return!0})),o,r]}function g(e,t){void 0===t&&(t={});var n=c(f(l(e.states[e.initial].entry).map((function(e){return u(e,t.actions)})),e.context,s),2),o=n[0],r=n[1],a={config:e,_options:t,initialState:{value:e.initial,actions:o,context:r,matches:p(e.initial)},transition:function(t,n){var o,r,i="string"==typeof t?{value:t,context:e.context}:t,s=i.value,d=i.context,g=y(n),v=e.states[s];if(v.on){var h=l(v.on[g.type]);try{for(var w=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(h),_=w.next();!_.done;_=w.next()){var C=_.value;if(void 0===C)return m(s,d);var A="string"==typeof C?{target:C}:C,S=A.target,I=A.actions,P=void 0===I?[]:I,T=A.cond,b=void 0===T?function(){return!0}:T,E=void 0===S,O=null!=S?S:s,k=e.states[O];if(b(d,g)){var x=c(f((E?l(P):[].concat(v.exit,P,k.entry).filter((function(e){return e}))).map((function(e){return u(e,a._options.actions)})),d,g),3),N=x[0],D=x[1],L=x[2],R=null!=S?S:s;return{value:R,context:D,actions:N,changed:S!==s||N.length>0||L,matches:p(R)}}}}catch(e){o={error:e}}finally{try{_&&!_.done&&(r=w.return)&&r.call(w)}finally{if(o)throw o.error}}}return m(s,d)}};return a}var v,h,w,_,C=function(e,t){return e.actions.forEach((function(n){var o=n.exec;return o&&o(e.context,t)}))},A=a.useLayoutEffect,S={exports:{}},I={},P={exports:{}},T={};var b=(_||(_=1,S.exports=function(){if(w)return I;w=1;var e=a.default,t=(h||(h=1,P.exports=function(){if(v)return T;v=1;var e=a.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,o=e.useEffect,r=e.useLayoutEffect,i=e.useDebugValue;function c(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!t(e,o)}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 a=t(),s=n({inst:{value:a,getSnapshot:t}}),l=s[0].inst,d=s[1];return r((function(){l.value=a,l.getSnapshot=t,c(l)&&d({inst:l})}),[e,a,t]),o((function(){return c(l)&&d({inst:l}),e((function(){c(l)&&d({inst:l})}))}),[e]),i(a),a};return T.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,T}()),P.exports),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useSyncExternalStore,r=e.useRef,i=e.useEffect,c=e.useMemo,s=e.useDebugValue;return I.useSyncExternalStoreWithSelector=function(e,t,a,l,d){var u=r(null);if(null===u.current){var p={hasValue:!1,value:null};u.current=p}else p=u.current;u=c((function(){function e(e){if(!i){if(i=!0,o=e,e=l(e),void 0!==d&&p.hasValue){var t=p.value;if(d(t,e))return r=t}return r=e}if(t=r,n(o,e))return t;var a=l(e);return void 0!==d&&d(t,a)?t:(o=e,r=a)}var o,r,i=!1,c=void 0===a?null:a;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,a,l,d]);var y=o(e,u[0],u[1]);return i((function(){p.hasValue=!0,p.value=y}),[y]),s(y),y},I}()),S.exports),E=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i};function O(e){return e}var k=function(e){var t;return e.subscribe((function(e){t=e})).unsubscribe(),t};var x=function(e,t){return!1===t.changed};function N(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 D=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`,L=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`,F=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`,j=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",Y=e=>e.includes("mock.shop");function B({storeDomain:e,privateStorefrontToken:t,publicStorefrontToken:n,storefrontApiVersion:o=G,contentType:r}){if(!e)throw new Error(z+"`storeDomain` is required when creating a new Storefront client in production.");o!==G&&K(`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: "${o}"; expected version "${G}"`);const a=t=>{const n=(null==t?void 0:t.storeDomain)??e;return n.includes("://")?n:`https://${n}`};return{getShopifyDomain:a,getStorefrontApiUrl(e){const t=a(e),n=t+(t.endsWith("/")?"api":"/api");return Y(t)?n:`${n}/${(null==e?void 0:e.storefrontApiVersion)??o}/graphql.json`},getPrivateTokenHeaders(n){if(!t&&!(null==n?void 0:n.privateStorefrontToken)&&!Y(e))throw new Error(z+"You did not pass in a `privateStorefrontToken` while using `createStorefrontClient()` or `getPrivateTokenHeaders()`");return{"content-type":"graphql"===((null==n?void 0:n.contentType)??r)?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":o,"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)&&!Y(e))throw new Error(z+"You did not pass in a `publicStorefrontToken` while using `createStorefrontClient()` or `getPublicTokenHeaders()`");return H((null==t?void 0:t.contentType)??r??"json",o,(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,z="[h2:error:createStorefrontClient] ",K=(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,a.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,a.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 o=e({storeDomain:(null==n?void 0:n.storeDomain)??t.storeDomain});return`${o}${o.endsWith("/")?"":"/"}api/${(null==n?void 0:n.storefrontApiVersion)??t.storefrontApiVersion}/graphql.json`}}}),[t]);return(0,i.jsx)(J.Provider,{value:n,children:e})}function X(){const e=(0,a.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",oe="Shopify-Storefront-S",re="_shopify_y",ae="_shopify_s";var ie=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 o=0;e=ce.replace(/[x]/g,(e=>{const t=n[o]%16;return o++,("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,o,r,a={},i=0,c=e.split(/;\s*/g);for(;inull==e?void 0:e.cart}),"onCartActionEntry","onCartActionOptimisticUI",e],on:{RESOLVE:{target:(null==t?void 0:t.resolveTarget)||"idle",actions:[d({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:[d({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:d({prevCart:e=>{},cart:e=>{},lastValidCart:e=>{},rawCartResult:e=>{},errors:e=>{}})}},exit:["onCartActionComplete",...(null==t?void 0:t.exitActions)||[]]}}const ue={CART_FETCH:{target:"cartFetching"},CART_CREATE:{target:"cartCreating"},CART_SET:{target:"idle",actions:[d({rawCartResult:(e,t)=>t.payload.cart,cart:(e,t)=>me(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:r,data:i,cartFragment:c,countryCode:l,languageCode:u}){const{cartFetch:m,cartCreate:f,cartLineAdd:v,cartLineUpdate:h,cartLineRemove:w,noteUpdate:_,buyerIdentityUpdate:S,cartAttributesUpdate:I,discountCodesUpdate:P}=function({numCartLines:e,cartFragment:t,countryCode:n="US",languageCode:o="EN"}){const r=function(){const{storefrontId:e,getPublicTokenHeaders:t,getStorefrontApiUrl:n}=X();return(0,a.useCallback)((({query:o,variables:r})=>{const a=t({contentType:"json"});e&&(a[te]=e);const i=le(document.cookie);return a[ne]=i[re],a[oe]=i[ae],fetch(n(),{method:"POST",headers:a,body:JSON.stringify({query:o.toString(),variables:r})}).then((e=>e.json())).catch((e=>({data:void 0,errors:null==e?void 0:e.toString()})))}),[t,e,n])}(),i=(0,a.useCallback)((a=>r({query:q(t),variables:{id:a,numCartLines:e,country:n,language:o}})),[r,t,e,n,o]),c=(0,a.useCallback)((a=>r({query:L(t),variables:{input:a,numCartLines:e,country:n,language:o}})),[t,n,r,e,o]),s=(0,a.useCallback)(((a,i)=>r({query:D(t),variables:{cartId:a,lines:i,numCartLines:e,country:n,language:o}})),[t,n,r,e,o]),l=(0,a.useCallback)(((a,i)=>r({query:V(t),variables:{cartId:a,lines:i,numCartLines:e,country:n,language:o}})),[t,n,r,e,o]),d=(0,a.useCallback)(((a,i)=>r({query:R(t),variables:{cartId:a,lines:i,numCartLines:e,country:n,language:o}})),[t,n,r,e,o]),u=(0,a.useCallback)(((a,i)=>r({query:U(t),variables:{cartId:a,note:i,numCartLines:e,country:n,language:o}})),[r,t,e,n,o]),p=(0,a.useCallback)(((a,i)=>r({query:$(t),variables:{cartId:a,buyerIdentity:i,numCartLines:e,country:n,language:o}})),[t,n,r,e,o]),y=(0,a.useCallback)(((a,i)=>r({query:F(t),variables:{cartId:a,attributes:i,numCartLines:e,country:n,language:o}})),[t,n,r,e,o]),m=(0,a.useCallback)(((a,i)=>r({query:j(t),variables:{cartId:a,discountCodes:i,numCartLines:e,country:n,language:o}})),[t,n,r,e,o]);return(0,a.useMemo)((()=>({cartFetch:i,cartCreate:c,cartLineAdd:s,cartLineUpdate:l,cartLineRemove:d,noteUpdate:u,buyerIdentityUpdate:p,cartAttributesUpdate:y,discountCodesUpdate:m,cartFragment:t})),[i,c,s,l,d,u,p,y,m,t])}({numCartLines:e,cartFragment:c,countryCode:l,languageCode:u}),T=(0,a.useMemo)((()=>{return g({id:"Cart",initial:(e=i)?"idle":"uninitialized",context:{cart:e&&me(e)},states:{uninitialized:{on:ue},cartCompleted:{on:ue},initializationError:{on:ue},idle:{on:{...ue,...pe}},error:{on:{...ue,...pe}},cartFetching:de("cartFetchAction",{errorTarget:"initializationError"}),cartCreating:de("cartCreateAction",{errorTarget:"initializationError"}),cartLineRemoving:de("cartLineRemoveAction"),cartLineUpdating:de("cartLineUpdateAction"),cartLineAdding:de("cartLineAddAction"),noteUpdating:de("noteUpdateAction"),buyerIdentityUpdating:de("buyerIdentityUpdateAction"),cartAttributesUpdating:de("cartAttributesUpdateAction"),discountCodesUpdating:de("discountCodesUpdateAction")}});var e}),[i]),[N,M,G]=function(e,t){var n,r,i=(0,a.useRef)(),c=E((n=function(){var n=[],r=function(e){var t=e.initialState,n=o.NotStarted,r=new Set,a={_machine:e,send:function(a){n===o.Running&&(t=e.transition(t,a),C(t,y(a)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var i="object"==typeof r?r:{context:e.config.context,value:r};t={value:i.value,actions:[],context:i.context,matches:p(i.value)}}else t=e.initialState;return n=o.Running,C(t,s),a},stop:function(){return n=o.Stopped,r.clear(),a},get state(){return t},get status(){return n}};return a}(g(e.config,t||e._options)),a=r.send;return r.send=function(e){r.status!==o.NotStarted?(a(e),i.current=r.state):n.push(e)},[r,n]},(r=a.useRef()).current||(r.current={v:n()}),r.current.v),2),l=c[0],d=c[1];A((function(){t&&(l._machine._options=t)}));var u=function(e){var t=(0,a.useCallback)((function(){return k(e)}),[e]),n=(0,a.useCallback)((function(t){return e.subscribe(t).unsubscribe}),[e]);return[b.useSyncExternalStoreWithSelector(n,t,t,O,x),e.send,e]}(l);return(0,a.useEffect)((function(){return l.start(i.current),d.forEach(l.send),i.current=l.state,function(){l.stop()}}),[]),u}(T,{actions:{cartFetchAction:async(e,t)=>{var n;if("CART_FETCH"!==t.type)return;const{data:o,errors:r}=await m(null==(n=null==t?void 0:t.payload)?void 0:n.cartId),a=fe(t,null==o?void 0:o.cart,r);M(a)},cartCreateAction:async(e,t)=>{var n;if("CART_CREATE"!==t.type)return;const{data:o,errors:r}=await f(null==t?void 0:t.payload),a=fe(t,null==(n=null==o?void 0:o.cartCreate)?void 0:n.cart,r);M(a)},cartLineAddAction:async(e,t)=>{var n,o;if("CARTLINE_ADD"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:r,errors:a}=await v(e.cart.id,t.payload.lines),i=fe(t,null==(o=null==r?void 0:r.cartLinesAdd)?void 0:o.cart,a);M(i)},cartLineUpdateAction:async(e,t)=>{var n,o;if("CARTLINE_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:r,errors:a}=await h(e.cart.id,t.payload.lines),i=fe(t,null==(o=null==r?void 0:r.cartLinesUpdate)?void 0:o.cart,a);M(i)},cartLineRemoveAction:async(e,t)=>{var n,o;if("CARTLINE_REMOVE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:r,errors:a}=await w(e.cart.id,t.payload.lines),i=fe(t,null==(o=null==r?void 0:r.cartLinesRemove)?void 0:o.cart,a);M(i)},noteUpdateAction:async(e,t)=>{var n,o;if("NOTE_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:r,errors:a}=await _(e.cart.id,t.payload.note),i=fe(t,null==(o=null==r?void 0:r.cartNoteUpdate)?void 0:o.cart,a);M(i)},buyerIdentityUpdateAction:async(e,t)=>{var n,o;if("BUYER_IDENTITY_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:r,errors:a}=await S(e.cart.id,t.payload.buyerIdentity),i=fe(t,null==(o=null==r?void 0:r.cartBuyerIdentityUpdate)?void 0:o.cart,a);M(i)},cartAttributesUpdateAction:async(e,t)=>{var n,o;if("CART_ATTRIBUTES_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:r,errors:a}=await I(e.cart.id,t.payload.attributes),i=fe(t,null==(o=null==r?void 0:r.cartAttributesUpdate)?void 0:o.cart,a);M(i)},discountCodesUpdateAction:async(e,t)=>{var n,o;if("DISCOUNT_CODES_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:r,errors:a}=await P(e.cart.id,t.payload.discountCodes),i=fe(t,null==(o=null==r?void 0:r.cartDiscountCodesUpdate)?void 0:o.cart,a);M(i)},...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:d(((e,t)=>n(e,t)))},...r&&{onCartActionComplete:(e,t)=>{(function(e){return"RESOLVE"===e.type||"ERROR"===e.type||"CART_COMPLETED"===e.type})(t)&&r(e,t)}}}});return(0,a.useMemo)((()=>[N,M,G]),[N,M,G])}function me(e){return{...e,lines:N(null==e?void 0:e.lines),note:e.note??void 0}}function fe(e,t,n){return n?{type:"ERROR",payload:{errors:n,cartActionEvent:e}}:t?{type:"RESOLVE",payload:{cart:me(t),rawCartResult:t,cartActionEvent:e}}:{type:"CART_COMPLETED",payload:{cartActionEvent:e}}}const ge=(0,a.createContext)(null);function ve(){const e=(0,a.useContext)(ge);if(!e)throw new Error("Expected a Cart Context, but no Cart Context was found");return e}function he({children:e,numCartLines:t,onCreate:n,onLineAdd:o,onLineRemove:r,onLineUpdate:c,onNoteUpdate:s,onBuyerIdentityUpdate:l,onAttributesUpdate:d,onDiscountCodesUpdate:u,onCreateComplete:p,onLineAddComplete:y,onLineRemoveComplete:m,onLineUpdateComplete:f,onNoteUpdateComplete:g,onBuyerIdentityUpdateComplete:v,onAttributesUpdateComplete:h,onDiscountCodesUpdateComplete:w,data:_,cartFragment:C=M,customerAccessToken:A,countryCode:S,languageCode:I}){var P,T,b,E,O,k,x;const N=X();if(!N)throw new Error(" needs to be a descendant of ");S=(S??N.countryIsoCode??"US").toUpperCase(),I=(I??N.languageIsoCode??"EN").toUpperCase(),S&&(S=S.toUpperCase());const[D,L]=(0,a.useState)(S),[R,V]=(0,a.useState)(A),U=(0,a.useRef)(!1);D===S&&R===A||(L(S),V(A),U.current=!1);const[$,F]=ye({numCartLines:t,data:_,cartFragment:C,countryCode:S,languageCode:I,onCartActionEntry(e,t){try{switch(t.type){case"CART_CREATE":return null==n?void 0:n();case"CARTLINE_ADD":return null==o?void 0:o();case"CARTLINE_REMOVE":return null==r?void 0:r();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==d?void 0:d();case"DISCOUNT_CODES_UPDATE":return null==u?void 0:u()}}catch(e){console.error("Cart entry action failed",e)}},onCartActionOptimisticUI(e,t){var n,o,r,a;if(!e.cart)return{...e};switch(t.type){case"CARTLINE_REMOVE":return{...e,cart:{...e.cart,lines:null==(o=null==(n=null==e?void 0:e.cart)?void 0:n.lines)?void 0:o.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==(a=null==(r=null==e?void 0:e.cart)?void 0:r.lines)?void 0:a.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==m?void 0:m();case"CARTLINE_UPDATE":return null==f?void 0:f();case"NOTE_UPDATE":return null==g?void 0:g();case"BUYER_IDENTITY_UPDATE":return function(e,t){var n,o;return!(!t.payload.buyerIdentity.countryCode||(null==(o=null==(n=e.cart)?void 0:n.buyerIdentity)?void 0:o.countryCode)===t.payload.buyerIdentity.countryCode)}(e,n)&&(U.current=!0),null==v?void 0:v();case"CART_ATTRIBUTES_UPDATE":return null==h?void 0:h();case"DISCOUNT_CODES_UPDATE":return null==w?void 0:w()}}catch(e){console.error("onCartActionComplete failed",e)}}}),j=(0,a.useRef)(!1),[q,G]=(0,a.useState)(!1),Y=$.matches("cartCompleted"),B=("idle"===$.value||"error"===$.value||"cartCompleted"===$.value)&&S!==(null==(b=null==(T=null==(P=null==$?void 0:$.context)?void 0:P.cart)?void 0:T.buyerIdentity)?void 0:b.countryCode)&&!$.context.errors,H=(0,a.useRef)(!1);(0,a.useEffect)((()=>{if(!j.current&&!H.current){if(!_&&_e("localStorage")){H.current=!0;try{const e=window.localStorage.getItem(ee);e&&F({type:"CART_FETCH",payload:{cartId:e}})}catch(e){console.warn("error fetching cartId"),console.warn(e)}}j.current=!0,G(!0)}}),[_,j,F]),(0,a.useEffect)((()=>{B&&!U.current&&F({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:{countryCode:S,customerAccessToken:A}}})}),[S,A,B,U,F]);const W=(0,a.useCallback)((e=>{if(!j.current)return console.warn("Cart isn't ready yet");F(e)}),[F]);(0,a.useEffect)((()=>{var e,t,n;if((null==(t=null==(e=null==$?void 0:$.context)?void 0:e.cart)?void 0:t.id)&&_e("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,a.useEffect)((()=>{if(Y&&_e("localStorage"))try{window.localStorage.removeItem(ee)}catch(e){console.warn("Failed to delete cartId from localStorage",e)}}),[Y]);const z=(0,a.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]),K=function(e){const[t,n]=(0,a.useTransition)(),[o,r]=(0,a.useState)(e),i=(0,a.useRef)(!1);t&&(i.current=!0);const c=(0,a.useRef)(!1);return!t&&i.current&&(c.current=!0),(0,a.useEffect)((()=>{n((()=>{c.current||r(e)}))}),[e]),c.current?e:o}($),Z=(0,a.useMemo)((()=>{var e,t,n,o;return{...(null==(e=null==K?void 0:K.context)?void 0:e.cart)??{lines:[],attributes:[]},status:we(K.value),error:null==(t=null==K?void 0:K.context)?void 0:t.errors,totalQuantity:(null==(o=null==(n=null==K?void 0:K.context)?void 0:n.cart)?void 0:o.totalQuantity)??0,cartCreate:z,cartReady:q,linesAdd(e){var t,n;(null==(n=null==(t=null==K?void 0:K.context)?void 0:t.cart)?void 0:n.id)?W({type:"CARTLINE_ADD",payload:{lines:e}}):z({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}}),[z,q,null==(k=null==K?void 0:K.context)?void 0:k.cart,null==(x=null==K?void 0:K.context)?void 0:x.errors,K.value,C,W]);return(0,i.jsx)(ge.Provider,{value:Z,children:e})}function we(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 _e(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,a.createContext)(null);function Ae({children:e,data:t,initialVariantId:n}){const o=(0,a.useMemo)((()=>N(t.variants??{})),[t.variants]);if(!(r=o)||!Array.isArray(r))throw new Error(" requires 'product.variants.nodes' or 'product.variants.edges'");var r;const c=(0,a.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])})))}(o)),[o]),[s,l]=(0,a.useState)((()=>Pe(n,o))),[d,u]=(0,a.useState)((()=>Te(s)));(0,a.useEffect)((()=>{const e=Pe(n,o);l(e),u(Te(e))}),[n,o]);const p=(0,a.useCallback)(((e,t)=>{u((n=>{const r={...n,[e]:t};return l(Ie(o,r)),r}))}),[u,o]),y=(0,a.useCallback)(((e,t)=>{const n=Ie(o,{...d,[e]:t});return(null==n?void 0:n.availableForSale)??!0}),[d,o]),m=(0,a.useMemo)((()=>N(t.sellingPlanGroups??{}).map((e=>({...e,sellingPlans:N((null==e?void 0:e.sellingPlans)??{})})))),[t.sellingPlanGroups]),[f,g]=(0,a.useState)(void 0),v=(0,a.useMemo)((()=>{var e,t;if(s&&f){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 N(s.sellingPlanAllocations).find((e=>{var t;return(null==(t=null==e?void 0:e.sellingPlan)?void 0:t.id)===f.id}))}}),[s,f]),h=(0,a.useMemo)((()=>({product:t,variants:o,variantsConnection:t.variants,options:c,selectedVariant:s,setSelectedVariant:l,selectedOptions:d,setSelectedOption:p,setSelectedOptions:u,isOptionInStock:y,selectedSellingPlan:f,setSelectedSellingPlan:g,selectedSellingPlanAllocation:v,sellingPlanGroups:m,sellingPlanGroupsConnection:t.sellingPlanGroups})),[t,y,c,d,f,v,s,m,p,o]);return(0,i.jsx)(Ce.Provider,{value:h,children:e})}function Se(){const e=(0,a.useContext)(Ce);if(!e)throw new Error("'useProduct' must be a child of ");return e}function Ie(e,t){var n,o;if(e.length&&(null==(o=null==(n=null==e?void 0:e[0])?void 0:n.selectedOptions)?void 0:o.length)===Object.keys(t).length)return null==e?void 0:e.find((e=>Object.entries(t).every((([t,n])=>{var o;return null==(o=null==e?void 0:e.selectedOptions)?void 0:o.some((e=>(null==e?void 0:e.name)===t&&(null==e?void 0:e.value)===n))}))))}function Pe(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 Te(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 be(e){const{as:t,onClick:n,defaultOnClick:o,children:r,buttonRef:c,...s}=e,l=(0,a.useCallback)((e=>{if(n){const t=n(e);if("boolean"==typeof t&&!1===t||(null==e?void 0:e.defaultPrevented))return}null==o||o(e)}),[o,n]),d=t||"button";return(0,i.jsx)(d,{ref:c,onClick:l,...s,children:r})}function Ee(e){const[t,n]=(0,a.useState)(!1),{variantId:o,quantity:r=1,attributes:c,sellingPlanId:s,onClick:l,children:d,accessibleAddingToCartLabel:u,...p}=e,{status:y,linesAdd:m}=ve(),{selectedVariant:f}=Se(),g=o??(null==f?void 0:f.id)??"",v=null===o||""===g||null===f||t||p.disabled;(0,a.useEffect)((()=>{t&&"idle"===y&&n(!1)}),[y,t]);const h=(0,a.useCallback)((()=>{n(!0),m([{quantity:r,merchandiseId:g||"",attributes:c,sellingPlanId:s}])}),[m,r,g,c,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(be,{...p,disabled:v,onClick:l,defaultOnClick:h,children:d}),u?(0,i.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?u: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"},xe={hydrogen:"hydrogen",headless:"headless"},Ne={hydrogen:"6167201",headless:"12875497473"};function De(e,t){return{schema_id:e,payload:t,metadata:{event_created_at_ms:Date.now()}}}function Le(e){const t={id:"",resource:null,resourceId:null,search:"",searchParams:new URLSearchParams,hash:""};if("string"!=typeof e)return t;try{const{search:n,searchParams:o,pathname:r,hash:a}=new URL(e),i=r.split("/"),c=i[i.length-1],s=i[i.length-2];if(!c||!s)return t;return{id:`${c}${n}${a}`||"",resource:s??null,resourceId:c||null,search:n,searchParams:o,hash:a}}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:o}=Le(t.resourceId),r=o?o.toLowerCase():void 0;return[De(Ve,Re({pageType:t.pageType,customerId:parseInt(Le(t.customerId).id||"0"),resourceType:r,resourceId:parseInt(n)},Fe(t)))]}function Fe(e){return{appClientId:e.shopifySalesChannel?Ne[e.shopifySalesChannel]:Ne.headless,isMerchantRequest:je(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(Le(e.shopId).id),currency:e.currency,contentLanguage:e.acceptedLanguage||"en"}}function je(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",Ye="collection_page_rendered",Be="product_page_rendered",He="product_added_to_cart",We="search_submitted";function ze(e){return{canonical_url:e.canonicalUrl||e.url,customer_id:parseInt(Le(e.customerId).id||"0")}}function Ke(e){return{source:e.shopifySalesChannel||xe.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(Le(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(Le(e.productGid).id),variant_id:parseInt(Le(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:o}=e;if(!o.hasUserConsent)return Promise.resolve();let r=[];const a=o;return n===Oe.PAGE_VIEW?r=r.concat($e(a),function(e){const t=e,n=ze(t),o=t.pageType,r=[];switch(r.push(De(Me,Re({event_name:Ge,...n},Ke(t)))),o){case ke.collection:r.push(De(Me,Re({event_name:Ye,...n,collection_name:t.collectionHandle,collection_id:parseInt(Le(t.collectionId).id)},Ke(t))));break;case ke.product:r.push(De(Me,Re({event_name:Be,...n,products:Ze(t.products),total_value:t.totalValue},Ke(t))));break;case ke.search:r.push(De(Me,Re({event_name:We,...n,search_string:t.searchString},Ke(t))))}return r}(a)):n===Oe.ADD_TO_CART?r=r.concat(function(e){const t=e,n=Le(t.cartId);return[De(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(Le(t.customerId).id||"0")},Ke(t)))]}(o)):n===Oe.PAGE_VIEW_2?r=r.concat($e(a),function(e){const t=e,n=ze(t);return[De(Me,Re({event_name:Ge,...n},Ke(t)))]}(a)):n===Oe.COLLECTION_VIEW?r=r.concat(function(e){const t=e,n=ze(t);return[De(Me,Re({event_name:Ye,...n,collection_name:t.collectionHandle,collection_id:parseInt(Le(t.collectionId).id)},Ke(t)))]}(a)):n===Oe.PRODUCT_VIEW?r=r.concat(function(e){const t=e,n=ze(t);return[De(Me,Re({event_name:Be,...n,products:Ze(t.products),total_value:t.totalValue},Ke(t)))]}(a)):n===Oe.SEARCH_VIEW&&(r=r.concat(function(e){const t=e,n=ze(t);return[De(Me,Re({event_name:We,...n,search_string:t.searchString},Ke(t)))]}(a))),r.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()}}(r,t):Promise.resolve()}const Qe="sendShopifyAnalytics request is unsuccessful";function Xe(){if("getClientBrowserParameters","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[re],visitToken:n[ae],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(),[o,r]=(0,a.useState)(!1),{quantity:c,variantId:s,sellingPlanId:l,onClick:d,attributes:u,children:p,...y}=e;(0,a.useEffect)((()=>{o&&n&&(window.location.href=n)}),[o,n]);const m=(0,a.useCallback)((()=>{r(!0),t({lines:[{quantity:c??1,merchandiseId:s,attributes:u,sellingPlanId:l}]})}),[t,c,s,u,l]);return(0,i.jsx)(be,{disabled:o??y.disabled,...y,onClick:d,defaultOnClick:m,children:p})}function tt(e){const[t,n]=(0,a.useState)(!1),{status:o,checkoutUrl:r}=ve(),{children:c,...s}=e;return(0,a.useEffect)((()=>{t&&r&&"idle"===o&&(window.location.href=r)}),[t,o,r]),(0,i.jsx)(be,{...s,disabled:t||s.disabled,onClick:()=>n(!0),children:c})}function nt(e){const{countryIsoCode:t,languageIsoCode:n}=X(),o=n.includes("_")?n.replace("_","-"):`${n}-${t}`;if(!o)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 r=parseFloat(e.amount),{defaultFormatter:i,nameFormatter:c,narrowSymbolFormatter:s,withoutTrailingZerosFormatter:l,withoutCurrencyFormatter:d,withoutTrailingZerosOrCurrencyFormatter:u}=(0,a.useMemo)((()=>{const t={style:"currency",currency:e.currencyCode};return{defaultFormatter:rt(o,t),nameFormatter:rt(o,{...t,currencyDisplay:"name"}),narrowSymbolFormatter:rt(o,{...t,currencyDisplay:"narrowSymbol"}),withoutTrailingZerosFormatter:rt(o,{...t,minimumFractionDigits:0,maximumFractionDigits:0}),withoutCurrencyFormatter:rt(o),withoutTrailingZerosOrCurrencyFormatter:rt(o,{minimumFractionDigits:0,maximumFractionDigits:0})}}),[e.currencyCode,o]),p=e=>"currency"===e.type,y=(0,a.useMemo)((()=>({original:()=>e,currencyCode:()=>e.currencyCode,localizedString:()=>i().format(r),parts:()=>i().formatToParts(r),withoutTrailingZeros:()=>r%1==0?l().format(r):i().format(r),withoutTrailingZerosAndCurrency:()=>r%1==0?u().format(r):d().format(r),currencyName:()=>{var t;return(null==(t=c().formatToParts(r).find(p))?void 0:t.value)??e.currencyCode},currencySymbol:()=>{var t;return(null==(t=i().formatToParts(r).find(p))?void 0:t.value)??e.currencyCode},currencyNarrowSymbol:()=>{var e;return(null==(e=s().formatToParts(r).find(p))?void 0:e.value)??""},amount:()=>i().formatToParts(r).filter((e=>["decimal","fraction","group","integer","literal"].includes(e.type))).map((e=>e.value)).join("")})),[e,r,c,i,s,d,l,u]);return(0,a.useMemo)((()=>new Proxy(y,{get:(e,t)=>{var n;return null==(n=Reflect.get(e,t))?void 0:n.call(null)}})),[y])}const ot=new Map;function rt(e,t){const n=JSON.stringify([e,t]);return function(){let o=ot.get(n);return o||(o=new Intl.NumberFormat(e,t),ot.set(n,o)),o}}function at({data:e,as:t,withoutCurrency:n,withoutTrailingZeros:o,measurement:r,measurementSeparator:a="/",...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),d=t??"div";let u=l.localizedString;return(n||o)&&(u=n&&!o?l.amount:!n&&o?l.withoutTrailingZeros:l.withoutTrailingZerosAndCurrency),(0,i.jsxs)(d,{...c,children:[u,r&&r.referenceUnit&&(0,i.jsxs)(i.Fragment,{children:[a,r.referenceUnit]})]})}function it(e){const{cost:t}=ve(),{amountType:n="total",children:o,...r}=e;let a;return"total"==n?a=null==t?void 0:t.totalAmount:"subtotal"==n?a=null==t?void 0:t.subtotalAmount:"tax"==n?a=null==t?void 0:t.totalTaxAmount:"duty"==n&&(a=null==t?void 0:t.totalDutyAmount),null==a?null:(0,i.jsx)(at,{...r,data:a,children:o})}const ct=(0,a.createContext)(null);function st(){const e=(0,a.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,i.jsx)(ct.Provider,{value:t,children:e})}function dt(e){const t=st(),{as:n,...o}=e,r=n||"span";return(0,i.jsx)(r,{...o,children:t.quantity})}function ut(e){const{status:t,linesRemove:n,linesUpdate:o}=ve(),r=st(),{children:c,adjust:s,onClick:l,...d}=e,u=(0,a.useCallback)((()=>{if("remove"===s)return void n([(null==r?void 0:r.id)??""]);const e="decrease"===s?((null==r?void 0:r.quantity)??0)-1:((null==r?void 0:r.quantity)??0)+1;if(e<=0)return void n([(null==r?void 0:r.id)??""]);const t={id:(null==r?void 0:r.id)??"",quantity:e,attributes:(null==r?void 0:r.attributes)??[]};o([t])}),[s,null==r?void 0:r.attributes,null==r?void 0:r.id,null==r?void 0:r.quantity,n,o]),p=d.disabled;return(0,i.jsx)(be,{...d,onClick:l,defaultOnClick:u,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"},mt=(0,a.forwardRef)(((e,t)=>{const{data:n,options:o,id:r=n.id,frameBorder:a="0",allow:c="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:s=!0,loading:l="lazy",...d}=e;if(!n.embedUrl)throw new Error(" requires the 'embedUrl' property");let u=n.embedUrl;if(o){const e=new URL(n.embedUrl);for(const[t,n]of Object.entries(o))void 0!==n&&e.searchParams.set(t,n.toString());u=e.toString()}return(0,i.jsx)("iframe",{...d,id:r??n.embedUrl,title:n.alt??n.id??"external video",frameBorder:a,allow:c,allowFullScreen:s,src:u,loading:l,ref:t})})),ft={OPTION:":",END_OF_PREFIX:",",SEQUENCE_GAP:" ",RANGE:"-"},gt=(()=>{const e=new Map;return function(t,n){var o;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 wt(e){return Object.assign({},...e.map((e=>({[e.name]:e.value}))))}function _t(e){return JSON.stringify(wt(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 It(e){return console.error(`[h2:error:getProductOptions] product.${e} is missing. Make sure you query for this field from the Storefront API.`),!1}function Pt(e,t=!1){var n;let o=!0;const r=Object.keys(e);if((t?[...At,...St]:At).forEach((e=>{r.includes(e)||(o=It(e))})),e.options){const r=null==e?void 0:e.options[0];if(t&&!(null==r?void 0:r.name)&&(o=It("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)&&(o=It("options.optionValues.name")),n=e.options[0].optionValues.filter((e=>!!(null==e?void 0:e.firstSelectableVariant)))[0],(null==n?void 0:n.firstSelectableVariant)&&(o=Tt(n.firstSelectableVariant,"options.optionValues.firstSelectableVariant",o,t))}else o=It("options.optionValues")}return e.selectedOrFirstAvailableVariant&&(o=Tt(e.selectedOrFirstAvailableVariant,"selectedOrFirstAvailableVariant",o,t)),e.adjacentVariants&&e.adjacentVariants[0]&&(o=Tt(e.adjacentVariants[0],"adjacentVariants",o,t)),o?e:{}}function Tt(e,t,n,o){var r;let a=n;if(o&&!(null==(r=e.product)?void 0:r.handle)&&(a=It(`${t}.product.handle`)),e.selectedOptions){const n=e.selectedOptions[0];(null==n?void 0:n.name)||(a=It(`${t}.selectedOptions.name`)),(null==n?void 0:n.value)||(a=It(`${t}.selectedOptions.value`))}else a=It(`${t}.selectedOptions`);return a}function bt(e){const t=Pt(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=_t(e.firstSelectableVariant.selectedOptions);n[t]=e.firstSelectableVariant}}))})),t.adjacentVariants.map((e=>{const t=_t(e.selectedOptions);n[t]=e}));const o=t.selectedOrFirstAvailableVariant;if(o){const e=_t(o.selectedOptions);n[e]=o}return Object.values(n)}function Et(e){const t=Pt(e,!0);if(!t.options)return[];const{options:n,selectedOrFirstAvailableVariant:o,adjacentVariants:r,encodedVariantExistence:a,encodedVariantAvailability:i,handle:c}=t,s=null==o?void 0:o.selectedOptions.map((e=>e.name)),l=n.filter((e=>s&&s.indexOf(e.name)>=0)),d=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),u=function(e){return Object.assign({},...e.map((e=>({[Ct(e.selectedOptions||[])]:e}))))}(o?[o,...r]:r),p=wt(o?o.selectedOptions:[]),y=l.map(((e,t)=>({...e,optionValues:e.optionValues.map((n=>{var o;const r={...p};r[e.name]=n.name;const s=Ct(r||[]),l=function(e,t){return Object.keys(e).map((n=>t[n]?t[n][e[n]]:null)).filter((e=>null!==e))}(r||[],d),y=l.slice(0,t+1),m=gt(y,a||""),f=gt(y,i||""),g=u[s]||n.firstSelectableVariant;let v={};g&&(v=wt(g.selectedOptions||[]));const h=new URLSearchParams(v),w=(null==(o=null==g?void 0:g.product)?void 0:o.handle)||c;return{...n,variant:g,handle:w,variantUriQuery:h.toString(),selected:p[e.name]===n.name,exists:m,available:f,isDifferentProduct:w!==c}}))})));return y}const Ot="#graphql\n fragment Image on Image {\n altText\n url\n width\n height\n }\n",kt=a.forwardRef((({alt:e,aspectRatio:t,crop:n="center",data:o,decoding:r="async",height:c="auto",loader:s=Lt,loading:l="lazy",sizes:d,src:u,srcSetOptions:p={intervals:15,startingWidth:200,incrementSize:200,placeholderWidth:100},width:y="100%",...m},f)=>{const g=a.useMemo((()=>{const e=(null==o?void 0:o.width)&&(null==o?void 0:o.height)?null==o?void 0:o.width:void 0,t=(null==o?void 0:o.width)&&(null==o?void 0:o.height)?null==o?void 0:o.height:void 0;return{width:e,height:t,unitsMatch:Boolean(Rt(e,t))}}),[o]),v=a.useMemo((()=>{const n=Vt((y||"100%").toString()),r=`${n.number}${n.unit}`,a=null==c,i=a?null:Vt(c.toString()),s=i?`${i.number}${i.unit}`:"";return{width:r,height:a?"auto":s,src:u||(null==o?void 0:o.url),alt:(null==o?void 0:o.altText)&&!e?null==o?void 0:o.altText:e||"",aspectRatio:t||(g.unitsMatch?[Ut(g.width),Ut(g.height)].join("/"):void 0)}}),[y,c,u,o,e,t,g,null==m?void 0:m.key]),{intervals:h,startingWidth:w,incrementSize:_,placeholderWidth:C}=p,A=a.useMemo((()=>function(e="100%",t,n,o){const r=Array.from({length:t},((e,t)=>t*o+n)),a=Array.from({length:3},((t,n)=>(n+1)*(Ut(e)??0)));return $t(e)?a:r}(y,h,w,_)),[y,h,w,_]);return $t(v.width)?(0,i.jsx)(xt,{aspectRatio:t,crop:n,decoding:r,height:c,imageWidths:A,loader:s,loading:l,normalizedProps:v,passthroughProps:m,ref:f,width:y,data:o}):(0,i.jsx)(Nt,{aspectRatio:t,crop:n,decoding:r,imageWidths:A,loader:s,loading:l,normalizedProps:v,passthroughProps:m,placeholderWidth:C,ref:f,sizes:d,data:o})})),xt=a.forwardRef((({aspectRatio:e,crop:t,decoding:n,height:o,imageWidths:r,loader:c=Lt,loading:s,normalizedProps:l,passthroughProps:d,width:u,data:p},y)=>{const m=a.useMemo((()=>{const n=Ut(u),a=Ut(o),i=e||(Rt(l.width,l.height)?[n,a].join("/"):l.aspectRatio?l.aspectRatio:void 0),s=void 0===r?void 0:qt(r,i,t,{width:(null==p?void 0:p.width)??void 0,height:(null==p?void 0:p.height)??void 0}),d=a||(i&&n?n*(jt(i)??1):void 0);return{width:n,aspectRatio:i,height:d,srcSet:Ft(l.src,s,c),src:c({src:l.src,width:n,height:d,crop:"auto"===l.height?void 0:t})}}),[e,t,p,o,r,c,l,u]);return(0,i.jsx)("img",{ref:y,alt:l.alt,decoding:n,height:m.height,loading:s,src:m.src,srcSet:m.srcSet,width:m.width,style:{aspectRatio:m.aspectRatio,...d.style},...d})})),Nt=a.forwardRef((({crop:e,decoding:t,imageWidths:n,loader:o=Lt,loading:r,normalizedProps:c,passthroughProps:s,placeholderWidth:l,sizes:d,data:u},p)=>{const y=a.useMemo((()=>{const t=void 0===n?void 0:qt(n,c.aspectRatio,e,{width:(null==u?void 0:u.width)??void 0,height:(null==u?void 0:u.height)??void 0}),r=c.aspectRatio&&l?l*(jt(c.aspectRatio)??1):void 0;return{placeholderHeight:r,srcSet:Ft(c.src,t,o),src:o({src:c.src,width:l,height:r,crop:e})}}),[e,u,n,o,c,l]);return(0,i.jsx)("img",{ref:p,alt:c.alt,decoding:t,height:y.placeholderHeight,loading:r,sizes:d,src:y.src,srcSet:y.srcSet,width:l,...s,style:{width:c.width,aspectRatio:c.aspectRatio,...s.style}})})),Dt="https://placeholder.shopify.com";function Lt({src:e,width:t,height:n,crop:o}){if(!e)return"";const r=new URL(e,Dt);return t&&r.searchParams.append("width",Math.round(t).toString()),n&&r.searchParams.append("height",Math.round(n).toString()),o&&r.searchParams.append("crop",o),r.href.replace(Dt,"")}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 Ft(e,t,n=Lt){return e?0!==(null==t?void 0:t.length)&&t?t.map(((o,r)=>`${n({src:e,width:o.width,height:o.height,crop:o.crop})} ${3===t.length?`${r+1}x`:`${o.width??0}w`}`)).join(", "):e:""}function jt(e){if(!e)return;const[t,n]=e.split("/");return 1/(Number(t)/Number(n))}function qt(e,t,n="center",o){if(e)return e.map((e=>({width:e,height:t?e*(jt(t)??1):void 0,crop:n}))).filter((({width:e,height:t})=>!((null==o?void 0:o.width)&&e>o.width||(null==o?void 0:o.height)&&t&&t>o.height)))}const Mt={};function Gt(e,t){const[n,o]=(0,a.useState)("loading");return(0,a.useEffect)((()=>{(function(e,t){const n=Mt[e];if(n)return n;const o=new Promise(((n,o)=>{const r=document.createElement("script");(null==t?void 0:t.module)?r.type="module":r.type="text/javascript",r.src=e,r.onload=()=>{n(!0)},r.onerror=()=>{o(!1)},"head"===(null==t?void 0:t.in)?document.head.appendChild(r):document.body.appendChild(r);const a=null==t?void 0:t.attributes;a&&Object.keys(a).forEach((e=>{r.setAttribute(e,a[e])}))}));return Mt[e]=o,o})(e,t).then((()=>o("done"))).catch((()=>o("error")))}),[e]),n}const Yt=(0,a.forwardRef)(((e,t)=>{var n;const{data:o,previewImageOptions:r,id:c=o.id,playsInline:s=!0,controls:l=!0,sourceProps:d={},...u}=e,p=Lt({src:(null==(n=o.previewImage)?void 0:n.url)??"",...r});if(!o.sources)throw new Error("