@occluze/tether 0.6.7 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/README.md +11 -11
  2. package/dist/esm/astro.js +2 -2
  3. package/dist/esm/chunks/account-UIPWJQ3Y.js +1 -0
  4. package/dist/esm/chunks/account-pages-6ROA6Y4V.js +1 -0
  5. package/dist/esm/chunks/analytics-2V632IRV.js +1 -0
  6. package/dist/esm/chunks/chunk-4GCXM764.js +1 -0
  7. package/dist/esm/chunks/chunk-56FCLJJD.js +1 -0
  8. package/dist/esm/chunks/chunk-5Z5O3767.js +1 -0
  9. package/dist/esm/chunks/chunk-6OZJCAGZ.js +1 -0
  10. package/dist/esm/chunks/chunk-A5SYCVQM.js +1 -0
  11. package/dist/esm/chunks/chunk-BA4LQJJQ.js +1 -0
  12. package/dist/esm/chunks/chunk-BFTZR4OB.js +4 -0
  13. package/dist/esm/chunks/chunk-C5JYQCWH.js +1 -0
  14. package/dist/esm/chunks/chunk-E5YO6274.js +1 -0
  15. package/dist/esm/chunks/chunk-MPDWM2NN.js +1 -0
  16. package/dist/esm/chunks/chunk-T44MUL4Y.js +1 -0
  17. package/dist/esm/chunks/chunk-YLUULATY.js +1 -0
  18. package/dist/esm/chunks/diagnose-3FEKRIEK.js +14 -0
  19. package/dist/esm/chunks/extras-6POFBNOP.js +1 -0
  20. package/dist/esm/chunks/markets-ui-FD6NI2OG.js +1 -0
  21. package/dist/esm/chunks/search-UJ73YBQ5.js +1 -0
  22. package/dist/esm/index.js +1 -1
  23. package/dist/esm/server.js +2 -1
  24. package/dist/presets/barba.esm.js +55 -39
  25. package/dist/tether.account-pages.js +781 -495
  26. package/dist/tether.account-pages.min.js +1 -1
  27. package/dist/tether.account.js +462 -381
  28. package/dist/tether.account.min.js +1 -1
  29. package/dist/tether.analytics.js +299 -194
  30. package/dist/tether.analytics.min.js +1 -1
  31. package/dist/tether.diagnose.js +354 -262
  32. package/dist/tether.diagnose.min.js +2 -2
  33. package/dist/tether.extras.js +82 -45
  34. package/dist/tether.extras.min.js +1 -1
  35. package/dist/tether.js +3653 -2116
  36. package/dist/tether.markets.js +238 -150
  37. package/dist/tether.markets.min.js +1 -1
  38. package/dist/tether.min.js +3 -3
  39. package/dist/tether.min.js.map +4 -4
  40. package/dist/tether.search.js +207 -136
  41. package/dist/tether.search.min.js +1 -1
  42. package/dist/types/server/src/shared/account-orders.d.ts +44 -0
  43. package/dist/types/server/src/shared/account-routes.d.ts +153 -0
  44. package/dist/types/server/src/shared/api-versions.d.ts +13 -0
  45. package/dist/types/server/src/shared/error-message.d.ts +2 -0
  46. package/dist/types/server/src/shared/json.d.ts +25 -0
  47. package/dist/types/server/src/shared/market-codes.d.ts +16 -0
  48. package/dist/types/src/account/addresses-view.d.ts +5 -0
  49. package/dist/types/src/account/answers.d.ts +40 -0
  50. package/dist/types/src/account/markup.d.ts +19 -0
  51. package/dist/types/src/account/operations.d.ts +41 -0
  52. package/dist/types/src/account/order-lines.d.ts +13 -0
  53. package/dist/types/src/account/order-list.d.ts +12 -0
  54. package/dist/types/src/account/order-page.d.ts +6 -0
  55. package/dist/types/src/account/page-answers.d.ts +182 -0
  56. package/dist/types/src/account/page-events.d.ts +2 -0
  57. package/dist/types/src/account/server-client.d.ts +60 -0
  58. package/dist/types/src/account/subscriptions-view.d.ts +2 -0
  59. package/dist/types/src/account-api.d.ts +18 -0
  60. package/dist/types/src/account-marks.d.ts +15 -0
  61. package/dist/types/src/account-pages.d.ts +8 -0
  62. package/dist/types/src/account.d.ts +64 -0
  63. package/dist/types/src/amounts.d.ts +12 -0
  64. package/dist/types/src/analytics-shopify.d.ts +41 -0
  65. package/dist/types/src/analytics.d.ts +2 -0
  66. package/dist/types/src/api-version.d.ts +28 -0
  67. package/dist/types/src/astro.d.ts +42 -0
  68. package/dist/types/src/cart/cart-shape.d.ts +43 -0
  69. package/dist/types/src/cart/checkout.d.ts +16 -0
  70. package/dist/types/src/cart/drawer.d.ts +18 -0
  71. package/dist/types/src/cart/mutations.d.ts +79 -0
  72. package/dist/types/src/cart/render.d.ts +17 -0
  73. package/dist/types/src/cart/store.d.ts +182 -0
  74. package/dist/types/src/cart.d.ts +106 -0
  75. package/dist/types/src/client.d.ts +100 -0
  76. package/dist/types/src/collection.d.ts +25 -0
  77. package/dist/types/src/config-sections.d.ts +40 -0
  78. package/dist/types/src/config.d.ts +185 -0
  79. package/dist/types/src/controls/cart-controls.d.ts +2 -0
  80. package/dist/types/src/controls/discount.d.ts +2 -0
  81. package/dist/types/src/controls/extras.d.ts +5 -0
  82. package/dist/types/src/controls/navigation.d.ts +12 -0
  83. package/dist/types/src/diagnose-markup.d.ts +19 -0
  84. package/dist/types/src/diagnose.d.ts +60 -0
  85. package/dist/types/src/dom.d.ts +75 -0
  86. package/dist/types/src/extras.d.ts +21 -0
  87. package/dist/types/src/fragments.d.ts +158 -0
  88. package/dist/types/src/globals.d.ts +15 -0
  89. package/dist/types/src/images.d.ts +20 -0
  90. package/dist/types/src/index.d.ts +167 -0
  91. package/dist/types/src/initial.d.ts +56 -0
  92. package/dist/types/src/lazy.d.ts +28 -0
  93. package/dist/types/src/loader.d.ts +84 -0
  94. package/dist/types/src/market-codes.d.ts +6 -0
  95. package/dist/types/src/markets-ui.d.ts +32 -0
  96. package/dist/types/src/markets.d.ts +72 -0
  97. package/dist/types/src/markup.d.ts +131 -0
  98. package/dist/types/src/mounting.d.ts +46 -0
  99. package/dist/types/src/page-market.d.ts +27 -0
  100. package/dist/types/src/presets/barba.d.ts +56 -0
  101. package/dist/types/src/product-events.d.ts +2 -0
  102. package/dist/types/src/product-render.d.ts +17 -0
  103. package/dist/types/src/product-shape.d.ts +88 -0
  104. package/dist/types/src/product-state.d.ts +110 -0
  105. package/dist/types/src/product.d.ts +66 -0
  106. package/dist/types/src/repeaters.d.ts +16 -0
  107. package/dist/types/src/search.d.ts +33 -0
  108. package/dist/types/src/selling-plans.d.ts +64 -0
  109. package/dist/types/src/server.d.ts +88 -0
  110. package/dist/types/src/shopify-values.d.ts +46 -0
  111. package/dist/types/src/status.d.ts +33 -0
  112. package/dist/types/src/storage.d.ts +12 -0
  113. package/dist/types/src/store-html.d.ts +39 -0
  114. package/dist/types/src/storefront/catalog.d.ts +38 -0
  115. package/dist/types/src/storefront/json-ld.d.ts +20 -0
  116. package/dist/types/src/variant-render.d.ts +14 -0
  117. package/package.json +42 -22
  118. package/src/account/addresses-view.ts +58 -0
  119. package/src/account/answers.ts +79 -0
  120. package/src/account/markup.ts +36 -0
  121. package/src/account/operations.ts +145 -0
  122. package/src/account/order-lines.ts +75 -0
  123. package/src/account/order-list.ts +107 -0
  124. package/src/account/order-page.ts +137 -0
  125. package/src/account/page-answers.ts +317 -0
  126. package/src/account/page-events.ts +253 -0
  127. package/src/account/server-client.ts +183 -0
  128. package/src/account/subscriptions-view.ts +115 -0
  129. package/src/account-api.ts +98 -0
  130. package/src/account-marks.ts +35 -0
  131. package/src/account-pages.ts +81 -0
  132. package/src/account.ts +284 -0
  133. package/src/amounts.ts +64 -0
  134. package/src/analytics-shopify.ts +246 -0
  135. package/src/analytics.ts +315 -0
  136. package/src/api-version.ts +79 -0
  137. package/src/astro.ts +272 -0
  138. package/src/cart/cart-shape.ts +25 -0
  139. package/src/cart/checkout.ts +101 -0
  140. package/src/cart/drawer.ts +125 -0
  141. package/src/cart/mutations.ts +237 -0
  142. package/src/cart/render.ts +266 -0
  143. package/src/cart/store.ts +279 -0
  144. package/src/cart.ts +345 -0
  145. package/src/client.ts +391 -0
  146. package/src/collection.ts +175 -0
  147. package/src/config-sections.ts +284 -0
  148. package/src/config.ts +480 -0
  149. package/src/controls/cart-controls.ts +123 -0
  150. package/src/controls/discount.ts +75 -0
  151. package/src/controls/extras.ts +54 -0
  152. package/src/controls/navigation.ts +77 -0
  153. package/src/diagnose-markup.ts +298 -0
  154. package/src/diagnose.ts +294 -0
  155. package/src/dom.ts +268 -0
  156. package/src/extras.ts +136 -0
  157. package/src/fragments.ts +261 -0
  158. package/src/globals.d.ts +15 -0
  159. package/src/images.ts +91 -0
  160. package/src/index.ts +415 -0
  161. package/src/initial.ts +101 -0
  162. package/src/lazy-iife.ts +197 -0
  163. package/src/lazy.ts +42 -0
  164. package/src/loader.ts +363 -0
  165. package/src/market-codes.ts +6 -0
  166. package/src/markets-ui.ts +227 -0
  167. package/src/markets.ts +246 -0
  168. package/src/markup.ts +127 -0
  169. package/src/mounting.ts +264 -0
  170. package/src/page-market.ts +110 -0
  171. package/src/part-integrity.ts +7 -0
  172. package/src/parts/account-pages.ts +7 -0
  173. package/src/parts/account.ts +7 -0
  174. package/src/parts/analytics.ts +7 -0
  175. package/src/parts/diagnose.ts +7 -0
  176. package/src/parts/extras.ts +7 -0
  177. package/src/parts/markets.ts +7 -0
  178. package/src/parts/search.ts +7 -0
  179. package/src/presets/barba.ts +194 -0
  180. package/src/product-events.ts +115 -0
  181. package/src/product-render.ts +218 -0
  182. package/src/product-shape.ts +49 -0
  183. package/src/product-state.ts +318 -0
  184. package/src/product.ts +308 -0
  185. package/src/repeaters.ts +161 -0
  186. package/src/search.ts +305 -0
  187. package/src/selling-plans.ts +145 -0
  188. package/src/server.ts +211 -0
  189. package/src/shopify-values.ts +91 -0
  190. package/src/status.ts +106 -0
  191. package/src/storage.ts +34 -0
  192. package/src/store-html.ts +359 -0
  193. package/src/storefront/catalog.ts +196 -0
  194. package/src/storefront/json-ld.ts +144 -0
  195. package/src/variant-render.ts +139 -0
  196. package/dist/esm/chunks/account-Q6E2TFEV.js +0 -1
  197. package/dist/esm/chunks/account-pages-UZXR4R5F.js +0 -1
  198. package/dist/esm/chunks/analytics-IJBKATUP.js +0 -1
  199. package/dist/esm/chunks/chunk-4QJKLPYR.js +0 -1
  200. package/dist/esm/chunks/chunk-64TUD3QR.js +0 -1
  201. package/dist/esm/chunks/chunk-AJLPU2JC.js +0 -4
  202. package/dist/esm/chunks/chunk-FIOZPPC5.js +0 -1
  203. package/dist/esm/chunks/chunk-K2YEQAIH.js +0 -1
  204. package/dist/esm/chunks/chunk-KIDH76B7.js +0 -1
  205. package/dist/esm/chunks/chunk-PAYT5ZD7.js +0 -1
  206. package/dist/esm/chunks/chunk-RREHGH4A.js +0 -1
  207. package/dist/esm/chunks/chunk-SSJT43CJ.js +0 -1
  208. package/dist/esm/chunks/chunk-VC46IEJQ.js +0 -1
  209. package/dist/esm/chunks/diagnose-3WVAWNTX.js +0 -14
  210. package/dist/esm/chunks/extras-7I7WJX35.js +0 -1
  211. package/dist/esm/chunks/markets-ui-545XLFTE.js +0 -1
  212. package/dist/esm/chunks/search-NILMGYXG.js +0 -1
  213. package/src/account-pages.js +0 -318
  214. package/src/account.js +0 -385
  215. package/src/analytics.js +0 -232
  216. package/src/api-version.js +0 -35
  217. package/src/astro.js +0 -101
  218. package/src/cart.js +0 -559
  219. package/src/client.js +0 -131
  220. package/src/collection.js +0 -114
  221. package/src/config.js +0 -85
  222. package/src/diagnose.js +0 -246
  223. package/src/dom.js +0 -288
  224. package/src/extras.js +0 -63
  225. package/src/fragments.js +0 -144
  226. package/src/index.js +0 -395
  227. package/src/initial.js +0 -75
  228. package/src/lazy-iife.js +0 -46
  229. package/src/lazy.js +0 -18
  230. package/src/loader.js +0 -198
  231. package/src/markets-ui.js +0 -90
  232. package/src/markets.js +0 -133
  233. package/src/mounting.js +0 -154
  234. package/src/parts/account-pages.js +0 -3
  235. package/src/parts/account.js +0 -3
  236. package/src/parts/analytics.js +0 -3
  237. package/src/parts/diagnose.js +0 -3
  238. package/src/parts/extras.js +0 -3
  239. package/src/parts/markets.js +0 -3
  240. package/src/parts/search.js +0 -3
  241. package/src/presets/barba.js +0 -100
  242. package/src/product.js +0 -570
  243. package/src/search.js +0 -153
  244. package/src/selling-plans.js +0 -94
  245. package/src/server.js +0 -252
  246. package/src/status.js +0 -66
  247. package/types/astro.d.ts +0 -17
  248. package/types/barba.d.ts +0 -16
  249. package/types/index.d.ts +0 -426
  250. package/types/server.d.ts +0 -110
@@ -1,5 +1,5 @@
1
- (()=>{var mn=Object.defineProperty;var M=(t,e)=>{for(var n in e)mn(t,n,{get:e[n],enumerable:!0})};var Lt={};M(Lt,{DEFAULTS:()=>Zt,cfg:()=>o,configure:()=>te,isConfigured:()=>Tt,log:()=>O,reportError:()=>P,warn:()=>U});var Zt={domain:"",token:"",apiVersion:"2026-07",country:void 0,language:void 0,locale:void 0,markets:null,prefix:"tether",productPath:"/product",collectionPath:"/collection",metafields:[],imagesFirst:25,variantsFirst:100,sellingPlanGroupsFirst:10,sellingPlansFirst:25,collectionFirst:24,retries:2,revalidate:!0,storageKey:null,cartDrawerOpenClass:"is-open",openCartOnAdd:!0,cartFocus:!0,checkoutTarget:"_self",defaultPurchase:"one-time",variantUrl:!1,maxAge:60,lowStock:5,autoMount:!0,observe:!1,astro:!0,partsUrl:null,formatMoney:null,onLayoutChange:null,onCartOpen:null,onCartClose:null,onLineEnter:null,onLineLeave:null,onValueChange:null,onError:null,debug:!1},o={...Zt};function te(t={}){return Object.keys(o).forEach(e=>delete o[e]),Object.assign(o,Zt,t),o.domain&&(o.domain=String(o.domain).replace(/^https?:\/\//,"").replace(/\/.*$/,"")),o.storageKey||(o.storageKey=`${o.prefix}:cart:${o.domain}`),o.apiVersion==="unstable"&&U('apiVersion "unstable" changes without notice. Pin a dated version (e.g. 2026-07).'),o}var Tt=()=>!!(o.domain&&o.token);function O(...t){o.debug&&console.log(`[${o.prefix}]`,...t)}function U(...t){console.warn(`[${o.prefix}]`,...t)}function P(t,e){if(U(e,t&&(t.message||t.code)?t.message||t.code:t),typeof o.onError=="function")try{o.onError(t,e)}catch{}}var ie={};M(ie,{TetherError:()=>E,endpoint:()=>Qe,gql:()=>_,request:()=>qt,unwrap:()=>re,withContext:()=>Ot});var E=class extends Error{constructor(e,{status:n,errors:r,userErrors:i,code:s}={}){super(e),this.name="TetherError",this.code=s||(n?`HTTP_${n}`:"ERROR"),this.status=n,this.errors=r,this.userErrors=i}};function Qe(t=o){return`https://${t.domain}/api/${t.apiVersion}/graphql.json`}function Ot(t,e=o){let n=[];if(e.country&&n.push(`country: ${String(e.country).toUpperCase()}`),e.language&&n.push(`language: ${String(e.language).toUpperCase().replace("-","_")}`),!n.length||/@inContext/.test(t))return t;let r=`@inContext(${n.join(", ")})`;return/^\s*\{/.test(t)?`query ${r} ${t.trimStart()}`:t.replace(/^(\s*(?:query|mutation)(?:\s+\w+)?\s*(?:\([^)]*\))?)/,`$1 ${r}`)}var ee=t=>new Promise(e=>setTimeout(e,t));function ne(t,e){return t===401||t===403?`Shopify rejected the Storefront token for ${e.domain} (${t}): use the public Storefront API token (Headless channel)${/^shpat_/.test(e.token)?", not an Admin API token (shpat_\u2026)":""}`:t===404?`Store or API version not found (404): check domain ${e.domain} and apiVersion ${e.apiVersion}`:`HTTP ${t} from ${e.domain}`}async function qt(t,e,n={},{context:r=!0}={}){if(!t.domain||!t.token)throw new E("Tether is not configured: domain and token are required",{code:"NOT_CONFIGURED"});let i=r?Ot(e,t):e,s=t.maxAge??60;s>0&&!/^\s*mutation\b/.test(i)&&(i+=` #${Math.floor(Date.now()/(s*1e3))}`);let a=JSON.stringify({query:i,variables:n}),c=0;for(;;){let u;try{u=await(t.fetch||fetch)(Qe(t),{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.token},body:a})}catch(m){if(c++<t.retries){await ee(300*2**c);continue}throw new E(`Network error: ${m.message}`,{code:"NETWORK"})}if(u.status===430)throw new E("Shopify security rejection (430)",{status:430});if((u.status===429||u.status>=500)&&c++<t.retries){O("retry",u.status,c),await ee(300*2**c);continue}let h;try{h=await u.json()}catch{throw new E(u.ok?`Invalid response (${u.status})`:ne(u.status,t),{status:u.status})}if(h.errors?.length){if(h.errors.some(C=>/quantityAvailable/.test(C.message||""))&&/\bquantityAvailable\b/.test(a))return O("no inventory permission, retrying without quantityAvailable"),qt(t,e.replace(/\bquantityAvailable\b/g,""),n,{context:r});if(h.errors.some(C=>/'warnings'/.test(C.message||""))&&/warnings \{ code message target \}/.test(e))return qt(t,e.replace(/ warnings \{ code message target \}/g,""),n,{context:r});if(h.errors.some(C=>C.extensions?.code==="THROTTLED")&&c++<t.retries){await ee(500*2**c);continue}let b=h.errors.map(C=>C.message).filter(Boolean).join(" | ");throw new E(u.ok?b||"Storefront API error":u.status===401||u.status===403||!b?ne(u.status,t):b,{status:u.status,errors:h.errors})}if(!u.ok)throw new E(ne(u.status,t),{status:u.status});return h.data}}var _=(t,e,n)=>qt(o,t,e,n);function re(t,e){if(!t)throw new E(`${e}: empty response`);let n=t.userErrors||[];if(n.length)throw new E(n.map(r=>r.message).join(" | "),{userErrors:n});return t}var Ce={};M(Ce,{Cart:()=>A,focusables:()=>Rt,toLineInput:()=>en});var ae={};M(ae,{ALLOCATION_FIELDS:()=>We,SELLING_PLAN_FIELDS:()=>Ge,cartFragment:()=>Nt,collectionFields:()=>se,metafieldIdentifiers:()=>He,productFragment:()=>gt});var w="amount currencyCode",tt="url altText width height";function He(t=o){return(t.metafields||[]).map(e=>{if(typeof e=="string"){let n=e.indexOf(".");return{namespace:e.slice(0,n),key:e.slice(n+1)}}return e}).filter(e=>e.namespace&&e.key)}function gn(t=o){let e=He(t);return e.length?`metafields(identifiers:[${e.map(r=>`{namespace: ${JSON.stringify(r.namespace)}, key: ${JSON.stringify(r.key)}}`).join(", ")}]){namespace key type value reference{... on MediaImage{image{${tt}}}}}`:""}var Ge=` id name description recurringDeliveries options{name value}priceAdjustments{orderCount adjustmentValue{__typename ... on SellingPlanPercentagePriceAdjustment{adjustmentPercentage}... on SellingPlanFixedAmountPriceAdjustment{adjustmentAmount{${w}}}... on SellingPlanFixedPriceAdjustment{price{${w}}}}}`,We=` sellingPlan{id}checkoutChargeAmount{${w}}remainingBalanceChargeAmount{${w}}priceAdjustments{price{${w}}compareAtPrice{${w}}perDeliveryPrice{${w}}unitPrice{${w}}}`;function gt(t=o){return` fragment TetherProduct on Product{id handle title description descriptionHtml productType vendor tags availableForSale publishedAt onlineStoreUrl requiresSellingPlan seo{title description}featuredImage{${tt}}images(first:${t.imagesFirst}){nodes{${tt}}}options{name optionValues{name swatch{color image{previewImage{${tt}}}}}}priceRange{minVariantPrice{${w}}maxVariantPrice{${w}}}compareAtPriceRange{minVariantPrice{${w}}maxVariantPrice{${w}}}${gn(t)} sellingPlanGroups(first:${t.sellingPlanGroupsFirst}){nodes{name appName options{name values}sellingPlans(first:${t.sellingPlansFirst}){nodes{${Ge}}}}}variants(first:${t.variantsFirst}){nodes{id title availableForSale currentlyNotInStock quantityAvailable sku barcode selectedOptions{name value}image{${tt}}price{${w}}compareAtPrice{${w}}unitPrice{${w}}sellingPlanAllocations(first:${t.sellingPlansFirst}){nodes{${We}}}}}}`}function Nt(){return` fragment TetherCart on Cart{id checkoutUrl totalQuantity note createdAt updatedAt attributes{key value}buyerIdentity{countryCode email}discountCodes{code applicable}cost{subtotalAmount{${w}}totalAmount{${w}}checkoutChargeAmount{${w}}}lines(first:100){nodes{id quantity attributes{key value}cost{totalAmount{${w}}subtotalAmount{${w}}amountPerQuantity{${w}}compareAtAmountPerQuantity{${w}}}discountAllocations{discountedAmount{${w}}}sellingPlanAllocation{sellingPlan{id name description recurringDeliveries options{name value}}checkoutChargeAmount{${w}}priceAdjustments{price{${w}}compareAtPrice{${w}}perDeliveryPrice{${w}}}}merchandise{... on ProductVariant{id title sku availableForSale requiresShipping quantityAvailable image{${tt}}price{${w}}compareAtPrice{${w}}selectedOptions{name value}product{id title handle vendor featuredImage{${tt}}}}}... on ComponentizableCartLine{lineComponents{id quantity merchandise{... on ProductVariant{id title product{title handle}}}}}}}}`}function se(){return`
1
+ (()=>{var Dn=Object.defineProperty;var Ei=(t,e,n)=>e in t?Dn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var wi=(t,e)=>{for(var n in e)Dn(t,n,{get:e[n],enumerable:!0})};var S=(t,e,n)=>Ei(t,typeof e!="symbol"?e+"":e,n);var Hn="2026-07";var Ci=/^(\d{4})-(01|04|07|10)$/;function Si(t){let e=Ci.exec(typeof t=="string"?t:"");return e?{year:Number(e[1]),month:Number(e[2])}:null}var Vn=t=>Si(t)!==null;function A(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function X(t,e){return A(t)?t[e]:void 0}var ki=/^[A-Za-z0-9_.-]+$/,Ti=/^(\$app(:[A-Za-z0-9_-]+)?|[A-Za-z0-9_.-]+)$/,vi=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Ai=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,xi=/^[A-Za-z_$][\w$]*$/,jn="https://site.invalid",Li=new Set(["localhost","127.0.0.1","[::1]"]),Gt=["saved","server","webflow"],Ii=["no-banner","default-banner","custom-banner"],Qt=t=>typeof t=="string"&&t!=="",Mi=t=>typeof t=="function";function Gn(t,e){if(typeof t!="string"||!t)return"";let n=t.replace(/^https?:\/\//,"").replace(/\/.*$/,"");return Ni(n)?n:(e("domain",t),"")}function Qn(t){if(!Qt(t))return!1;try{let e=new URL(t,`${jn}/`);return e.origin===jn?!0:e.protocol==="https:"||e.protocol==="http:"&&Li.has(e.hostname)}catch{return!1}}function Kn(t,e){return t==null||t===""?null:typeof t=="string"&&(Qn(t)||Oi(t))?t:(e("partsUrl",t),null)}function Oi(t){if(typeof location>"u")return!1;try{return new URL(t).origin===location.origin}catch{return!1}}function Ri(t){if(typeof t!="string")return null;try{let e=new URL(t);return e.protocol==="https:"&&e.href===new URL(e.origin).href?e.origin:null}catch{return null}}function Wn(t,e){if(!Array.isArray(t))return e("embedOrigins",t),[];let n=[],r=t;for(let o of r){let i=Ri(o);i?n.push(i):e("embedOrigin",o)}return n}function Qe(t){let e,n;if(typeof t=="string"){let r=t.indexOf(".");e=r>0?t.slice(0,r):"",n=t.slice(r+1)}else typeof t=="object"&&t!==null&&(e=Reflect.get(t,"namespace"),n=Reflect.get(t,"key"));return typeof e!="string"||typeof n!="string"?null:Ti.test(e)&&ki.test(n)?{namespace:e,key:n}:null}function Bn(t,e){if(!Array.isArray(t))return e("metafields",t),[];let n=[],r=t;for(let o of r){let i=Qe(o);i?n.push(typeof o=="string"?o:i):e("metafield",o)}return n}var xt=t=>e=>t(e)?e:void 0,Ni=t=>Qt(t)&&vi.test(t),$i=t=>Qt(t)&&Ai.test(t),_i=t=>typeof t=="boolean"||Qt(t)&&xi.test(t),qt=xt(Qn),ce=xt(Qt),qn=xt(t=>typeof t=="boolean"),Yn=xt(Mi);function Kt(t,e,n,r){if(e==null)return null;if(!A(e))return r(t,e),null;let o={},i=n;for(let[s,u]of Object.entries(i)){let l=e[s];if(l===void 0)continue;let d=u(l);d===void 0?r(`${t}.${s}`,l):o[s]=d}return o}var Ui={server:qt,orderUrl:qt,subscriptionsUrl:qt,paymentUrl:qt,logoutUrl:qt,locale:ce,navigate:Yn},Fi="customer accounts need the Worker since 0.7.0: set account.server",Di={country:ce,language:ce,locale:ce},Hi={detect:t=>{if(typeof t=="boolean")return t;let e=Array.isArray(t)?t:[t];return typeof t=="string"||Array.isArray(t)?Gt.filter(n=>e.includes(n)):void 0},locales:t=>{if(!A(t))return;let e={};for(let[n,r]of Object.entries(t)){let o=Kt(`markets.locales.${n}`,r,Di,()=>{});o&&(e[n]=o)}return e},cookie:xt($i),remember:qn,strict:qn},Vi={consent:t=>Ii.find(e=>e===t),proxy:t=>t!==void 0&&!!t},ji={dataLayer:xt(_i),shopify:t=>typeof t=="boolean"?t:Kt("analytics.shopify",t,Vi,()=>{})??void 0,onEvent:Yn};function zn(t,e,n){let r=Kt("account",t,Ui,e);if(r===null)return null;let{server:o}=r;return o===void 0?(n(Fi),null):{...r,server:o}}var Ke=(t,e)=>Kt("markets",t,Hi,e),Jn=(t,e)=>Kt("analytics",t,ji,e);var qi=/^[A-Z]{2}$/,Gi=new Set(["XX","T1"]),Qi=new Set(["PT_BR","PT_PT","ZH_CN","ZH_TW"]),Ki=/^[A-Z]{2,3}$/;function _(t){let e=(typeof t=="string"?t:"").trim().toUpperCase();return!qi.test(e)||Gi.has(e)?null:e}function U(t){let e=(typeof t=="string"?t:"").trim().replace("-","_").toUpperCase();if(Qi.has(e))return e;let n=e.split("_")[0]??"";return Ki.test(n)?n:null}var at={domain:"",token:"",apiVersion:Hn,country:void 0,language:void 0,locale:void 0,markets:null,prefix:"tether",productPath:"/product",collectionPath:"/collection",metafields:[],embedOrigins:[],imagesFirst:25,variantsFirst:100,sellingPlanGroupsFirst:10,sellingPlansFirst:25,collectionFirst:24,retries:2,revalidate:!0,storageKey:"",cartDrawerOpenClass:"is-open",openCartOnAdd:!0,cartFocus:!0,checkoutTarget:"_self",defaultPurchase:"one-time",variantUrl:!1,maxAge:60,lowStock:5,searchDelay:150,autoMount:!0,observe:!1,astro:!0,partsUrl:null,analytics:null,account:null,warningText:null,formatMoney:null,onLayoutChange:null,onCartOpen:null,onCartClose:null,onLineEnter:null,onLineLeave:null,onValueChange:null,onError:null,debug:!1},a={...at};function tr(t){let e=n=>(k(`Tether.config is read-only (${String(n)}): pass options to Tether.init() instead`),!1);return new Proxy(t,{get(n,r){let o=Reflect.get(n,r);return typeof o=="object"&&o!==null?tr(o):o},set:(n,r)=>e(r),deleteProperty:(n,r)=>e(r),defineProperty:(n,r)=>e(r)})}var er=tr(a),Wi=/^[a-z][a-z0-9-]*$/,Bi=["revalidate","openCartOnAdd","cartFocus","variantUrl","autoMount","observe","astro","debug"],Yi=["token","productPath","collectionPath","cartDrawerOpenClass"],zi=["imagesFirst","variantsFirst","sellingPlanGroupsFirst","sellingPlansFirst","collectionFirst","retries","maxAge","lowStock","searchDelay"],Ji=["warningText","formatMoney","onLayoutChange","onCartOpen","onCartClose","onLineEnter","onLineLeave","onValueChange","onError"];function Lt(t,e,n){return e!==void 0&&k(`invalid ${t} ${JSON.stringify(e)}: using ${JSON.stringify(n)}`),n}function W(t,e){k(`invalid ${t} ${JSON.stringify(e)}: ignored`)}function Zi(t){for(let e of Object.keys(t))e in at||k(`unknown option ${JSON.stringify(e)}: ignored`)}function Xi(t){return typeof t=="function"?t:null}function ts(t){return Object.fromEntries(Ji.map(n=>[n,Xi(t[n])]))}function es(t,e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:Lt(t,e,at[t])}function ns(t,e){return typeof e=="boolean"?e:Lt(t,e,at[t])}function rs(t,e){return typeof e=="string"?e:Lt(t,e,at[t])}function os(t){if(!(t==null||t==="")){try{if(typeof t=="string"&&Intl.getCanonicalLocales(t).length)return t}catch{}W("locale",t)}}function Zn(t,e,n){return n.find(r=>r===e)??Lt(t,e,n[0])}function is(t){return t==="unstable"?(k('apiVersion "unstable" changes without notice. Pin a dated version (e.g. 2026-07).'),t):Vn(t)?t:Lt("apiVersion",t,at.apiVersion)}function Xn(t,e,n){if(e==null||e==="")return;let r=n(e);if(r!==null)return r;W(t,e)}function ss(t){Zi(t);let e=Gn(t.domain,W),n=typeof t.prefix=="string"&&Wi.test(t.prefix)?t.prefix:Lt("prefix",t.prefix,at.prefix),r={...at,...ts(t),domain:e,apiVersion:is(t.apiVersion),country:Xn("country",t.country,_),locale:os(t.locale),partsUrl:Kn(t.partsUrl,W),language:Xn("language",t.language,U),markets:Ke(t.markets,W),analytics:Jn(t.analytics,W),account:zn(t.account,W,k),prefix:n,storageKey:typeof t.storageKey=="string"&&t.storageKey?t.storageKey:`${n}:cart:${e}`,metafields:Bn(t.metafields??[],W),embedOrigins:Wn(t.embedOrigins??[],W),checkoutTarget:Zn("checkoutTarget",t.checkoutTarget,["_self","_blank"]),defaultPurchase:Zn("defaultPurchase",t.defaultPurchase,["one-time","subscription"])};for(let o of zi)r[o]=es(o,t[o]);for(let o of Bi)r[o]=ns(o,t[o]);for(let o of Yi)r[o]=rs(o,t[o]);return r}var We=t=>Ke(t,W);function nr(t={}){let e=ss(t);for(let n of Object.keys(a))n in e||Reflect.deleteProperty(a,n);return Object.assign(a,e)}var It=()=>!!(a.domain&&a.token);function x(...t){a.debug&&console.log(`[${a.prefix}]`,...t)}function k(...t){console.warn(`[${a.prefix}]`,...t)}function m(t,e){if(k(e,t instanceof Error&&t.message?t.message:t),!!a.onError)try{a.onError(t,e)}catch(n){k("onError threw",n)}}function rr(t){return t instanceof Error?t.message:String(t)}var P=class extends Error{constructor(n,{status:r,errors:o,userErrors:i,code:s}={}){super(n);S(this,"name","TetherError");S(this,"code");S(this,"status");S(this,"errors");S(this,"userErrors");this.code=s??(r?`HTTP_${r}`:"ERROR"),this.status=r,this.errors=o,this.userErrors=i}};function tt(t,e){return typeof e=="function"?e(t):typeof e=="string"?e==="object"?A(t):typeof t===e:as(e)?Array.isArray(t)&&t.every(n=>tt(n,e[0])):A(t)&&Object.entries(e).every(([n,r])=>tt(t[n],r))}var as=t=>Array.isArray(t),F=t=>e=>e===null||tt(e,t),B=t=>e=>tt(e,t);function ze(t=a){return`https://${t.domain}/api/${t.apiVersion}/graphql.json`}var us=/"(?:\\.|[^"\\\n])*"|#[^\n]*/g,cs=/^\s*(?:query|mutation)(?:\s+\w+)?\s*(?:\([^)]*\))?/;function ur(t,{country:e,language:n}){let r=[];if(e&&r.push(`country: ${e}`),n&&r.push(`language: ${n}`),!r.length)return t;let o=`@inContext(${r.join(", ")})`,i=t.replace(us,d=>" ".repeat(d.length)),s=i.indexOf("{");if(i.slice(0,s).includes("@inContext"))return t;if(i.trimStart().startsWith("{"))return`query ${o} ${t.slice(s)}`;let u=cs.exec(i);if(!u)return t;let l=u[0].length;return`${t.slice(0,l).trimEnd()} ${o} ${t.slice(l).trimStart()}`}function cr(t,e=a){let n=_(e.country)??void 0,r=U(e.language)??void 0;return ur(t,{country:n,language:r})}var or=300,ls=500,ir=430,ds=1e3,Ye="quantityAvailable",sr=new Set,ps=t=>`${t.domain} ${t.apiVersion} ${t.token}`;function fs(t,e,n,r){let o=typeof e=="string"?e:e(n),i=r?ur(o,t):o;return t.maxAge<=0||/^\s*mutation\b/.test(i)?i:`${i} #${Math.floor(Date.now()/(t.maxAge*ds))}`}var ms=t=>new Promise(e=>setTimeout(e,t));function Je(t,e){if(t===401||t===403){let n=e.token.startsWith("shpat_")?", not an Admin API token (shpat_\u2026)":"";return`Shopify rejected the Storefront token for ${e.domain} (${t}): use the public Storefront API token (Headless channel)${n}`}return t===404?`Store or API version not found (404): check domain ${e.domain} and apiVersion ${e.apiVersion}`:`HTTP ${t} from ${e.domain}`}function gs(t){let e=X(t,"message"),n=X(X(t,"extensions"),"code"),r=typeof e=="string"?e:"";return typeof n=="string"?{message:r,extensions:{code:n}}:{message:r}}function hs(t){if(!A(t))return null;let{data:e,errors:n}=t;return n==null?{data:e}:Array.isArray(n)?{data:e,errors:n.map(gs)}:null}function Be(t,e){let n=t.ok?`Invalid response (${t.status})`:Je(t.status,e);return new P(n,{status:t.status})}function ar(t,e,n){let r=e.map(i=>i.message).filter(Boolean).join(" | "),o=r||"Storefront API error";return t.ok||(o=t.status===401||t.status===403||!r?Je(t.status,n):r),new P(o,{status:t.status,errors:e})}async function ys(t,e,n,r,o){let i;try{i=await(t.fetch??fetch)(ze(t),{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.token},body:JSON.stringify({query:e,variables:n})})}catch(g){if(o)return{kind:"retry",backoffMs:or};throw new P(`Network error: ${rr(g)}`,{code:"NETWORK"})}if(i.status===ir)throw new P("Shopify security rejection (430)",{status:ir});if(o&&(i.status===429||i.status>=500))return{kind:"retry",backoffMs:or};let s;try{s=await i.json()}catch{throw Be(i,t)}let u=hs(s);if(!u)throw Be(i,t);let{data:l,errors:d=[]}=u;if(d.length){if(e.includes(Ye)&&d.some(g=>g.message.includes(Ye)))return{kind:"inventory-refused",error:ar(i,d,t)};if(o&&d.some(g=>g.extensions?.code==="THROTTLED"))return{kind:"retry",backoffMs:ls};throw ar(i,d,t)}if(!i.ok)throw new P(Je(i.status,t),{status:i.status});if(!r(l))throw Be(i,t);return{kind:"data",data:l}}async function bs(t,e,n,r,{context:o=!0}={}){if(!t.domain||!t.token)throw new P("Tether is not configured: domain and token are required",{code:"NOT_CONFIGURED"});let i=ps(t),s=0;for(;;){let u=fs(t,e,{inventory:!sr.has(i)},o),l=await ys(t,u,n,r,s<t.retries);switch(l.kind){case"data":return l.data;case"inventory-refused":if(typeof e=="string")throw l.error;x(`the token can't read inventory: ${Ye} is left out from now on`),sr.add(i);break;case"retry":s+=1,x("retry",s),await ms(l.backoffMs*2**s);break}}}function D(t,e,n,r){return bs(a,t,e,n,r)}var Ps=t=>typeof t=="object"&&t!==null;function lr(t,e={},n){return D(t,e,Ps,n)}function dr(t,e){if(!t)throw new P(`${e}: empty response`);let n=t.userErrors??[];if(n.length)throw new P(n.map(r=>r.message).join(" | "),{userErrors:n});return t}var f=t=>`${a.prefix}-${t}`,c=(t,e)=>e===void 0?`[${f(t)}]`:`[${f(t)}="${e}"]`,p=(t,e)=>t.getAttribute(f(e)),H=(t,e)=>t.hasAttribute(f(e));function y(t,e){return t?[...t.querySelectorAll(e)]:[]}var ut=(t,e,n)=>y(t,e).filter(r=>r.closest(n)===t),Wt=["product-ready","list-ready","cart-updated","cart-toggled","checkout","search"],pr=new WeakMap;function fr(t,e){let n=new CustomEvent(`${a.prefix}:${t}`,{detail:e,bubbles:!0});return pr.set(n,t),n}function ct(t,e){return pr.get(t)===e}function h(t,e,n=document){n.dispatchEvent(fr(t,e))}var Es="http://www.w3.org/1999/xhtml",ws=new Set(["h1","h2","h3","h4","h5","h6","p","span","div","br","hr","blockquote","code","pre","strong","em","b","i","u","s","small","sub","sup","ul","ol","li","dl","dt","dd","table","caption","colgroup","col","thead","tbody","tfoot","tr","th","td","a","img","picture","source","video","figure","figcaption","iframe"]),Cs=new Set(["script","style","template","noscript","textarea","select","title"]),Ss=new Set(["style","title","lang","dir","role","align","width","height"]),ks=new Map([["a",new Set(["href","target","rel","hreflang"])],["img",new Set(["src","srcset","sizes","alt","loading","decoding"])],["source",new Set(["src","srcset","sizes","type","media"])],["video",new Set(["src","poster","controls","autoplay","muted","loop","playsinline","preload"])],["iframe",new Set(["src","allow","allowfullscreen","frameborder","loading"])],["blockquote",new Set(["cite"])],["ol",new Set(["start","type","reversed"])],["li",new Set(["value"])],["table",new Set(["border","cellpadding","cellspacing","summary"])],["col",new Set(["span"])],["colgroup",new Set(["span"])],["th",new Set(["colspan","rowspan","headers","scope","valign"])],["td",new Set(["colspan","rowspan","headers","valign"])]]),Ts=new Set(["href","src","poster","cite"]),vs=/^(javascript|vbscript|data):/i,As=/^data:image\/(png|gif|jpeg|webp|avif);/i,xs=new Set(["position","top","right","bottom","left","z-index","-webkit-box-reflect"]),Ls=["inset","transform","translate","rotate","scale","offset"],Is=/\d(?:[sld]?v|cq)(?:w|h|i|b|min|max)\b/i,Ms=/^(?:outline|box-shadow|text-shadow|filter|text-decoration|text-underline-offset|text-stroke)|^(?:border-image|mask-border|mask-box-image)(?:-outset)?$/,mr=40,Os=new Map([["letter-spacing",{px:4,em:.25}],["word-spacing",{px:4,em:.25}],["text-indent",{px:mr}]]),gr=/(?<![\w#.-])[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(%|[a-z]+)?/gi,Rs=/(?<![\w-])(?!drop-shadow\(|blur\()[\w-]+\([^()]*\)/g,hr=/(?:var|calc|min|max|clamp|env|attr)\(/i,Ns=/url\(|expression\(|@import/i,$s=/[\u0000- ]/g,_s="allow-scripts allow-same-origin allow-popups allow-presentation",Us=new Set(["autoplay","encrypted-media","picture-in-picture","fullscreen","clipboard-write","accelerometer","gyroscope","web-share"]),Fs="strict-origin-when-cross-origin",Ds=["https://www.youtube.com","https://www.youtube-nocookie.com","https://player.vimeo.com","https://www.loom.com","https://fast.wistia.net"];function Hs(t,e){return Ss.has(e)||e.startsWith("aria-")||(ks.get(t)?.has(e)??!1)}function Vs(t,e,n){let r=n.replace($s,"");return vs.test(r)?t==="img"&&e==="src"&&As.test(r):!0}function yr(t,e){try{return new URL(t,e)}catch{return null}}function js(t,e,n){let r=t.baseURI,o=yr(r)?.origin??"null";return{origin:o==="null"?null:o,baseUrl:r,styleParser:e,embedOrigins:new Set([...Ds,...n])}}function qs(t,e){let n=yr(t.trim(),e.baseUrl);return n!==null&&n.origin!==e.origin&&e.embedOrigins.has(n.origin)}function Gs(t){let e=t.split(";").map(n=>n.trim().split(/\s+/)[0]?.toLowerCase()??"");return[...new Set(e.filter(n=>Us.has(n)))].join("; ")}function Qs(t,e){if(xs.has(t)||Ls.some(r=>t.startsWith(r))||Is.test(e))return!0;let n=Os.get(t);return n?hr.test(e)||Ks(e,n):t.startsWith("margin")&&e.includes("-")}function Ks(t,e){return[...t.matchAll(gr)].some(([n="",r=""])=>{let o=parseFloat(n);if(o>=0)return!1;let i=e[r.toLowerCase()];return i===void 0||-o>i})}function Ws(t,e){return Ms.test(t.replace(/^-webkit-/,""))?hr.test(e)?!0:[...e.replace(Rs,"").matchAll(gr)].some(([n="",r=""])=>{let o=Math.abs(parseFloat(n));return o!==0&&(r.toLowerCase()!=="px"||o>mr)}):!1}function Bs(t,e){let n=e.style;n.cssText=t;let r=Array.from({length:n.length},(i,s)=>n.item(s));for(let i of r){let s=n.getPropertyValue(i);(Qs(i,s)||Ws(i,s)||Ns.test(s))&&n.removeProperty(i)}let o=n.cssText;return e.removeAttribute("style"),o}function Ys(t,e){let n=t.localName;for(let i of[...t.attributes]){let s=i.name.toLowerCase(),u=Ts.has(s);Hs(n,s)&&(!u||Vs(n,s,i.value))||t.removeAttribute(i.name)}let r=t.getAttribute("style");if(r===null)return;let o=Bs(r,e.styleParser);o===""?t.removeAttribute("style"):t.setAttribute("style",o)}function zs(t){if(t.localName==="iframe"){let n=Gs(t.getAttribute("allow")??"");n===""?t.removeAttribute("allow"):t.setAttribute("allow",n),t.setAttribute("sandbox",_s),t.setAttribute("referrerpolicy",Fs);return}if(t.localName!=="a"||t.getAttribute("target")?.toLowerCase()!=="_blank")return;let e=new Set((t.getAttribute("rel")??"").split(/\s+/).filter(Boolean));e.add("noopener"),e.add("noreferrer"),t.setAttribute("rel",[...e].join(" "))}function Js(t,e){let n=t.localName,r=t.namespaceURI===Es;if(r&&Cs.has(n)){t.remove();return}if(!r||!ws.has(n)){t.replaceWith(...t.childNodes);return}if(n==="iframe"&&!qs(t.getAttribute("src")??"",e)){t.remove();return}Ys(t,e),zs(t)}function br(t,e=globalThis.document,n=[]){let r=e.createElement("template");r.innerHTML=t??"";let o=js(e,r,n);for(let i of[...r.content.querySelectorAll("*")])Js(i,o);return r.content}function le(t){if(typeof t!="string")return!1;try{return new URL(t).protocol==="https:"}catch{return!1}}function Pr(t,e){if(!t)return"";let n=parseFloat(t.amount);if(Number.isNaN(n))return"";try{return new Intl.NumberFormat(e||void 0,{style:"currency",currency:t.currencyCode}).format(n)}catch{return`${t.currencyCode} ${n.toFixed(2)}`}}function Er(t,e,n){if(!/\{(handle|id)\}/.test(t))return e?`${t.replace(/\/$/,"")}/${encodeURIComponent(e)}`:null;let r=n?n.split("/").at(-1)??"":"";return t.includes("{handle}")&&!e||t.includes("{id}")&&!r?null:t.replace(/\{handle\}/g,encodeURIComponent(e??"")).replace(/\{id\}/g,encodeURIComponent(r))}function wr(t){let e=String(t??"").trim();return e?e.startsWith("gid://")?e:/^\d+$/.test(e)?`gid://shopify/Product/${e}`:/\/products\/([^/?#]+)/.exec(e)?.[1]??e:null}function de(t,{width:e,height:n,crop:r}={}){if(!t)return t;let o;try{o=new URL(t)}catch(i){if(i instanceof TypeError)return t;throw i}return e&&o.searchParams.set("width",String(e)),n&&o.searchParams.set("height",String(n)),r&&o.searchParams.set("crop",r),o.toString()}function Ze(t,e){return t.getAttribute(e)??t.getAttribute(f(e))??t.getAttribute(`data-${e}`)}function Sr(t,e){if(!t||!e)return t;let n=Ze(e,"max-width"),r=Ze(e,"max-height");return de(t,{width:n,height:r,crop:n||r?Ze(e,"crop"):null})}var Cr=t=>t.replace(/\?.*$/,"");function pe(t,e){return!t||!e?!1:Cr(t)===Cr(e)}function Zs(t){return/^\s*[a-z][a-z0-9+.-]*:/i.test(t)&&!/^\s*(https?:|data:image\/)/i.test(t)?"none":`url("${t.replace(/["\\\n\r\f]/g,r=>`\\${r.charCodeAt(0).toString(16)} `)}")`}function I(t,e,n){if(!e)return;let r=Sr(e,t);if(t.tagName!=="IMG"){t.style.backgroundImage=Zs(r);return}if(pe(t.getAttribute("src"),r)){n!=null&&!t.getAttribute("alt")&&t.setAttribute("alt",n);return}t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.setAttribute("src",r),n!=null&&t.setAttribute("alt",n),t.getAttribute("loading")||t.setAttribute("loading","lazy")}var Xe=new WeakMap,Bt=t=>!!Xe.get(t),tn=t=>t.cloneNode(!0);function kr(t){let e=Xe.get(t);if(e!==void 0)return e;let n=t.firstElementChild,r=n?tn(n):null;return Xe.set(t,r),t.replaceChildren(),r}function V(t,e,n){let r=kr(t);if(!r){e.length&&k("repeater without a template child",t);return}t.replaceChildren(),e.forEach((o,i)=>{let s=tn(r);n(s,o,i),t.appendChild(s)})}function Xs(t,e){let n=()=>{t.remove()};if(!e){n();return}try{e(t,n)}catch(r){m(r,"repeater onLeave"),n()}}function ta(t,e,n,r){e.forEach((o,i)=>{if(!n.has(o))return;let s=e[i-1];if(s?.parentNode===t?s.after(o):t.prepend(o),!!r)try{r(o)}catch(u){m(u,"repeater onEnter")}})}function en(t,e,n,r,{onEnter:o,onLeave:i}={}){let s=kr(t);if(!s){k("repeater without a template child",t);return}let u=`data-${a.prefix}-key`,l=`data-${a.prefix}-leaving`,d=()=>[...t.children].filter(C=>C.hasAttribute(u)&&!C.hasAttribute(l)),g=new Map(d().map(C=>[C.getAttribute(u),C])),$=[],Z=new Set;e.forEach((C,ue)=>{let Ge=String(n(C,ue)),bt=g.get(Ge);bt?g.delete(Ge):(bt=tn(s),bt.setAttribute(u,Ge),Z.add(bt)),r(bt,C,ue,Z.has(bt)),$.push(bt)});let G=$.filter(C=>!Z.has(C)),Fn=d().filter(C=>G.includes(C));if(!(Fn.length===G.length&&Fn.every((C,ue)=>C===G[ue]))){g.forEach(C=>{C.remove()}),$.forEach(C=>t.appendChild(C));return}ta(t,$,Z,o),g.forEach(C=>{C.setAttribute(l,""),C.removeAttribute(u),C.style.pointerEvents="none",C.inert=!0,Xs(C,i)})}var Tr="data-tether-seen",rn="data-tether-shown",fe="data-tether-prev-display",ea=120;function Mt(t,e){return Er(a.productPath||"/product",t,e)}function Lr(t,e){try{return t()}catch(n){if(n instanceof RangeError)return e;throw n}}function Ir(t,e=a.locale){return t?Lr(()=>new Intl.NumberFormat(e||void 0,{style:"percent",maximumFractionDigits:0}).format(t/100),`${t}%`):""}function M(t){return t?a.formatMoney?a.formatMoney(t,a.locale):Pr(t,a.locale):""}function me(t){return t?Lr(()=>new Date(t).toLocaleDateString(a.locale||void 0),""):""}function ge(t,e){t.replaceChildren(br(e,t.ownerDocument,a.embedOrigins))}var Mr=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA",vr=t=>t.tagName==="INPUT";function w(t,e){let n=e==null?"":String(e);Mr(t)?t.value=n:t.textContent=n}var Ar=t=>Mr(t)?t.value:t.textContent;function lt(t,e){let n=Ar(t);if(w(t,e),n!==Ar(t)&&t.hasAttribute(Tr)&&a.onValueChange)try{a.onValueChange(t,n)}catch(r){m(r,"onValueChange")}t.setAttribute(Tr,"1")}function na(t){if(t.hasAttribute(rn))return;t.setAttribute(rn,""),t.removeAttribute("hidden");let e=t.getAttribute(fe);e!==null?(t.style.display=e,t.removeAttribute(fe)):t.style.display==="none"&&(t.style.display=""),typeof getComputedStyle=="function"&&getComputedStyle(t).display==="none"&&(t.style.display=t.getAttribute(f("display"))||"block")}function L(t,e){if(e){na(t);return}t.removeAttribute(rn),!t.hasAttribute(fe)&&t.style.display!=="none"&&t.setAttribute(fe,t.style.display),t.style.display="none"}function he(t,e){t.classList.toggle("is-selected",e),t.setAttribute("aria-pressed",e?"true":"false"),vr(t)&&(t.type==="radio"||t.type==="checkbox")&&(t.checked=e);let n=t.querySelector('input[type="radio"],input[type="checkbox"]');n&&vr(n)&&(n.checked=e)}var xr,Yt=t=>Reflect.get(window,t);function ra(){let t=Yt("ScrollTrigger");if(typeof t!="function")return;let e=Reflect.get(t,"refresh");typeof e=="function"&&Reflect.apply(e,t,[])}function dt(t){clearTimeout(xr),xr=setTimeout(()=>{try{a.onLayoutChange?a.onLayoutChange(t):ra()}catch(e){m(e,"layout-changed")}h("layout-changed",{reason:t})},ea)}function Or(t,e){let n=[...t.querySelectorAll("img")].filter(i=>!i.complete),r=n.length,o=()=>{r-=1,r===0&&dt(`${e}:images`)};n.forEach(i=>{i.addEventListener("load",o,{once:!0}),i.addEventListener("error",o,{once:!0})})}function Q(t,e){return t.getAttribute("aria-busy")==="true"?Promise.resolve(void 0):(t.setAttribute("aria-busy","true"),Promise.resolve().then(e).finally(()=>{t.removeAttribute("aria-busy")}))}function ye(t,e){let n=t?p(t,e):null;if(!n)return null;try{return JSON.parse(n)}catch{return k(`invalid JSON in ${f(e)}`,t),null}}function nn(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}function be(t){return Array.isArray(t)?t.filter(A).map(n=>({key:nn(n.key),value:nn(n.value)})):A(t)?Object.entries(t).map(([e,n])=>({key:e,value:nn(n)})):[]}function zt(t){return t?Array.isArray(t)?t.map(e=>({key:String(e.key),value:String(e.value??"")})):Object.entries(t).map(([e,n])=>({key:e,value:String(n??"")})):[]}var E="amount currencyCode",Rr={inventory:!0},Nr=t=>t.inventory?"quantityAvailable":"",pt="url altText width height";function oa(t){let e=[];for(let r of t){let o=Qe(r);o&&e.push(o)}return e.length?`metafields(identifiers:[${e.map(({namespace:r,key:o})=>`{namespace: ${JSON.stringify(r)}, key: ${JSON.stringify(o)}}`).join(", ")}]){namespace key type value reference{... on MediaImage{image{${pt}}}}}`:""}var ia=` id name description recurringDeliveries options{name value}priceAdjustments{orderCount adjustmentValue{__typename ... on SellingPlanPercentagePriceAdjustment{adjustmentPercentage}... on SellingPlanFixedAmountPriceAdjustment{adjustmentAmount{${E}}}... on SellingPlanFixedPriceAdjustment{price{${E}}}}}`,sa=` sellingPlan{id}checkoutChargeAmount{${E}}remainingBalanceChargeAmount{${E}}priceAdjustments{price{${E}}compareAtPrice{${E}}perDeliveryPrice{${E}}unitPrice{${E}}}`;function $r(t=a,e=Rr){return` fragment TetherProduct on Product{id handle title description descriptionHtml productType vendor tags availableForSale publishedAt onlineStoreUrl requiresSellingPlan seo{title description}featuredImage{${pt}}images(first:${t.imagesFirst}){nodes{${pt}}}options{name optionValues{name swatch{color image{previewImage{${pt}}}}}}priceRange{minVariantPrice{${E}}maxVariantPrice{${E}}}compareAtPriceRange{minVariantPrice{${E}}maxVariantPrice{${E}}}${oa(t.metafields)} sellingPlanGroups(first:${t.sellingPlanGroupsFirst}){nodes{name appName options{name values}sellingPlans(first:${t.sellingPlansFirst}){nodes{${ia}}}}}variants(first:${t.variantsFirst}){nodes{id title availableForSale currentlyNotInStock ${Nr(e)} sku barcode selectedOptions{name value}image{${pt}}price{${E}}compareAtPrice{${E}}unitPrice{${E}}sellingPlanAllocations(first:${t.sellingPlansFirst}){nodes{${sa}}}}}}`}function on(t=Rr){return` fragment TetherCart on Cart{id checkoutUrl totalQuantity note createdAt updatedAt attributes{key value}buyerIdentity{countryCode email}discountCodes{code applicable}cost{subtotalAmount{${E}}totalAmount{${E}}checkoutChargeAmount{${E}}}lines(first:100){nodes{id quantity attributes{key value}cost{totalAmount{${E}}subtotalAmount{${E}}amountPerQuantity{${E}}compareAtAmountPerQuantity{${E}}}discountAllocations{discountedAmount{${E}}}sellingPlanAllocation{sellingPlan{id name description recurringDeliveries options{name value}}checkoutChargeAmount{${E}}priceAdjustments{price{${E}}compareAtPrice{${E}}perDeliveryPrice{${E}}}}merchandise{... on ProductVariant{id title sku availableForSale requiresShipping ${Nr(t)} image{${pt}}price{${E}}compareAtPrice{${E}}selectedOptions{name value}product{id title handle vendor featuredImage{${pt}}}}}... on ComponentizableCartLine{lineComponents{id quantity merchandise{... on ProductVariant{id title product{title handle}}}}}}}}`}function _r(){return`
2
2
  id handle title description descriptionHtml
3
- image { ${tt} }
4
- seo { title description }`}var fe={};M(fe,{clearProductCache:()=>ue,getProduct:()=>nt,getProducts:()=>bt,getRecommendations:()=>vt,hydrateProducts:()=>de,normalizeProductKey:()=>ct,primeProduct:()=>et,refreshProducts:()=>he,takeStale:()=>pe});var F=new Map,Je=[],oe=new Map,ce=!1,yt=0,le=t=>typeof t=="string"&&t.startsWith("gid://");function ct(t){let e=String(t??"").trim();if(!e)return null;if(le(e))return e;if(/^\d+$/.test(e))return`gid://shopify/Product/${e}`;let n=e.match(/\/products\/([^/?#]+)/);return n?n[1]:e}function et(t){if(!t)return;let e=Promise.resolve(t);F.set(t.handle,e),F.set(t.id,e)}function nt(t){let e=ct(t);if(!e)return Promise.reject(new E("empty product key",{code:"NOT_FOUND"}));if(F.has(e))return F.get(e);let n=new Promise((r,i)=>{oe.set(e,{resolve:r,reject:i}),Je.push(e),ce||(ce=!0,setTimeout(yn,0))});return F.set(e,n),n}async function yn(){ce=!1;let t=yt,e=Je.splice(0);if(!e.length)return;let n=e.filter(le),r=e.filter(f=>!le(f)),i=[],s=[],a={};n.length&&(i.push("$ids: [ID!]!"),a.ids=n,s.push("byId: nodes(ids: $ids) { ... on Product { ...TetherProduct } }")),r.forEach((f,h)=>{i.push(`$h${h}: String!`),a[`h${h}`]=f,s.push(`h${h}: product(handle: $h${h}) { ...TetherProduct }`)});let c=`query TetherProducts(${i.join(",")}){${s.join(" ")}}${gt()}`;O("fetch products",e);let u=(f,h)=>{let m=oe.get(f);oe.delete(f),m&&h(m)};try{let f=await _(c,a),h=new Map;(f.byId||[]).forEach(m=>{m&&h.set(m.id,m)}),r.forEach((m,k)=>{f[`h${k}`]&&h.set(m,f[`h${k}`])}),e.forEach(m=>u(m,k=>{if(h.has(m)){let b=h.get(m);t===yt&&(et(b),_t.set(b.handle,Date.now()),_t.set(b.id,Date.now())),k.resolve(b)}else{let b=F.get(m);t===yt&&setTimeout(()=>{F.get(m)===b&&F.delete(m)},1e4),k.reject(new E(`Product not found: ${m}`,{code:"NOT_FOUND"}))}}))}catch(f){e.forEach(h=>u(h,m=>{t===yt&&F.delete(h),m.reject(f)}))}}function ue(){F.clear(),yt++,ot.clear(),_t.clear()}var ot=new Set,_t=new Map,bn=6e4;function de(t){(t||[]).forEach(e=>{!e?.id||!e.handle||Date.now()-(_t.get(e.handle)||0)<bn&&F.has(e.handle)||(et(e),ot.add(e.handle),ot.add(e.id))})}function pe(t){let e=ct(t);if(!ot.has(e))return!1;let n=F.get(e);return ot.delete(e),n?.then?.(r=>{ot.delete(r.handle),ot.delete(r.id)}),!0}function he(t){return t.forEach(e=>F.delete(ct(e))),t.map(e=>nt(e))}async function bt({collection:t,query:e,first:n=o.collectionFirst,after:r=null,sortKey:i,reverse:s=!1,filters:a}={}){let c=gt();if(t){let f=await _(`query TetherCollection($handle:String!,$first:Int!,$after:String,$sortKey:ProductCollectionSortKeys,$reverse:Boolean,$filters:[ProductFilter!]){collection(handle:$handle){${se()} products(first:$first,after:$after,sortKey:$sortKey,reverse:$reverse,filters:$filters){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}}${c}`,{handle:t,first:n,after:r,sortKey:i||void 0,reverse:s,filters:a||void 0});if(!f.collection)throw new E(`Collection not found: ${t}`,{code:"NOT_FOUND"});let{products:h,...m}=f.collection;return h.nodes.forEach(et),{collection:m,products:h.nodes,pageInfo:h.pageInfo}}let u=await _(`query TetherSearch($first:Int!,$after:String,$query:String,$sortKey:ProductSortKeys,$reverse:Boolean){products(first:$first,after:$after,query:$query,sortKey:$sortKey,reverse:$reverse){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}${c}`,{first:n,after:r,query:e||void 0,sortKey:i||void 0,reverse:s});return u.products.nodes.forEach(et),{collection:null,products:u.products.nodes,pageInfo:u.products.pageInfo}}async function vt(t,e="RELATED"){let n=ct(typeof t=="object"?t?.id:t),r=n?.startsWith("gid://"),s=(await _(`query TetherRecs(${r?"$id: ID!":"$handle: String!"},$intent:ProductRecommendationIntent){productRecommendations(${r?"productId: $id":"productHandle: $handle"},intent:$intent){...TetherProduct}}${gt()}`,r?{id:n,intent:e}:{handle:n,intent:e})).productRecommendations||[];return s.forEach(et),s}var xt={};M(xt,{GID:()=>R,allPlans:()=>H,allocationFor:()=>V,findPlan:()=>wt,hasPlans:()=>vn,planAdjustment:()=>ge,planCheckoutCharge:()=>me,planPrice:()=>$t,planSavings:()=>Dt,plansForVariant:()=>$n,toGid:()=>Ft});var R={product:t=>Ft(t,"Product"),variant:t=>Ft(t,"ProductVariant"),sellingPlan:t=>Ft(t,"SellingPlan")};function Ft(t,e){let n=String(t??"").trim();return n?n.startsWith("gid://")?n:/^\d+$/.test(n)?`gid://shopify/${e}/${n}`:n:null}function H(t){return(t?.sellingPlanGroups?.nodes||[]).flatMap(n=>(n.sellingPlans?.nodes||[]).map(r=>({...r,group:n})))}function vn(t){return H(t).length>0}function V(t,e){return!t||!e?null:(t.sellingPlanAllocations?.nodes||[]).find(n=>n.sellingPlan?.id===e)||null}function $n(t,e){return H(t).filter(n=>V(e,n.id))}function $t(t,e){let r=V(t,e)?.priceAdjustments?.[0];return r?.perDeliveryPrice||r?.price||t?.price||null}function me(t,e){let n=V(t,e);return n?.checkoutChargeAmount||n?.priceAdjustments?.[0]?.price||t?.price||null}function Dt(t,e){let n=parseFloat(t?.price?.amount),r=parseFloat($t(t,e)?.amount);return!Number.isFinite(n)||!Number.isFinite(r)||n<=0||r>=n?{amount:null,percentage:0}:{amount:{amount:(n-r).toFixed(2),currencyCode:t.price.currencyCode},percentage:Math.round((1-r/n)*100)}}function ge(t){let e=t?.priceAdjustments?.[0]?.adjustmentValue;if(!e)return null;switch(e.__typename){case"SellingPlanPercentagePriceAdjustment":return{type:"percentage",value:e.adjustmentPercentage};case"SellingPlanFixedAmountPriceAdjustment":return{type:"amount",value:e.adjustmentAmount};case"SellingPlanFixedPriceAdjustment":return{type:"price",value:e.price};default:return null}}function wt(t,e){if(!e)return null;let n=H(t),r=R.sellingPlan(e),i=String(e).trim().toLowerCase();return n.find(s=>s.id===r)||n.find(s=>s.name.toLowerCase()===i)||n.find(s=>(s.options||[]).some(a=>String(a.value).toLowerCase()===i))||null}var Pe={};M(Pe,{attr:()=>g,busy:()=>K,cdnUrl:()=>Xe,dataKey:()=>Ye,emit:()=>$,formatDate:()=>ve,formatMoney:()=>D,formatPercent:()=>be,get:()=>p,has:()=>G,hasTemplate:()=>$e,imageUrl:()=>jt,notifyLayoutChanged:()=>J,parseJSONAttr:()=>Ae,productUrl:()=>At,qsa:()=>x,readText:()=>ye,repeat:()=>B,repeatKeyed:()=>we,sameImage:()=>Mt,scoped:()=>rt,sel:()=>l,setImage:()=>j,setSelected:()=>Pt,setText:()=>S,setTextTracked:()=>W,show:()=>L,toAttributes:()=>lt,watchImages:()=>xe});var g=t=>`${o.prefix}-${t}`,l=(t,e)=>e===void 0?`[${g(t)}]`:`[${g(t)}="${e}"]`,p=(t,e)=>t.getAttribute(g(e)),G=(t,e)=>t.hasAttribute(g(e)),Ye=()=>`data-${o.prefix}-key`;function At(t,e){let n=o.productPath||"/product";if(!/\{(handle|id)\}/.test(n))return`${n.replace(/\/$/,"")}/${t}`;let r=e?String(e).split("/").pop():"";return n.replace(/\{handle\}/g,encodeURIComponent(t||"")).replace(/\{id\}/g,encodeURIComponent(r))}var x=(t,e)=>t?[...t.querySelectorAll(e)]:[],rt=(t,e,n)=>x(t,e).filter(r=>r.closest(n)===t);function $(t,e,n=document){n.dispatchEvent(new CustomEvent(`${o.prefix}:${t}`,{detail:e,bubbles:!0}))}function be(t,e=o.locale){if(!t)return"";try{return new Intl.NumberFormat(e||void 0,{style:"percent",maximumFractionDigits:0}).format(t/100)}catch{return`${t}%`}}function D(t){if(!t)return"";if(typeof o.formatMoney=="function")return o.formatMoney(t,o.locale);let e=parseFloat(t.amount);if(Number.isNaN(e))return"";try{return new Intl.NumberFormat(o.locale||void 0,{style:"currency",currency:t.currencyCode}).format(e)}catch{return`${t.currencyCode} ${e.toFixed(2)}`}}function ve(t){if(!t)return"";try{return new Date(t).toLocaleDateString(o.locale||void 0)}catch{return""}}function jt(t,{width:e,height:n,crop:r}={}){if(!t)return t;try{let i=new URL(t);return e&&i.searchParams.set("width",String(e)),n&&i.searchParams.set("height",String(n)),r&&i.searchParams.set("crop",r),i.toString()}catch{return t}}function Xe(t,e){if(!t||!e)return t;let n=r=>e.getAttribute(r)??e.getAttribute(`${o.prefix}-${r}`)??e.getAttribute(`data-${r}`);return jt(t,{width:n("max-width"),height:n("max-height"),crop:n("max-width")||n("max-height")?n("crop"):null})}var Mt=(t,e)=>!!(t&&e)&&t.split("?")[0]===e.split("?")[0];function j(t,e,n){if(!e)return;let r=Xe(e,t);if(t.tagName==="IMG"&&Mt(t.getAttribute("src"),r)){n!=null&&!t.getAttribute("alt")&&t.setAttribute("alt",n);return}t.tagName==="IMG"?(t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.setAttribute("src",r),n!=null&&t.setAttribute("alt",n),t.getAttribute("loading")||t.setAttribute("loading","lazy")):t.style.backgroundImage=`url("${r}")`}function S(t,e){let n=e==null?"":String(e);t.tagName==="INPUT"||t.tagName==="TEXTAREA"?t.value=n:t.textContent=n}var ye=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA"?t.value:t.textContent;function W(t,e){let n=ye(t);S(t,e);let r=ye(t);if(n!==r&&t.dataset.tetherSeen&&typeof o.onValueChange=="function")try{o.onValueChange(t,n)}catch{}t.dataset.tetherSeen="1"}function L(t,e){let n="tetherPrevDisplay";if(e){if(t.dataset.tetherShown!==void 0)return;t.dataset.tetherShown="",t.removeAttribute("hidden"),t.dataset[n]!==void 0?(t.style.display=t.dataset[n],delete t.dataset[n]):t.style.display==="none"&&(t.style.display=""),typeof getComputedStyle=="function"&&getComputedStyle(t).display==="none"&&(t.style.display=t.getAttribute(`${o.prefix}-display`)||"block")}else delete t.dataset.tetherShown,t.dataset[n]===void 0&&t.style.display!=="none"&&(t.dataset[n]=t.style.display||""),t.style.display="none"}function Pt(t,e){t.classList.toggle("is-selected",e),t.setAttribute("aria-pressed",e?"true":"false"),t.tagName==="INPUT"&&(t.type==="radio"||t.type==="checkbox")&&(t.checked=e);let n=t.querySelector?.('input[type="radio"],input[type="checkbox"]');n&&(n.checked=e)}var Ut=new WeakMap,$e=t=>!!Ut.get(t);function Ze(t){if(!Ut.has(t)){let e=t.firstElementChild?.cloneNode(!0)??null;Ut.set(t,e),t.innerHTML=""}return Ut.get(t)}function B(t,e,n){let r=Ze(t);if(!r){e.length&&U("repeater without a template child",t);return}t.innerHTML="",e.forEach((i,s)=>{let a=r.cloneNode(!0);n(a,i,s),t.appendChild(a)})}function we(t,e,n,r,{onEnter:i,onLeave:s}={}){let a=Ze(t);if(!a){U("repeater without a template child",t);return}let c=Ye(),u=`data-${o.prefix}-leaving`,f=()=>[...t.children].filter(v=>v.hasAttribute(c)&&!v.hasAttribute(u)),h=new Map(f().map(v=>[v.getAttribute(c),v])),m=[],k=new Set;e.forEach((v,N)=>{let d=String(n(v,N)),y=h.get(d);y?h.delete(d):(y=a.cloneNode(!0),y.setAttribute(c,d),k.add(y)),r(y,v,N,k.has(y)),m.push(y)});let b=m.filter(v=>!k.has(v)),C=f().filter(v=>b.includes(v));if(!(C.length===b.length&&C.every((v,N)=>v===b[N]))){h.forEach(v=>v.remove()),m.forEach(v=>t.appendChild(v));return}m.forEach((v,N)=>{if(!k.has(v))return;let d=m[N-1];if(d&&d.parentNode===t?d.after(v):t.prepend(v),i)try{i(v)}catch{}}),h.forEach(v=>{v.setAttribute(u,""),v.removeAttribute(c),v.style.pointerEvents="none",v.inert=!0;let N=()=>v.remove();if(s)try{s(v,N)}catch{N()}else N()})}var ze=null;function J(t){clearTimeout(ze),ze=setTimeout(()=>{typeof o.onLayoutChange=="function"?o.onLayoutChange(t):window.ScrollTrigger?.refresh&&window.ScrollTrigger.refresh(),$("layout-changed",{reason:t})},120)}function xe(t,e){let n=x(t,"img").filter(s=>!s.complete);if(!n.length)return;let r=n.length,i=()=>{--r===0&&J(`${e}:images`)};n.forEach(s=>{s.addEventListener("load",i,{once:!0}),s.addEventListener("error",i,{once:!0})})}function K(t,e){return t.getAttribute("aria-busy")==="true"?Promise.resolve():(t.setAttribute("aria-busy","true"),Promise.resolve().then(e).finally(()=>t.removeAttribute("aria-busy")))}function Ae(t,e){let n=t&&p(t,e);if(!n)return null;try{return JSON.parse(n)}catch{return U(`invalid JSON in ${g(e)}`,t),null}}function lt(t){return t?Array.isArray(t)?t.map(e=>({key:String(e.key),value:String(e.value??"")})):Object.entries(t).map(([e,n])=>({key:e,value:String(n??"")})):[]}function en(t,e=1,n={}){let r=typeof t=="object"&&t!==null?t:{variantId:t,quantity:e,...n},i=R.variant(r.merchandiseId||r.variantId||r.id);if(!i)throw new E("add(): variantId is required");let s={merchandiseId:i,quantity:Math.max(1,parseInt(r.quantity??1,10)||1)},a=r.sellingPlanId||r.sellingPlan;a&&(s.sellingPlanId=R.sellingPlan(a));let c=lt(r.attributes);return c.length&&(s.attributes=c),s}function tn(t,e,n){return`mutation Tether_${t}(${e}){${t}(${n}){cart{...TetherCart}userErrors{field message}warnings{code message target}}}${Nt()}`}var wn='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',Vt=null,Rt=t=>x(t,wn).filter(e=>e.offsetParent!==null||e===document.activeElement);function Se(t){x(document,l("cart-open")).forEach(e=>e.setAttribute("aria-expanded",String(t))),x(document,l("cart-drawer")).forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","dialog"),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&e.setAttribute("aria-label",p(e,"cart-label")||"Cart"),e.setAttribute("aria-modal",String(t)),e.classList.contains(o.cartDrawerOpenClass)||(e.setAttribute("aria-hidden","true"),o.cartFocus!==!1&&(e.inert=!0))})}var Ee=t=>/does not exist|not found|invalid id/i.test(t?.message||""),A={state:null,_chain:Promise.resolve(),id(){try{return localStorage.getItem(o.storageKey)}catch{return null}},_setId(t){try{t?localStorage.setItem(o.storageKey,t):localStorage.removeItem(o.storageKey)}catch{}},get lines(){return this.state?.lines?.nodes||[]},get count(){return this.state?.totalQuantity||0},lastError:null,customerAccessToken:null,pendingQty:new Map,warnings:[],loaded:!1,_take(t,e){let n=re(t,e);return this.warnings=(n.warnings||[]).filter((r,i,s)=>s.findIndex(a=>a.message===r.message)===i).map(r=>({...r,message:typeof o.warningText=="function"&&o.warningText(r)||r.message})),this.warnings.length&&$("cart-warning",{warnings:this.warnings}),n.cart},_queue(t){let e=this._chain.then(t,t).then(n=>(this.lastError&&(this.lastError=null,this.render()),n),n=>{throw this.lastError=n,this.render(),$("cart-error",{error:n}),n});return this._chain=e.catch(()=>{}),e},_commit(t,e){this.state=t,t?.id&&this._setId(t.id);try{localStorage.setItem(`${o.storageKey}:seen`,`${Date.now()}|${t?.totalQuantity||0}`)}catch{}return this.render(),$("cart-updated",{cart:t,reason:e}),t},async init(){let t=this.id();if(!t)return this.state=null,this.loaded=!0,this.render(),$("cart-updated",{cart:null,reason:"load"}),null;if(!this.loaded)try{let e=(localStorage.getItem(`${o.storageKey}:seen`)||"").split("|")[1];e&&x(document,l("cart-count")).forEach(n=>{/^\s*0?\s*$/.test(n.textContent)&&(n.textContent=e)})}catch{}try{let e=await _(`query TetherCart($id:ID!){cart(id:$id){...TetherCart}}${Nt()}`,{id:t});e.cart?this.state=e.cart:(this._setId(null),this.state=null)}catch(e){P(e,"cart load failed"),this.lastError=e,Ee(e)&&this._setId(null),this.state=null}return this.loaded=!0,this.render(),$("cart-updated",{cart:this.state,reason:"load"}),this.state},async _create(t={}){let e=o.country||this.customerAccessToken?{...o.country?{countryCode:String(o.country).toUpperCase()}:{},...this.customerAccessToken?{customerAccessToken:this.customerAccessToken}:{}}:void 0,n=await _(tn("cartCreate","$input: CartInput!","input: $input"),{input:{buyerIdentity:e,...t}});return this._take(n.cartCreate,"cartCreate")},async _mutate(t,e,n,r,i){let s=this.id();if(!s)return i?this._create(i):null;try{let a=await _(tn(t,`$cartId: ID!, ${e}`,`cartId: $cartId, ${n}`),{...r,cartId:s});return this._take(a[t],t)}catch(a){if(i&&Ee(a))return O("cart expired, creating a new one"),this._setId(null),this._create(i);throw a}},add(t,e=1,n={}){let r=(Array.isArray(t)?t:[t]).map(i=>en(i,e,n));return this._queue(async()=>{let i=await this._mutate("cartLinesAdd","$lines: [CartLineInput!]!","lines: $lines",{lines:r},{lines:r});return this._commit(i,"add"),$("added",{cart:i,lines:r}),o.openCartOnAdd&&this.open(),i})},updateLine(t,e){let n=typeof e=="number"?{quantity:e}:{...e};if(n.quantity!==void 0&&n.quantity<=0)return this.removeLine(t);let r={id:t};return n.quantity!==void 0&&(r.quantity=n.quantity),"sellingPlanId"in n&&(r.sellingPlanId=n.sellingPlanId?R.sellingPlan(n.sellingPlanId):null),n.attributes&&(r.attributes=lt(n.attributes)),(n.merchandiseId||n.variantId)&&(r.merchandiseId=R.variant(n.merchandiseId||n.variantId)),this._queue(async()=>this._commit(await this._mutate("cartLinesUpdate","$lines: [CartLineUpdateInput!]!","lines: $lines",{lines:[r]}),"update"))},changeQuantity(t,e){let n=this.lines.find(a=>a.id===t);if(!n)return Promise.resolve(this.state);let r=Math.max(0,(this.pendingQty.get(t)?.qty??n.quantity)+e),i={qty:r,done:!1};this.pendingQty.set(t,i),this.render(),$("cart-updated",{cart:this.state,reason:"pending"});let s=()=>this.pendingQty.get(t)===i;return this._queue(async()=>{if(!s())return this.state;let a=this.lines.find(u=>u.id===t);if(a&&a.quantity===r)return this.state;let c=r>0?await this._mutate("cartLinesUpdate","$lines: [CartLineUpdateInput!]!","lines: $lines",{lines:[{id:t,quantity:r}]}):await this._mutate("cartLinesRemove","$lineIds: [ID!]!","lineIds: $lineIds",{lineIds:[t]});return s()?this._commit(c,r>0?"update":"remove"):(this.state=c,c?.id&&this._setId(c.id),c)}).finally(()=>{s()&&(this.pendingQty.delete(t),this.render(),$("cart-updated",{cart:this.state,reason:"settled"}))})},quantityOf(t){return this.pendingQty.get(t.id)?.qty??t.quantity},removeLine(t){let e=Array.isArray(t)?t:[t];return this._queue(async()=>this._commit(await this._mutate("cartLinesRemove","$lineIds: [ID!]!","lineIds: $lineIds",{lineIds:e}),"remove"))},clear(){let t=this.lines.map(e=>e.id);return t.length?this.removeLine(t):Promise.resolve(this.state)},setNote(t){return this._queue(async()=>this._commit(await this._mutate("cartNoteUpdate","$note: String!","note: $note",{note:t??""},{note:t??""}),"note"))},setAttributes(t){let e=lt(t);return this._queue(async()=>{let n=new Map((this.state?.attributes||[]).map(i=>[i.key,i.value]));e.forEach(i=>n.set(i.key,i.value));let r=[...n].filter(([,i])=>i!=="").map(([i,s])=>({key:i,value:s}));return this._commit(await this._mutate("cartAttributesUpdate","$attributes: [AttributeInput!]!","attributes: $attributes",{attributes:r},{attributes:r}),"attributes")})},setDiscountCodes(t){return this._queue(async()=>{let e=typeof t=="function"?t((this.state?.discountCodes||[]).map(r=>r.code)):t,n=(Array.isArray(e)?e:[e]).map(r=>String(r).trim()).filter(Boolean);return this._commit(await this._mutate("cartDiscountCodesUpdate","$discountCodes: [String!]!","discountCodes: $discountCodes",{discountCodes:n},{discountCodes:n}),"discount")})},async applyDiscount(t){let e=await this.setDiscountCodes(r=>[...new Set([...r,t])]);if((e?.discountCodes||[]).find(r=>r.code.toLowerCase()===String(t).toLowerCase())?.applicable)return e;throw await this.removeDiscount(t).catch(()=>{}),new E(`Discount code not valid: ${t}`,{code:"INVALID_DISCOUNT"})},removeDiscount(t){let e=String(t).toLowerCase();return this.setDiscountCodes(n=>n.filter(r=>r.toLowerCase()!==e))},setBuyerIdentity(t,{create:e=!0}={}){return this._queue(async()=>{let n=await this._mutate("cartBuyerIdentityUpdate","$buyerIdentity: CartBuyerIdentityInput!","buyerIdentity: $buyerIdentity",{buyerIdentity:t},e?{buyerIdentity:t}:null).catch(r=>{if(e||!Ee(r))throw r;return this._setId(null),null});return this._commit(n,"buyer-identity")})},async checkout(t=o.checkoutTarget){let e=this.id();if(!e||this.state&&!this.count)return null;let n=t==="_blank"?window.open("","_blank"):null;if(n)try{n.opener=null}catch{}try{let r=_("query TetherCheckout($id: ID!) { cart(id: $id) { checkoutUrl } }",{id:e}).then(s=>s.cart?.checkoutUrl);r.catch(()=>{});let i=this.beforeCheckout&&await this.beforeCheckout().catch(()=>null)||await r;if(i&&this.customerAccessToken&&(i+=`${i.includes("?")?"&":"?"}logged_in=true`),!i)throw new E("No checkoutUrl (cart empty or expired)");return $("checkout",{url:i,cart:this.state}),n&&!n.closed?n.location.href=i:window.location.href=i,i}catch(r){return n&&n.close(),P(r,"checkout failed"),null}},drawers(){return x(document,l("cart-drawer"))},_open:!1,isOpen(){let t=this.drawers();return t.length?t.some(e=>e.classList.contains(o.cartDrawerOpenClass)):this._open},open(){if(this.isOpen())return;this._open=!0;let t=this.drawers().filter(e=>p(e,"cart-drawer")!=="manual");t.forEach(e=>{e.inert=!1,e.classList.add(o.cartDrawerOpenClass),e.setAttribute("aria-hidden","false")}),Se(!0),o.cartFocus!==!1&&t[0]&&(Vt=document.activeElement,setTimeout(()=>{let e=Rt(t[0])[0]||t[0];e===t[0]&&!t[0].hasAttribute("tabindex")&&(t[0].tabIndex=-1),e.focus?.({preventScroll:!0})},60)),typeof o.onCartOpen=="function"&&o.onCartOpen(t),$("cart-toggled",{open:!0})},close(){if(!this.isOpen())return;this._open=!1;let t=this.drawers(),e=t.some(n=>n.contains(document.activeElement));t.forEach(n=>{n.classList.remove(o.cartDrawerOpenClass),n.setAttribute("aria-hidden","true"),o.cartFocus!==!1&&(n.inert=!0)}),Se(!1),e&&Vt?.isConnected&&Vt.focus({preventScroll:!0}),Vt=null,typeof o.onCartClose=="function"&&o.onCartClose(t),$("cart-toggled",{open:!1})},toggle(){this.isOpen()?this.close():this.open()},subscribe(t){let e=()=>t(this.state,{open:this.isOpen(),count:this.count,loaded:this.loaded,warnings:this.warnings}),n=()=>e();return["cart-updated","cart-toggled"].forEach(r=>document.addEventListener(`${o.prefix}:${r}`,n)),e(),()=>["cart-updated","cart-toggled"].forEach(r=>document.removeEventListener(`${o.prefix}:${r}`,n))},render(){let t=this.state,e=t?t.totalQuantity:0,n=s=>t?D(t.cost?.[s]):"";Se(this.isOpen()),x(document,l("cart-count")).forEach(s=>W(s,e)),x(document,l("cart-subtotal")).forEach(s=>W(s,n("subtotalAmount"))),x(document,l("cart-total")).forEach(s=>W(s,n("totalAmount"))),x(document,l("cart-checkout-charge")).forEach(s=>W(s,n("checkoutChargeAmount")));let r=this.lines.some(s=>s.sellingPlanAllocation),i={"cart-empty":e===0,"cart-filled":e>0,"cart-has-subscription":r,"cart-no-subscription":!r,"cart-has-discount":(t?.discountCodes||[]).some(s=>s.applicable),"cart-error":!!this.lastError,"cart-warning":this.warnings.length>0};x(document,l("cart-warning")).forEach(s=>W(s,[...new Set(this.warnings.map(a=>a.message))].join(" "))),x(document,l("show")).forEach(s=>{let a=p(s,"show");a in i&&!s.closest(l("product"))&&L(s,i[a])}),x(document,l("checkout")).forEach(s=>{s.classList.toggle("is-disabled",!e),s.setAttribute("aria-disabled",String(!e))}),x(document,`textarea${l("cart-note")},input${l("cart-note")}`).forEach(s=>{document.activeElement!==s&&(s.value=t?.note||"")}),x(document,l("cart-discounts")).forEach(s=>{B(s,t?.discountCodes||[],(a,c)=>{a.setAttribute(g("discount-code"),c.code);let u=a.querySelector(l("discount","code"))||(a.firstElementChild?null:a);u&&S(u,c.code),a.classList.toggle("is-inapplicable",!c.applicable)})}),x(document,l("cart-lines")).forEach(s=>{we(s,this.lines,a=>a.id,(a,c)=>An(a,c),{onEnter:o.onLineEnter,onLeave:o.onLineLeave})}),t&&J("cart")}};function xn(t,e){let n=t.merchandise||{},r=t.sellingPlanAllocation?.sellingPlan;switch(e){case"title":return n.product?.title;case"product-title":return n.product?.title;case"variant-title":return n.title==="Default Title"?"":n.title;case"options":return(n.selectedOptions||[]).filter(i=>i.value!=="Default Title").map(i=>`${i.name}: ${i.value}`).join(", ");case"vendor":return n.product?.vendor;case"sku":return n.sku;case"price":return D(t.cost?.amountPerQuantity||n.price);case"compare-at-price":return D(t.cost?.compareAtAmountPerQuantity||n.compareAtPrice);case"line-total":return D(t.cost?.totalAmount);case"line-subtotal":return D(t.cost?.subtotalAmount);case"quantity":return A.quantityOf(t);case"plan":return r?.name||"";case"plan-description":return r?.description||"";case"components":return(t.lineComponents||[]).map(i=>`${i.quantity} \xD7 ${i.merchandise?.product?.title||""}`).join(", ");default:if(e.startsWith("attribute:")){let i=e.slice(10);return(t.attributes||[]).find(s=>s.key===i)?.value||""}return}}function An(t,e){let n=e.merchandise||{},r=!!e.sellingPlanAllocation;t.setAttribute(g("line-id"),e.id),t.classList.toggle("is-subscription",r),x(t,l("line")).forEach(c=>{let u=p(c,"line");if(u==="image")return j(c,n.image?.url||n.product?.featuredImage?.url,n.product?.title);if(u==="url"){let h=At(n.product?.handle,n.product?.id),m=new URLSearchParams;n.id&&m.set("variant",String(n.id).split("/").pop());let k=e.sellingPlanAllocation?.sellingPlan?.id;k&&m.set("selling_plan",k.split("/").pop());let b=m.toString();return c.setAttribute("href",b?`${h}${h.includes("?")?"&":"?"}${b}`:h)}let f=xn(e,u);f!==void 0&&W(c,f)});let i=A.warnings.find(c=>c.target===e.id);t.classList.toggle("is-warning",!!i);let s=A.pendingQty.has(e.id);t.classList.toggle("is-busy",s),s?t.setAttribute("aria-busy","true"):t.removeAttribute("aria-busy"),x(t,l("line","warning")).forEach(c=>W(c,i?.message||""));let a={subscription:r,"one-time":!r,"on-sale":parseFloat(e.cost?.compareAtAmountPerQuantity?.amount)>parseFloat(e.cost?.amountPerQuantity?.amount),"has-components":(e.lineComponents||[]).length>0,warning:!!i};x(t,l("line-show")).forEach(c=>{let u=p(c,"line-show");u in a&&L(c,a[u])}),x(t,`select${l("line-plan")}`).forEach(c=>{let u=n.product?.handle;u&&nt(u).then(f=>{let h=H(f),k=[...!f.requiresSellingPlan&&p(c,"line-plan")!=="subscription-only"?[{value:"",label:c.getAttribute(g("one-time-label"))||"One-time purchase"}]:[],...h.map(C=>({value:C.id,label:C.name}))],b=k.map(C=>C.value).join("|");c.dataset.tetherSig!==b&&(c.innerHTML="",k.forEach(C=>{let at=document.createElement("option");at.value=C.value,at.textContent=C.label,c.appendChild(at)}),c.dataset.tetherSig=b),c.value=e.sellingPlanAllocation?.sellingPlan?.id||"",L(c,h.length>0)}).catch(f=>P(f,"line plan options"))})}var Te={};M(Te,{ProductScope:()=>St,rememberOptionNames:()=>Ht,scopes:()=>it});var Ie={};M(Ie,{STATUS_KEYS:()=>Kt,boundary:()=>Bt,isNotFound:()=>ht,ownedBy:()=>ke,resolveProductKey:()=>z,setScopeStatus:()=>Y});function z(t,e=window.location,n="product"){let r=(p(t,n)||"").trim();if(!r.toLowerCase().startsWith("url:"))return{key:r||null,fromUrl:!1,raw:r};let i=r.slice(4).trim(),s=null;if(i.toLowerCase()==="path"){let a=e.pathname.split("/").filter(Boolean);s=a.length?Pn(a[a.length-1]):null}else s=new URLSearchParams(e.search).get(i||"handle");return s=s&&s.trim()?s.trim():null,{key:s,fromUrl:!0,raw:r}}function Pn(t){try{return decodeURIComponent(t)}catch{return t}}var Kt=["loading","ready","error","not-found"],ht=t=>t?.code==="NOT_FOUND",Bt=()=>["product","collection","products","recommendations"].map(t=>l(t)).join(","),ke=(t,e)=>t===e||t.parentElement?.closest(Bt())===e;function Y(t,e,n){let r=e==="not-found";t.setAttribute(g("state"),r?"error":e),e==="error"||r?t.setAttribute(g("error"),r?"not-found":n?.code||"error"):t.removeAttribute(g("error")),rt(t,l("show"),Bt()).forEach(i=>{let s=p(i,"show");Kt.includes(s)&&L(i,s===e)}),(e==="error"||r)&&rt(t,l("add-to-cart"),Bt()).forEach(i=>{i.classList.add("is-disabled"),i.setAttribute("aria-disabled","true"),"disabled"in i&&(i.disabled=!0)})}var it=new WeakMap,nn=()=>l("product");function Sn(t,e){let n=e.indexOf("."),r=e.slice(0,n),i=e.slice(n+1);return(t.metafields||[]).find(a=>a&&a.namespace===r&&a.key===i)||null}var Qt=new Map;function Ht(t){(t||[]).forEach(e=>{e?.handle&&!Qt.has(e.handle)&&Qt.set(e.handle,(e.options||[]).map(n=>n.name))})}var St=class{constructor(e,n){this.root=e,this.product=n,this.selected={},this.variant=null,this.quantity=Math.max(0,parseInt(p(e,"quantity")??"1",10)||(G(e,"quantity")?0:1)),this.plans=H(n),this.purchase="one-time",this.planId=null,it.set(e,this),e.setAttribute(g("state"),"ready"),e.removeAttribute(g("error")),this.initSelection(),this.initPurchase(),this.renderProduct(),this.bind(),this.renderVariant(),xe(e,"product"),J("product"),$("product-ready",{product:n,scope:this},e)}update(e){let n=this.variant?.id;this.product=e,this.plans=H(e),this.planId&&!this.plans.some(i=>i.id===this.planId)&&(this.planId=this.plans[0]?.id||null),!this.plans.length&&this.purchase==="subscription"&&(this.purchase="one-time");let r=e.variants.nodes.find(i=>i.id===n);r&&(this.selected={},r.selectedOptions.forEach(i=>{this.selected[i.name]=i.value})),this.root.setAttribute(g("state"),"ready"),this.root.removeAttribute(g("error")),this.renderProduct(),this.renderVariant(),J("product"),$("product-updated",{product:e,scope:this},this.root)}$(e){let n=rt(this.root,e,nn());return this.root.matches(e)?[this.root,...n]:n}optName(e){let n=this.product?.options||[];if(!e||n.some(i=>i.name===e))return e;let r=(Qt.get(this.product.handle)||[]).indexOf(e);return r>=0&&n[r]?n[r].name:e}initSelection(){let e=this.product.variants.nodes,n=e.find(i=>i.availableForSale)||e[0];n&&n.selectedOptions.forEach(i=>{this.selected[i.name]=i.value});let r=new URLSearchParams(window.location.search).get("variant")||p(this.root,"variant");if(r){let i=R.variant(r),s=e.find(a=>a.id===i);s&&(this.selected={},s.selectedOptions.forEach(a=>{this.selected[a.name]=a.value}))}}initPurchase(){if(!this.plans.length)return;let e=new URLSearchParams(window.location.search),n=wt(this.product,e.get("selling_plan")),r=wt(this.product,p(this.root,"default-plan"));this.planId=(n||r||this.plans[0]).id;let i=n?"subscription":p(this.root,"default-purchase")||o.defaultPurchase;this.purchase=this.product.requiresSellingPlan||i==="subscription"?"subscription":"one-time"}findVariant(){return this.product.variants.nodes.find(e=>e.selectedOptions.every(n=>this.selected[n.name]===n.value))||null}isValueAvailable(e,n){return this.product.variants.nodes.some(r=>r.availableForSale&&r.selectedOptions.every(i=>i.name===e?i.value===n:this.selected[i.name]===i.value))}get plan(){return this.plans.find(e=>e.id===this.planId)||null}get subscriptionAvailable(){return!!(this.variant&&this.plans.some(e=>V(this.variant,e.id)))}get isSubscription(){return this.purchase==="subscription"&&!!V(this.variant,this.planId)}getLine(){if(!this.variant)return null;let e={merchandiseId:this.variant.id,quantity:this.quantity};this.isSubscription&&(e.sellingPlanId=this.planId);let n=this.collectAttributes();return n.length&&(e.attributes=n),e}collectAttributes(){let e=lt(Ae(this.root,"line-attributes")),n=this.$(l("line-attribute")).map(r=>{let i=p(r,"line-attribute"),s;return r.type==="checkbox"?s=r.checked?r.value&&r.value!=="on"?r.value:"Yes":"":r.type==="radio"?s=r.checked?r.value:null:s=r.value,s==null||s===""?null:{key:i,value:String(s)}}).filter(Boolean);return[...e,...n]}select(e,n){if(this.selected[e]===n)return;let r=this.product.variants.nodes.filter(s=>s.selectedOptions.some(a=>a.name===e&&a.value===n));if(!r.length)return;let i={...this.selected,[e]:n};if(!r.some(s=>s.selectedOptions.every(a=>i[a.name]===a.value))){let s=c=>c.selectedOptions.filter(u=>u.name!==e&&this.selected[u.name]===u.value).length*2+(c.availableForSale?1:0);r.reduce((c,u)=>s(u)>s(c)?u:c).selectedOptions.forEach(c=>{i[c.name]=c.value})}this.selected=i,this.renderVariant()}selectVariant(e){let n=this.product.variants.nodes.find(r=>r.id===R.variant(e));n&&(this.selected={},n.selectedOptions.forEach(r=>{this.selected[r.name]=r.value}),this.renderVariant())}setPurchase(e){let n=e==="subscription"?"subscription":"one-time";n==="one-time"&&this.product.requiresSellingPlan||this.purchase!==n&&(this.purchase=n,this.renderVariant())}selectPlan(e){let n=wt(this.product,e);n&&(this.planId=n.id,this.purchase="subscription",this.renderVariant())}setQuantity(e){let n=G(this.root,"quantity")?0:1;this.quantity=Math.max(n,parseInt(e,10)||0),this.$(l("qty")).forEach(r=>S(r,this.quantity)),this.renderVariant()}async addToCart(){if(!this.variant?.availableForSale)return null;let e=this.getLine();if(!e||e.quantity<1)return null;let n=await A.add(e);return $("product-added",{product:this.product,variant:this.variant,line:e},this.root),n}bind(){let e=n=>n&&n.closest(nn())===this.root;this.root.addEventListener("click",n=>{let r=n.target;if(!r?.closest)return;let i=r.closest(l("option-value"));if(e(i)&&i.closest(l("option-list"))){n.preventDefault(),this.select(this.optName(p(i.closest(l("option-list")),"option-list")),p(i,"option-value"));return}let s=r.closest(l("plan-value"));if(e(s)){n.preventDefault(),this.selectPlan(p(s,"plan-value"));return}let a=r.closest(`${l("purchase")}:not(select)`);if(e(a)){a.tagName!=="INPUT"&&n.preventDefault(),this.setPurchase(p(a,"purchase"));return}let c=r.closest(l("qty-plus"));if(e(c)){n.preventDefault(),this.setQuantity(this.quantity+1);return}let u=r.closest(l("qty-minus"));if(e(u)){n.preventDefault(),this.setQuantity(this.quantity-1);return}let f=r.closest(l("add-to-cart"));e(f)&&(n.preventDefault(),this.onAddClick(f))}),this.root.addEventListener("change",n=>{let r=n.target;e(r)&&(r.matches(`select${l("option")}`)?this.select(this.optName(p(r,"option")),r.value):r.matches(`select${l("variant-select")}`)?this.selectVariant(r.value):r.matches(`select${l("plan")}`)?r.value?this.selectPlan(r.value):this.setPurchase("one-time"):r.matches(`select${l("purchase")}`)?this.setPurchase(r.value):r.matches(l("qty"))&&this.setQuantity(r.value))})}onAddClick(e){let n=e.querySelector(l("add-label"))||e,r=p(e,"adding-text"),i=s=>S(n,s);n.dataset.tetherLabel===void 0&&(n.dataset.tetherLabel=n.tagName==="INPUT"?n.value:n.textContent),K(e,async()=>{r&&i(r);try{await this.addToCart()}catch(s){P(s,"add to cart failed"),$("error",{error:s,context:"add-to-cart"},this.root)}finally{r&&i(n.dataset.tetherLabel)}}).then(()=>{this.renderVariant()})}renderProduct(){let e=this.product;Qt.has(e.handle)||this.$(`${l("option-list")},select${l("option")}`).map(i=>p(i,"option-list")||p(i,"option")).some(i=>e.options.some(s=>s.name===i))&&Ht([e]);let n=this.product;this.$(l("bind")).forEach(r=>{let i=p(r,"bind")||"",s={title:n.title,"description-text":n.description,vendor:n.vendor,type:n.productType,handle:n.handle}[i];if(s!==void 0)return S(r,s);switch(i){case"description":r.innerHTML=n.descriptionHtml||"";return;case"published-at":return S(r,ve(n.publishedAt));case"min-price":return S(r,D(n.priceRange.minVariantPrice));case"max-price":return S(r,D(n.priceRange.maxVariantPrice));case"featured-image":return j(r,n.featuredImage?.url,n.featuredImage?.altText||n.title);case"url":case"link":r.setAttribute("href",At(n.handle,n.id)),i==="url"&&!r.firstElementChild&&!r.textContent.trim()&&S(r,n.title);return;case"images":{let a=[...r.children].map(c=>c.tagName==="IMG"?c:c.querySelector("img"));if(!$e(r)&&a.length===n.images.nodes.length&&a.every((c,u)=>Mt(c?.getAttribute("src"),n.images.nodes[u].url)))return}return B(r,n.images.nodes,(a,c)=>{let u=a.matches(`img,${l("bind","image")}`)?a:a.querySelector("img")||a;j(u,c.url,c.altText||n.title)});case"tags":{let a=(r.getAttribute("exclude")||"").split(",").map(c=>c.trim()).filter(Boolean);return B(r,n.tags.filter(c=>!a.includes(c)),(c,u)=>S(c,u))}default:if(/^image:\d+$/.test(i)){let a=n.images.nodes[i.slice(6)-1]||n.featuredImage;return j(r,a?.url,a?.altText||n.title)}if(i.startsWith("metafield:")){let a=Sn(n,i.slice(10));return a?a.reference?.image?j(r,a.reference.image.url,a.reference.image.altText):(/^(rich_text|multi_line_text)_field$/.test(a.type)&&(r.style.whiteSpace="pre-line"),S(r,a.value)):S(r,"")}return}}),this.$(l("option-list")).forEach(r=>{let i=this.optName(p(r,"option-list")),s=n.options.find(a=>a.name===i);return!s||s.optionValues.length<=1&&G(r,"hide-single")?L(r,!1):B(r,s.optionValues,(a,c)=>{a.setAttribute(g("option-value"),c.name);let u=a.querySelector(l("bind","option-value"));u?S(u,c.name):a.firstElementChild||S(a,c.name);let f=a.querySelector(l("bind","swatch"));f&&c.swatch?.color&&(f.style.backgroundColor=c.swatch.color),f&&c.swatch?.image?.previewImage&&j(f,c.swatch.image.previewImage.url,c.name)})}),this.$(`select${l("option")}`).forEach(r=>{let i=n.options.find(s=>s.name===this.optName(p(r,"option")));if(!i)return L(r,!1);r.innerHTML="",i.optionValues.forEach(s=>r.appendChild(new Option(s.name,s.name)))}),this.$(`select${l("variant-select")}`).forEach(r=>{r.innerHTML="",n.variants.nodes.forEach(i=>r.appendChild(new Option(i.title,i.id)))}),this.$(l("plan-list")).forEach(r=>{let i=(p(r,"plan-list")||"").trim(),s=["","true","all","*"].includes(i.toLowerCase())?null:i,a=this.plans.filter(c=>!s||c.group.name===s);B(r,a,(c,u)=>{c.setAttribute(g("plan-value"),u.id),!c.firstElementChild&&!c.querySelector(l("plan-bind"))&&S(c,u.name)})}),this.$(`select${l("plan")}`).forEach(r=>{r.innerHTML="",!n.requiresSellingPlan&&p(r,"plan")!=="subscription-only"&&r.appendChild(new Option(r.getAttribute(g("one-time-label"))||"One-time purchase","")),this.plans.forEach(i=>r.appendChild(new Option(i.name,i.id)))})}renderVariant(){let e=this.product,n=this.findVariant();if(n||([n]=e.variants.nodes,n&&(this.selected={},n.selectedOptions.forEach(d=>{this.selected[d.name]=d.value}))),this.variant=n,!n)return;if(this.plans.length&&!V(n,this.planId)){let d=this.plans.find(y=>V(n,y.id));d&&(this.planId=d.id)}let r=this.isSubscription,i=n.price,s=this.planId?$t(n,this.planId):null,a=r?s:i,c=r&&V(n,this.planId)?.priceAdjustments?.[0]?.compareAtPrice||n.compareAtPrice,u=c&&parseFloat(c.amount)>parseFloat(a.amount),f=u?Math.round((1-parseFloat(a.amount)/parseFloat(c.amount))*100):0,h=this.planId?Dt(n,this.planId):{amount:null,percentage:0},m=this.plan,k={amount:(parseFloat(a.amount)*Math.max(1,this.quantity)).toFixed(2),currencyCode:a.currencyCode},b=D,C=d=>be(d),at={price:()=>b(a),"total-price":()=>b(k),"one-time-price":()=>b(i),"subscription-price":()=>b(s),"subscription-savings":()=>C(h.percentage),"subscription-savings-amount":()=>b(h.amount),"checkout-charge":()=>{let d=r?me(n,this.planId):a;return d&&b({amount:(parseFloat(d.amount)*Math.max(1,this.quantity)).toFixed(2),currencyCode:d.currencyCode})},"plan-name":()=>m?.name,"plan-description":()=>m?.description,"plan-group":()=>m?.group?.name,"compare-at-price":()=>u?b(c):"","unit-price":()=>b(n.unitPrice),"discount-percentage":()=>`${f}%`,"discount-amount":()=>u?b({amount:String(parseFloat(c.amount)-parseFloat(a.amount)),currencyCode:a.currencyCode}):"","variant-title":()=>n.title,"variant-id":()=>n.id,sku:()=>n.sku,barcode:()=>n.barcode,stock:()=>n.quantityAvailable,quantity:()=>this.quantity};this.$(l("bind")).forEach(d=>{let y=p(d,"bind");y==="variant-image"?j(d,n.image?.url||e.featuredImage?.url,n.image?.altText||e.title):at[y]&&S(d,at[y]())}),this.$(l("option-selected")).forEach(d=>S(d,this.selected[this.optName(p(d,"option-selected"))]||"")),this.$(l("option-list")).forEach(d=>{let y=this.optName(p(d,"option-list"));x(d,l("option-value")).forEach(I=>{let X=p(I,"option-value");Pt(I,this.selected[y]===X);let T=!this.isValueAvailable(y,X);I.classList.toggle("is-unavailable",T),I.setAttribute("data-unavailable",T?"true":"false")})}),this.$(`select${l("option")}`).forEach(d=>{d.value=this.selected[this.optName(p(d,"option"))]||""}),this.$(`select${l("variant-select")}`).forEach(d=>{d.value=n.id}),this.$(l("purchase")).forEach(d=>{if(d.tagName==="SELECT"){d.value=this.purchase;return}let y=p(d,"purchase");Pt(d,y===this.purchase);let I=y==="subscription"?!this.subscriptionAvailable:e.requiresSellingPlan;d.classList.toggle("is-unavailable",I)}),this.$(l("plan-value")).forEach(d=>{let y=p(d,"plan-value"),I=this.plans.find(T=>T.id===y),X=!!V(n,y);Pt(d,r&&y===this.planId),d.classList.toggle("is-unavailable",!X),x(d,l("plan-bind")).forEach(T=>{let Z=ge(I),Be=Dt(n,y),hn=p(T,"plan-bind"),Ke={name:()=>I?.name,option:()=>(I?.options||[]).map(fn=>fn.value).join(", "),description:()=>I?.description,price:()=>b($t(n,y)),savings:()=>C(Be.percentage),"savings-amount":()=>b(Be.amount),adjustment:()=>Z?Z.type==="percentage"?`${Z.value}%`:b(Z.value):""}[hn];Ke&&S(T,Ke())})}),this.$(`select${l("plan")}`).forEach(d=>{d.value=r?this.planId:""});let v=n.quantityAvailable!=null&&n.quantityAvailable>0&&n.quantityAvailable<=(o.lowStock??5),N={"in-stock":n.availableForSale,"out-of-stock":!n.availableForSale,backorder:n.availableForSale&&n.currentlyNotInStock,"on-sale":!!u,"not-on-sale":!u,"has-variants":e.variants.nodes.length>1,"single-variant":e.variants.nodes.length===1,"low-stock":v,"plenty-in-stock":n.availableForSale&&!v,"subscription-available":this.subscriptionAvailable,"subscription-unavailable":!this.subscriptionAvailable,"subscription-only":!!e.requiresSellingPlan,"one-time-available":!e.requiresSellingPlan,"subscription-selected":r,"one-time-selected":!r,"has-savings":r?h.percentage>0:!!u,loading:!1,ready:!0,error:!1,"not-found":!1};this.$(l("show")).forEach(d=>{let y=p(d,"show");y in N&&(Kt.includes(y)&&!ke(d,this.root)||L(d,N[y]))}),this.root.classList.toggle("is-subscription",r),this.root.setAttribute(g("purchase-mode"),r?"subscription":"one-time"),this.$(l("add-to-cart")).forEach(d=>{let y=!n.availableForSale;d.classList.toggle("is-disabled",y),d.setAttribute("aria-disabled",String(y)),"disabled"in d&&(d.disabled=y);let I=p(d,"soldout-text"),X=p(d,"subscribe-text");if(I||X){let T=d.querySelector(l("add-label"))||d;T.dataset.tetherLabel===void 0&&(T.dataset.tetherLabel=T.tagName==="INPUT"?T.value:T.textContent);let Z=T.dataset.tetherLabel;r&&X&&(Z=X),y&&I&&(Z=I),d.getAttribute("aria-busy")!=="true"&&S(T,Z)}}),$("variant-changed",{product:e,variant:n,selected:{...this.selected},purchase:this.purchase,sellingPlanId:r?this.planId:null},this.root)}};var Le={};M(Le,{ListScope:()=>Et,listSelector:()=>ut});var ut=()=>`${l("collection")},${l("products")},${l("recommendations")}`,Et=class{constructor(e){this.root=e,this.products=[],this.pageInfo=null,this.collection=null,Y(e,"loading"),e.addEventListener("click",n=>{let r=n.target.closest?.(l("load-more"));r&&r.closest(ut())===e&&(n.preventDefault(),K(r,()=>this.load(!0)))})}$(e){return rt(this.root,e,ut())}options(){let e=this.root,n={first:parseInt(p(e,"limit")||"",10)||void 0,sortKey:p(e,"sort")||void 0,reverse:p(e,"reverse")==="true"};if(G(e,"collection"))n.collection=p(e,"collection");else{let r=p(e,"products")||"";n.query=r.startsWith("url:")?new URL(window.location.href).searchParams.get(r.slice(4))||"":r}return n}async load(e=!1){let n=this.loadToken=(this.loadToken||0)+1,r=()=>n!==this.loadToken;try{if(G(this.root,"recommendations")){let{key:i}=z(this.root,window.location,"recommendations"),s=this.root.closest(l("product"));if(!i&&s&&({key:i}=z(s)),!i)throw new E("No product for recommendations",{code:"NOT_FOUND"});let a=await vt(i,p(this.root,"intent")||"RELATED");if(r())return;let c=parseInt(p(this.root,"limit")||"",10);this.products=c?a.slice(0,c):a}else{let i=await bt({...this.options(),after:e?this.pageInfo?.endCursor:null});if(r())return;this.collection=i.collection,this.pageInfo=i.pageInfo,this.products=e?[...this.products,...i.products]:i.products}this.render(),Y(this.root,"ready"),$("list-ready",{products:this.products,collection:this.collection},this.root)}catch(i){if(r())return;e||Y(this.root,ht(i)?"not-found":"error",i),ht(i)&&G(this.root,"recommendations")||P(i,"list load failed"),$("error",{error:i,context:"list"},this.root)}}render(){let e=this.collection;this.$(l("collection-bind")).forEach(r=>{switch(p(r,"collection-bind")){case"title":return S(r,e?.title||"");case"description":r.innerHTML=e?.descriptionHtml||"";return;case"image":return j(r,e?.image?.url,e?.image?.altText||e?.title);case"count":return S(r,this.products.length);default:return}}),this.$(l("list")).forEach(r=>{B(r,this.products,(i,s)=>{i.setAttribute(g("product"),s.handle),i.removeAttribute(g("state"))}),$("list-rendered",{container:r},this.root)});let n=this.products.length===0;this.$(l("show")).forEach(r=>{let i=p(r,"show");i==="list-empty"&&L(r,n),i==="list-filled"&&L(r,!n)}),this.$(l("load-more")).forEach(r=>L(r,!!this.pageInfo?.hasNextPage)),J("list")}};var _e={};M(_e,{hydrateFromPage:()=>Ne,liveLists:()=>mt,liveProducts:()=>ft,mountProduct:()=>zt,mountedLists:()=>Wt,mountedProducts:()=>Ct,pruneLive:()=>Jt,retryFailed:()=>qe,settleMarket:()=>Yt,trackMarket:()=>Oe,within:()=>dt});var Ct=new WeakSet,Wt=new WeakSet,ft=new Set,mt=new Set,rn=new WeakMap;function Jt(){ft.forEach(t=>{t.isConnected||ft.delete(t)}),mt.forEach(t=>{t.root.isConnected||mt.delete(t)})}function dt(t,e){return[...t.matches?.(e)?[t]:[],...x(t,e)]}function zt(t){if(Ct.has(t))return!1;let{key:e,fromUrl:n,raw:r}=z(t);if(!e)return n?(Ct.add(t),Y(t,"not-found"),$("product-not-found",{key:null,source:r},t)):t.closest(ut())||U(`[${g("product")}] without a value. Bind it to the Shopify handle field, or use "url:handle".`,t),!1;Ct.add(t),ft.add(t);let i={};rn.set(t,i);let s=()=>rn.get(t)===i;it.get(t)?t.setAttribute(g("state"),"updating"):Y(t,"loading");let a=nt(e);return Q?.add(a),a.then(c=>{if(!s())return;let u=it.get(t);u?u.update(c):new St(t,c),En(t,c),o.revalidate!==!1&&pe(e)&&Cn(e)}).catch(c=>{if(!s())return;let u=ht(c);Y(t,u?"not-found":"error",c),u?($("product-not-found",{key:e,source:r},t),n?O(`product not found: ${e}`):P(c,`product ${e}`)):(P(c,`product ${e}`),$("error",{error:c,context:"product",key:e},t))}),!0}function En(t,e){let n=p(t,"page-title");!n||typeof document>"u"||(document.title=n.replace(/\{title\}/g,e.title).replace(/\{vendor\}/g,e.vendor||"").replace(/\{type\}/g,e.productType||""))}function qe(){Jt(),ft.forEach(t=>{t.getAttribute(g("state"))!=="error"||t.getAttribute(g("error"))==="not-found"||(Ct.delete(t),zt(t))})}var Gt=new Set;function Cn(t){Gt.size||setTimeout(kn,0),Gt.add(t)}function kn(){let t=[...Gt];Gt=new Set,he(t).forEach((e,n)=>e.then(r=>{ft.forEach(i=>{let s=it.get(i);if(!s||!i.isConnected)return;let a=z(i).key;a!==t[n]&&a!==r.handle&&a!==r.id||JSON.stringify(s.product)!==JSON.stringify(r)&&s.update(r)})}).catch(r=>P(r,`refresh ${t[n]}`)))}var sn=new WeakSet,Q=null,Oe=t=>(Q?.add(t),t);function Yt(){if(!Q)return;let t=[...Q];Promise.allSettled(t).then(()=>{!Q||t.some(e=>!Q.has(e))||(t.length===Q.size?(Q=null,document.documentElement.classList.remove(`${o.prefix}-market-pending`)):Yt())})}function Ne(t=document){x(t.ownerDocument||t,'script[type="application/json"][data-tether-hydrate]').forEach(e=>{if(!sn.has(e)){sn.add(e);try{let n=JSON.parse(e.textContent);Ht(n.products);let r=(i,s)=>String(i||"").toUpperCase()===String(s||"").toUpperCase();r(n.country,o.country)&&r(n.language,o.language)?de(n.products):(O("hydration skipped: other market"),Q||(Q=new Set,document.documentElement.classList.add(`${o.prefix}-market-pending`)))}catch(n){U("bad data-tether-hydrate",n)}}})}var{cfg:In}=Lt,Xt={"config.js":Lt,"client.js":ie,"dom.js":Pe,"fragments.js":ae,"loader.js":fe,"selling-plans.js":xt,"status.js":Ie,"cart.js":Ce,"product.js":Te,"collection.js":Le,"mounting.js":_e},Fe=typeof document<"u"&&document.currentScript?.src||"",kt={};function q(t){if(kt[t])return kt[t];let e=In.partsUrl||Fe.replace(/[^/]*$/,""),n=/\.min\.js(\?|$)/.test(Fe)||!Fe?".min":"",r=`${e.replace(/\/?$/,"/")}tether.${t}${n}.js`;return kt[t]=new Promise((i,s)=>{let a=document.createElement("script");a.src=r,a.async=!0,a.onload=()=>window.Tether?.__parts?.[t]?i(window.Tether.__parts[t]):s(new Error(`${r} did not register`)),a.onerror=()=>{delete kt[t],s(new Error(`Could not load ${r}. Host it next to the Tether script, or set partsUrl.`))},document.head.appendChild(a)}),kt[t]}Xt["lazy.js"]={loadPart:q,coreModules:Xt};var an="0.6.7",st=null,De=null,Ue=null;function pt(t=document){if(!Tt())return 0;t===document&&(Ue=document.body);let e=0;return Jt(),Ne(t),dt(t,ut()).forEach(n=>{if(Wt.has(n))return;Wt.add(n),e++;let r=new Et(n);mt.add(r),n.addEventListener(`${o.prefix}:list-rendered`,i=>pt(i.detail.container)),Oe(r.load())}),dt(t,l("product")).forEach(n=>{zt(n)&&e++}),dt(t,`${l("country-select")},${l("country-bind")}`).length&&q("markets").then(n=>n.renderCountrySelects(t)).catch(n=>P(n,"markets")),(o.account?.clientId||o.account?.server)&&(dt(t,["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"].map(n=>`[${g(n)}]`).join(",")+`,[${g("show")}^="logged-"]`).length||/[?&]code=/.test(window.location.search)||On())&&q("account").then(n=>n.mountAccount(t)).catch(n=>P(n,"account")),dt(t,l("search")).length&&q("search").then(n=>n.mountSearch(t)).catch(n=>P(n,"search")),Yt(),A.render(),O(`mounted ${e} scope(s)`,t),e}function ln(){A.close()}function Tn(t){let e=t?.closest?.(l("product"));return e&&it.get(e)||null}var on=!1;function Ln(){on||(on=!0,document.addEventListener("click",t=>{let e=t.target;if(!e?.closest)return;if(e.closest(l("cart-open"))){t.preventDefault(),A.toggle();return}if(e.closest(l("cart-close"))){t.preventDefault(),A.close();return}let n=e.closest(l("cart-clear"));if(n){t.preventDefault(),K(n,()=>A.clear().catch(c=>P(c,"cart clear")));return}let r=e.closest(l("checkout"));if(r){t.preventDefault(),K(r,()=>A.checkout());return}let i=e.closest(cn());if(i&&i.closest(l("cart-lines"))){let c=i.getAttribute(`data-${o.prefix}-key`),u=A.lines.find(h=>h.id===c),f=h=>{t.preventDefault(),h().catch(m=>P(m,"cart line"))};if(e.closest(l("line-remove")))return i.classList.add("is-busy"),f(()=>A.removeLine(c));if(u&&e.closest(l("line-plus")))return f(()=>A.changeQuantity(c,1));if(u&&e.closest(l("line-minus")))return f(()=>A.changeQuantity(c,-1))}let s=e.closest(l("discount-remove"));if(s){t.preventDefault();let c=s.closest(l("discount-code"))?.getAttribute(g("discount-code"));c&&A.removeDiscount(c).catch(u=>P(u,"discount"));return}let a=e.closest(l("group-add"));a&&(t.preventDefault(),K(a,()=>un(a)))}),document.addEventListener("change",t=>{let e=t.target;if(!e?.closest)return;let n=e.closest(cn()),r=n?.getAttribute(`data-${o.prefix}-key`),i=(s,a)=>{n.classList.add("is-busy"),n.setAttribute("aria-busy","true"),s.catch(c=>P(c,a))};r&&e.matches(`input${l("line","quantity")}`)?i(A.updateLine(r,parseInt(e.value,10)||0),"cart line"):r&&e.matches(`select${l("line-plan")}`)?i(A.updateLine(r,{sellingPlanId:e.value||null}),"cart line plan"):e.matches(`select${l("country-select")}`)?e.value&&Ve(e.value).catch(s=>P(s,"country")):e.matches(l("cart-note"))&&A.setNote(e.value).catch(s=>P(s,"cart note"))}),document.addEventListener("submit",t=>{let e=t.target.closest?.(l("discount-form"));if(!e)return;t.preventDefault();let n=e.querySelector(l("discount-input"))||e.querySelector("input"),r=n?.value.trim();r&&K(e,async()=>{let i=s=>{e.classList.toggle("is-invalid",s),n&&(s?n.setAttribute("aria-invalid","true"):n.removeAttribute("aria-invalid"))};try{await A.applyDiscount(r),i(!1),$("discount-applied",{code:r},e),n&&(n.value="")}catch(s){i(!0),s?.code==="INVALID_DISCOUNT"?$("discount-invalid",{code:r},e):P(s,"discount")}})},!0),document.addEventListener("input",t=>{let e=t.target.closest?.(l("discount-form"));e&&(e.classList.remove("is-invalid"),t.target.removeAttribute?.("aria-invalid"))}),window.addEventListener("storage",t=>{o.domain&&t.key?.startsWith(`${o.prefix}:`)&&q("extras").then(e=>e.onStorage(t)).catch(()=>{})}),document.addEventListener(`${o.prefix}:variant-changed`,t=>{let e=t.target;(o.variantUrl||e.hasAttribute?.(g("variant-url")))&&q("extras").then(n=>n.writeVariantUrl(e,t.detail)).catch(()=>{})}),o.astro!==!1&&(document.addEventListener("astro:page-load",()=>(st||Promise.resolve()).then(()=>{let t=je();if(!t&&Me){try{t=JSON.parse(localStorage.getItem(`${o.prefix}:market:${o.domain}`)||"null")}catch{t=null}t=t?.country?t:pn}Me=!!je(),t?.country&&(String(t.country).toUpperCase()!==String(o.country||"").toUpperCase()||String(t.language||"").toUpperCase()!==String(o.language||"").toUpperCase())?Ve(t.country,{language:t.language??null,locale:t.locale,remember:!1}).then(()=>pt(document),()=>pt(document)):Ue!==document.body&&pt(document)})),document.addEventListener("astro:before-swap",()=>{Ue=null,ln()})),window.addEventListener("online",()=>{qe(),mt.forEach(t=>{t.root.getAttribute(g("state"))==="error"&&t.load()})}),document.addEventListener("keydown",t=>{if(!A.isOpen())return;if(t.key==="Escape"){A.close();return}if(t.key!=="Tab"||o.cartFocus===!1)return;let e=A.drawers().find(s=>s.classList.contains(o.cartDrawerOpenClass)),n=e?Rt(e):[];if(!n.length)return;let r=n[0],i=n[n.length-1];(!e.contains(document.activeElement)||t.shiftKey&&document.activeElement===r||!t.shiftKey&&document.activeElement===i)&&(t.preventDefault(),(t.shiftKey?i:r).focus())}))}function cn(){return`[data-${o.prefix}-key]`}var un=t=>q("extras").then(e=>e.addGroup(t)),It=null;function dn(t={}){return st&&!Object.keys(t).length?st:(te({...window.TETHER_CONFIG||{},...t}),Tt()?(Ln(),o.observe&&_n(),o.analytics&&!It&&(It=[],["product-ready","list-ready","cart-updated","cart-toggled","checkout","search"].forEach(e=>document.addEventListener(`${o.prefix}:${e}`,n=>It.push(n))),document.addEventListener("astro:page-load",()=>It.push(new CustomEvent(`${o.prefix}:page`))),q("analytics").then(e=>e.startAnalytics(It)).catch(e=>P(e,"analytics"))),st=qn(t).then(()=>A.init()).then(async e=>{let n=o.country?String(o.country).toUpperCase():null;if(e&&n&&e.buyerIdentity?.countryCode&&e.buyerIdentity.countryCode!==n)try{e=await A.setBuyerIdentity({countryCode:n},{create:!1})}catch(r){P(r,"cart country")}return $("ready",{cart:e}),Re}),st):(U("TETHER_CONFIG is missing domain or token. Tether is idle."),st=Promise.resolve(null),st))}function je(t=document){let e=r=>t.querySelector(`meta[name="${o.prefix}-page-${r}"]`)?.getAttribute("content")||void 0,n=e("country");return n?{country:n.toUpperCase(),language:e("language"),locale:e("locale")}:null}var pn=null,Me=!1;async function qn(t){let e=o.markets||{};pn={country:o.country,language:o.language,locale:o.locale};let n=je();if(Me=!!n,n){o.country=n.country,o.language=n.language?n.language.toUpperCase():void 0,n.locale&&(o.locale=n.locale);return}if(e.detect===!1)return;let r=null;if(e.detect)try{r=(await q("markets")).detectMarket(e)}catch(i){P(i,"markets");return}else if(e.remember!==!1){try{r=JSON.parse(localStorage.getItem(`${o.prefix}:market:${o.domain}`)||"null")}catch{}r&&!/^[A-Z]{2}$/.test(r.country||"")&&(r=null)}r&&(r.country&&(o.country=r.country),r.language&&(o.language=r.language),r.locale&&!t.locale&&(o.locale=r.locale),O("market",r))}function On(){try{return!!(sessionStorage[`${o.prefix}:account:${o.domain}`]||localStorage[`${o.prefix}:account:${o.domain}`]||localStorage[`${o.prefix}:account-hint:${o.domain}`])}catch{return!1}}var Nn=new Proxy({},{get:(t,e)=>(...n)=>q("account").then(r=>r[e](...n))});function Ve(t,e){return q("markets").then(n=>n.setCountry(t,e))}function _n(){if(De||typeof MutationObserver>"u")return;let t=null,e=new Set;De=new MutationObserver(n=>{n.forEach(r=>r.addedNodes.forEach(i=>{i.nodeType===1&&e.add(i)})),clearTimeout(t),t=setTimeout(()=>{e.forEach(r=>{r.isConnected&&pt(r)}),e.clear()},50)}),De.observe(document.body,{childList:!0,subtree:!0})}var Re={VERSION:an,init:dn,mount:pt,unmount:ln,get config(){return o},get ready(){return st||Promise.resolve(null)},query:_,withContext:Ot,cart:A,getProduct:nt,getProducts:bt,getRecommendations:vt,getScope:Tn,addGroup:un,account:Nn,primeProduct:et,normalizeProductKey:ct,clearProductCache:ue,formatMoney:D,imageUrl:jt,plans:xt,TetherError:E,resolveProductKey:z,setCountry:Ve,detectMarket:t=>q("markets").then(e=>e.detectMarket(t||o.markets)),getLocalization:()=>q("markets").then(t=>t.getLocalization()),diagnose:t=>q("diagnose").then(e=>e.diagnose({...t,version:an})),__core:Xt,__parts:{},on(t,e){let n=r=>e(r.detail,r);return document.addEventListener(`${o.prefix}:${t}`,n),()=>document.removeEventListener(`${o.prefix}:${t}`,n)}},Cr=Re;if(typeof window<"u"&&typeof document<"u"&&(window.Tether=Re,window.TETHER_CONFIG&&window.TETHER_CONFIG.autoMount!==!1&&!window.TETHER_INTEGRATION)){let e=()=>dn().then(()=>pt(document));document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}})();
3
+ image { ${pt} }
4
+ seo { title description }`}var un={};wi(un,{GID:()=>K,allPlans:()=>R,allocationFor:()=>N,findPlan:()=>Rt,hasPlans:()=>ca,planAdjustment:()=>an,planCheckoutCharge:()=>sn,planPrice:()=>Ot,planSavings:()=>Zt,plansForVariant:()=>la,toGid:()=>Pe});var aa=/^(-?)(\d+)(?:\.(\d+))?$/;function Ur(t,e){let n=aa.exec(t.trim());if(!n)return null;let[,r="",o="0",i=""]=n,s=BigInt(`${o}${i.padEnd(e,"0")}`);return r==="-"?-s:s}var Fr=t=>t.split(".")[1]?.length??0;function Vr(t,e){if(t==null||e==null)return!1;let n=Math.max(Fr(t.trim()),Fr(e.trim())),r=Ur(t,n),o=Ur(e,n);return r===null||o===null?!1:r>o}var Dr=2,Hr=new Map;function jr(t){let e=Hr.get(t);if(e!==void 0)return e;let n=Dr;try{n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??Dr}catch{}return Hr.set(t,n),n}function Pt(t){return Math.round(parseFloat(t.amount)*10**jr(t.currencyCode))}function Jt(t,e){let n=jr(e);return{amount:(t/10**n).toFixed(n),currencyCode:e}}var ua=100;function Pe(t,e){let n=typeof t=="string"||typeof t=="number"?String(t).trim():"";return n?n.startsWith("gid://")?n:/^\d+$/.test(n)?`gid://shopify/${e}/${n}`:n:null}var K={product:t=>Pe(t,"Product"),variant:t=>Pe(t,"ProductVariant"),sellingPlan:t=>Pe(t,"SellingPlan")};function R(t){return(t?.sellingPlanGroups?.nodes??[]).flatMap(n=>n.sellingPlans.nodes.map(r=>({...r,group:n})))}function ca(t){return R(t).length>0}function N(t,e){return!t||!e?null:(t.sellingPlanAllocations?.nodes??[]).find(r=>r.sellingPlan.id===e)??null}function la(t,e){return R(t).filter(n=>N(e,n.id))}function Ot(t,e){let n=N(t,e)?.priceAdjustments[0];return n?.perDeliveryPrice??n?.price??t?.price??null}function sn(t,e){let n=N(t,e);return n?.checkoutChargeAmount??n?.priceAdjustments[0]?.price??t?.price??null}function Zt(t,e){let n=Ot(t,e);if(!t||!n)return{amount:null,percentage:0};let r=parseFloat(t.price.amount),o=parseFloat(n.amount);if(!Number.isFinite(r)||!Number.isFinite(o)||r<=0||o>=r)return{amount:null,percentage:0};let i=Pt(t.price)-Pt(n);return{amount:Jt(i,t.price.currencyCode),percentage:Math.round((1-o/r)*ua)}}function an(t){let e=t?.priceAdjustments[0]?.adjustmentValue;if(!e)return null;switch(e.__typename){case"SellingPlanPercentagePriceAdjustment":return{type:"percentage",value:e.adjustmentPercentage};case"SellingPlanFixedAmountPriceAdjustment":return{type:"amount",value:e.adjustmentAmount};case"SellingPlanFixedPriceAdjustment":return{type:"price",value:e.price};default:return null}}function Rt(t,e){if(!e)return null;let n=R(t),r=K.sellingPlan(e),o=e.trim().toLowerCase();return n.find(i=>i.id===r)??n.find(i=>i.name.toLowerCase()===o)??n.find(i=>i.options.some(s=>s.value.toLowerCase()===o))??null}var et={amount:"string",currencyCode:"string"},Nt={id:"string",handle:"string",title:"string",options:["object"],images:{nodes:["object"]},priceRange:{minVariantPrice:et,maxVariantPrice:et},variants:{nodes:[{id:"string",price:et,selectedOptions:["object"]}]}},cn={nodes:[Nt],pageInfo:{hasNextPage:"boolean"}},qr=t=>X(t,"id")!==""&&X(t,"handle")!==""&&tt(t,Nt),Gr=t=>A(t)&&(t.id===void 0||tt(t,Nt));var da={id:"string",quantity:"number",attributes:["object"],cost:{totalAmount:et,subtotalAmount:et,amountPerQuantity:et},merchandise:{id:"string",selectedOptions:["object"],product:"object"}},ln={id:"string",checkoutUrl:"string",totalQuantity:"number",attributes:["object"],discountCodes:["object"],cost:{totalAmount:et,subtotalAmount:et},lines:{nodes:[da]}};var pa='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',fa=60,dn=!1,Ee=null,ma=t=>t!==null&&"focus"in t,Qr=t=>y(t,pa).filter(e=>e.offsetParent!==null||e===document.activeElement),Et=()=>y(document,c("cart-drawer")),pn=t=>t.classList.contains(a.cartDrawerOpenClass);function Y(){let t=Et();return t.length?t.some(pn):dn}function we(t){y(document,c("cart-open")).forEach(e=>{e.setAttribute("aria-expanded",String(t))}),Et().forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","dialog"),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&e.setAttribute("aria-label",p(e,"cart-label")||"Cart"),e.setAttribute("aria-modal",String(t)),!pn(e)&&(e.setAttribute("aria-hidden","true"),a.cartFocus&&(e.inert=!0))})}function ga(t){let e=Qr(t)[0]??t;e===t&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),e.focus({preventScroll:!0})}function Ce(){if(Y())return;dn=!0;let t=Et().filter(n=>p(n,"cart-drawer")!=="manual");t.forEach(n=>{n.inert=!1,n.classList.add(a.cartDrawerOpenClass),n.setAttribute("aria-hidden","false")}),we(!0);let[e]=t;a.cartFocus&&e&&(Ee=ma(document.activeElement)?document.activeElement:null,setTimeout(()=>{ga(e)},fa)),a.onCartOpen?.(t),h("cart-toggled",{open:!0})}function fn(){if(!Y())return;dn=!1;let t=Et(),e=t.some(n=>n.contains(document.activeElement));t.forEach(n=>{n.classList.remove(a.cartDrawerOpenClass),n.setAttribute("aria-hidden","true"),a.cartFocus&&(n.inert=!0)}),we(!1),e&&Ee?.isConnected&&Ee.focus({preventScroll:!0}),Ee=null,a.onCartClose?.(t),h("cart-toggled",{open:!1})}function Kr(){Y()?fn():Ce()}function mn(t){if(t.key!=="Tab"||!a.cartFocus||!Y())return;let e=Et().find(pn);if(!e)return;let n=Qr(e),r=n[0],o=n.at(-1);if(!r||!o)return;let i=document.activeElement,s=t.shiftKey?i===r:i===o;e.contains(i)&&!s||(t.preventDefault(),(t.shiftKey?o:r).focus())}var ha=1e4,ya=6e4,j=new Map,gn=new Map,wt=new Set,Se=new Map,Yr=[],hn=!1,Xt=0,Wr=t=>t.startsWith("gid://"),$t=wr;function Ct(t){if(!t)return;let e=Promise.resolve(t);j.set(t.handle,e),j.set(t.id,e)}function nt(t){let e=$t(t);if(!e)return Promise.reject(new P("empty product key",{code:"NOT_FOUND"}));let n=j.get(e);if(n)return n;let r=new Promise((o,i)=>{gn.set(e,{resolve:o,reject:i}),Yr.push(e),hn||(hn=!0,setTimeout(()=>void wa(),0))});return j.set(e,r),r}var ke=t=>e=>`${t}${$r(a,e)}`;function ba(t){let e=t.filter(Wr),n=t.filter(u=>!Wr(u)),r=[],o=[],i={};return e.length&&(r.push("$ids: [ID!]!"),i.ids=e,o.push("byId: nodes(ids: $ids) { ... on Product { ...TetherProduct } }")),n.forEach((u,l)=>{r.push(`$h${l}: String!`),i[`h${l}`]=u,o.push(`h${l}: product(handle: $h${l}) { ...TetherProduct }`)}),{query:ke(`query TetherProducts(${r.join(",")}){${o.join(" ")}}`),variables:i,handles:n}}function Br(t,e){let n=gn.get(t);gn.delete(t),n&&e(n)}function Pa(t,e){if(e!==Xt)return;let n=j.get(t);setTimeout(()=>{j.get(t)===n&&j.delete(t)},ha)}function Ea(t){if(!A(t))return!1;let{byId:e=[],...n}=t;return tt(e,[F(Gr)])&&Object.values(n).every(F(Nt))}async function wa(){hn=!1;let t=Xt,e=Yr.splice(0);if(!e.length)return;let{query:n,variables:r,handles:o}=ba(e);x("fetch products",e);let i;try{i=await D(n,r,Ea)}catch(l){e.forEach(d=>{Br(d,g=>{t===Xt&&j.delete(d),g.reject(l)})});return}let s=new Map;for(let l of i.byId??[])l?.id&&s.set(l.id,l);o.forEach((l,d)=>{let g=i[`h${d}`];g&&s.set(l,g)});let u=Date.now();e.forEach(l=>{Br(l,d=>{let g=s.get(l);if(!g){Pa(l,t),d.reject(new P(`Product not found: ${l}`,{code:"NOT_FOUND"}));return}t===Xt&&(Ct(g),Se.set(g.handle,u),Se.set(g.id,u)),d.resolve(g)})})}function Te(){j.clear(),Xt+=1,wt.clear(),Se.clear()}function zr(t){for(let e of t??[])!e.id||!e.handle||Date.now()-(Se.get(e.handle)??0)<ya&&j.has(e.handle)||(Ct(e),wt.add(e.handle),wt.add(e.id))}function Jr(t){let e=$t(t);return!e||!wt.has(e)?!1:(wt.delete(e),j.get(e)?.then(n=>{wt.delete(n.handle),wt.delete(n.id)},Ca),!0)}function Ca(){}function Zr(t){let e=$t(t);return e&&j.delete(e),nt(t)}var Sa=B({collection:F({handle:"string",products:cn})}),ka=B({products:cn}),Ta=B({productRecommendations:F([Nt])}),va=`query TetherCollection($handle:String!,$first:Int!,$after:String,$sortKey:ProductCollectionSortKeys,$reverse:Boolean,$filters:[ProductFilter!]){collection(handle:$handle){${_r()} products(first:$first,after:$after,sortKey:$sortKey,reverse:$reverse,filters:$filters){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}}`,Aa="query TetherSearch($first:Int!,$after:String,$query:String,$sortKey:ProductSortKeys,$reverse:Boolean){products(first:$first,after:$after,query:$query,sortKey:$sortKey,reverse:$reverse){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}";async function ve({collection:t,query:e,first:n=a.collectionFirst,after:r=null,sortKey:o,reverse:i=!1,filters:s}={}){if(t){let l=await D(ke(va),{handle:t,first:n,after:r,sortKey:o||void 0,reverse:i,filters:s??void 0},Sa);if(!l.collection)throw new P(`Collection not found: ${t}`,{code:"NOT_FOUND"});let{products:d,...g}=l.collection;return d.nodes.forEach(Ct),{collection:g,products:d.nodes,pageInfo:d.pageInfo}}let u=await D(ke(Aa),{first:n,after:r,query:e||void 0,sortKey:o||void 0,reverse:i},ka);return u.products.nodes.forEach(Ct),{collection:null,products:u.products.nodes,pageInfo:u.products.pageInfo}}async function Ae(t,e="RELATED"){let n=$t(typeof t=="object"?t?.id:t),r=n?.startsWith("gid://")??!1,i=(await D(ke(`query TetherRecs(${r?"$id: ID!":"$handle: String!"},$intent:ProductRecommendationIntent){productRecommendations(${r?"productId: $id":"productHandle: $handle"},intent:$intent){...TetherProduct}}`),r?{id:n,intent:e}:{handle:n,intent:e},Ta)).productRecommendations??[];return i.forEach(Ct),i}var Xr="Default Title",yn=(t,e)=>e.get(t.id)?.quantity??t.quantity,to=t=>t.split("/").pop()??t;function xa(t){let e=t.merchandise,n=Mt(e.product.handle,e.product.id);if(!n)return null;let r=new URLSearchParams;r.set("variant",to(e.id));let o=t.sellingPlanAllocation?.sellingPlan.id;return o&&r.set("selling_plan",to(o)),`${n}${n.includes("?")?"&":"?"}${r.toString()}`}var eo=t=>t.merchandise.product.title,no={title:eo,"product-title":eo,"variant-title":t=>t.merchandise.title===Xr?"":t.merchandise.title,options:t=>t.merchandise.selectedOptions.filter(e=>e.value!==Xr).map(e=>`${e.name}: ${e.value}`).join(", "),vendor:t=>t.merchandise.product.vendor,sku:t=>t.merchandise.sku??"",price:t=>M(t.cost.amountPerQuantity),"compare-at-price":t=>M(t.cost.compareAtAmountPerQuantity??t.merchandise.compareAtPrice),"line-total":t=>M(t.cost.totalAmount),"line-subtotal":t=>M(t.cost.subtotalAmount),quantity:(t,e)=>yn(t,e.pending),plan:t=>t.sellingPlanAllocation?.sellingPlan.name??"","plan-description":t=>t.sellingPlanAllocation?.sellingPlan.description??"",components:t=>(t.lineComponents??[]).map(e=>`${e.quantity} \xD7 ${e.merchandise.product.title}`).join(", ")},ro="attribute:";function La(t,e,n){if(Object.hasOwn(no,e))return no[e]?.(t,n);if(!e.startsWith(ro))return;let r=e.slice(ro.length);return t.attributes.find(o=>o.key===r)?.value??""}function Ia(t,e,n){let r=R(n),o=!n.requiresSellingPlan&&p(t,"line-plan")!=="subscription-only",i={value:"",label:t.getAttribute(f("one-time-label"))||"One-time purchase"},s=[...o?[i]:[],...r.map(l=>({value:l.id,label:l.name}))],u=s.map(l=>l.value).join("|");t.dataset.tetherSig!==u&&(t.replaceChildren(...s.map(l=>{let d=document.createElement("option");return d.value=l.value,d.textContent=l.label,d})),t.dataset.tetherSig=u),t.value=e.sellingPlanAllocation?.sellingPlan.id??"",L(t,r.length>0)}function Ma(t,e,n){let r=!!e.sellingPlanAllocation;t.classList.toggle("is-subscription",r);let o=n.warnings.find(u=>u.target===e.id);t.classList.toggle("is-warning",!!o);let i=n.pending.has(e.id);t.classList.toggle("is-busy",i),i?t.setAttribute("aria-busy","true"):t.removeAttribute("aria-busy"),y(t,c("line","warning")).forEach(u=>{lt(u,o?.message??"")});let s=new Map([["subscription",r],["one-time",!r],["on-sale",Vr(e.cost.compareAtAmountPerQuantity?.amount,e.cost.amountPerQuantity.amount)],["has-components",(e.lineComponents??[]).length>0],["warning",!!o]]);y(t,c("line-show")).forEach(u=>{let l=p(u,"line-show"),d=l===null?void 0:s.get(l);d!==void 0&&L(u,d)})}function Oa(t,e,n){let r=e.merchandise;t.setAttribute(f("line-id"),e.id),y(t,c("line")).forEach(o=>{let i=p(o,"line")??"";if(i==="image"){I(o,r.image?.url??r.product.featuredImage?.url,r.product.title);return}if(i==="url"){let u=xa(e);u&&o.setAttribute("href",u);return}let s=La(e,i,n);s!==void 0&&lt(o,s)}),Ma(t,e,n),y(t,`select${c("line-plan")}`).forEach(o=>{nt(r.product.handle).then(i=>{Ia(o,e,i)}).catch(i=>{m(i,"line plan options")})})}function Ra(t,e){let n=t?.totalQuantity??0,r=(t?.lines.nodes??[]).some(i=>i.sellingPlanAllocation),o=new Map([["cart-empty",n===0],["cart-filled",n>0],["cart-has-subscription",r],["cart-no-subscription",!r],["cart-has-discount",(t?.discountCodes??[]).some(i=>i.applicable)],["cart-error",e.failed],["cart-warning",e.warnings.length>0]]);y(document,c("show")).forEach(i=>{let s=p(i,"show"),u=s===null?void 0:o.get(s);u===void 0||i.closest(c("product"))||L(i,u)}),y(document,c("checkout")).forEach(i=>{i.classList.toggle("is-disabled",!n),i.setAttribute("aria-disabled",String(!n))})}function Na(t){y(document,`textarea${c("cart-note")},input${c("cart-note")}`).forEach(e=>{document.activeElement!==e&&w(e,t?.note??"")}),y(document,c("cart-discounts")).forEach(e=>{V(e,t?.discountCodes??[],(n,r)=>{n.setAttribute(f("discount-code"),r.code);let o=n.querySelector(c("discount","code"))??(n.firstElementChild?null:n);o&&w(o,r.code),n.classList.toggle("is-inapplicable",!r.applicable)})})}function oo(t){let{cart:e}=t,n=r=>e?M(e.cost[r]):"";we(Y()),y(document,c("cart-count")).forEach(r=>{lt(r,e?.totalQuantity??0)}),y(document,c("cart-subtotal")).forEach(r=>{lt(r,n("subtotalAmount"))}),y(document,c("cart-total")).forEach(r=>{lt(r,n("totalAmount"))}),y(document,c("cart-checkout-charge")).forEach(r=>{lt(r,n("checkoutChargeAmount"))}),Ra(e,t),y(document,c("cart-warning")).forEach(r=>{lt(r,[...new Set(t.warnings.map(o=>o.message))].join(" "))}),Na(e),y(document,c("cart-lines")).forEach(r=>{en(r,e?.lines.nodes??[],o=>o.id,(o,i)=>{Oa(o,i,t)},{onEnter:a.onLineEnter,onLeave:a.onLineLeave})}),e&&dt("cart")}function io(t){y(document,c("cart-count")).forEach(e=>{/^\s*0?\s*$/.test(e.textContent)&&(e.textContent=String(t))})}function St(t,e="localStorage"){try{return window[e].getItem(t)}catch{return null}}function xe(t,e,n="localStorage"){try{window[n].setItem(t,e)}catch{}}function te(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var q={kind:"unknown"},_t=[],kt=new Map,Le=()=>q;function T(){switch(q.kind){case"ready":case"error":return q.cart;case"unknown":case"empty":return null}}var ao=()=>_t,bn=t=>t?{kind:"ready",cart:t}:{kind:"empty"},uo=()=>`${a.storageKey}:seen`,Tt=()=>St(a.storageKey)||null;function Ut(){te(a.storageKey)}function Pn(t){q=bn(t),t&&xe(a.storageKey,t.id)}function ee(){oo({cart:T(),warnings:_t,pending:kt,failed:q.kind==="error"})}function ne(t){ee(),h("cart-updated",{cart:T(),reason:t})}function rt(t,e){return Pn(t),xe(uo(),`${Date.now()}|${t?.totalQuantity??0}`),ne(e),t}function re(t){q=t.kind==="loaded"?bn(t.cart):{kind:"error",error:t.error,cart:null},ne("load")}function $a(){let t=St(uo())?.split("|")[1]??"",e=Number(t);return/^\d+$/.test(t)&&Number.isSafeInteger(e)?e:null}function co(){if(q.kind!=="unknown")return;let t=$a();t!==null&&io(t)}function lo(t){_t=t.filter((e,n)=>t.findIndex(r=>r.message===e.message)===n).map(e=>({...e,message:a.warningText?.(e)||e.message})),_t.length&&h("cart-warning",{warnings:_t})}var so=()=>{};function _a(){let t=Promise.resolve();return e=>{let n=t.then(e);return t=n.then(so,so),n}}var Ua=_a();function ot(t){return Ua(t).then(e=>(q.kind==="error"&&(q=bn(q.cart),ee()),e),e=>{throw q={kind:"error",error:e,cart:T()},ee(),h("cart-error",{error:e}),e})}var En=t=>yn(t,kt),Fa=()=>({open:Y(),count:T()?.totalQuantity??0,loaded:q.kind!=="unknown",warnings:[..._t]});function po(t){let e=["cart-updated","cart-toggled"].map(r=>`${a.prefix}:${r}`),n=()=>{t(T(),Fa())};return e.forEach(r=>{document.addEventListener(r,n)}),n(),()=>{e.forEach(r=>{document.removeEventListener(r,n)})}}var Da=/does not exist|not found|invalid id/i,Ha=t=>B({[t]:F({cart:F(ln)})});function Ie(t){return t instanceof P?t.userErrors?.some(e=>e.field?.[0]==="cartId")?!0:(t.errors??[]).some(e=>Da.test(e.message)):!1}function mo(t,e=1,n={}){let r=typeof t=="object"&&t!==null?t:{...n,quantity:e,...t==null?{}:{variantId:t}},o=K.variant(r.merchandiseId||r.variantId||r.id);if(!o)throw new P("add(): variantId is required");let i=parseInt(String(r.quantity??1),10),s={merchandiseId:o,quantity:Math.max(1,i||1)},u=K.sellingPlan(r.sellingPlanId||r.sellingPlan);u&&(s.sellingPlanId=u);let l=zt(r.attributes);return l.length&&(s.attributes=l),s}function Va(t,e,n){return r=>`mutation Tether_${t}(${e}){${t}(${n}){cart{...TetherCart}userErrors{field message}warnings{code message target}}}${on(r)}`}async function go(t,e,n,r){let o=await D(Va(t,e,n),r,Ha(t)),i=dr(o[t],t);return lo(i.warnings??[]),i.cart}function fo(t){let e=a.country?{buyerIdentity:{countryCode:a.country},...t}:t;return go("cartCreate","$input: CartInput!","input: $input",{input:e})}async function ft({name:t,args:e,inner:n,variables:r,createInput:o}){let i=Tt();if(!i)return o?fo(o):null;try{return await go(t,`$cartId: ID!, ${e}`,`cartId: $cartId, ${n}`,{...r,cartId:i})}catch(s){if(!Ie(s)||(Ut(),!o))throw s;return x("cart expired, creating a new one"),fo(o)}}async function ho(t){return(await D(n=>`query TetherCart($id:ID!){cart(id:$id){...TetherCart}}${on(n)}`,{id:t},B({cart:F(ln)}))).cart}async function yo(t){return(await D("query TetherCheckout($id: ID!) { cart(id: $id) { checkoutUrl } }",{id:t},B({cart:F({checkoutUrl:"string"})}))).cart?.checkoutUrl??null}function bo(t,e){let n=typeof e=="number"?{quantity:e}:e,r={id:t};n.quantity!==void 0&&(r.quantity=n.quantity),"sellingPlanId"in n&&(r.sellingPlanId=n.sellingPlanId?K.sellingPlan(n.sellingPlanId):null),n.attributes&&(r.attributes=zt(n.attributes));let o=n.merchandiseId||n.variantId;return o&&(r.merchandiseId=K.variant(o)),r}var wn=t=>ft({name:"cartLinesUpdate",args:"$lines: [CartLineUpdateInput!]!",inner:"lines: $lines",variables:{lines:t},createInput:null}),Cn=t=>ft({name:"cartLinesRemove",args:"$lineIds: [ID!]!",inner:"lineIds: $lineIds",variables:{lineIds:t},createInput:null}),Po=(t,e)=>e>0?wn([{id:t,quantity:e}]):Cn([t]);var Sn=null;function Eo(t){Sn=t}var ja=t=>yo(t).then(e=>({kind:"url",url:e}),e=>({kind:"failed",error:e}));async function qa(){if(!Sn)return null;try{let t=await Sn();return t&&`${t}${t.includes("?")?"&":"?"}logged_in=true`}catch(t){return m(t,"account checkout"),null}}async function Ga(t){let e=ja(t),n=await qa();if(n)return n;let r=await e;if(r.kind==="failed")throw r.error;if(!r.url)throw new P("No checkoutUrl (cart empty or expired)");return r.url}function Qa(t){try{t.opener=null}catch{}}async function wo(t=a.checkoutTarget){let e=Tt(),n=T();if(!e||n&&!n.totalQuantity)return null;let r=t==="_blank"?window.open("","_blank"):null;r&&Qa(r);try{let o=await Ga(e);if(!le(o))throw new P("The checkout URL is not https: not opened");return h("checkout",{url:o,cart:T()}),r&&!r.closed?r.location.href=o:window.location.href=o,o}catch(o){return r?.close(),m(o,"checkout failed"),null}}var Me=()=>T()?.lines.nodes??[];function Ka(t,e){let n=Me().find(u=>u.id===t);if(!n)return Promise.resolve(T());let r=Math.max(0,En(n)+e),o={quantity:r};kt.set(t,o),ne("pending");let i=()=>kt.get(t)===o;return ot(async()=>{if(!i())return T();if(Me().find(d=>d.id===t)?.quantity===r)return T();let l=await Po(t,r);return i()?rt(l,r>0?"update":"remove"):(Pn(l),l)}).finally(()=>{i()&&(kt.delete(t),ne("settled"))})}function Wa(t){let e=(T()?.discountCodes??[]).map(r=>r.code),n=typeof t=="function"?t(e):t;return(Array.isArray(n)?n:[n]).map(r=>r.trim()).filter(Boolean)}function Ba(t){let e=new Map((T()?.attributes??[]).map(n=>[n.key,n.value]));return zt(t).forEach(n=>e.set(n.key,n.value)),[...e].filter(([,n])=>n!=="").map(([n,r])=>({key:n,value:r}))}async function Ya(){let t=Tt();if(!t)return re({kind:"loaded",cart:null}),null;co();try{let e=await ho(t);e||Ut(),re({kind:"loaded",cart:e})}catch(e){m(e,"cart load failed"),Ie(e)&&Ut(),re({kind:"failed",error:e})}return T()}var b={init:Ya,id:Tt,get status(){return Le()},get state(){return T()},get lines(){return[...Me()]},get count(){return T()?.totalQuantity??0},get loaded(){return Le().kind!=="unknown"},get lastError(){let t=Le();return t.kind!=="error"?null:t.error instanceof Error?t.error:new Error(String(t.error))},get warnings(){return[...ao()]},get pendingQty(){return kt},setCheckoutResolver:Eo,forgetSaved(){Ut(),re({kind:"loaded",cart:null})},render:ee,subscribe:po,add(t,e=1,n={}){let r=(Array.isArray(t)?t:[t]).map(o=>mo(o,e,n));return ot(async()=>{let o=await ft({name:"cartLinesAdd",args:"$lines: [CartLineInput!]!",inner:"lines: $lines",variables:{lines:r},createInput:{lines:r}});if(!o)throw new P("Shopify answered the add without a cart");return rt(o,"add"),h("added",{cart:o,lines:r}),a.openCartOnAdd&&Ce(),o})},updateLine(t,e){let n=typeof e=="number"?e:e.quantity;if(n!==void 0&&n<=0)return b.removeLine(t);let r=bo(t,e);return ot(async()=>rt(await wn([r]),"update"))},changeQuantity:Ka,quantityOf:En,removeLine(t){let e=Array.isArray(t)?t:[t];return ot(async()=>rt(await Cn(e),"remove"))},clear(){let t=Me().map(e=>e.id);return t.length?b.removeLine(t):Promise.resolve(T())},setNote(t){let e={note:t??""};return ot(async()=>rt(await ft({name:"cartNoteUpdate",args:"$note: String!",inner:"note: $note",variables:e,createInput:e}),"note"))},setAttributes(t){return ot(async()=>{let e={attributes:Ba(t)},n=await ft({name:"cartAttributesUpdate",args:"$attributes: [AttributeInput!]!",inner:"attributes: $attributes",variables:e,createInput:e});return rt(n,"attributes")})},setDiscountCodes(t){return ot(async()=>{let e={discountCodes:Wa(t)},n=await ft({name:"cartDiscountCodesUpdate",args:"$discountCodes: [String!]!",inner:"discountCodes: $discountCodes",variables:e,createInput:e});return rt(n,"discount")})},async applyDiscount(t){let e=await b.setDiscountCodes(o=>[...new Set([...o,t])]),n=t.toLowerCase();if((e?.discountCodes??[]).find(o=>o.code.toLowerCase()===n)?.applicable)return e;try{await b.removeDiscount(t)}catch(o){m(o,"removing a discount code Shopify refused")}throw new P(`Discount code not valid: ${t}`,{code:"INVALID_DISCOUNT"})},removeDiscount(t){let e=t.toLowerCase();return b.setDiscountCodes(n=>n.filter(r=>r.toLowerCase()!==e))},setBuyerIdentity(t,{create:e=!0}={}){return ot(async()=>{let n=await ft({name:"cartBuyerIdentityUpdate",args:"$buyerIdentity: CartBuyerIdentityInput!",inner:"buyerIdentity: $buyerIdentity",variables:{buyerIdentity:t},createInput:e?{buyerIdentity:t}:null}).catch(r=>{if(e||!Ie(r))throw r;return null});return rt(n,"buyer-identity")})},checkout:wo,drawers:Et,isOpen:Y,open:Ce,close:fn,toggle:Kr};var za=100,Ja=(t,e)=>Jt(Pt(t)*e,t.currencyCode),Dt=t=>Object.fromEntries(t.selectedOptions.map(e=>[e.name,e.value]));function Za(t,e){return t.variants.nodes.find(n=>n.selectedOptions.every(r=>e[r.name]===r.value))??null}function Co(t,e,n,r){return t.variants.nodes.some(o=>o.availableForSale&&o.selectedOptions.every(i=>i.name===n?i.value===r:e[i.name]===i.value))}var Ft=t=>t.kind==="subscription"?t.planId:t.offeredPlanId;function Oe(t,e){return t.kind==="subscription"&&N(e,t.planId)?t:{kind:"one-time"}}function Re(t,e,n,r){let o=R(t),i=o.find(u=>u.id===r)??o[0];if(!i)return{kind:"one-time",offeredPlanId:null};let s=N(e,i.id)?i:o.find(u=>N(e,u.id))??i;return t.requiresSellingPlan||n==="subscription"?{kind:"subscription",planId:s.id}:{kind:"one-time",offeredPlanId:s.id}}function So(t,{variant:e,sellingPlan:n,defaultPlan:r,defaultPurchase:o}){let i=t.variants.nodes,s=K.variant(e),u=i.find($=>$.id===s)??i.find($=>$.availableForSale)??i[0]??null,l=Rt(t,n),d=l??Rt(t,r),g=l||o==="subscription"?"subscription":"one-time";return{selected:u?Dt(u):{},purchase:Re(t,u,g,d?.id??null)}}function Xa(t,e,n,r,o){let i=t.quantityAvailable,s=i!=null&&i>0&&i<=e,u=r.compareAtPrice!==null,l=r.line.kind==="subscription";return{"in-stock":t.availableForSale,"out-of-stock":!t.availableForSale,backorder:t.availableForSale&&t.currentlyNotInStock,"on-sale":u,"not-on-sale":!u,"has-variants":n>1,"single-variant":n===1,"low-stock":s,"plenty-in-stock":t.availableForSale&&!s,"subscription-available":r.subscriptionAvailable,"subscription-unavailable":!r.subscriptionAvailable,"subscription-only":o,"one-time-available":!o,"subscription-selected":l,"one-time-selected":!l,"has-savings":l?r.savings.percentage>0:u}}function ko(t,e,n){let r=Za(t,e.selected),o=r??t.variants.nodes[0];if(!o)return null;let i=Re(t,o,e.purchase.kind,Ft(e.purchase)),s=Ft(i),u=R(t),l=Oe(i,o),d=l.kind==="subscription"?N(o,l.planId):null,g=d?Ot(o,s)??o.price:o.price,$=d?.priceAdjustments[0]?.compareAtPrice??o.compareAtPrice,Z={line:l,subscriptionAvailable:u.some(G=>N(o,G.id)),compareAtPrice:$&&parseFloat($.amount)>parseFloat(g.amount)?$:null,savings:Zt(o,s)};return{...Z,variant:o,selected:r?e.selected:Dt(o),purchase:i,plan:u.find(G=>G.id===s)??null,quantity:e.quantity,price:g,show:Xa(o,n,t.variants.nodes.length,Z,t.requiresSellingPlan)}}function To(t,e){let{variant:n,plan:r,price:o,compareAtPrice:i,quantity:s}=t,u=Ft(t.purchase),l=G=>Ja(G,Math.max(1,s)),Z={price:()=>e.money(o),"total-price":()=>e.money(l(o)),"one-time-price":()=>e.money(n.price),"subscription-price":()=>e.money(u?Ot(n,u):null),"subscription-savings":()=>e.percent(t.savings.percentage),"subscription-savings-amount":()=>e.money(t.savings.amount),"checkout-charge":()=>{let G=t.line.kind==="subscription"?sn(n,u)??o:o;return e.money(l(G))},"plan-name":()=>r?.name,"plan-description":()=>r?.description,"plan-group":()=>r?.group.name,"compare-at-price":()=>e.money(i),"unit-price":()=>e.money(n.unitPrice),"discount-percentage":()=>i?`${Math.round((1-parseFloat(o.amount)/parseFloat(i.amount))*za)}%`:"0%","discount-amount":()=>i?e.money(Jt(Pt(i)-Pt(o),o.currencyCode)):"","variant-title":()=>n.title,"variant-id":()=>n.id,sku:()=>n.sku,barcode:()=>n.barcode,stock:()=>n.quantityAvailable,quantity:()=>s};return new Map(Object.entries(Z))}function vo(t,e,n,r){let i={name:()=>n?.name,option:()=>(n?.options??[]).map(s=>s.value).join(", "),description:()=>n?.description,price:()=>r.money(Ot(t,e)),savings:()=>r.percent(Zt(t,e).percentage),"savings-amount":()=>r.money(Zt(t,e).amount),adjustment:()=>{let s=an(n);return s?s.type==="percentage"?`${s.value}%`:r.money(s.value):""}};return new Map(Object.entries(i))}var tu=/^image:(\d+)$/,Ao="metafield:",eu=/^(rich_text|multi_line_text)_field$/,nu=["","true","all","*"],kn=t=>t.tagName==="SELECT",vt=(t,e)=>t.$(`select${e}`).filter(kn);function ru(t,e){let n=e.images.nodes,r=[...t.children].map(i=>i.tagName==="IMG"?i:i.querySelector("img"));!Bt(t)&&r.length===n.length&&r.every((i,s)=>pe(i?.getAttribute("src"),n[s]?.url))||V(t,n,(i,s)=>{let u=i.matches(`img,${c("bind","image")}`)?i:y(i,"img")[0]??i;I(u,s.url,s.altText||e.title)})}function ou(t,e,n){let r=n.indexOf("."),o=n.slice(0,r),i=n.slice(r+1),s=(e.metafields??[]).find(l=>l?.namespace===o&&l.key===i);if(!s){w(t,"");return}let u=s.reference?.image;if(u){I(t,u.url,u.altText);return}eu.test(s.type)&&(t.style.whiteSpace="pre-line"),w(t,s.value)}var iu=new Map(Object.entries({title:t=>t.title,"description-text":t=>t.description,vendor:t=>t.vendor,type:t=>t.productType,handle:t=>t.handle,"published-at":t=>me(t.publishedAt),"min-price":t=>M(t.priceRange.minVariantPrice),"max-price":t=>M(t.priceRange.maxVariantPrice)}));function su(t,e){let n=(t.getAttribute("exclude")??"").split(",").map(o=>o.trim()).filter(Boolean),r=e.tags.filter(o=>!n.includes(o));V(t,r,(o,i)=>{w(o,i)})}function au(t,e,n){let r=iu.get(e);if(r){w(t,r(n));return}switch(e){case"description":ge(t,n.descriptionHtml);break;case"featured-image":I(t,n.featuredImage?.url,n.featuredImage?.altText||n.title);break;case"url":case"link":{let o=Mt(n.handle,n.id);o&&t.setAttribute("href",o),e==="url"&&!t.firstElementChild&&!t.textContent.trim()&&w(t,n.title);break}case"images":ru(t,n);break;case"tags":su(t,n);break;default:uu(t,e,n)}}function uu(t,e,n){let r=tu.exec(e);if(r){let o=n.images.nodes[Number(r[1])-1]??n.featuredImage;I(t,o?.url,o?.altText||n.title)}else e.startsWith(Ao)&&ou(t,n,e.slice(Ao.length))}function cu(t){let{product:e}=t;t.$(c("option-list")).forEach(n=>{let r=t.optName(p(n,"option-list")),o=e.options.find(i=>i.name===r);if(!o||o.optionValues.length<=1&&H(n,"hide-single")){L(n,!1);return}V(n,o.optionValues,(i,s)=>{i.setAttribute(f("option-value"),s.name);let u=y(i,c("bind","option-value"))[0];u?w(u,s.name):i.firstElementChild||w(i,s.name);let l=y(i,c("bind","swatch"))[0],{swatch:d}=s;!l||!d||(d.color&&(l.style.backgroundColor=d.color),d.image?.previewImage&&I(l,d.image.previewImage.url,s.name))})})}function lu(t){let{product:e}=t;vt(t,c("option")).forEach(n=>{let r=e.options.find(o=>o.name===t.optName(p(n,"option")));if(!r){L(n,!1);return}n.replaceChildren(...r.optionValues.map(o=>new Option(o.name,o.name)))}),vt(t,c("variant-select")).forEach(n=>{n.replaceChildren(...e.variants.nodes.map(r=>new Option(r.title,r.id)))}),vt(t,c("plan")).forEach(n=>{let r=t.plans.map(s=>new Option(s.name,s.id)),o=!e.requiresSellingPlan&&p(n,"plan")!=="subscription-only",i=n.getAttribute(f("one-time-label"))||"One-time purchase";n.replaceChildren(...o?[new Option(i,"")]:[],...r)})}function du(t){t.$(c("plan-list")).forEach(e=>{let n=(p(e,"plan-list")??"").trim(),r=nu.includes(n.toLowerCase())?null:n,o=t.plans.filter(i=>!r||i.group.name===r);V(e,o,(i,s)=>{i.setAttribute(f("plan-value"),s.id),!i.firstElementChild&&!i.querySelector(c("plan-bind"))&&w(i,s.name)})})}function xo(t){t.$(c("bind")).forEach(e=>{au(e,p(e,"bind")??"",t.product)}),cu(t),lu(t),du(t)}var Lo="url:";function pu(t){try{return decodeURIComponent(t)}catch(e){if(e instanceof URIError)return t;throw e}}function z(t,e=window.location,n="product"){let r=(p(t,n)??"").trim();if(!r.toLowerCase().startsWith(Lo))return{key:r||null,fromUrl:!1,raw:r};let o=r.slice(Lo.length).trim(),i;if(o.toLowerCase()==="path"){let s=e.pathname.split("/").filter(Boolean),u=s[s.length-1];i=u===void 0?null:pu(u)}else i=new URLSearchParams(e.search).get(o||"handle");return{key:i?.trim()||null,fromUrl:!0,raw:r}}var Ne=["loading","ready","error","not-found"],fu=t=>Ne.some(e=>e===t),Io=t=>typeof t=="object"&&t!==null&&"code"in t?t.code:void 0,ie=t=>Io(t)==="NOT_FOUND",oe=()=>["product","collection","products","recommendations"].map(t=>c(t)).join(","),Mo=(t,e)=>t===e||t.parentElement?.closest(oe())===e;function mu(t){let e=Io(t);return typeof e=="string"&&e?e:"error"}function mt(t,e,n){let r=e==="not-found",o=e==="error"||r;t.setAttribute(f("state"),r?"error":e),o?t.setAttribute(f("error"),r?"not-found":mu(n)):t.removeAttribute(f("error")),ut(t,c("show"),oe()).forEach(i=>{let s=p(i,"show");fu(s)&&L(i,s===e)}),o&&ut(t,c("add-to-cart"),oe()).forEach(i=>{i.classList.add("is-disabled"),i.setAttribute("aria-disabled","true"),"disabled"in i&&(i.disabled=!0)})}var Oo={money:M,percent:Ir},gu=t=>t.tagName==="INPUT";function Tn(t){let e=y(t,c("add-label"))[0]??t,n=e.dataset.tetherLabel??(gu(e)?e.value:e.textContent);return e.dataset.tetherLabel=n,{label:e,original:n}}function hu(t,e){let{product:n}=t,r=o=>e.selected[t.optName(o)]??"";t.$(c("option-selected")).forEach(o=>{w(o,r(p(o,"option-selected")))}),t.$(c("option-list")).forEach(o=>{let i=t.optName(p(o,"option-list"));y(o,c("option-value")).forEach(s=>{let u=p(s,"option-value")??"";he(s,e.selected[i]===u);let l=!Co(n,e.selected,i,u);s.classList.toggle("is-unavailable",l),s.setAttribute("data-unavailable",l?"true":"false")})}),vt(t,c("option")).forEach(o=>{o.value=r(p(o,"option"))}),vt(t,c("variant-select")).forEach(o=>{o.value=e.variant.id})}function yu(t,e){let{variant:n,purchase:r,line:o}=e;t.$(c("purchase")).forEach(i=>{if(kn(i)){i.value=r.kind;return}let s=p(i,"purchase");he(i,s===r.kind);let u=s==="subscription"?!e.subscriptionAvailable:t.product.requiresSellingPlan;i.classList.toggle("is-unavailable",u)}),t.$(c("plan-value")).forEach(i=>{let s=p(i,"plan-value")??"";he(i,o.kind==="subscription"&&s===o.planId),i.classList.toggle("is-unavailable",!N(n,s));let u=t.plans.find(d=>d.id===s),l=vo(n,s,u,Oo);y(i,c("plan-bind")).forEach(d=>{let g=l.get(p(d,"plan-bind")??"");g&&w(d,g())})}),vt(t,c("plan")).forEach(i=>{i.value=o.kind==="subscription"?o.planId:""})}function bu(t,e){let n=new Map(Object.entries(e.show));Ne.forEach(r=>n.set(r,r==="ready")),t.$(c("show")).forEach(r=>{let o=p(r,"show")??"",i=n.get(o);i!==void 0&&(Ne.some(s=>s===o)&&!Mo(r,t.root)||L(r,i))})}function Pu(t,e){let n=!e.variant.availableForSale;t.$(c("add-to-cart")).forEach(r=>{r.classList.toggle("is-disabled",n),r.setAttribute("aria-disabled",String(n)),"disabled"in r&&(r.disabled=n);let o=p(r,"soldout-text"),i=p(r,"subscribe-text");if(!o&&!i)return;let{label:s,original:u}=Tn(r),l=u;e.line.kind==="subscription"&&i&&(l=i),n&&o&&(l=o),r.getAttribute("aria-busy")!=="true"&&w(s,l)})}function Ro(t,e){let{variant:n}=e,{product:r}=t,o=To(e,Oo);t.$(c("bind")).forEach(i=>{let s=p(i,"bind")??"";if(s==="variant-image"){I(i,n.image?.url||r.featuredImage?.url,n.image?.altText||r.title);return}let u=o.get(s);u&&w(i,u())}),hu(t,e),yu(t,e),bu(t,e),t.root.classList.toggle("is-subscription",e.line.kind==="subscription"),t.root.setAttribute(f("purchase-mode"),e.line.kind),Pu(t,e)}var $o=()=>c("product"),Eu=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA",No=t=>t instanceof window.Element;function Ht(t,e,n){let r=e.closest(n);return r?.closest($o())===t.root?r:null}function wu(t,e){let{label:n,original:r}=Tn(e),o=p(e,"adding-text");Q(e,async()=>{o&&w(n,o);try{await t.addToCart()}catch(i){m(i,"add to cart failed"),h("error",{error:i,context:"add-to-cart"},t.root)}finally{o&&w(n,r)}}).then(()=>{t.renderVariant()}).catch(i=>{m(i,"add to cart render")})}function Cu(t,e,n){let r=Ht(t,n,c("option-value")),o=r?.closest(c("option-list"));if(r&&o){e.preventDefault(),t.select(t.optName(p(o,"option-list")),p(r,"option-value")??"");return}let i=Ht(t,n,c("plan-value"));if(i){e.preventDefault(),t.selectPlan(p(i,"plan-value"));return}let s=Ht(t,n,`${c("purchase")}:not(select)`);if(s){s.tagName!=="INPUT"&&e.preventDefault(),t.setPurchase(_o(p(s,"purchase")));return}let u=Ht(t,n,c("qty-plus")),l=u?null:Ht(t,n,c("qty-minus"));if(u||l){e.preventDefault(),t.setQuantity(t.quantity+(u?1:-1));return}let d=Ht(t,n,c("add-to-cart"));d&&(e.preventDefault(),wu(t,d))}var _o=t=>t==="subscription"?"subscription":"one-time";function Su(t,e){let n=Eu(e)?e.value:"";e.matches(`select${c("option")}`)?t.select(t.optName(p(e,"option")),n):e.matches(`select${c("variant-select")}`)?t.selectVariant(n):e.matches(`select${c("plan")}`)?n?t.selectPlan(n):t.setPurchase("one-time"):e.matches(`select${c("purchase")}`)?t.setPurchase(_o(n)):e.matches(c("qty"))&&t.setQuantity(n)}function Uo(t){t.root.addEventListener("click",e=>{No(e.target)&&Cu(t,e,e.target)}),t.root.addEventListener("change",e=>{let{target:n}=e;No(n)&&n.closest($o())===t.root&&Su(t,n)})}var it=new WeakMap,ku=()=>c("product"),$e=new Map;function vn(t){t.forEach(e=>{$e.has(e.handle)||$e.set(e.handle,e.options.map(n=>n.name))})}var Fo=t=>t.tagName==="INPUT",Tu=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA";function vu(t){return Fo(t)&&t.type==="checkbox"?t.checked?t.value&&t.value!=="on"?t.value:"Yes":null:Fo(t)&&t.type==="radio"?t.checked?t.value:null:Tu(t)&&t.value||null}var _e=class{constructor(e,n){S(this,"root");S(this,"product");S(this,"plans");S(this,"selected");S(this,"purchase");S(this,"variant");S(this,"quantity");this.root=e,this.product=n,this.plans=R(n);let r=new URLSearchParams(window.location.search),o=So(n,{variant:r.get("variant")||p(e,"variant"),sellingPlan:r.get("selling_plan"),defaultPlan:p(e,"default-plan"),defaultPurchase:p(e,"default-purchase")||a.defaultPurchase});this.selected=o.selected,this.purchase=o.purchase,this.variant=null,this.quantity=H(e,"quantity")?Math.max(0,parseInt(p(e,"quantity")??"",10)||0):1,it.set(e,this),e.setAttribute(f("state"),"ready"),e.removeAttribute(f("error")),this.renderProduct(),Uo(this),this.renderVariant(),Or(e,"product"),dt("product"),h("product-ready",{product:n,scope:this},e)}update(e){let n=this.variant?.id;this.product=e,this.plans=R(e);let r=e.variants.nodes.find(o=>o.id===n);r&&(this.selected=Dt(r)),this.root.setAttribute(f("state"),"ready"),this.root.removeAttribute(f("error")),this.renderProduct(),this.renderVariant(),dt("product"),h("product-updated",{product:e,scope:this},this.root)}$(e){let n=ut(this.root,e,ku());return this.root.matches(e)?[this.root,...n]:n}optName(e){if(!e)return"";let{options:n}=this.product;if(n.some(o=>o.name===e))return e;let r=($e.get(this.product.handle)??[]).indexOf(e);return n[r]?.name??e}get plan(){let e=Ft(this.purchase);return this.plans.find(n=>n.id===e)??null}get subscriptionAvailable(){return this.plans.some(e=>N(this.variant,e.id))}get isSubscription(){return Oe(this.purchase,this.variant).kind==="subscription"}getLine(){if(!this.variant)return null;let e={merchandiseId:this.variant.id,quantity:this.quantity},n=Oe(this.purchase,this.variant);n.kind==="subscription"&&(e.sellingPlanId=n.planId);let r=this.collectAttributes();return r.length&&(e.attributes=r),e}collectAttributes(){let e=be(ye(this.root,"line-attributes")),n=this.$(c("line-attribute")).flatMap(r=>{let o=vu(r);return o===null?[]:[{key:p(r,"line-attribute")??"",value:o}]});return[...e,...n]}select(e,n){if(this.selected[e]===n)return;let r=this.product.variants.nodes.filter(s=>s.selectedOptions.some(u=>u.name===e&&u.value===n)),[o]=r;if(!o)return;let i={...this.selected,[e]:n};if(!r.some(s=>s.selectedOptions.every(u=>i[u.name]===u.value))){let s=l=>l.selectedOptions.filter(g=>g.name!==e&&this.selected[g.name]===g.value).length*2+(l.availableForSale?1:0),u=r.reduce((l,d)=>s(d)>s(l)?d:l,o);Object.assign(i,Dt(u))}this.selected=i,this.renderVariant()}selectVariant(e){let n=this.product.variants.nodes.find(r=>r.id===K.variant(e));n&&(this.selected=Dt(n),this.renderVariant())}setPurchase(e){let n=Re(this.product,this.variant,e,Ft(this.purchase));n.kind!==this.purchase.kind&&(this.purchase=n,this.renderVariant())}selectPlan(e){let n=Rt(this.product,e);n&&(this.purchase={kind:"subscription",planId:n.id},this.renderVariant())}setQuantity(e){let n=H(this.root,"quantity")?0:1;this.quantity=Math.max(n,parseInt(String(e),10)||0),this.$(c("qty")).forEach(r=>{w(r,this.quantity)}),this.renderVariant()}async addToCart(){if(!this.variant?.availableForSale)return null;let e=this.getLine();if(!e||e.quantity<1)return null;let n=await b.add(e);return h("product-added",{product:this.product,variant:this.variant,line:e},this.root),n}renderProduct(){let{product:e}=this;$e.has(e.handle)||this.$(`${c("option-list")},select${c("option")}`).map(r=>p(r,"option-list")||p(r,"option")).some(r=>e.options.some(o=>o.name===r))&&vn([e]),xo(this)}renderVariant(){let e=ko(this.product,{selected:this.selected,purchase:this.purchase,quantity:this.quantity},a.lowStock);if(!e){this.variant=null;return}this.variant=e.variant,this.selected=e.selected,this.purchase=e.purchase,Ro(this,e),h("variant-changed",{product:this.product,variant:e.variant,selected:{...e.selected},purchase:e.purchase.kind,sellingPlanId:e.line.kind==="subscription"?e.line.planId:null},this.root)}};var Do="url:",gt=()=>`${c("collection")},${c("products")},${c("recommendations")}`,Au=t=>t instanceof window.Element,Ho=t=>parseInt(t??"",10)||void 0,xu=t=>t==="COMPLEMENTARY"?"COMPLEMENTARY":"RELATED",Ue=class{constructor(e){S(this,"root");S(this,"products",[]);S(this,"pageInfo",null);S(this,"collection",null);S(this,"loadToken",0);this.root=e,mt(e,"loading"),e.addEventListener("click",n=>{if(!Au(n.target))return;let r=n.target.closest(c("load-more"));r?.closest(gt())===e&&(n.preventDefault(),Q(r,()=>this.load(!0)))})}$(e){return ut(this.root,e,gt())}options(){let{root:e}=this,n={reverse:p(e,"reverse")==="true"},r=Ho(p(e,"limit"));r&&(n.first=r);let o=p(e,"sort");if(o&&(n.sortKey=o),H(e,"collection"))return n.collection=p(e,"collection")??"",n;let i=p(e,"products")??"";return n.query=i.startsWith(Do)?new URL(window.location.href).searchParams.get(i.slice(Do.length))||"":i,n}async loadRecommendations(){let{key:e}=z(this.root,window.location,"recommendations"),n=this.root.closest(c("product"));if(!e&&n&&({key:e}=z(n)),!e)throw new P("No product for recommendations",{code:"NOT_FOUND"});return Ae(e,xu(p(this.root,"intent")))}async load(e=!1){this.loadToken+=1;let n=this.loadToken,r=()=>n!==this.loadToken;try{if(H(this.root,"recommendations")){let o=await this.loadRecommendations();if(r())return;let i=Ho(p(this.root,"limit"));this.products=i?o.slice(0,i):o}else{let o=await ve({...this.options(),after:e?this.pageInfo?.endCursor??null:null});if(r())return;this.collection=o.collection,this.pageInfo=o.pageInfo,this.products=e?[...this.products,...o.products]:o.products}this.render(),mt(this.root,"ready"),h("list-ready",{products:this.products,collection:this.collection},this.root)}catch(o){if(r())return;e||mt(this.root,ie(o)?"not-found":"error",o),ie(o)&&H(this.root,"recommendations")||m(o,"list load failed"),h("error",{error:o,context:"list"},this.root)}}render(){let{collection:e}=this;this.$(c("collection-bind")).forEach(r=>{switch(p(r,"collection-bind")??""){case"title":w(r,e?.title??"");break;case"description":ge(r,e?.descriptionHtml);break;case"image":I(r,e?.image?.url,e?.image?.altText||e?.title);break;case"count":w(r,this.products.length);break}}),this.$(c("list")).forEach(r=>{V(r,this.products,(o,i)=>{o.setAttribute(f("product"),i.handle),o.removeAttribute(f("state"))}),h("list-rendered",{container:r},this.root)});let n=this.products.length===0;this.$(c("show")).forEach(r=>{let o=p(r,"show");o==="list-empty"&&L(r,n),o==="list-filled"&&L(r,!n)}),this.$(c("load-more")).forEach(r=>{L(r,!!this.pageInfo?.hasNextPage)}),dt("list")}};var Lu='script[type="application/json"][data-tether-hydrate]',Vt=new WeakSet,An=new WeakSet,At=new Set,ht=new Set,Vo=new WeakMap;function jt(){At.forEach(t=>{t.isConnected||At.delete(t)}),ht.forEach(t=>{t.root.isConnected||ht.delete(t)})}function J(t,e){return[...t.matches?.(e)?[t]:[],...y(t,e)]}function Iu(t,e){let n=p(t,"page-title");!n||typeof document>"u"||(document.title=n.replace(/\{title\}/g,e.title).replace(/\{vendor\}/g,e.vendor||"").replace(/\{type\}/g,e.productType||""))}function Mu(t,{fromUrl:e,raw:n}){e?(Vt.add(t),mt(t,"not-found"),h("product-not-found",{key:null,source:n},t)):t.closest(gt())||k(`[${f("product")}] without a value. Bind it to the Shopify handle field, or use "url:handle".`,t)}function Ou(t,e,{fromUrl:n,raw:r},o){let i=ie(o);if(mt(t,i?"not-found":"error",o),!i){m(o,`product ${e}`),h("error",{error:o,context:"product",key:e},t);return}h("product-not-found",{key:e,source:r},t),n?x(`product not found: ${e}`):m(o,`product ${e}`)}function se(t){if(Vt.has(t))return!1;let{key:e,...n}=z(t);if(!e)return Mu(t,n),!1;Vt.add(t),At.add(t);let r={};Vo.set(t,r);let o=()=>Vo.get(t)===r;return it.get(t)?t.setAttribute(f("state"),"updating"):mt(t,"loading"),xn(nt(e)).then(s=>{if(!o())return;let u=it.get(t);u?u.update(s):new _e(t,s),Iu(t,s),a.revalidate&&Jr(e)&&Ru(e)}).catch(s=>{o()&&Ou(t,e,n,s)}),!0}function qo(){jt(),At.forEach(t=>{t.getAttribute(f("state"))!=="error"||t.getAttribute(f("error"))==="not-found"||(Vt.delete(t),se(t))})}var Fe=new Set;function Ru(t){Fe.size||setTimeout($u,0),Fe.add(t)}function Nu(t,e){At.forEach(n=>{let r=it.get(n);if(!r||!n.isConnected)return;let o=z(n).key;o!==t&&o!==e.handle&&o!==e.id||JSON.stringify(r.product)!==JSON.stringify(e)&&r.update(e)})}function $u(){let t=[...Fe];Fe=new Set,t.forEach(e=>{Zr(e).then(n=>{Nu(e,n)}).catch(n=>{m(n,`refresh ${e}`)})})}var st=null,xn=t=>(st?.add(t),t);function De(){if(!st)return;let t=[...st];Promise.allSettled(t).then(()=>{if(!(!st||t.some(e=>!st?.has(e)))){if(t.length!==st.size){De();return}st=null,document.documentElement.classList.remove(`${a.prefix}-market-pending`)}})}function _u(t){if(!A(t))return{country:void 0,language:void 0,products:[]};let{products:e}=t,n=Array.isArray(e)?e:[];return{country:_(t.country)??void 0,language:U(t.language)??void 0,products:n.filter(qr)}}var jo=new WeakSet;function Ln(t=document){J(t,Lu).forEach(e=>{if(jo.has(e))return;jo.add(e);let n;try{n=JSON.parse(e.textContent)}catch(s){k("bad data-tether-hydrate",s);return}let{country:r,language:o,products:i}=_u(n);if(vn(i),r===a.country&&o===a.language){zr(i);return}x("hydration skipped: other market"),st||(st=new Set,document.documentElement.classList.add(`${a.prefix}-market-pending`))})}var Go={"tether.diagnose.min.js":"sha384-ixW08iKQRQT89kEAE+EITHUE40xGxifFkuNpX6+kCZFBl5ERJvJJpQBUJE4x7nB6","tether.markets.min.js":"sha384-BUuxirP/jdbhnMWgFlai+knQlCsjgIAu6sbXiKsA/VOjZegbRJ3SumFa3P91BlLp","tether.search.min.js":"sha384-2Ig++6Zaxyy9Qr9kZM5Zk0Rfa40/cs7o2QWvtlLFqsLrngsVlcXfZohGYUgDQ5Pj","tether.extras.min.js":"sha384-8HI2MV9bcPzUDlRMkiX+ewv2lqNmV0fjAr+lUe6EJ/JwPsrNUjZGoLQWzsDTGzDC","tether.account.min.js":"sha384-rabebf2u/KQwewOvpzGdNmgW9PZQPSnAxCWDRC8uZ9WxkjLcl2ZLmjuK8ElIUNkz","tether.account-pages.min.js":"sha384-EbQqoBXAHwYyqxcnPpGCjQS5xeZtoZChP6xXwl7gRKAg19gJRBL0mkhHV/r4isbO","tether.analytics.min.js":"sha384-wZRyA+OVF8wPzx0jCnRUWb2Zo/kVNQkT1fE3s6f+i5iwOSlOLtFOYD9AxsMrrusI"};var Ko={get"config.ts"(){return[a,It,x,Gt,We,m,k]},get"client.ts"(){return[ze,D,F,B,P]},get"dom.ts"(){return[Wt,f,be,h,me,M,p,H,Bt,ct,ye,Mt,y,V,c,I,w,L]},get"loader.ts"(){return[Te,nt]},get"selling-plans.ts"(){return[R]},get"status.ts"(){return[oe,z]},get"cart.ts"(){return[b]},get"product.ts"(){return[it]},get"collection.ts"(){return[gt]},get"mounting.ts"(){return[ht,At,Vt,se,jt,J]},get"market-codes.ts"(){return[_,U]},get"shopify-values.ts"(){return[le]},get"lazy.ts"(){return[v]}},Uu=/\.min\.js(\?|$)/,Qo=typeof document>"u"?"":document.currentScript?.getAttribute("src")??"",He=Qo?new URL(Qo,document.baseURI).href:"",Ve=new Map;function Fu(){return a.partsUrl?new URL(a.partsUrl,document.baseURI).href:He?He.replace(/[^/]*$/,""):null}function Du(t,e){t.integrity=e,new URL(t.src).origin!==window.location.origin&&(t.crossOrigin="anonymous")}function Hu(t,e,n,r){return new Promise((o,i)=>{let s=`${e.replace(/\/?$/,"/")}${n}`,u=document.createElement("script");u.src=s,u.async=!0,Du(u,r),u.onload=()=>{let{Tether:l}=window,d=l?.__parts[t];if(d){o(d);return}Ve.delete(t),i(new Error(`${s} did not register`))},u.onerror=()=>{Ve.delete(t),i(new Error(`Could not load ${s}, or it is not the file built with this Tether script. Host the same release's files next to the Tether script or at partsUrl.`))},document.head.appendChild(u)})}function v(t){let e=Ve.get(t);if(!e){let n=Fu();if(n===null)return Promise.reject(new Error(`The Tether script's own location is unknown, so its ${t} part can't be found: set partsUrl.`));let r=Uu.test(He)||!He?".min":"",o=`tether.${t}${r}.js`,i=Go[o];if(i===void 0)return Promise.reject(new Error(`This Tether script was built without ${o}, so it can't load that part.`));e=Hu(t,n,o,i),Ve.set(t,e)}return e}var Vu=()=>`${a.prefix}:market:${a.domain}`,ju={getItem:t=>St(t)};function qu(t){try{return JSON.parse(t)}catch(e){if(e instanceof SyntaxError)return null;throw e}}function Gu(t){if(typeof t!="object"||t===null)return null;let e=_(Reflect.get(t,"country"));if(!e)return null;let n=Reflect.get(t,"locale");return{country:e,language:U(Reflect.get(t,"language"))??void 0,locale:typeof n=="string"&&n?n:void 0}}function In(t=ju){let e=t.getItem(Vu());return e?Gu(qu(e)):null}var Bo={country:void 0,language:void 0,locale:void 0},Mn=!1;function Yo(){let t=n=>document.querySelector(`meta[name="${a.prefix}-page-${n}"]`)?.getAttribute("content")||void 0,e=_(t("country"));return e?{country:e,language:U(t("language"))??void 0,locale:t("locale")}:null}async function Qu(){let t=a.markets??{};if(t.detect===!1)return null;if(!t.detect)return t.remember===!1?null:In();try{return(await v("markets")).detectMarket(t)}catch(e){return m(e,"markets"),null}}async function zo(t){Bo={country:a.country,language:a.language,locale:a.locale};let e=Yo();if(Mn=e!==null,e){a.country=e.country,a.language=e.language,e.locale&&(a.locale=e.locale);return}let n=await Qu();n&&(n.country&&(a.country=n.country),n.language&&(a.language=n.language),n.locale&&!t.locale&&(a.locale=n.locale),x("market",n))}var Wo=(t,e)=>(t??"").toUpperCase()===(e??"").toUpperCase();function Jo(){let t=Yo(),e=t===null&&Mn;Mn=t!==null;let n=t??(e?In()??Bo:null);return!n?.country||Wo(n.country,a.country)&&Wo(n.language,a.language)?null:{country:n.country,language:n.language,locale:n.locale}}function ae(t,e){return v("markets").then(n=>n.setCountry(t,e))}var Xo=()=>`${a.prefix}:account-hint:${a.domain}`;function Zo(t){te(t,"sessionStorage"),te(t,"localStorage")}function ti(){Zo(`${a.prefix}:account:${a.domain}`),Zo(`${a.prefix}:account-login:${a.domain}`)}var ei=t=>t==="in"||t==="expired"||t==="error";var Ku=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],Wu=()=>[...Ku.map(t=>`[${f(t)}]`),`[${f("show")}^="logged-"]`].join(",");function Bu(){return!!St(Xo())}function ni(t){!a.account||!(J(t,Wu()).length>0||ei(new URLSearchParams(window.location.search).get("account"))||Bu())||v("account").then(n=>n.mountAccount(t)).catch(n=>{m(n,"account")})}function O(t){return(...e)=>v("account").then(n=>{let r=n[t];return r(...e)})}var ri={login:O("login"),logout:O("logout"),isLoggedIn:O("isLoggedIn"),customer:O("customer"),orders:O("orders"),order:O("order"),updateProfile:O("updateProfile"),addresses:O("addresses"),saveAddress:O("saveAddress"),deleteAddress:O("deleteAddress"),subscriptions:O("subscriptions"),subscriptionAction:O("subscriptionAction"),requestReturn:O("requestReturn"),render:O("render"),mountAccount:O("mountAccount")};var oi=()=>`data-${a.prefix}-key`,si=t=>t instanceof window.Element;function ai(t){let e=t.closest(`[${oi()}]`),n=e?.getAttribute(oi());return e&&n?{line:e,id:n}:null}function je(t,e){t.catch(n=>{m(n,e)})}function Yu(t,e){let n=ai(e);if(!n?.line.closest(c("cart-lines")))return;let{line:r,id:o}=n;if(e.closest(c("line-remove"))){t.preventDefault(),r.classList.add("is-busy"),je(b.removeLine(o),"cart line");return}let i=zu(e);!i||!b.lines.some(s=>s.id===o)||(t.preventDefault(),je(b.changeQuantity(o,i),"cart line"))}function zu(t){return t.closest(c("line-plus"))?1:t.closest(c("line-minus"))?-1:0}function Ju(t){let{target:e}=t;if(!si(e))return;if(e.closest(c("cart-open"))){t.preventDefault(),b.toggle();return}if(e.closest(c("cart-close"))){t.preventDefault(),b.close();return}let n=e.closest(c("cart-clear"));if(n){t.preventDefault(),Q(n,()=>b.clear().catch(o=>{m(o,"cart clear")}));return}let r=e.closest(c("checkout"));if(r){t.preventDefault(),Q(r,()=>b.checkout());return}Yu(t,e)}function ii(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),je(e,n)}function Zu(t){let{target:e}=t;if(!si(e))return;let n=ai(e);n&&e instanceof window.HTMLInputElement&&e.matches(c("line","quantity"))?ii(n.line,b.updateLine(n.id,parseInt(e.value,10)||0),"cart line"):n&&e instanceof window.HTMLSelectElement&&e.matches(c("line-plan"))?ii(n.line,b.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):Xu(e)&&e.matches(c("cart-note"))&&je(b.setNote(e.value),"cart note")}var Xu=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function tc(t){if(b.isOpen()){if(t.key==="Escape"){b.close();return}mn(t)}}function ui(){document.addEventListener("click",Ju),document.addEventListener("change",Zu),document.addEventListener("keydown",tc)}var On=t=>t instanceof window.Element;function ec(t){let e=t.querySelector(c("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function ci(t,e,n){t.classList.toggle("is-invalid",n),n?e?.setAttribute("aria-invalid","true"):e?.removeAttribute("aria-invalid")}async function nc(t,e,n){try{await b.applyDiscount(n),ci(t,e,!1),h("discount-applied",{code:n},t),e&&(e.value="")}catch(r){ci(t,e,!0),r instanceof P&&r.code==="INVALID_DISCOUNT"?h("discount-invalid",{code:n},t):m(r,"discount")}}function rc(t){let{target:e}=t,n=On(e)?e.closest(c("discount-form")):null;if(!n)return;t.preventDefault();let r=ec(n),o=r?.value.trim();o&&Q(n,()=>nc(n,r,o))}function oc(t){let{target:e}=t;if(!On(e))return;let n=e.closest(c("discount-form"));n&&(n.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"))}function ic(t){let{target:e}=t,n=On(e)?e.closest(c("discount-remove")):null;if(!n)return;t.preventDefault();let r=n.closest(c("discount-code"))?.getAttribute(f("discount-code"));r&&b.removeDiscount(r).catch(o=>{m(o,"discount")})}function li(){document.addEventListener("submit",rc,!0),document.addEventListener("input",oc),document.addEventListener("click",ic)}var Rn=t=>v("extras").then(e=>e.addGroup(t)),Nn=t=>{m(t,"extras")};function sc(t){let{target:e}=t,n=e instanceof window.Element?e.closest(c("group-add")):null;n&&(t.preventDefault(),Q(n,()=>Rn(n)).catch(Nn))}function ac(t){!a.domain||!t.key?.startsWith(`${a.prefix}:`)||v("extras").then(e=>{e.onStorage(t)}).catch(Nn)}function uc(t){if(!ct(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!a.variantUrl&&!e.hasAttribute(f("variant-url"))||v("extras").then(n=>{n.writeVariantUrl(e,t.detail)}).catch(Nn))}function di(){document.addEventListener("click",sc),window.addEventListener("storage",ac),document.addEventListener(`${a.prefix}:variant-changed`,uc)}var $n=null;function pi(){$n=document.body}async function cc(t){await t.ready();let e=Jo();if(!e){$n!==document.body&&t.mount(document);return}try{await ae(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){m(n,"country")}t.mount(document)}function lc(t){document.addEventListener("astro:page-load",()=>{cc(t).catch(e=>{m(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{$n=null,t.unmount()})}function dc(t){let{target:e}=t;!(e instanceof window.HTMLSelectElement)||!e.matches(c("country-select"))||e.value&&ae(e.value).catch(n=>{m(n,"country")})}function pc(){qo(),ht.forEach(t=>{t.root.getAttribute(f("state"))==="error"&&t.load()})}function fi(t){a.astro&&lc(t),document.addEventListener("change",dc),window.addEventListener("online",pc)}var gi="0.7.0",fc=50;function mc(){let t=Yt("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var yt=null,_n=null,hi=null,mi=!1;function gc(t){let e=0;return J(t,gt()).forEach(n=>{if(An.has(n))return;An.add(n),e++;let r=new Ue(n);ht.add(r),n.addEventListener(`${a.prefix}:list-rendered`,o=>{ct(o,"list-rendered")&&qe(o.detail.container)}),xn(r.load())}),e}function hc(t){J(t,`${c("country-select")},${c("country-bind")}`).length&&v("markets").then(e=>e.renderCountrySelects(t)).catch(e=>{m(e,"markets")}),ni(t),J(t,c("search")).length&&v("search").then(e=>{e.mountSearch(t)}).catch(e=>{m(e,"search")})}function yi(t){let e=gc(t);return J(t,c("product")).forEach(n=>{se(n)&&e++}),hc(t),e}function qe(t=document){if(!It())return 0;t===document&&pi(),jt(),Ln(t.ownerDocument??document);let e=yi(t);return De(),b.render(),x(`mounted ${e} scope(s)`,t),e}function yc(t){let e=t.filter(r=>r.isConnected&&!t.some(o=>o!==r&&o.contains(r)));if(!e.length||!It())return;jt(),e.forEach(r=>{Ln(r)});let n=e.reduce((r,o)=>r+yi(o),0);De(),b.render(),x(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function bi(){b.close()}function bc(t){let e=t?.closest(c("product"));return e?it.get(e)??null:null}function Pc(){mi||(mi=!0,ui(),li(),di(),fi({ready:()=>yt??Promise.resolve(null),mount:qe,unmount:bi}))}function Ec(){let t=[];hi=t,Wt.forEach(e=>{document.addEventListener(`${a.prefix}:${e}`,n=>t.push(n))}),document.addEventListener("astro:page-load",e=>t.push(e)),v("analytics").then(e=>e.startAnalytics(t)).catch(e=>{m(e,"analytics")})}async function wc(t){let e=a.country,n=t?.buyerIdentity.countryCode;if(!t||!e||!n||n===e)return t;try{return await b.setBuyerIdentity({countryCode:e},{create:!1})}catch(r){return m(r,"cart country"),t}}function Pi(t={}){return yt&&!Object.keys(t).length?yt:(nr({...mc(),...t}),It()?(ti(),Pc(),a.observe&&Cc(),a.analytics&&!hi&&Ec(),yt=zo(t).then(()=>b.init()).then(wc).then(e=>(h("ready",{cart:e}),Un)),yt):(k("TETHER_CONFIG is missing domain or token. Tether is idle."),yt=Promise.resolve(null),yt))}function Cc(){if(_n||typeof MutationObserver>"u")return;let t,e=new Set;_n=new MutationObserver(n=>{n.forEach(r=>{r.addedNodes.forEach(o=>{o instanceof window.Element&&e.add(o)})}),clearTimeout(t),t=setTimeout(()=>{let r=[...e];e.clear(),yc(r)},fc)}),_n.observe(document.body,{childList:!0,subtree:!0})}var Sc=t=>v("markets").then(e=>e.detectMarket(t??a.markets)),kc=()=>v("markets").then(t=>t.getLocalization()),Tc=t=>v("diagnose").then(e=>e.diagnose({...t,version:gi}));function vc(t,e){let n=`${a.prefix}:${t}`,r=o=>{ct(o,t)&&e(o.detail,o)};return document.addEventListener(n,r),()=>{document.removeEventListener(n,r)}}var Ac={VERSION:gi,init:Pi,mount:qe,unmount:bi,get config(){return er},get ready(){return yt??Promise.resolve(null)},query:lr,withContext:cr,cart:b,getProduct:nt,getProducts:ve,getRecommendations:Ae,getScope:bc,addGroup:Rn,account:ri,primeProduct:Ct,normalizeProductKey:$t,clearProductCache:Te,formatMoney:M,imageUrl:de,plans:un,TetherError:P,resolveProductKey:z,setCountry:ae,detectMarket:Sc,getLocalization:kc,diagnose:Tc,on:vc},xc={__core:Ko,__parts:{}},Un=Object.assign(Ac,xc),vf=Un;function Lc(){Reflect.set(window,"Tether",Un);let t=Yt("TETHER_CONFIG");if(!t||X(t,"autoMount")===!1||Yt("TETHER_INTEGRATION"))return;let e=()=>{Pi().then(()=>qe(document)).catch(n=>{m(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&Lc();})();
5
5
  //# sourceMappingURL=tether.min.js.map