@occluze/tether 0.7.2 → 0.8.1

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 (43) hide show
  1. package/README.md +4 -4
  2. package/dist/esm/astro.js +1 -1
  3. package/dist/esm/chunks/{account-W4FBRKXA.js → account-BS5MCC2R.js} +1 -1
  4. package/dist/esm/chunks/{account-pages-IM3OQTOP.js → account-pages-XR6QZ3DX.js} +1 -1
  5. package/dist/esm/chunks/{analytics-QDVOLZY3.js → analytics-BYN3QHBA.js} +1 -1
  6. package/dist/esm/chunks/{chunk-YC4JXWRG.js → chunk-2IVIZDT5.js} +1 -4
  7. package/dist/esm/chunks/{chunk-NYDZPTLP.js → chunk-A2PCQK2F.js} +1 -1
  8. package/dist/esm/chunks/{chunk-BMDYNMRC.js → chunk-A3GXCQJ4.js} +1 -1
  9. package/dist/esm/chunks/{chunk-GF6JTI65.js → chunk-COQ6ATC6.js} +1 -1
  10. package/dist/esm/chunks/chunk-EGIDFV3T.js +1 -0
  11. package/dist/esm/chunks/{chunk-CUL66KRA.js → chunk-EW3GKRT4.js} +1 -1
  12. package/dist/esm/chunks/{chunk-CXHPBT7N.js → chunk-FM7ZLLVP.js} +1 -1
  13. package/dist/esm/chunks/{chunk-AUVAN3KZ.js → chunk-FPJGQ7Z5.js} +1 -1
  14. package/dist/esm/chunks/chunk-GXCCTPDF.js +1 -0
  15. package/dist/esm/chunks/{chunk-RPI5C3EJ.js → chunk-HXZSNZOV.js} +1 -1
  16. package/dist/esm/chunks/{chunk-RJY76ESL.js → chunk-MJFKAMFM.js} +1 -1
  17. package/dist/esm/chunks/{chunk-QUECUXHD.js → chunk-TE5PNI76.js} +1 -1
  18. package/dist/esm/chunks/{chunk-CVNRODH3.js → chunk-X2JZPXLF.js} +1 -1
  19. package/dist/esm/chunks/{diagnose-3XHPZZNP.js → diagnose-IFRNCEYG.js} +1 -1
  20. package/dist/esm/chunks/{extras-C724KKG6.js → extras-3477M6Y7.js} +1 -1
  21. package/dist/esm/chunks/{markets-ui-WBWWQAGU.js → markets-ui-3L2UZ7PK.js} +1 -1
  22. package/dist/esm/chunks/{search-5NFIZBPJ.js → search-YR73GIWY.js} +1 -1
  23. package/dist/esm/index.js +1 -1
  24. package/dist/esm/server.js +2 -2
  25. package/dist/tether.js +26 -25
  26. package/dist/tether.min.js +1 -4
  27. package/dist/tether.min.js.map +4 -4
  28. package/dist/types/src/account/page-answers.d.ts +3 -1
  29. package/dist/types/src/analytics.d.ts +3 -1
  30. package/dist/types/src/cart/store.d.ts +8 -2
  31. package/dist/types/src/client.d.ts +8 -3
  32. package/dist/types/src/controls/navigation.d.ts +3 -1
  33. package/dist/types/src/dom.d.ts +3 -1
  34. package/dist/types/src/index.d.ts +3 -3
  35. package/dist/types/src/markup.d.ts +7 -5
  36. package/dist/types/src/presets/barba.d.ts +3 -1
  37. package/dist/types/src/product-state.d.ts +3 -1
  38. package/dist/types/src/server.d.ts +4 -4
  39. package/dist/types/src/store-html.d.ts +4 -4
  40. package/dist/types/src/version.d.ts +1 -0
  41. package/package.json +4 -1
  42. package/dist/esm/chunks/chunk-MRSDJPBC.js +0 -1
  43. package/dist/esm/chunks/chunk-QDHLXXAZ.js +0 -1
@@ -1,5 +1,2 @@
1
- (()=>{var jn=Object.defineProperty;var xi=(t,e,n)=>e in t?jn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Li=(t,e)=>{for(var n in e)jn(t,n,{get:e[n],enumerable:!0})};var T=(t,e,n)=>xi(t,typeof e!="symbol"?e+"":e,n);var Gn="2026-07";var Ii=/^(\d{4})-(01|04|07|10)$/;function Oi(t){let e=Ii.exec(typeof t=="string"?t:"");return e?{year:Number(e[1]),month:Number(e[2])}:null}var Kn=t=>Oi(t)!==null;function C(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function tt(t,e){return C(t)?t[e]:void 0}var Mi=/^[A-Za-z0-9_.-]+$/,Ri=/^(\$app(:[A-Za-z0-9_-]+)?|[A-Za-z0-9_.-]+)$/,Ni=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,$i=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,_i=/^[A-Za-z_$][\w$]*$/,Qn="https://site.invalid",Ui=new Set(["localhost","127.0.0.1","[::1]"]),Kt=["saved","server","webflow"],Fi=["no-banner","default-banner","custom-banner"],Qt=t=>typeof t=="string"&&t!=="",Di=t=>typeof t=="function";function Bn(t,e){if(typeof t!="string"||!t)return"";let n=t.replace(/^https?:\/\//,"").replace(/\/.*$/,"");return qi(n)?n:(e("domain",t),"")}function Yn(t){if(!Qt(t))return!1;try{let e=new URL(t,`${Qn}/`);return e.origin===Qn?!0:e.protocol==="https:"||e.protocol==="http:"&&Ui.has(e.hostname)}catch{return!1}}function zn(t,e){return t==null||t===""?null:typeof t=="string"&&(Yn(t)||Vi(t))?t:(e("partsUrl",t),null)}function Vi(t){if(typeof location>"u")return!1;try{return new URL(t).origin===location.origin}catch{return!1}}function Hi(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 Jn(t,e){if(!Array.isArray(t))return e("embedOrigins",t),[];let n=[],r=t;for(let o of r){let i=Hi(o);i?n.push(i):e("embedOrigin",o)}return n}function We(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:Ri.test(e)&&Mi.test(n)?{namespace:e,key:n}:null}function Xn(t,e){if(!Array.isArray(t))return e("metafields",t),[];let n=[],r=t;for(let o of r){let i=We(o);i?n.push(typeof o=="string"?o:i):e("metafield",o)}return n}var It=t=>e=>t(e)?e:void 0,qi=t=>Qt(t)&&Ni.test(t),ji=t=>Qt(t)&&$i.test(t),Gi=t=>typeof t=="boolean"||Qt(t)&&_i.test(t),Gt=It(Yn),le=It(Qt),Wn=It(t=>typeof t=="boolean"),Zn=It(Di);function Wt(t,e,n,r){if(e==null)return null;if(!C(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 Ki={server:Gt,orderUrl:Gt,subscriptionsUrl:Gt,paymentUrl:Gt,logoutUrl:Gt,locale:le,navigate:Zn},Qi="customer accounts need the Worker since 0.7.0: set account.server",Wi={country:le,language:le,locale:le},Bi={detect:t=>{if(typeof t=="boolean")return t;let e=Array.isArray(t)?t:[t];return typeof t=="string"||Array.isArray(t)?Kt.filter(n=>e.includes(n)):void 0},locales:t=>{if(!C(t))return;let e={};for(let[n,r]of Object.entries(t)){let o=Wt(`markets.locales.${n}`,r,Wi,()=>{});o&&(e[n]=o)}return e},cookie:It(ji),remember:Wn,strict:Wn},Yi={consent:t=>Fi.find(e=>e===t),proxy:t=>t!==void 0&&!!t},zi={dataLayer:It(Gi),shopify:t=>typeof t=="boolean"?t:Wt("analytics.shopify",t,Yi,()=>{})??void 0,onEvent:Zn};function tr(t,e,n){let r=Wt("account",t,Ki,e);if(r===null)return null;let{server:o}=r;return o===void 0?(n(Qi),null):{...r,server:o}}var Be=(t,e)=>Wt("markets",t,Bi,e),er=(t,e)=>Wt("analytics",t,zi,e);var Ji=/^[A-Z]{2}$/,Xi=new Set(["XX","T1"]),Zi=new Set(["PT_BR","PT_PT","ZH_CN","ZH_TW"]),ts=/^[A-Z]{2,3}$/;function U(t){let e=(typeof t=="string"?t:"").trim().toUpperCase();return!Ji.test(e)||Xi.has(e)?null:e}function F(t){let e=(typeof t=="string"?t:"").trim().replace("-","_").toUpperCase();if(Zi.has(e))return e;let n=e.split("_")[0]??"";return ts.test(n)?n:null}var at={domain:"",token:"",apiVersion:Gn,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 or(t){let e=n=>(v(`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?or(o):o},set:(n,r)=>e(r),deleteProperty:(n,r)=>e(r),defineProperty:(n,r)=>e(r)})}var ir=or(a),es=/^[a-z][a-z0-9-]*$/,ns=["revalidate","openCartOnAdd","cartFocus","variantUrl","autoMount","observe","astro","debug"],rs=["token","productPath","collectionPath","cartDrawerOpenClass"],os=["imagesFirst","variantsFirst","sellingPlanGroupsFirst","sellingPlansFirst","collectionFirst","retries","maxAge","lowStock","searchDelay"],is=["warningText","formatMoney","onLayoutChange","onCartOpen","onCartClose","onLineEnter","onLineLeave","onValueChange","onError"];function Ot(t,e,n){return e!==void 0&&v(`invalid ${t} ${JSON.stringify(e)}: using ${JSON.stringify(n)}`),n}function Y(t,e){v(`invalid ${t} ${JSON.stringify(e)}: ignored`)}function ss(t){for(let e of Object.keys(t))e in at||v(`unknown option ${JSON.stringify(e)}: ignored`)}function as(t){return typeof t=="function"?t:null}function us(t){return Object.fromEntries(is.map(n=>[n,as(t[n])]))}function cs(t,e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:Ot(t,e,at[t])}function ls(t,e){return typeof e=="boolean"?e:Ot(t,e,at[t])}function ds(t,e){return typeof e=="string"?e:Ot(t,e,at[t])}function ps(t){if(!(t==null||t==="")){try{if(typeof t=="string"&&Intl.getCanonicalLocales(t).length)return t}catch{}Y("locale",t)}}function nr(t,e,n){return n.find(r=>r===e)??Ot(t,e,n[0])}function fs(t){return t==="unstable"?(v('apiVersion "unstable" changes without notice. Pin a dated version (e.g. 2026-07).'),t):Kn(t)?t:Ot("apiVersion",t,at.apiVersion)}function rr(t,e,n){if(e==null||e==="")return;let r=n(e);if(r!==null)return r;Y(t,e)}function ms(t){ss(t);let e=Bn(t.domain,Y),n=typeof t.prefix=="string"&&es.test(t.prefix)?t.prefix:Ot("prefix",t.prefix,at.prefix),r={...at,...us(t),domain:e,apiVersion:fs(t.apiVersion),country:rr("country",t.country,U),locale:ps(t.locale),partsUrl:zn(t.partsUrl,Y),language:rr("language",t.language,F),markets:Be(t.markets,Y),analytics:er(t.analytics,Y),account:tr(t.account,Y,v),prefix:n,storageKey:typeof t.storageKey=="string"&&t.storageKey?t.storageKey:`${n}:cart:${e}`,metafields:Xn(t.metafields??[],Y),embedOrigins:Jn(t.embedOrigins??[],Y),checkoutTarget:nr("checkoutTarget",t.checkoutTarget,["_self","_blank"]),defaultPurchase:nr("defaultPurchase",t.defaultPurchase,["one-time","subscription"])};for(let o of os)r[o]=cs(o,t[o]);for(let o of ns)r[o]=ls(o,t[o]);for(let o of rs)r[o]=ds(o,t[o]);return r}var Ye=t=>Be(t,Y);function sr(t={}){let e=ms(t);for(let n of Object.keys(a))n in e||Reflect.deleteProperty(a,n);return Object.assign(a,e)}var Mt=()=>!!(a.domain&&a.token);function L(...t){a.debug&&console.log(`[${a.prefix}]`,...t)}function v(...t){console.warn(`[${a.prefix}]`,...t)}function f(t,e){if(v(e,t instanceof Error&&t.message?t.message:t),!!a.onError)try{a.onError(t,e)}catch(n){v("onError threw",n)}}function ar(t){return t instanceof Error?t.message:String(t)}var b=class extends Error{constructor(n,{status:r,errors:o,userErrors:i,code:s}={}){super(n);T(this,"name","TetherError");T(this,"code");T(this,"status");T(this,"errors");T(this,"userErrors");this.code=s??(r?`HTTP_${r}`:"ERROR"),this.status=r,this.errors=o,this.userErrors=i}};function et(t,e){return typeof e=="function"?e(t):typeof e=="string"?e==="object"?C(t):typeof t===e:gs(e)?Array.isArray(t)&&t.every(n=>et(n,e[0])):C(t)&&Object.entries(e).every(([n,r])=>r===void 0||et(t[n],r))}var gs=t=>Array.isArray(t),D=t=>e=>e===null||et(e,t),z=t=>e=>et(e,t);function Xe(t=a){return`https://${t.domain}/api/${t.apiVersion}/graphql.json`}var pr=/"(?:\\.|[^"\\\n])*"|#[^\n]*/g,hs=/^\s*(?:query|mutation)(?:\s+\w+)?\s*(?:\([^)]*\))?/;function ys(t){return/\bmutation\b/.test(t.replace(pr,""))?"mutation":"query"}function fr(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(pr,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=hs.exec(i);if(!u)return t;let l=u[0].length;return`${t.slice(0,l).trimEnd()} ${o} ${t.slice(l).trimStart()}`}function mr(t,e=a){let n=U(e.country)??void 0,r=F(e.language)??void 0;return fr(t,{country:n,language:r})}var Ze=300,bs=500,ur=430,Ps=1e3,Je="quantityAvailable",cr=new Set,Es=t=>`${t.domain} ${t.apiVersion} ${t.token}`;function ws(t,e,n,{context:r,operation:o}){let i=typeof e=="string"?e:e(n),s=r?fr(i,t):i;return t.maxAge<=0||o==="mutation"?s:`${s} #${Math.floor(Date.now()/(t.maxAge*Ps))}`}var Ss=t=>new Promise(e=>setTimeout(e,t));function tn(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 Cs(t){let e=tt(t,"message"),n=tt(tt(t,"extensions"),"code"),r=typeof e=="string"?e:"";return typeof n=="string"?{message:r,extensions:{code:n}}:{message:r}}function ks(t){if(!C(t))return null;let{data:e,errors:n}=t;return n==null?{data:e}:Array.isArray(n)?{data:e,errors:n.map(Cs)}:null}function ze(t,e){return t.ok?new b(`Invalid response (${t.status})`,{code:"INVALID_RESPONSE",status:t.status}):new b(tn(t.status,e),{status:t.status})}function lr(t,e,n,r){let o=e.map(s=>s.message).filter(Boolean).join(" | "),i=o||"Storefront API error";return t.ok||(i=t.status===401||t.status===403||!o?tn(t.status,n):o),new b(i,{status:t.status,errors:e,code:r})}function dr(t,e){if(e==="any")return{kind:"retry",backoffMs:Ze};throw new b(`Network error: ${ar(t)}`,{code:"NETWORK"})}function Ts(t,e,n,r,o,i,s){if(n.includes(Je)&&r.some(g=>g.message.includes(Je)))return{kind:"inventory-refused",error:lr(t,r,e)};let u=r.map(g=>g.extensions?.code);if(i!=="none"&&u.includes("THROTTLED"))return{kind:"retry",backoffMs:bs};let l=u.includes("INTERNAL_SERVER_ERROR");if(i==="any"&&l)return{kind:"retry",backoffMs:Ze};let d=t.ok&&(l||s==="mutation"&&o==null);throw lr(t,r,e,d?"SERVER_ERROR":void 0)}async function vs(t,e,n,r,o,i){let s;try{s=await(t.fetch??fetch)(Xe(t),{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.token},body:JSON.stringify({query:e,variables:n})})}catch(k){return dr(k,o)}if(s.status===ur)throw new b("Shopify security rejection (430)",{status:ur});if(o!=="none"&&s.status===429||o==="any"&&s.status>=500)return{kind:"retry",backoffMs:Ze};let u;try{u=await s.json()}catch(k){if(k instanceof SyntaxError)throw ze(s,t);return dr(k,o)}let l=ks(u);if(!l)throw ze(s,t);let{data:d,errors:g=[]}=l;if(g.length)return Ts(s,t,e,g,d,o,i);if(!s.ok)throw new b(tn(s.status,t),{status:s.status});if(!r(d))throw ze(s,t);return{kind:"data",data:d}}async function gr(t,e,n,r,{context:o=!0,operation:i="query"}={}){if(!t.domain||!t.token)throw new b("Tether is not configured: domain and token are required",{code:"NOT_CONFIGURED"});let s=Es(t),u=i==="mutation"?"not-run":"any",l=0;for(;;){let d={inventory:!cr.has(s)},g=ws(t,e,d,{context:o,operation:i}),k=l<t.retries?u:"none",N=await vs(t,g,n,r,k,i);switch(N.kind){case"data":return N.data;case"inventory-refused":if(typeof e=="string"||!d.inventory)throw N.error;L(`the token can't read inventory: ${Je} is left out from now on`),cr.add(s);break;case"retry":l+=1,L("retry",l),await Ss(N.backoffMs*2**l);break}}}function K(t,e,n,r){return gr(a,t,e,n,r)}var As=t=>typeof t=="object"&&t!==null;function xs(t,e,n={},r){return gr(t,e,n,As,{...r,operation:ys(e)})}function hr(t,e,n){return xs(a,t,e,n)}function yr(t,e){if(!t)throw new b(`${e}: empty response`);let n=t.userErrors??[];if(n.length)throw new b(n.map(r=>r.message).join(" | "),{userErrors:n});return t}var m=t=>`${a.prefix}-${t}`,c=(t,e)=>e===void 0?`[${m(t)}]`:`[${m(t)}="${e}"]`,p=(t,e)=>t.getAttribute(m(e)),V=(t,e)=>t.hasAttribute(m(e));function y(t,e){return t?[...t.querySelectorAll(e)]:[]}var ut=(t,e,n)=>y(t,e).filter(r=>r.closest(n)===t),Bt=["product-ready","list-ready","cart-updated","cart-toggled","checkout","search"],br=new WeakMap;function Pr(t,e){let n=new CustomEvent(`${a.prefix}:${t}`,{detail:e,bubbles:!0});return br.set(n,t),n}function ct(t,e){return br.get(t)===e}function h(t,e,n=document){n.dispatchEvent(Pr(t,e))}var Ls="http://www.w3.org/1999/xhtml",Is=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"]),Os=new Set(["script","style","template","noscript","textarea","select","title"]),Ms=new Set(["style","title","lang","dir","role","align","width","height"]),Rs=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"])]]),Ns=new Set(["href","src","poster","cite"]),$s=/^(javascript|vbscript|data):/i,_s=/^data:image\/(png|gif|jpeg|webp|avif);/i,Us=new Set(["position","top","right","bottom","left","z-index","-webkit-box-reflect"]),Fs=["inset","transform","translate","rotate","scale","offset"],Ds=/\d(?:[sld]?v|cq)(?:w|h|i|b|min|max)\b/i,Vs=/^(?:outline|box-shadow|text-shadow|filter|text-decoration|text-underline-offset|text-stroke)|^(?:border-image|mask-border|mask-box-image)(?:-outset)?$/,Er=40,Hs=new Map([["letter-spacing",{px:4,em:.25}],["word-spacing",{px:4,em:.25}],["text-indent",{px:Er}]]),wr=/(?<![\w#.-])[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(%|[a-z]+)?/gi,qs=/(?<![\w-])(?!drop-shadow\(|blur\()[\w-]+\([^()]*\)/g,Sr=/(?:var|calc|min|max|clamp|env|attr)\(/i,js=/url\(|expression\(|@import/i,Gs=/[\u0000- ]/g,Ks="allow-scripts allow-same-origin allow-popups allow-presentation",Qs=new Set(["autoplay","encrypted-media","picture-in-picture","fullscreen","clipboard-write","accelerometer","gyroscope","web-share"]),Ws="strict-origin-when-cross-origin",Bs=["https://www.youtube.com","https://www.youtube-nocookie.com","https://player.vimeo.com","https://www.loom.com","https://fast.wistia.net"];function Ys(t,e){return Ms.has(e)||e.startsWith("aria-")||(Rs.get(t)?.has(e)??!1)}function zs(t,e,n){let r=n.replace(Gs,"");return $s.test(r)?t==="img"&&e==="src"&&_s.test(r):!0}function Cr(t,e){try{return new URL(t,e)}catch{return null}}function Js(t,e,n){let r=t.baseURI,o=Cr(r)?.origin??"null";return{origin:o==="null"?null:o,baseUrl:r,styleParser:e,embedOrigins:new Set([...Bs,...n])}}function Xs(t,e){let n=Cr(t.trim(),e.baseUrl);return n!==null&&n.origin!==e.origin&&e.embedOrigins.has(n.origin)}function Zs(t){let e=t.split(";").map(n=>n.trim().split(/\s+/)[0]?.toLowerCase()??"");return[...new Set(e.filter(n=>Qs.has(n)))].join("; ")}function ta(t,e){if(Us.has(t)||Fs.some(r=>t.startsWith(r))||Ds.test(e))return!0;let n=Hs.get(t);return n?Sr.test(e)||ea(e,n):t.startsWith("margin")&&e.includes("-")}function ea(t,e){return[...t.matchAll(wr)].some(([n="",r=""])=>{let o=parseFloat(n);if(o>=0)return!1;let i=e[r.toLowerCase()];return i===void 0||-o>i})}function na(t,e){return Vs.test(t.replace(/^-webkit-/,""))?Sr.test(e)?!0:[...e.replace(qs,"").matchAll(wr)].some(([n="",r=""])=>{let o=Math.abs(parseFloat(n));return o!==0&&(r.toLowerCase()!=="px"||o>Er)}):!1}function ra(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);(ta(i,s)||na(i,s)||js.test(s))&&n.removeProperty(i)}let o=n.cssText;return e.removeAttribute("style"),o}function oa(t,e){let n=t.localName;for(let i of[...t.attributes]){let s=i.name.toLowerCase(),u=Ns.has(s);Ys(n,s)&&(!u||zs(n,s,i.value))||t.removeAttribute(i.name)}let r=t.getAttribute("style");if(r===null)return;let o=ra(r,e.styleParser);o===""?t.removeAttribute("style"):t.setAttribute("style",o)}function ia(t){if(t.localName==="iframe"){let n=Zs(t.getAttribute("allow")??"");n===""?t.removeAttribute("allow"):t.setAttribute("allow",n),t.setAttribute("sandbox",Ks),t.setAttribute("referrerpolicy",Ws);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 sa(t,e){let n=t.localName,r=t.namespaceURI===Ls;if(r&&Os.has(n)){t.remove();return}if(!r||!Is.has(n)){t.replaceWith(...t.childNodes);return}if(n==="iframe"&&!Xs(t.getAttribute("src")??"",e)){t.remove();return}oa(t,e),ia(t)}function kr(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("*")])sa(i,o);return r.content}function de(t){if(typeof t!="string")return!1;try{return new URL(t).protocol==="https:"}catch{return!1}}function Tr(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 vr(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 Ar(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 pe(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 en(t,e){return t.getAttribute(e)??t.getAttribute(m(e))??t.getAttribute(`data-${e}`)}function Lr(t,e){if(!t||!e)return t;let n=en(e,"max-width"),r=en(e,"max-height");return pe(t,{width:n,height:r,crop:n||r?en(e,"crop"):null})}var xr=t=>t.replace(/\?.*$/,"");function fe(t,e){return!t||!e?!1:xr(t)===xr(e)}function aa(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 O(t,e,n){if(!e)return;let r=Lr(e,t);if(t.tagName!=="IMG"){t.style.backgroundImage=aa(r);return}if(fe(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 nn=new WeakMap,Yt=t=>!!nn.get(t),rn=t=>t.cloneNode(!0);function Ir(t){let e=nn.get(t);if(e!==void 0)return e;let n=t.firstElementChild,r=n?rn(n):null;return nn.set(t,r),t.replaceChildren(),r}function H(t,e,n){let r=Ir(t);if(!r){e.length&&v("repeater without a template child",t);return}t.replaceChildren(),e.forEach((o,i)=>{let s=rn(r);n(s,o,i),t.appendChild(s)})}function ua(t,e){let n=()=>{t.remove()};if(!e){n();return}try{e(t,n)}catch(r){f(r,"repeater onLeave"),n()}}function ca(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){f(u,"repeater onEnter")}})}function on(t,e,n,r,{onEnter:o,onLeave:i}={}){let s=Ir(t);if(!s){v("repeater without a template child",t);return}let u=`data-${a.prefix}-key`,l=`data-${a.prefix}-leaving`,d=()=>[...t.children].filter(S=>S.hasAttribute(u)&&!S.hasAttribute(l)),g=new Map(d().map(S=>[S.getAttribute(u),S])),k=[],N=new Set;e.forEach((S,ce)=>{let Qe=String(n(S,ce)),Et=g.get(Qe);Et?g.delete(Qe):(Et=rn(s),Et.setAttribute(u,Qe),N.add(Et)),r(Et,S,ce,N.has(Et)),k.push(Et)});let G=k.filter(S=>!N.has(S)),qn=d().filter(S=>G.includes(S));if(!(qn.length===G.length&&qn.every((S,ce)=>S===G[ce]))){g.forEach(S=>{S.remove()}),k.forEach(S=>t.appendChild(S));return}ca(t,k,N,o),g.forEach(S=>{S.setAttribute(l,""),S.removeAttribute(u),S.style.pointerEvents="none",S.inert=!0,ua(S,i)})}var Or="data-tether-seen",an="data-tether-shown",me="data-tether-prev-display",la=120;function Rt(t,e){return vr(a.productPath||"/product",t,e)}function $r(t,e){try{return t()}catch(n){if(n instanceof RangeError)return e;throw n}}function _r(t,e=a.locale){return t?$r(()=>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):Tr(t,a.locale):""}function ge(t){return t?$r(()=>new Date(t).toLocaleDateString(a.locale||void 0),""):""}function he(t,e){t.replaceChildren(kr(e,t.ownerDocument,a.embedOrigins))}var Ur=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA",Mr=t=>t.tagName==="INPUT";function w(t,e){let n=e==null?"":String(e);Ur(t)?t.value=n:t.textContent=n}var Rr=t=>Ur(t)?t.value:t.textContent;function lt(t,e){let n=Rr(t);if(w(t,e),n!==Rr(t)&&t.hasAttribute(Or)&&a.onValueChange)try{a.onValueChange(t,n)}catch(r){f(r,"onValueChange")}t.setAttribute(Or,"1")}function da(t){if(t.hasAttribute(an))return;t.setAttribute(an,""),t.removeAttribute("hidden");let e=t.getAttribute(me);e!==null?(t.style.display=e,t.removeAttribute(me)):t.style.display==="none"&&(t.style.display=""),typeof getComputedStyle=="function"&&getComputedStyle(t).display==="none"&&(t.style.display=t.getAttribute(m("display"))||"block")}function I(t,e){if(e){da(t);return}t.removeAttribute(an),!t.hasAttribute(me)&&t.style.display!=="none"&&t.setAttribute(me,t.style.display),t.style.display="none"}function ye(t,e){t.classList.toggle("is-selected",e),t.setAttribute("aria-pressed",e?"true":"false"),Mr(t)&&(t.type==="radio"||t.type==="checkbox")&&(t.checked=e);let n=t.querySelector('input[type="radio"],input[type="checkbox"]');n&&Mr(n)&&(n.checked=e)}var Nr,zt=t=>Reflect.get(window,t);function pa(){let t=zt("ScrollTrigger");if(typeof t!="function")return;let e=Reflect.get(t,"refresh");typeof e=="function"&&Reflect.apply(e,t,[])}function dt(t){clearTimeout(Nr),Nr=setTimeout(()=>{try{a.onLayoutChange?a.onLayoutChange(t):pa()}catch(e){f(e,"layout-changed")}h("layout-changed",{reason:t})},la)}function Fr(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 be(t,e){let n=t?p(t,e):null;if(!n)return null;try{return JSON.parse(n)}catch{return v(`invalid JSON in ${m(e)}`,t),null}}function sn(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}function Pe(t){return Array.isArray(t)?t.filter(C).map(n=>({key:sn(n.key),value:sn(n.value)})):C(t)?Object.entries(t).map(([e,n])=>({key:e,value:sn(n)})):[]}function Jt(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",Dr={inventory:!0},Vr=t=>t.inventory?"quantityAvailable":"",pt="url altText width height";function fa(t){let e=[];for(let r of t){let o=We(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 ma=` id name description recurringDeliveries options{name value}priceAdjustments{orderCount adjustmentValue{__typename ... on SellingPlanPercentagePriceAdjustment{adjustmentPercentage}... on SellingPlanFixedAmountPriceAdjustment{adjustmentAmount{${E}}}... on SellingPlanFixedPriceAdjustment{price{${E}}}}}`,ga=` sellingPlan{id}checkoutChargeAmount{${E}}remainingBalanceChargeAmount{${E}}priceAdjustments{price{${E}}compareAtPrice{${E}}perDeliveryPrice{${E}}unitPrice{${E}}}`;function Hr(t=a,e=Dr){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}}}${fa(t.metafields)} sellingPlanGroups(first:${t.sellingPlanGroupsFirst}){nodes{name appName options{name values}sellingPlans(first:${t.sellingPlansFirst}){nodes{${ma}}}}}variants(first:${t.variantsFirst}){nodes{id title availableForSale currentlyNotInStock ${Vr(e)} sku barcode selectedOptions{name value}image{${pt}}price{${E}}compareAtPrice{${E}}unitPrice{${E}}sellingPlanAllocations(first:${t.sellingPlansFirst}){nodes{${ga}}}}}}`}function un(t=Dr){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 ${Vr(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 qr(){return`
2
- id handle title description descriptionHtml
3
- image { ${pt} }
4
- seo { title description }`}var dn={};Li(dn,{GID:()=>W,allPlans:()=>$,allocationFor:()=>_,findPlan:()=>$t,hasPlans:()=>ba,planAdjustment:()=>ln,planCheckoutCharge:()=>cn,planPrice:()=>Nt,planSavings:()=>Zt,plansForVariant:()=>Pa,toGid:()=>Ee});var ha=/^(-?)(\d+)(?:\.(\d+))?$/;function jr(t,e){let n=ha.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 Gr=t=>t.split(".")[1]?.length??0;function Wr(t,e){if(t==null||e==null)return!1;let n=Math.max(Gr(t.trim()),Gr(e.trim())),r=jr(t,n),o=jr(e,n);return r===null||o===null?!1:r>o}var Kr=2,Qr=new Map;function Br(t){let e=Qr.get(t);if(e!==void 0)return e;let n=Kr;try{n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??Kr}catch{}return Qr.set(t,n),n}function wt(t){return Math.round(parseFloat(t.amount)*10**Br(t.currencyCode))}function Xt(t,e){let n=Br(e);return{amount:(t/10**n).toFixed(n),currencyCode:e}}var ya=100;function Ee(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 W={product:t=>Ee(t,"Product"),variant:t=>Ee(t,"ProductVariant"),sellingPlan:t=>Ee(t,"SellingPlan")};function $(t){return(t?.sellingPlanGroups?.nodes??[]).flatMap(n=>n.sellingPlans.nodes.map(r=>({...r,group:n})))}function ba(t){return $(t).length>0}function _(t,e){return!t||!e?null:(t.sellingPlanAllocations?.nodes??[]).find(r=>r.sellingPlan.id===e)??null}function Pa(t,e){return $(t).filter(n=>_(e,n.id))}function Nt(t,e){let n=_(t,e)?.priceAdjustments[0];return n?.perDeliveryPrice??n?.price??t?.price??null}function cn(t,e){let n=_(t,e);return n?.checkoutChargeAmount??n?.priceAdjustments[0]?.price??t?.price??null}function Zt(t,e){let n=Nt(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=wt(t.price)-wt(n);return{amount:Xt(i,t.price.currencyCode),percentage:Math.round((1-o/r)*ya)}}function ln(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 $t(t,e){if(!e)return null;let n=$(t),r=W.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 nt={amount:"string",currencyCode:"string"},_t={id:"string",handle:"string",title:"string",options:["object"],images:{nodes:["object"]},priceRange:{minVariantPrice:nt,maxVariantPrice:nt},variants:{nodes:[{id:"string",price:nt,selectedOptions:["object"]}]}},pn={nodes:[_t],pageInfo:{hasNextPage:"boolean"}},Yr=t=>tt(t,"id")!==""&&tt(t,"handle")!==""&&et(t,_t),zr=t=>C(t)&&(t.id===void 0||et(t,_t));var Ea={id:"string",quantity:"number",attributes:["object"],cost:{totalAmount:nt,subtotalAmount:nt,amountPerQuantity:nt},merchandise:{id:"string",selectedOptions:["object"],product:"object"}},fn={id:"string",checkoutUrl:"string",totalQuantity:"number",attributes:["object"],discountCodes:["object"],cost:{totalAmount:nt,subtotalAmount:nt},lines:{nodes:[Ea]}};var wa='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',Sa=60,mn=!1,we=null,Ca=t=>t!==null&&"focus"in t,Jr=t=>y(t,wa).filter(e=>e.offsetParent!==null||e===document.activeElement),St=()=>y(document,c("cart-drawer")),gn=t=>t.classList.contains(a.cartDrawerOpenClass);function J(){let t=St();return t.length?t.some(gn):mn}function Se(t){y(document,c("cart-open")).forEach(e=>{e.setAttribute("aria-expanded",String(t))}),St().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)),!gn(e)&&(e.setAttribute("aria-hidden","true"),a.cartFocus&&(e.inert=!0))})}function ka(t){let e=Jr(t)[0]??t;e===t&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),e.focus({preventScroll:!0})}function Ce(){if(J())return;mn=!0;let t=St().filter(n=>p(n,"cart-drawer")!=="manual");t.forEach(n=>{n.inert=!1,n.classList.add(a.cartDrawerOpenClass),n.setAttribute("aria-hidden","false")}),Se(!0);let[e]=t;a.cartFocus&&e&&(we=Ca(document.activeElement)?document.activeElement:null,setTimeout(()=>{ka(e)},Sa)),a.onCartOpen?.(t),h("cart-toggled",{open:!0})}function hn(){if(!J())return;mn=!1;let t=St(),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)}),Se(!1),e&&we?.isConnected&&we.focus({preventScroll:!0}),we=null,a.onCartClose?.(t),h("cart-toggled",{open:!1})}function Xr(){J()?hn():Ce()}function yn(t){if(t.key!=="Tab"||!a.cartFocus||!J())return;let e=St().find(gn);if(!e)return;let n=Jr(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 Ta=1e4,va=6e4,q=new Map,bn=new Map,Ct=new Set,ke=new Map,eo=[],Pn=!1,te=0,Zr=t=>t.startsWith("gid://"),Ut=Ar;function kt(t){if(!t)return;let e=Promise.resolve(t);q.set(t.handle,e),q.set(t.id,e)}function rt(t){let e=Ut(t);if(!e)return Promise.reject(new b("empty product key",{code:"NOT_FOUND"}));let n=q.get(e);if(n)return n;let r=new Promise((o,i)=>{bn.set(e,{resolve:o,reject:i}),eo.push(e),Pn||(Pn=!0,setTimeout(()=>void Ia(),0))});return q.set(e,r),r}var Te=t=>e=>`${t}${Hr(a,e)}`;function Aa(t){let e=t.filter(Zr),n=t.filter(u=>!Zr(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:Te(`query TetherProducts(${r.join(",")}){${o.join(" ")}}`),variables:i,handles:n}}function to(t,e){let n=bn.get(t);bn.delete(t),n&&e(n)}function xa(t,e){if(e!==te)return;let n=q.get(t);setTimeout(()=>{q.get(t)===n&&q.delete(t)},Ta)}function La(t){if(!C(t))return!1;let{byId:e=[],...n}=t;return et(e,[D(zr)])&&Object.values(n).every(D(_t))}async function Ia(){Pn=!1;let t=te,e=eo.splice(0);if(!e.length)return;let{query:n,variables:r,handles:o}=Aa(e);L("fetch products",e);let i;try{i=await K(n,r,La)}catch(l){e.forEach(d=>{to(d,g=>{t===te&&q.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=>{to(l,d=>{let g=s.get(l);if(!g){xa(l,t),d.reject(new b(`Product not found: ${l}`,{code:"NOT_FOUND"}));return}t===te&&(kt(g),ke.set(g.handle,u),ke.set(g.id,u)),d.resolve(g)})})}function ve(){q.clear(),te+=1,Ct.clear(),ke.clear()}function no(t){for(let e of t??[])!e.id||!e.handle||Date.now()-(ke.get(e.handle)??0)<va&&q.has(e.handle)||(kt(e),Ct.add(e.handle),Ct.add(e.id))}function ro(t){let e=Ut(t);return!e||!Ct.has(e)?!1:(Ct.delete(e),q.get(e)?.then(n=>{Ct.delete(n.handle),Ct.delete(n.id)},Oa),!0)}function Oa(){}function oo(t){let e=Ut(t);return e&&q.delete(e),rt(t)}var Ma=z({collection:D({handle:"string",products:pn})}),Ra=z({products:pn}),Na=z({productRecommendations:D([_t])}),$a=`query TetherCollection($handle:String!,$first:Int!,$after:String,$sortKey:ProductCollectionSortKeys,$reverse:Boolean,$filters:[ProductFilter!]){collection(handle:$handle){${qr()} products(first:$first,after:$after,sortKey:$sortKey,reverse:$reverse,filters:$filters){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}}`,_a="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 Ae({collection:t,query:e,first:n=a.collectionFirst,after:r=null,sortKey:o,reverse:i=!1,filters:s}={}){if(t){let l=await K(Te($a),{handle:t,first:n,after:r,sortKey:o||void 0,reverse:i,filters:s??void 0},Ma);if(!l.collection)throw new b(`Collection not found: ${t}`,{code:"NOT_FOUND"});let{products:d,...g}=l.collection;return d.nodes.forEach(kt),{collection:g,products:d.nodes,pageInfo:d.pageInfo}}let u=await K(Te(_a),{first:n,after:r,query:e||void 0,sortKey:o||void 0,reverse:i},Ra);return u.products.nodes.forEach(kt),{collection:null,products:u.products.nodes,pageInfo:u.products.pageInfo}}async function xe(t,e="RELATED"){let n=Ut(typeof t=="object"?t?.id:t),r=n?.startsWith("gid://")??!1,i=(await K(Te(`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},Na)).productRecommendations??[];return i.forEach(kt),i}var Ua=/^image:(\d+)$/,io="metafield:",Fa=/^(rich_text|multi_line_text)_field$/,Da=["","true","all","*"],ee=t=>t.tagName==="SELECT",Tt=(t,e)=>t.$(`select${e}`).filter(ee);function Va(t,e){let n=e.images.nodes,r=[...t.children].map(i=>i.tagName==="IMG"?i:i.querySelector("img"));!Yt(t)&&r.length===n.length&&r.every((i,s)=>fe(i?.getAttribute("src"),n[s]?.url))||H(t,n,(i,s)=>{let u=i.matches(`img,${c("bind","image")}`)?i:y(i,"img")[0]??i;O(u,s.url,s.altText||e.title)})}function Ha(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){O(t,u.url,u.altText);return}Fa.test(s.type)&&(t.style.whiteSpace="pre-line"),w(t,s.value)}var qa=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=>ge(t.publishedAt),"min-price":t=>M(t.priceRange.minVariantPrice),"max-price":t=>M(t.priceRange.maxVariantPrice)}));function ja(t,e){let n=(t.getAttribute("exclude")??"").split(",").map(o=>o.trim()).filter(Boolean),r=e.tags.filter(o=>!n.includes(o));H(t,r,(o,i)=>{w(o,i)})}function Ga(t,e,n){let r=qa.get(e);if(r){w(t,r(n));return}switch(e){case"description":he(t,n.descriptionHtml);break;case"featured-image":O(t,n.featuredImage?.url,n.featuredImage?.altText||n.title);break;case"url":case"link":{let o=Rt(n.handle,n.id);o&&t.setAttribute("href",o),e==="url"&&!t.firstElementChild&&!t.textContent.trim()&&w(t,n.title);break}case"images":Va(t,n);break;case"tags":ja(t,n);break;default:Ka(t,e,n)}}function Ka(t,e,n){let r=Ua.exec(e);if(r){let o=n.images.nodes[Number(r[1])-1]??n.featuredImage;O(t,o?.url,o?.altText||n.title)}else e.startsWith(io)&&Ha(t,n,e.slice(io.length))}function Qa(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&&V(n,"hide-single")){I(n,!1);return}H(n,o.optionValues,(i,s)=>{i.setAttribute(m("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&&O(l,d.image.previewImage.url,s.name))})})}function Wa(t){let{product:e}=t;Tt(t,c("option")).forEach(n=>{let r=e.options.find(o=>o.name===t.optName(p(n,"option")));if(!r){I(n,!1);return}n.replaceChildren(...r.optionValues.map(o=>new Option(o.name,o.name)))}),Tt(t,c("variant-select")).forEach(n=>{n.replaceChildren(...e.variants.nodes.map(r=>new Option(r.title,r.id)))}),Tt(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(m("one-time-label"))||"One-time purchase";n.replaceChildren(...o?[new Option(i,"")]:[],...r)})}function Ba(t){t.$(c("plan-list")).forEach(e=>{let n=(p(e,"plan-list")??"").trim(),r=Da.includes(n.toLowerCase())?null:n,o=t.plans.filter(i=>!r||i.group.name===r);H(e,o,(i,s)=>{i.setAttribute(m("plan-value"),s.id),!i.firstElementChild&&!i.querySelector(c("plan-bind"))&&w(i,s.name)})})}function so(t){t.$(c("bind")).forEach(e=>{Ga(e,p(e,"bind")??"",t.product)}),Qa(t),Wa(t),Ba(t)}var ao="Default Title",En=(t,e)=>e.get(t.id)?.quantity??t.quantity,uo=t=>t.split("/").pop()??t;function Ya(t){let e=t.merchandise,n=Rt(e.product.handle,e.product.id);if(!n)return null;let r=new URLSearchParams;r.set("variant",uo(e.id));let o=t.sellingPlanAllocation?.sellingPlan.id;return o&&r.set("selling_plan",uo(o)),`${n}${n.includes("?")?"&":"?"}${r.toString()}`}var co=t=>t.merchandise.product.title,lo={title:co,"product-title":co,"variant-title":t=>t.merchandise.title===ao?"":t.merchandise.title,options:t=>t.merchandise.selectedOptions.filter(e=>e.value!==ao).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)=>En(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(", ")},po="attribute:";function za(t,e,n){if(Object.hasOwn(lo,e))return lo[e]?.(t,n);if(!e.startsWith(po))return;let r=e.slice(po.length);return t.attributes.find(o=>o.key===r)?.value??""}function Ja(t,e,n){let r=$(n),o=!n.requiresSellingPlan&&p(t,"line-plan")!=="subscription-only",i={value:"",label:t.getAttribute(m("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??"",I(t,r.length>0)}function Xa(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",Wr(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&&I(u,d)})}function Za(t,e,n){let r=e.merchandise;t.setAttribute(m("line-id"),e.id),y(t,c("line")).forEach(i=>{let s=p(i,"line")??"";if(s==="image"){O(i,r.image?.url??r.product.featuredImage?.url,r.product.title);return}if(s==="url"){let l=Ya(e);l&&i.setAttribute("href",l);return}let u=za(e,s,n);u!==void 0&&lt(i,u)}),Xa(t,e,n),y(t,c("line-plan")).filter(ee).forEach(i=>{rt(r.product.handle).then(s=>{Ja(i,e,s)}).catch(s=>{f(s,"line plan options")})})}function tu(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"))||I(i,u)}),y(document,c("checkout")).forEach(i=>{i.classList.toggle("is-disabled",!n),i.setAttribute("aria-disabled",String(!n))})}function eu(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=>{H(e,t?.discountCodes??[],(n,r)=>{n.setAttribute(m("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 fo(t){let{cart:e}=t,n=r=>e?M(e.cost[r]):"";Se(J()),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"))}),tu(e,t),y(document,c("cart-warning")).forEach(r=>{lt(r,[...new Set(t.warnings.map(o=>o.message))].join(" "))}),eu(e),y(document,c("cart-lines")).forEach(r=>{on(r,e?.lines.nodes??[],o=>o.id,(o,i)=>{Za(o,i,t)},{onEnter:a.onLineEnter,onLeave:a.onLineLeave})}),e&&dt("cart")}function mo(t){y(document,c("cart-count")).forEach(e=>{/^\s*0?\s*$/.test(e.textContent)&&(e.textContent=String(t))})}function vt(t,e="localStorage"){try{return window[e].getItem(t)}catch{return null}}function Le(t,e,n="localStorage"){try{window[n].setItem(t,e)}catch{}}function ne(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var go=/^gid:\/\/shopify\/Cart\/[\w-]+(\?key=[\w-]+)?$/;var j={kind:"unknown"},Ft=[],At=new Map,Ie=()=>j;function A(){switch(j.kind){case"ready":case"error":return j.cart;case"unknown":case"empty":return null}}var yo=()=>Ft,wn=t=>t?{kind:"ready",cart:t}:{kind:"empty"},bo=()=>`${a.storageKey}:seen`;function ft(){let t=vt(a.storageKey);return t?go.test(t)?t:(mt(),null):null}function mt(){ne(a.storageKey)}function Sn(t){j=wn(t),t&&Le(a.storageKey,t.id)}function re(){fo({cart:A(),warnings:Ft,pending:At,failed:j.kind==="error"})}function oe(t){re(),h("cart-updated",{cart:A(),reason:t})}function B(t,e){return Sn(t),Le(bo(),`${Date.now()}|${t?.totalQuantity??0}`),oe(e),t}function ie(t){j=t.kind==="loaded"?wn(t.cart):{kind:"error",error:t.error,cart:null},oe("load")}function nu(){let t=vt(bo())?.split("|")[1]??"",e=Number(t);return/^\d+$/.test(t)&&Number.isSafeInteger(e)?e:null}function Po(){if(j.kind!=="unknown")return;let t=nu();t!==null&&mo(t)}function Eo(t){Ft=t.filter((e,n)=>t.findIndex(r=>r.message===e.message)===n).map(e=>({...e,message:a.warningText?.(e)||e.message})),Ft.length&&h("cart-warning",{warnings:Ft})}var ho=()=>{};function ru(){let t=Promise.resolve();return e=>{let n=t.then(e);return t=n.then(ho,ho),n}}var ou=ru();function wo(t){return ou(t).then(e=>(j.kind==="error"&&(j=wn(j.cart),re()),e),e=>{throw j={kind:"error",error:e,cart:A()},re(),h("cart-error",{error:e}),e})}var Cn=t=>En(t,At),iu=()=>({open:J(),count:A()?.totalQuantity??0,loaded:j.kind!=="unknown",warnings:[...Ft]});function So(t){let e=["cart-updated","cart-toggled"].map(r=>`${a.prefix}:${r}`),n=()=>{t(A(),iu())};return e.forEach(r=>{document.addEventListener(r,n)}),n(),()=>{e.forEach(r=>{document.removeEventListener(r,n)})}}var su=/does not exist|not found|invalid id/i,au=t=>z({[t]:D({cart:D(fn)})});function Oe(t){return t instanceof b?t.userErrors?.some(e=>e.field?.[0]==="cartId")?!0:(t.errors??[]).some(e=>su.test(e.message)):!1}function ko(t){if(!(t instanceof b))return!1;let{code:e,status:n=0}=t;return e==="NETWORK"||e==="INVALID_RESPONSE"||e==="SERVER_ERROR"||n>=500}function To(t,e=1,n={}){let r=typeof t=="object"&&t!==null?t:{...n,quantity:e,...t==null?{}:{variantId:t}},o=W.variant(r.merchandiseId||r.variantId||r.id);if(!o)throw new b("add(): variantId is required");let i=parseInt(String(r.quantity??1),10),s={merchandiseId:o,quantity:Math.max(1,i||1)},u=W.sellingPlan(r.sellingPlanId||r.sellingPlan);u&&(s.sellingPlanId=u);let l=Jt(r.attributes);return l.length&&(s.attributes=l),s}function uu(t,e,n){return r=>`mutation Tether_${t}(${e}){${t}(${n}){cart{...TetherCart}userErrors{field message}warnings{code message target}}}${un(r)}`}async function vo(t,e,n,r){let o=await K(uu(t,e,n),r,au(t),{operation:"mutation"}),i=yr(o[t],t);return Eo(i.warnings??[]),i.cart}function Co(t){let e=a.country?{buyerIdentity:{countryCode:a.country},...t}:t;return vo("cartCreate","$input: CartInput!","input: $input",{input:e})}async function gt({name:t,args:e,inner:n,variables:r,createInput:o}){let i=ft();if(!i)return o?Co(o):null;try{return await vo(t,`$cartId: ID!, ${e}`,`cartId: $cartId, ${n}`,{...r,cartId:i})}catch(s){if(!Oe(s)||(mt(),!o))throw s;return L("cart expired, creating a new one"),Co(o)}}async function kn(t){return(await K(n=>`query TetherCart($id:ID!){cart(id:$id){...TetherCart}}${un(n)}`,{id:t},z({cart:D(fn)}))).cart}async function Ao(t){return(await K("query TetherCheckout($id: ID!) { cart(id: $id) { checkoutUrl } }",{id:t},z({cart:D({checkoutUrl:"string"})}))).cart?.checkoutUrl??null}function xo(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?W.sellingPlan(n.sellingPlanId):null),n.attributes&&(r.attributes=Jt(n.attributes));let o=n.merchandiseId||n.variantId;return o&&(r.merchandiseId=W.variant(o)),r}var Tn=t=>gt({name:"cartLinesUpdate",args:"$lines: [CartLineUpdateInput!]!",inner:"lines: $lines",variables:{lines:t},createInput:null}),Me=t=>gt({name:"cartLinesRemove",args:"$lineIds: [ID!]!",inner:"lineIds: $lineIds",variables:{lineIds:t},createInput:null}),Lo=(t,e)=>e>0?Tn([{id:t,quantity:e}]):Me([t]);var vn=null;function Io(t){vn=t}var cu=t=>Ao(t).then(e=>({kind:"url",url:e}),e=>({kind:"failed",error:e}));async function lu(){if(!vn)return null;try{let t=await vn();return t&&`${t}${t.includes("?")?"&":"?"}logged_in=true`}catch(t){return f(t,"account checkout"),null}}async function du(t){let e=cu(t),n=await lu();if(n)return n;let r=await e;if(r.kind==="failed")throw r.error;if(!r.url)throw new b("No checkoutUrl (cart empty or expired)");return r.url}function pu(t){try{t.opener=null}catch{}}async function Oo(t=a.checkoutTarget){let e=ft(),n=A();if(!e||n&&!n.totalQuantity)return null;let r=t==="_blank"?window.open("","_blank"):null;r&&pu(r);try{let o=await du(e);if(!de(o))throw new b("The checkout URL is not https: not opened");return h("checkout",{url:o,cart:A()}),r&&!r.closed?r.location.href=o:window.location.href=o,o}catch(o){return r?.close(),f(o,"checkout failed"),null}}var Re=()=>A()?.lines.nodes??[];async function fu(){let t=ft();if(t)try{let e=await kn(t);e||mt(),B(e,"load")}catch(e){f(e,"cart reload after a failed change")}}function ot(t){return wo(()=>t().catch(async e=>{throw ko(e)&&await fu(),e}))}function mu(t,e){let n=Re().find(u=>u.id===t);if(!n)return Promise.resolve(A());let r=Math.max(0,Cn(n)+e),o={quantity:r};At.set(t,o),oe("pending");let i=()=>At.get(t)===o;return ot(async()=>{if(!i())return A();if(Re().find(d=>d.id===t)?.quantity===r)return A();let l=await Lo(t,r);return i()?B(l,r>0?"update":"remove"):(Sn(l),l)}).finally(()=>{i()&&(At.delete(t),oe("settled"))})}function gu(t){let e=(A()?.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 hu(t){let e=new Map((A()?.attributes??[]).map(n=>[n.key,n.value]));return Jt(t).forEach(n=>e.set(n.key,n.value)),[...e].filter(([,n])=>n!=="").map(([n,r])=>({key:n,value:r}))}async function yu(){let t=ft();if(!t)return ie({kind:"loaded",cart:null}),null;Po();try{let e=await kn(t);e||mt(),ie({kind:"loaded",cart:e})}catch(e){f(e,"cart load failed"),Oe(e)&&mt(),ie({kind:"failed",error:e})}return A()}var P={init:yu,id:ft,get status(){return Ie()},get state(){return A()},get lines(){return[...Re()]},get count(){return A()?.totalQuantity??0},get loaded(){return Ie().kind!=="unknown"},get lastError(){let t=Ie();return t.kind!=="error"?null:t.error instanceof Error?t.error:new Error(String(t.error))},get warnings(){return[...yo()]},get pendingQty(){return At},setCheckoutResolver:Io,forgetSaved(){mt(),ie({kind:"loaded",cart:null})},render:re,subscribe:So,add(t,e=1,n={}){let r=(Array.isArray(t)?t:[t]).map(o=>To(o,e,n));return ot(async()=>{let o=await gt({name:"cartLinesAdd",args:"$lines: [CartLineInput!]!",inner:"lines: $lines",variables:{lines:r},createInput:{lines:r}});if(!o)throw new b("Shopify answered the add without a cart");return B(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 P.removeLine(t);let r=xo(t,e);return ot(async()=>B(await Tn([r]),"update"))},changeQuantity:mu,quantityOf:Cn,removeLine(t){let e=Array.isArray(t)?t:[t];return ot(async()=>B(await Me(e),"remove"))},clear(){return ot(async()=>{let t=Re().map(e=>e.id);return t.length?B(await Me(t),"remove"):A()})},setNote(t){let e={note:t??""};return ot(async()=>B(await gt({name:"cartNoteUpdate",args:"$note: String!",inner:"note: $note",variables:e,createInput:e}),"note"))},setAttributes(t){return ot(async()=>{let e={attributes:hu(t)},n=await gt({name:"cartAttributesUpdate",args:"$attributes: [AttributeInput!]!",inner:"attributes: $attributes",variables:e,createInput:e});return B(n,"attributes")})},setDiscountCodes(t){return ot(async()=>{let e={discountCodes:gu(t)},n=await gt({name:"cartDiscountCodesUpdate",args:"$discountCodes: [String!]!",inner:"discountCodes: $discountCodes",variables:e,createInput:e});return B(n,"discount")})},async applyDiscount(t){let e=await P.setDiscountCodes(o=>[...new Set([...o,t])]),n=t.toLowerCase();if((e?.discountCodes??[]).find(o=>o.code.toLowerCase()===n)?.applicable)return e;try{await P.removeDiscount(t)}catch(o){f(o,"removing a discount code Shopify refused")}throw new b(`Discount code not valid: ${t}`,{code:"INVALID_DISCOUNT"})},removeDiscount(t){let e=t.toLowerCase();return P.setDiscountCodes(n=>n.filter(r=>r.toLowerCase()!==e))},setBuyerIdentity(t,{create:e=!0}={}){return ot(async()=>{let n=await gt({name:"cartBuyerIdentityUpdate",args:"$buyerIdentity: CartBuyerIdentityInput!",inner:"buyerIdentity: $buyerIdentity",variables:{buyerIdentity:t},createInput:e?{buyerIdentity:t}:null}).catch(r=>{if(e||!Oe(r))throw r;return null});return B(n,"buyer-identity")})},checkout:Oo,drawers:St,isOpen:J,open:Ce,close:hn,toggle:Xr};var bu=100,Pu=(t,e)=>Xt(wt(t)*e,t.currencyCode),Vt=t=>Object.fromEntries(t.selectedOptions.map(e=>[e.name,e.value]));function Eu(t,e){return t.variants.nodes.find(n=>n.selectedOptions.every(r=>e[r.name]===r.value))??null}function Mo(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 Dt=t=>t.kind==="subscription"?t.planId:t.offeredPlanId;function Ne(t,e){return t.kind==="subscription"&&_(e,t.planId)?t:{kind:"one-time"}}function $e(t,e,n,r){let o=$(t),i=o.find(u=>u.id===r)??o[0];if(!i)return{kind:"one-time",offeredPlanId:null};let s=_(e,i.id)?i:o.find(u=>_(e,u.id))??i;return t.requiresSellingPlan||n==="subscription"?{kind:"subscription",planId:s.id}:{kind:"one-time",offeredPlanId:s.id}}function Ro(t,{variant:e,sellingPlan:n,defaultPlan:r,defaultPurchase:o}){let i=t.variants.nodes,s=W.variant(e),u=i.find(k=>k.id===s)??i.find(k=>k.availableForSale)??i[0]??null,l=$t(t,n),d=l??$t(t,r),g=l||o==="subscription"?"subscription":"one-time";return{selected:u?Vt(u):{},purchase:$e(t,u,g,d?.id??null)}}function wu(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 No(t,e,n){let r=Eu(t,e.selected),o=r??t.variants.nodes[0];if(!o)return null;let i=$e(t,o,e.purchase.kind,Dt(e.purchase)),s=Dt(i),u=$(t),l=Ne(i,o),d=l.kind==="subscription"?_(o,l.planId):null,g=d?Nt(o,s)??o.price:o.price,k=d?.priceAdjustments[0]?.compareAtPrice??o.compareAtPrice,N={line:l,subscriptionAvailable:u.some(G=>_(o,G.id)),compareAtPrice:k&&parseFloat(k.amount)>parseFloat(g.amount)?k:null,savings:Zt(o,s)};return{...N,variant:o,selected:r?e.selected:Vt(o),purchase:i,plan:u.find(G=>G.id===s)??null,quantity:e.quantity,price:g,show:wu(o,n,t.variants.nodes.length,N,t.requiresSellingPlan)}}function $o(t,e){let{variant:n,plan:r,price:o,compareAtPrice:i,quantity:s}=t,u=Dt(t.purchase),l=G=>Pu(G,Math.max(1,s)),N={price:()=>e.money(o),"total-price":()=>e.money(l(o)),"one-time-price":()=>e.money(n.price),"subscription-price":()=>e.money(u?Nt(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"?cn(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))*bu)}%`:"0%","discount-amount":()=>i?e.money(Xt(wt(i)-wt(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(N))}function _o(t,e,n,r){let i={name:()=>n?.name,option:()=>(n?.options??[]).map(s=>s.value).join(", "),description:()=>n?.description,price:()=>r.money(Nt(t,e)),savings:()=>r.percent(Zt(t,e).percentage),"savings-amount":()=>r.money(Zt(t,e).amount),adjustment:()=>{let s=ln(n);return s?s.type==="percentage"?`${s.value}%`:r.money(s.value):""}};return new Map(Object.entries(i))}function An(t){try{return decodeURIComponent(t)}catch(e){if(e instanceof URIError)return t;throw e}}var Uo="url:";function X(t,e=window.location,n="product"){let r=(p(t,n)??"").trim();if(!r.toLowerCase().startsWith(Uo))return{key:r||null,fromUrl:!1,raw:r};let o=r.slice(Uo.length).trim(),i;if(o.toLowerCase()==="path"){let s=e.pathname.split("/").filter(Boolean),u=s[s.length-1];i=u===void 0?null:An(u)}else i=new URLSearchParams(e.search).get(o||"handle");return{key:i?.trim()||null,fromUrl:!0,raw:r}}var _e=["loading","ready","error","not-found"],Su=t=>_e.some(e=>e===t),Fo=t=>typeof t=="object"&&t!==null&&"code"in t?t.code:void 0,ae=t=>Fo(t)==="NOT_FOUND",se=()=>["product","collection","products","recommendations"].map(t=>c(t)).join(","),Do=(t,e)=>t===e||t.parentElement?.closest(se())===e;function Cu(t){let e=Fo(t);return typeof e=="string"&&e?e:"error"}function ht(t,e,n){let r=e==="not-found",o=e==="error"||r;t.setAttribute(m("state"),r?"error":e),o?t.setAttribute(m("error"),r?"not-found":Cu(n)):t.removeAttribute(m("error")),ut(t,c("show"),se()).forEach(i=>{let s=p(i,"show");Su(s)&&I(i,s===e)}),o&&ut(t,c("add-to-cart"),se()).forEach(i=>{i.classList.add("is-disabled"),i.setAttribute("aria-disabled","true"),"disabled"in i&&(i.disabled=!0)})}var Vo={money:M,percent:_r},ku=t=>t.tagName==="INPUT";function xn(t){let e=y(t,c("add-label"))[0]??t,n=e.dataset.tetherLabel??(ku(e)?e.value:e.textContent);return e.dataset.tetherLabel=n,{label:e,original:n}}function Tu(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")??"";ye(s,e.selected[i]===u);let l=!Mo(n,e.selected,i,u);s.classList.toggle("is-unavailable",l),s.setAttribute("data-unavailable",l?"true":"false")})}),Tt(t,c("option")).forEach(o=>{o.value=r(p(o,"option"))}),Tt(t,c("variant-select")).forEach(o=>{o.value=e.variant.id})}function vu(t,e){let{variant:n,purchase:r,line:o}=e;t.$(c("purchase")).forEach(i=>{if(ee(i)){i.value=r.kind;return}let s=p(i,"purchase");ye(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")??"";ye(i,o.kind==="subscription"&&s===o.planId),i.classList.toggle("is-unavailable",!_(n,s));let u=t.plans.find(d=>d.id===s),l=_o(n,s,u,Vo);y(i,c("plan-bind")).forEach(d=>{let g=l.get(p(d,"plan-bind")??"");g&&w(d,g())})}),Tt(t,c("plan")).forEach(i=>{i.value=o.kind==="subscription"?o.planId:""})}function Au(t,e){let n=new Map(Object.entries(e.show));_e.forEach(r=>n.set(r,r==="ready")),t.$(c("show")).forEach(r=>{let o=p(r,"show")??"",i=n.get(o);i!==void 0&&(_e.some(s=>s===o)&&!Do(r,t.root)||I(r,i))})}function xu(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}=xn(r),l=u;e.line.kind==="subscription"&&i&&(l=i),n&&o&&(l=o),r.getAttribute("aria-busy")!=="true"&&w(s,l)})}function Ho(t,e){let{variant:n}=e,{product:r}=t,o=$o(e,Vo);t.$(c("bind")).forEach(i=>{let s=p(i,"bind")??"";if(s==="variant-image"){O(i,n.image?.url||r.featuredImage?.url,n.image?.altText||r.title);return}let u=o.get(s);u&&w(i,u())}),Tu(t,e),vu(t,e),Au(t,e),t.root.classList.toggle("is-subscription",e.line.kind==="subscription"),t.root.setAttribute(m("purchase-mode"),e.line.kind),xu(t,e)}var jo=()=>c("product"),Lu=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA",qo=t=>t instanceof window.Element;function Ht(t,e,n){let r=e.closest(n);return r?.closest(jo())===t.root?r:null}function Iu(t,e){let{label:n,original:r}=xn(e),o=p(e,"adding-text");Q(e,async()=>{o&&w(n,o);try{await t.addToCart()}catch(i){f(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=>{f(i,"add to cart render")})}function Ou(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(Go(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(),Iu(t,d))}var Go=t=>t==="subscription"?"subscription":"one-time";function Mu(t,e){let n=Lu(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(Go(n)):e.matches(c("qty"))&&t.setQuantity(n)}function Ko(t){t.root.addEventListener("click",e=>{qo(e.target)&&Ou(t,e,e.target)}),t.root.addEventListener("change",e=>{let{target:n}=e;qo(n)&&n.closest(jo())===t.root&&Mu(t,n)})}var it=new WeakMap,Ru=()=>c("product"),Ue=new Map;function Ln(t){t.forEach(e=>{Ue.has(e.handle)||Ue.set(e.handle,e.options.map(n=>n.name))})}var Qo=t=>t.tagName==="INPUT",Nu=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA";function $u(t){return Qo(t)&&t.type==="checkbox"?t.checked?t.value&&t.value!=="on"?t.value:"Yes":null:Qo(t)&&t.type==="radio"?t.checked?t.value:null:Nu(t)&&t.value||null}var Fe=class{constructor(e,n){T(this,"root");T(this,"product");T(this,"plans");T(this,"selected");T(this,"purchase");T(this,"variant");T(this,"quantity");this.root=e,this.product=n,this.plans=$(n);let r=new URLSearchParams(window.location.search),o=Ro(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=V(e,"quantity")?Math.max(0,parseInt(p(e,"quantity")??"",10)||0):1,it.set(e,this),e.setAttribute(m("state"),"ready"),e.removeAttribute(m("error")),this.renderProduct(),Ko(this),this.renderVariant(),Fr(e,"product"),dt("product"),h("product-ready",{product:n,scope:this},e)}update(e){let n=this.variant?.id;this.product=e,this.plans=$(e);let r=e.variants.nodes.find(o=>o.id===n);r&&(this.selected=Vt(r)),this.root.setAttribute(m("state"),"ready"),this.root.removeAttribute(m("error")),this.renderProduct(),this.renderVariant(),dt("product"),h("product-updated",{product:e,scope:this},this.root)}$(e){let n=ut(this.root,e,Ru());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=(Ue.get(this.product.handle)??[]).indexOf(e);return n[r]?.name??e}get plan(){let e=Dt(this.purchase);return this.plans.find(n=>n.id===e)??null}get subscriptionAvailable(){return this.plans.some(e=>_(this.variant,e.id))}get isSubscription(){return Ne(this.purchase,this.variant).kind==="subscription"}getLine(){if(!this.variant)return null;let e={merchandiseId:this.variant.id,quantity:this.quantity},n=Ne(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=Pe(be(this.root,"line-attributes")),n=this.$(c("line-attribute")).flatMap(r=>{let o=$u(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,Vt(u))}this.selected=i,this.renderVariant()}selectVariant(e){let n=this.product.variants.nodes.find(r=>r.id===W.variant(e));n&&(this.selected=Vt(n),this.renderVariant())}setPurchase(e){let n=$e(this.product,this.variant,e,Dt(this.purchase));n.kind!==this.purchase.kind&&(this.purchase=n,this.renderVariant())}selectPlan(e){let n=$t(this.product,e);n&&(this.purchase={kind:"subscription",planId:n.id},this.renderVariant())}setQuantity(e){let n=V(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 P.add(e);return h("product-added",{product:this.product,variant:this.variant,line:e},this.root),n}renderProduct(){let{product:e}=this;Ue.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))&&Ln([e]),so(this)}renderVariant(){let e=No(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,Ho(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 Wo="url:",yt=()=>`${c("collection")},${c("products")},${c("recommendations")}`,_u=t=>t instanceof window.Element,Bo=t=>parseInt(t??"",10)||void 0,Uu=t=>t==="COMPLEMENTARY"?"COMPLEMENTARY":"RELATED",De=class{constructor(e){T(this,"root");T(this,"products",[]);T(this,"pageInfo",null);T(this,"collection",null);T(this,"loadToken",0);this.root=e,ht(e,"loading"),e.addEventListener("click",n=>{if(!_u(n.target))return;let r=n.target.closest(c("load-more"));r?.closest(yt())===e&&(n.preventDefault(),Q(r,()=>this.load(!0)))})}$(e){return ut(this.root,e,yt())}options(){let{root:e}=this,n={reverse:p(e,"reverse")==="true"},r=Bo(p(e,"limit"));r&&(n.first=r);let o=p(e,"sort");if(o&&(n.sortKey=o),V(e,"collection"))return n.collection=p(e,"collection")??"",n;let i=p(e,"products")??"";return n.query=i.startsWith(Wo)?new URL(window.location.href).searchParams.get(i.slice(Wo.length))||"":i,n}async loadRecommendations(){let{key:e}=X(this.root,window.location,"recommendations"),n=this.root.closest(c("product"));if(!e&&n&&({key:e}=X(n)),!e)throw new b("No product for recommendations",{code:"NOT_FOUND"});return xe(e,Uu(p(this.root,"intent")))}async load(e=!1){this.loadToken+=1;let n=this.loadToken,r=()=>n!==this.loadToken;try{if(V(this.root,"recommendations")){let o=await this.loadRecommendations();if(r())return;let i=Bo(p(this.root,"limit"));this.products=i?o.slice(0,i):o}else{let o=await Ae({...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(),ht(this.root,"ready"),h("list-ready",{products:this.products,collection:this.collection},this.root)}catch(o){if(r())return;e||ht(this.root,ae(o)?"not-found":"error",o),ae(o)&&V(this.root,"recommendations")||f(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":he(r,e?.descriptionHtml);break;case"image":O(r,e?.image?.url,e?.image?.altText||e?.title);break;case"count":w(r,this.products.length);break}}),this.$(c("list")).forEach(r=>{H(r,this.products,(o,i)=>{o.setAttribute(m("product"),i.handle),o.removeAttribute(m("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"&&I(r,n),o==="list-filled"&&I(r,!n)}),this.$(c("load-more")).forEach(r=>{I(r,!!this.pageInfo?.hasNextPage)}),dt("list")}};var Fu='script[type="application/json"][data-tether-hydrate]',qt=new WeakSet,In=new WeakSet,xt=new Set,bt=new Set,Yo=new WeakMap;function jt(){xt.forEach(t=>{t.isConnected||xt.delete(t)}),bt.forEach(t=>{t.root.isConnected||bt.delete(t)})}function Z(t,e){return[...t.matches?.(e)?[t]:[],...y(t,e)]}function Du(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 Vu(t,{fromUrl:e,raw:n}){e?(qt.add(t),ht(t,"not-found"),h("product-not-found",{key:null,source:n},t)):t.closest(yt())||v(`[${m("product")}] without a value. Bind it to the Shopify handle field, or use "url:handle".`,t)}function Hu(t,e,{fromUrl:n,raw:r},o){let i=ae(o);if(ht(t,i?"not-found":"error",o),!i){f(o,`product ${e}`),h("error",{error:o,context:"product",key:e},t);return}h("product-not-found",{key:e,source:r},t),n?L(`product not found: ${e}`):f(o,`product ${e}`)}function ue(t){if(qt.has(t))return!1;let{key:e,...n}=X(t);if(!e)return Vu(t,n),!1;qt.add(t),xt.add(t);let r={};Yo.set(t,r);let o=()=>Yo.get(t)===r;return it.get(t)?t.setAttribute(m("state"),"updating"):ht(t,"loading"),On(rt(e)).then(s=>{if(!o())return;let u=it.get(t);u?u.update(s):new Fe(t,s),Du(t,s),a.revalidate&&ro(e)&&qu(e)}).catch(s=>{o()&&Hu(t,e,n,s)}),!0}function Jo(){jt(),xt.forEach(t=>{t.getAttribute(m("state"))!=="error"||t.getAttribute(m("error"))==="not-found"||(qt.delete(t),ue(t))})}var Ve=new Set;function qu(t){Ve.size||setTimeout(Gu,0),Ve.add(t)}function ju(t,e){xt.forEach(n=>{let r=it.get(n);if(!r||!n.isConnected)return;let o=X(n).key;o!==t&&o!==e.handle&&o!==e.id||JSON.stringify(r.product)!==JSON.stringify(e)&&r.update(e)})}function Gu(){let t=[...Ve];Ve=new Set,t.forEach(e=>{oo(e).then(n=>{ju(e,n)}).catch(n=>{f(n,`refresh ${e}`)})})}var st=null,On=t=>(st?.add(t),t);function He(){if(!st)return;let t=[...st];Promise.allSettled(t).then(()=>{if(!(!st||t.some(e=>!st?.has(e)))){if(t.length!==st.size){He();return}st=null,document.documentElement.classList.remove(`${a.prefix}-market-pending`)}})}function Ku(t){if(!C(t))return{country:void 0,language:void 0,products:[]};let{products:e}=t,n=Array.isArray(e)?e:[];return{country:U(t.country)??void 0,language:F(t.language)??void 0,products:n.filter(Yr)}}var zo=new WeakSet;function Mn(t=document){Z(t,Fu).forEach(e=>{if(zo.has(e))return;zo.add(e);let n;try{n=JSON.parse(e.textContent)}catch(s){v("bad data-tether-hydrate",s);return}let{country:r,language:o,products:i}=Ku(n);if(Ln(i),r===a.country&&o===a.language){no(i);return}L("hydration skipped: other market"),st||(st=new Set,document.documentElement.classList.add(`${a.prefix}-market-pending`))})}var Qu=()=>`${a.prefix}:market:${a.domain}`,Wu={getItem:t=>vt(t)};function Bu(t){try{return JSON.parse(t)}catch(e){if(e instanceof SyntaxError)return null;throw e}}function Yu(t){if(typeof t!="object"||t===null)return null;let e=U(Reflect.get(t,"country"));if(!e)return null;let n=Reflect.get(t,"locale");return{country:e,language:F(Reflect.get(t,"language"))??void 0,locale:typeof n=="string"&&n?n:void 0}}var zu=t=>Yu(Bu(t));function Rn(t=Wu){let e=t.getItem(Qu());return e?zu(e):null}var Zo={country:void 0,language:void 0,locale:void 0},Nn=!1;function ti(){let t=n=>document.querySelector(`meta[name="${a.prefix}-page-${n}"]`)?.getAttribute("content")||void 0,e=U(t("country"));return e?{country:e,language:F(t("language"))??void 0,locale:t("locale")}:null}async function Ju(){let t=a.markets??{};if(t.detect===!1)return null;if(!t.detect)return t.remember===!1?null:Rn();try{return(await x("markets")).detectMarket(t)}catch(e){return f(e,"markets"),null}}async function ei(t){Zo={country:a.country,language:a.language,locale:a.locale};let e=ti();if(Nn=e!==null,e){a.country=e.country,a.language=e.language,e.locale&&(a.locale=e.locale);return}let n=await Ju();n&&(n.country&&(a.country=n.country),n.language&&(a.language=n.language),n.locale&&!t.locale&&(a.locale=n.locale),L("market",n))}var Xo=(t,e)=>(t??"").toUpperCase()===(e??"").toUpperCase();function ni(){let t=ti(),e=t===null&&Nn;Nn=t!==null;let n=t??(e?Rn()??Zo:null);return!n?.country||Xo(n.country,a.country)&&Xo(n.language,a.language)?null:{country:n.country,language:n.language,locale:n.locale}}function Lt(t,e){return x("markets").then(n=>n.setCountry(t,e))}var ri={"tether.diagnose.min.js":"sha384-GoSabxXrpEUWCpbWmyCt6Eby/SRGcvuJ1c8lQFVaLprF1MbfyZwlfundN9SJzHlS","tether.markets.min.js":"sha384-ZCR9y6ze/DzdKq13UxtHqcuWrujwCRgkMkock5VjQXA6svPWzCbim2/jseMyhsji","tether.search.min.js":"sha384-LdRf9V4s9Z9Jq0JASRj5LoGHLRYj98SnSKldeLxslwGFEuYTFVMYviMDVYORA9sN","tether.extras.min.js":"sha384-xKG8mQaRI9O7rOHGPtEMFCjCa5GJt8v1Pg+aUi1DnKMMCcRhbtXeB66FkiIBValW","tether.account.min.js":"sha384-bsEg4NX+L08ZQv6v4gRa9tvI5FBWjVBUPfgb7MAB9P0htKO+vWs0AetLGfVcHPWU","tether.account-pages.min.js":"sha384-PmV835ZgO/6emk4R8FSrpmAbAL4l9uacnyY6qc4RPauLLwB3GCQzxIKjbhlvKhak","tether.analytics.min.js":"sha384-PCfUr7l9kFJGvf6kowF32Q4j+PYp6VbtG+RAiqU7A1rXqHlSE3mf+NlhiOInGIC6"};function $n(t){return C(t)&&C(t.__core)&&C(t.__parts)}var ii={get"config.ts"(){return[a,Mt,L,Kt,Ye,f,v]},get"client.ts"(){return[Xe,K,D,z,b]},get"dom.ts"(){return[Bt,m,Pe,h,ge,M,p,V,Yt,ct,be,Rt,y,H,c,O,w,I]},get"loader.ts"(){return[ve,rt]},get"selling-plans.ts"(){return[$]},get"status.ts"(){return[se,X]},get"cart.ts"(){return[P]},get"product.ts"(){return[it]},get"collection.ts"(){return[yt]},get"mounting.ts"(){return[bt,xt,qt,ue,jt,Z]},get"market-codes.ts"(){return[U,F]},get"page-market.ts"(){return[Lt]},get"shopify-values.ts"(){return[de]},get"lazy.ts"(){return[x]}},Xu=/\.min\.js(\?|$)/,oi=typeof document>"u"?"":document.currentScript?.getAttribute("src")??"",qe=oi?new URL(oi,document.baseURI).href:"",je=new Map;function Zu(){return a.partsUrl?new URL(a.partsUrl,document.baseURI).href:qe?qe.replace(/[^/]*$/,""):null}function tc(t,e){t.integrity=e,new URL(t.src).origin!==window.location.origin&&(t.crossOrigin="anonymous")}function ec(t,e,n,r){return new Promise((o,i)=>{let s=`${e.replace(/\/?$/,"/")}${n}`,u=document.createElement("script");u.src=s,u.async=!0,tc(u,r),u.onload=()=>{let l=Reflect.get(window,"Tether"),d=$n(l)?l.__parts[t]:void 0;if(d){o(d);return}je.delete(t);let g=$n(l)?"did not register":"can't register: window.Tether is no longer this Tether script's, another script replaced it";i(new Error(`${s} ${g}`))},u.onerror=()=>{je.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 x(t){let e=je.get(t);if(!e){let n=Zu();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=Xu.test(qe)||!qe?".min":"",o=`tether.${t}${r}.js`,i=ri[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=ec(t,n,o,i),je.set(t,e)}return e}var ai=()=>`${a.prefix}:account-hint:${a.domain}`;function si(t){ne(t,"sessionStorage"),ne(t,"localStorage")}function ui(){si(`${a.prefix}:account:${a.domain}`),si(`${a.prefix}:account-login:${a.domain}`)}var ci=t=>t==="in"||t==="expired"||t==="error";var nc=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],rc=()=>[...nc.map(t=>`[${m(t)}]`),`[${m("show")}^="logged-"]`].join(",");function oc(){return!!vt(ai())}function li(t){!a.account||!(Z(t,rc()).length>0||ci(new URLSearchParams(window.location.search).get("account"))||oc())||x("account").then(n=>n.mountAccount(t)).catch(n=>{f(n,"account")})}function R(t){return(...e)=>x("account").then(n=>{let r=n[t];return r(...e)})}var di={login:R("login"),logout:R("logout"),isLoggedIn:R("isLoggedIn"),customer:R("customer"),orders:R("orders"),order:R("order"),updateProfile:R("updateProfile"),addresses:R("addresses"),saveAddress:R("saveAddress"),deleteAddress:R("deleteAddress"),subscriptions:R("subscriptions"),subscriptionAction:R("subscriptionAction"),requestReturn:R("requestReturn"),render:R("render"),mountAccount:R("mountAccount")};var pi=()=>`data-${a.prefix}-key`,mi=t=>t instanceof window.Element;function gi(t){let e=t.closest(`[${pi()}]`),n=e?.getAttribute(pi());return e&&n?{line:e,id:n}:null}function Ge(t,e){t.catch(n=>{f(n,e)})}function ic(t,e){let n=gi(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"),Ge(P.removeLine(o),"cart line");return}let i=sc(e);!i||!P.lines.some(s=>s.id===o)||(t.preventDefault(),Ge(P.changeQuantity(o,i),"cart line"))}function sc(t){return t.closest(c("line-plus"))?1:t.closest(c("line-minus"))?-1:0}function ac(t){let{target:e}=t;if(!mi(e))return;if(e.closest(c("cart-open"))){t.preventDefault(),P.toggle();return}if(e.closest(c("cart-close"))){t.preventDefault(),P.close();return}let n=e.closest(c("cart-clear"));if(n){t.preventDefault(),Q(n,()=>P.clear().catch(o=>{f(o,"cart clear")}));return}let r=e.closest(c("checkout"));if(r){t.preventDefault(),Q(r,()=>P.checkout());return}ic(t,e)}function fi(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),Ge(e,n)}function uc(t){let{target:e}=t;if(!mi(e))return;let n=gi(e);n&&e instanceof window.HTMLInputElement&&e.matches(c("line","quantity"))?fi(n.line,P.updateLine(n.id,parseInt(e.value,10)||0),"cart line"):n&&e instanceof window.HTMLSelectElement&&e.matches(c("line-plan"))?fi(n.line,P.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):cc(e)&&e.matches(c("cart-note"))&&Ge(P.setNote(e.value),"cart note")}var cc=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function lc(t){if(P.isOpen()){if(t.key==="Escape"){P.close();return}yn(t)}}function hi(){document.addEventListener("click",ac),document.addEventListener("change",uc),document.addEventListener("keydown",lc)}var _n=t=>t instanceof window.Element;function dc(t){let e=t.querySelector(c("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function yi(t,e,n){t.classList.toggle("is-invalid",n),n?e?.setAttribute("aria-invalid","true"):e?.removeAttribute("aria-invalid")}async function pc(t,e,n){try{await P.applyDiscount(n),yi(t,e,!1),h("discount-applied",{code:n},t),e&&(e.value="")}catch(r){yi(t,e,!0),r instanceof b&&r.code==="INVALID_DISCOUNT"?h("discount-invalid",{code:n},t):f(r,"discount")}}function fc(t){let{target:e}=t,n=_n(e)?e.closest(c("discount-form")):null;if(!n)return;t.preventDefault();let r=dc(n),o=r?.value.trim();o&&Q(n,()=>pc(n,r,o))}function mc(t){let{target:e}=t;if(!_n(e))return;let n=e.closest(c("discount-form"));n&&(n.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"))}function gc(t){let{target:e}=t,n=_n(e)?e.closest(c("discount-remove")):null;if(!n)return;t.preventDefault();let r=n.closest(c("discount-code"))?.getAttribute(m("discount-code"));r&&P.removeDiscount(r).catch(o=>{f(o,"discount")})}function bi(){document.addEventListener("submit",fc,!0),document.addEventListener("input",mc),document.addEventListener("click",gc)}var Un=t=>x("extras").then(e=>e.addGroup(t)),Fn=t=>{f(t,"extras")};function hc(t){let{target:e}=t,n=e instanceof window.Element?e.closest(c("group-add")):null;n&&(t.preventDefault(),Q(n,()=>Un(n)).catch(Fn))}function yc(t){!a.domain||!t.key?.startsWith(`${a.prefix}:`)||x("extras").then(e=>{e.onStorage(t)}).catch(Fn)}function bc(t){if(!ct(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!a.variantUrl&&!e.hasAttribute(m("variant-url"))||x("extras").then(n=>{n.writeVariantUrl(e,t.detail)}).catch(Fn))}function Pi(){document.addEventListener("click",hc),window.addEventListener("storage",yc),document.addEventListener(`${a.prefix}:variant-changed`,bc)}var Dn=null;function Ei(){Dn=document.body}async function Pc(t){await t.ready();let e=ni();if(!e){Dn!==document.body&&t.mount(document);return}try{await Lt(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){f(n,"country")}t.mount(document)}function Ec(t){document.addEventListener("astro:page-load",()=>{Pc(t).catch(e=>{f(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{Dn=null,t.unmount()})}function wc(t){let{target:e}=t;!(e instanceof window.HTMLSelectElement)||!e.matches(c("country-select"))||e.value&&Lt(e.value).catch(n=>{f(n,"country")})}function Sc(){Jo(),bt.forEach(t=>{t.root.getAttribute(m("state"))==="error"&&t.load()})}function wi(t){a.astro&&Ec(t),document.addEventListener("change",wc),window.addEventListener("online",Sc)}var Ci="0.7.2",Cc=50;function kc(){let t=zt("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var Pt=null,Vn=null,ki=null,Si=!1;function Tc(t){let e=0;return Z(t,yt()).forEach(n=>{if(In.has(n))return;In.add(n),e++;let r=new De(n);bt.add(r),n.addEventListener(`${a.prefix}:list-rendered`,o=>{ct(o,"list-rendered")&&Ke(o.detail.container)}),On(r.load())}),e}function vc(t){Z(t,`${c("country-select")},${c("country-bind")}`).length&&x("markets").then(e=>e.renderCountrySelects(t)).catch(e=>{f(e,"markets")}),li(t),Z(t,c("search")).length&&x("search").then(e=>{e.mountSearch(t)}).catch(e=>{f(e,"search")})}function Ti(t){let e=Tc(t);return Z(t,c("product")).forEach(n=>{ue(n)&&e++}),vc(t),e}function Ke(t=document){if(!Mt())return 0;t===document&&Ei(),jt(),Mn(t.ownerDocument??document);let e=Ti(t);return He(),P.render(),L(`mounted ${e} scope(s)`,t),e}function Ac(t){let e=t.filter(r=>r.isConnected&&!t.some(o=>o!==r&&o.contains(r)));if(!e.length||!Mt())return;jt(),e.forEach(r=>{Mn(r)});let n=e.reduce((r,o)=>r+Ti(o),0);He(),P.render(),L(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function vi(){P.close()}function xc(t){let e=t?.closest(c("product"));return e?it.get(e)??null:null}function Lc(){Si||(Si=!0,hi(),bi(),Pi(),wi({ready:()=>Pt??Promise.resolve(null),mount:Ke,unmount:vi}))}function Ic(){let t=[];ki=t,Bt.forEach(e=>{document.addEventListener(`${a.prefix}:${e}`,n=>t.push(n))}),document.addEventListener("astro:page-load",e=>t.push(e)),x("analytics").then(e=>e.startAnalytics(t)).catch(e=>{f(e,"analytics")})}async function Oc(t){let e=a.country,n=t?.buyerIdentity.countryCode;if(!t||!e||!n||n===e)return t;try{return await P.setBuyerIdentity({countryCode:e},{create:!1})}catch(r){return f(r,"cart country"),t}}function Ai(t={}){return Pt&&!Object.keys(t).length?Pt:(sr({...kc(),...t}),Mt()?(ui(),Lc(),a.observe&&Mc(),a.analytics&&!ki&&Ic(),Pt=ei(t).then(()=>P.init()).then(Oc).then(e=>(h("ready",{cart:e}),Hn)),Pt):(v("TETHER_CONFIG is missing domain or token. Tether is idle."),Pt=Promise.resolve(null),Pt))}function Mc(){if(Vn||typeof MutationObserver>"u")return;let t,e=new Set;Vn=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(),Ac(r)},Cc)}),Vn.observe(document.body,{childList:!0,subtree:!0})}var Rc=t=>x("markets").then(e=>e.detectMarket(t??a.markets)),Nc=()=>x("markets").then(t=>t.getLocalization()),$c=t=>x("diagnose").then(e=>e.diagnose({...t,version:Ci}));function _c(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 Uc={VERSION:Ci,init:Ai,mount:Ke,unmount:vi,get config(){return ir},get ready(){return Pt??Promise.resolve(null)},query:hr,withContext:mr,cart:P,getProduct:rt,getProducts:Ae,getRecommendations:xe,getScope:xc,addGroup:Un,account:di,primeProduct:kt,normalizeProductKey:Ut,clearProductCache:ve,formatMoney:M,imageUrl:pe,plans:dn,TetherError:b,resolveProductKey:X,setCountry:Lt,detectMarket:Rc,getLocalization:Nc,diagnose:$c,on:_c},Fc={__core:ii,__parts:{}},Hn=Object.assign(Uc,Fc),Qf=Hn;function Dc(){Reflect.set(window,"Tether",Hn);let t=zt("TETHER_CONFIG");if(!t||tt(t,"autoMount")===!1||zt("TETHER_INTEGRATION"))return;let e=()=>{Ai().then(()=>Ke(document)).catch(n=>{f(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&Dc();})();
1
+ (()=>{var Gn=Object.defineProperty;var xi=(t,e,n)=>e in t?Gn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Li=(t,e)=>{for(var n in e)Gn(t,n,{get:e[n],enumerable:!0})};var T=(t,e,n)=>xi(t,typeof e!="symbol"?e+"":e,n);var Kn="2026-07";var Ii=/^(\d{4})-(01|04|07|10)$/;function Oi(t){let e=Ii.exec(typeof t=="string"?t:"");return e?{year:Number(e[1]),month:Number(e[2])}:null}var Qn=t=>Oi(t)!==null;function C(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function tt(t,e){return C(t)?t[e]:void 0}var Mi=/^[A-Za-z0-9_.-]+$/,Ri=/^(\$app(:[A-Za-z0-9_-]+)?|[A-Za-z0-9_.-]+)$/,Ni=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,$i=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,_i=/^[A-Za-z_$][\w$]*$/,Wn="https://site.invalid",Ui=new Set(["localhost","127.0.0.1","[::1]"]),Kt=["saved","server","webflow"],Fi=["no-banner","default-banner","custom-banner"],Qt=t=>typeof t=="string"&&t!=="",Di=t=>typeof t=="function";function Yn(t,e){if(typeof t!="string"||!t)return"";let n=t.replace(/^https?:\/\//,"").replace(/\/.*$/,"");return qi(n)?n:(e("domain",t),"")}function zn(t){if(!Qt(t))return!1;try{let e=new URL(t,`${Wn}/`);return e.origin===Wn?!0:e.protocol==="https:"||e.protocol==="http:"&&Ui.has(e.hostname)}catch{return!1}}function Jn(t,e){return t==null||t===""?null:typeof t=="string"&&(zn(t)||Vi(t))?t:(e("partsUrl",t),null)}function Vi(t){if(typeof location>"u")return!1;try{return new URL(t).origin===location.origin}catch{return!1}}function Hi(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 Xn(t,e){if(!Array.isArray(t))return e("embedOrigins",t),[];let n=[],r=t;for(let o of r){let i=Hi(o);i?n.push(i):e("embedOrigin",o)}return n}function Be(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:Ri.test(e)&&Mi.test(n)?{namespace:e,key:n}:null}function Zn(t,e){if(!Array.isArray(t))return e("metafields",t),[];let n=[],r=t;for(let o of r){let i=Be(o);i?n.push(typeof o=="string"?o:i):e("metafield",o)}return n}var It=t=>e=>t(e)?e:void 0,qi=t=>Qt(t)&&Ni.test(t),ji=t=>Qt(t)&&$i.test(t),Gi=t=>typeof t=="boolean"||Qt(t)&&_i.test(t),Gt=It(zn),de=It(Qt),Bn=It(t=>typeof t=="boolean"),tr=It(Di);function Wt(t,e,n,r){if(e==null)return null;if(!C(e))return r(t,e),null;let o={};for(let i in n){let s=e[i];if(s===void 0)continue;let u=n[i](s);u===void 0?r(`${t}.${i}`,s):o[i]=u}return o}var Ki={server:Gt,orderUrl:Gt,subscriptionsUrl:Gt,paymentUrl:Gt,logoutUrl:Gt,locale:de,navigate:tr},Qi="customer accounts need the Worker since 0.7.0: set account.server",Wi={country:de,language:de,locale:de},Bi={detect:t=>{if(typeof t=="boolean")return t;let e=Array.isArray(t)?t:[t];return typeof t=="string"||Array.isArray(t)?Kt.filter(n=>e.includes(n)):void 0},locales:t=>{if(!C(t))return;let e={};for(let[n,r]of Object.entries(t)){let o=Wt(`markets.locales.${n}`,r,Wi,()=>{});o&&(e[n]=o)}return e},cookie:It(ji),remember:Bn,strict:Bn},Yi={consent:t=>Fi.find(e=>e===t),proxy:t=>t!==void 0&&!!t},zi={dataLayer:It(Gi),shopify:t=>typeof t=="boolean"?t:Wt("analytics.shopify",t,Yi,()=>{})??void 0,onEvent:tr};function er(t,e,n){let r=Wt("account",t,Ki,e);if(r===null)return null;let{server:o}=r;return o===void 0?(n(Qi),null):{...r,server:o}}var Ye=(t,e)=>Wt("markets",t,Bi,e),nr=(t,e)=>Wt("analytics",t,zi,e);var Ji=/^[A-Z]{2}$/,Xi=new Set(["XX","T1"]),Zi=new Set(["PT_BR","PT_PT","ZH_CN","ZH_TW"]),ts=/^[A-Z]{2,3}$/;function U(t){let e=(typeof t=="string"?t:"").trim().toUpperCase();return!Ji.test(e)||Xi.has(e)?null:e}function F(t){let e=(typeof t=="string"?t:"").trim().replace("-","_").toUpperCase();if(Zi.has(e))return e;let n=e.split("_")[0]??"";return ts.test(n)?n:null}var at={domain:"",token:"",apiVersion:Kn,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 ir(t){let e=n=>(v(`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?ir(o):o},set:(n,r)=>e(r),deleteProperty:(n,r)=>e(r),defineProperty:(n,r)=>e(r)})}var sr=ir(a),es=/^[a-z][a-z0-9-]*$/,ns=["revalidate","openCartOnAdd","cartFocus","variantUrl","autoMount","observe","astro","debug"],rs=["token","productPath","collectionPath","cartDrawerOpenClass"],os=["imagesFirst","variantsFirst","sellingPlanGroupsFirst","sellingPlansFirst","collectionFirst","retries","maxAge","lowStock","searchDelay"],is=["warningText","formatMoney","onLayoutChange","onCartOpen","onCartClose","onLineEnter","onLineLeave","onValueChange","onError"];function Ot(t,e,n){return e!==void 0&&v(`invalid ${t} ${JSON.stringify(e)}: using ${JSON.stringify(n)}`),n}function K(t,e){v(`invalid ${t} ${JSON.stringify(e)}: ignored`)}function ss(t){for(let e of Object.keys(t))e in at||v(`unknown option ${JSON.stringify(e)}: ignored`)}function as(t,e,n){typeof n=="function"?t[e]=n:n!=null&&K(e,n)}function us(t,e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:Ot(t,e,at[t])}function cs(t,e){return typeof e=="boolean"?e:Ot(t,e,at[t])}function ls(t,e){return typeof e=="string"?e:Ot(t,e,at[t])}function ds(t){if(!(t==null||t==="")){try{if(typeof t=="string"&&Intl.getCanonicalLocales(t).length)return t}catch{}K("locale",t)}}function rr(t,e,n){return n.find(r=>r===e)??Ot(t,e,n[0])}function ps(t){return t==="unstable"?(v('apiVersion "unstable" changes without notice. Pin a dated version (e.g. 2026-07).'),t):Qn(t)?t:Ot("apiVersion",t,at.apiVersion)}function or(t,e,n){if(e==null||e==="")return;let r=n(e);if(r!==null)return r;K(t,e)}function fs(t){ss(t);let e=Yn(t.domain,K),n=typeof t.prefix=="string"&&es.test(t.prefix)?t.prefix:Ot("prefix",t.prefix,at.prefix),r={...at,domain:e,apiVersion:ps(t.apiVersion),country:or("country",t.country,U),locale:ds(t.locale),partsUrl:Jn(t.partsUrl,K),language:or("language",t.language,F),markets:Ye(t.markets,K),analytics:nr(t.analytics,K),account:er(t.account,K,v),prefix:n,storageKey:typeof t.storageKey=="string"&&t.storageKey?t.storageKey:`${n}:cart:${e}`,metafields:Zn(t.metafields??[],K),embedOrigins:Xn(t.embedOrigins??[],K),checkoutTarget:rr("checkoutTarget",t.checkoutTarget,["_self","_blank"]),defaultPurchase:rr("defaultPurchase",t.defaultPurchase,["one-time","subscription"])};for(let o of os)r[o]=us(o,t[o]);for(let o of ns)r[o]=cs(o,t[o]);for(let o of rs)r[o]=ls(o,t[o]);for(let o of is)as(r,o,t[o]);return r}var ze=t=>Ye(t,K);function ar(t={}){let e=fs(t);for(let n of Object.keys(a))n in e||Reflect.deleteProperty(a,n);return Object.assign(a,e)}var Mt=()=>!!(a.domain&&a.token);function L(...t){a.debug&&console.log(`[${a.prefix}]`,...t)}function v(...t){console.warn(`[${a.prefix}]`,...t)}function f(t,e){if(v(e,t instanceof Error&&t.message?t.message:t),!!a.onError)try{a.onError(t,e)}catch(n){v("onError threw",n)}}function ur(t){return t instanceof Error?t.message:String(t)}var b=class extends Error{constructor(n,{status:r,errors:o,userErrors:i,code:s}={}){super(n);T(this,"name","TetherError");T(this,"code");T(this,"status");T(this,"errors");T(this,"userErrors");this.code=s??(r?`HTTP_${r}`:"ERROR"),this.status=r,this.errors=o,this.userErrors=i}};function et(t,e){return typeof e=="function"?e(t):typeof e=="string"?e==="object"?C(t):typeof t===e:ms(e)?Array.isArray(t)&&t.every(n=>et(n,e[0])):C(t)&&Object.entries(e).every(([n,r])=>r===void 0||et(t[n],r))}var ms=t=>Array.isArray(t),D=t=>e=>e===null||et(e,t),z=t=>e=>et(e,t);function Ze(t=a){return`https://${t.domain}/api/${t.apiVersion}/graphql.json`}var fr=/"(?:\\.|[^"\\\n])*"|#[^\n]*/g,gs=/^\s*(?:query|mutation)(?:\s+\w+)?\s*(?:\([^)]*\))?/;function hs(t){return/\bmutation\b/.test(t.replace(fr,""))?"mutation":"query"}function mr(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(fr,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=gs.exec(i);if(!u)return t;let l=u[0].length;return`${t.slice(0,l).trimEnd()} ${o} ${t.slice(l).trimStart()}`}function gr(t,e=a){let n=U(e.country)??void 0,r=F(e.language)??void 0;return mr(t,{country:n,language:r})}var tn=300,ys=500,cr=430,bs=1e3,Xe="quantityAvailable",lr=new Set,Ps=t=>`${t.domain} ${t.apiVersion} ${t.token}`;function Es(t,e,n,{context:r,operation:o}){let i=typeof e=="string"?e:e(n),s=r?mr(i,t):i;return t.maxAge<=0||o==="mutation"?s:`${s} #${Math.floor(Date.now()/(t.maxAge*bs))}`}var ws=t=>new Promise(e=>setTimeout(e,t));function en(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 Ss(t){let e=tt(t,"message"),n=tt(tt(t,"extensions"),"code"),r=typeof e=="string"?e:"";return typeof n=="string"?{message:r,extensions:{code:n}}:{message:r}}function Cs(t){if(!C(t))return null;let{data:e,errors:n}=t;return n==null?{data:e}:Array.isArray(n)?{data:e,errors:n.map(Ss)}:null}function Je(t,e){return t.ok?new b(`Invalid response (${t.status})`,{code:"INVALID_RESPONSE",status:t.status}):new b(en(t.status,e),{status:t.status})}function dr(t,e,n,r){let o=e.map(s=>s.message).filter(Boolean).join(" | "),i=o||"Storefront API error";return t.ok||(i=t.status===401||t.status===403||!o?en(t.status,n):o),new b(i,{status:t.status,errors:e,code:r})}function pr(t,e){if(e==="any")return{kind:"retry",backoffMs:tn};throw new b(`Network error: ${ur(t)}`,{code:"NETWORK"})}function ks(t,e,n,r,o,i,s){if(n.includes(Xe)&&r.some(g=>g.message.includes(Xe)))return{kind:"inventory-refused",error:dr(t,r,e)};let u=r.map(g=>g.extensions?.code);if(i!=="none"&&u.includes("THROTTLED"))return{kind:"retry",backoffMs:ys};let l=u.includes("INTERNAL_SERVER_ERROR");if(i==="any"&&l)return{kind:"retry",backoffMs:tn};let d=t.ok&&(l||s==="mutation"&&o==null);throw dr(t,r,e,d?"SERVER_ERROR":void 0)}async function Ts(t,e,n,r,o,i){let s;try{s=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(k){return pr(k,o)}if(s.status===cr)throw new b("Shopify security rejection (430)",{status:cr});if(o!=="none"&&s.status===429||o==="any"&&s.status>=500)return{kind:"retry",backoffMs:tn};let u;try{u=await s.json()}catch(k){if(k instanceof SyntaxError)throw Je(s,t);return pr(k,o)}let l=Cs(u);if(!l)throw Je(s,t);let{data:d,errors:g=[]}=l;if(g.length)return ks(s,t,e,g,d,o,i);if(!s.ok)throw new b(en(s.status,t),{status:s.status});if(!r(d))throw Je(s,t);return{kind:"data",data:d}}async function hr(t,e,n,r,{context:o=!0,operation:i="query"}={}){if(!t.domain||!t.token)throw new b("Tether is not configured: domain and token are required",{code:"NOT_CONFIGURED"});let s=Ps(t),u=i==="mutation"?"not-run":"any",l=0;for(;;){let d={inventory:!lr.has(s)},g=Es(t,e,d,{context:o,operation:i}),k=l<t.retries?u:"none",N=await Ts(t,g,n,r,k,i);switch(N.kind){case"data":return N.data;case"inventory-refused":if(typeof e=="string"||!d.inventory)throw N.error;L(`the token can't read inventory: ${Xe} is left out from now on`),lr.add(s);break;case"retry":l+=1,L("retry",l),await ws(N.backoffMs*2**l);break}}}function Q(t,e,n,r){return hr(a,t,e,n,r)}var vs=t=>typeof t=="object"&&t!==null;function As(t,e,n={},r){return hr(t,e,n,vs,{...r,operation:hs(e)})}function yr(t,e,n){return As(a,t,e,n)}function br(t,e){if(!t)throw new b(`${e}: empty response`);let n=t.userErrors??[];if(n.length)throw new b(n.map(r=>r.message).join(" | "),{userErrors:n});return t}var m=t=>`${a.prefix}-${t}`,c=(t,e)=>e===void 0?`[${m(t)}]`:`[${m(t)}="${e}"]`,p=(t,e)=>t.getAttribute(m(e)),V=(t,e)=>t.hasAttribute(m(e));function y(t,e){return t?[...t.querySelectorAll(e)]:[]}var ut=(t,e,n)=>y(t,e).filter(r=>r.closest(n)===t),Bt=["product-ready","list-ready","cart-updated","cart-toggled","checkout","search"],Pr=new WeakMap;function Er(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(Er(t,e))}var xs="http://www.w3.org/1999/xhtml",Ls=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"]),Is=new Set(["script","style","template","noscript","textarea","select","title"]),Os=new Set(["style","title","lang","dir","role","align","width","height"]),Ms=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"])]]),Rs=new Set(["href","src","poster","cite"]),Ns=/^(javascript|vbscript|data):/i,$s=/^data:image\/(png|gif|jpeg|webp|avif);/i,_s=new Set(["position","top","right","bottom","left","z-index","-webkit-box-reflect"]),Us=["inset","transform","translate","rotate","scale","offset"],Fs=/\d(?:[sld]?v|cq)(?:w|h|i|b|min|max)\b/i,Ds=/^(?:outline|box-shadow|text-shadow|filter|text-decoration|text-underline-offset|text-stroke)|^(?:border-image|mask-border|mask-box-image)(?:-outset)?$/,wr=40,Vs=new Map([["letter-spacing",{px:4,em:.25}],["word-spacing",{px:4,em:.25}],["text-indent",{px:wr}]]),Sr=/(?<![\w#.-])[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(%|[a-z]+)?/gi,Hs=/(?<![\w-])(?!drop-shadow\(|blur\()[\w-]+\([^()]*\)/g,Cr=/(?:var|calc|min|max|clamp|env|attr)\(/i,qs=/url\(|expression\(|@import/i,js=/[\u0000- ]/g,Gs="allow-scripts allow-same-origin allow-popups allow-presentation",Ks=new Set(["autoplay","encrypted-media","picture-in-picture","fullscreen","clipboard-write","accelerometer","gyroscope","web-share"]),Qs="strict-origin-when-cross-origin",Ws=["https://www.youtube.com","https://www.youtube-nocookie.com","https://player.vimeo.com","https://www.loom.com","https://fast.wistia.net"];function Bs(t,e){return Os.has(e)||e.startsWith("aria-")||(Ms.get(t)?.has(e)??!1)}function Ys(t,e,n){let r=n.replace(js,"");return Ns.test(r)?t==="img"&&e==="src"&&$s.test(r):!0}function kr(t,e){try{return new URL(t,e)}catch{return null}}function zs(t,e,n){let r=t.baseURI,o=kr(r)?.origin??"null";return{origin:o==="null"?null:o,baseUrl:r,styleParser:e,embedOrigins:new Set([...Ws,...n])}}function Js(t,e){let n=kr(t.trim(),e.baseUrl);return n!==null&&n.origin!==e.origin&&e.embedOrigins.has(n.origin)}function Xs(t){let e=t.split(";").map(n=>n.trim().split(/\s+/)[0]?.toLowerCase()??"");return[...new Set(e.filter(n=>Ks.has(n)))].join("; ")}function Zs(t,e){if(_s.has(t)||Us.some(r=>t.startsWith(r))||Fs.test(e))return!0;let n=Vs.get(t);return n?Cr.test(e)||ta(e,n):t.startsWith("margin")&&e.includes("-")}function ta(t,e){return[...t.matchAll(Sr)].some(([n="",r=""])=>{let o=parseFloat(n);if(o>=0)return!1;let i=e[r.toLowerCase()];return i===void 0||-o>i})}function ea(t,e){return Ds.test(t.replace(/^-webkit-/,""))?Cr.test(e)?!0:[...e.replace(Hs,"").matchAll(Sr)].some(([n="",r=""])=>{let o=Math.abs(parseFloat(n));return o!==0&&(r.toLowerCase()!=="px"||o>wr)}):!1}function na(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);(Zs(i,s)||ea(i,s)||qs.test(s))&&n.removeProperty(i)}let o=n.cssText;return e.removeAttribute("style"),o}function ra(t,e){let n=t.localName;for(let i of[...t.attributes]){let s=i.name.toLowerCase(),u=Rs.has(s);Bs(n,s)&&(!u||Ys(n,s,i.value))||t.removeAttribute(i.name)}let r=t.getAttribute("style");if(r===null)return;let o=na(r,e.styleParser);o===""?t.removeAttribute("style"):t.setAttribute("style",o)}function oa(t){if(t.localName==="iframe"){let n=Xs(t.getAttribute("allow")??"");n===""?t.removeAttribute("allow"):t.setAttribute("allow",n),t.setAttribute("sandbox",Gs),t.setAttribute("referrerpolicy",Qs);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 ia(t,e){let n=t.localName,r=t.namespaceURI===xs;if(r&&Is.has(n)){t.remove();return}if(!r||!Ls.has(n)){t.replaceWith(...t.childNodes);return}if(n==="iframe"&&!Js(t.getAttribute("src")??"",e)){t.remove();return}ra(t,e),oa(t)}function Tr(t,e=globalThis.document,n=[]){let r=e.createElement("template");r.innerHTML=t??"";let o=zs(e,r,n);for(let i of[...r.content.querySelectorAll("*")])ia(i,o);return r.content}function pe(t){if(typeof t!="string")return!1;try{return new URL(t).protocol==="https:"}catch{return!1}}function vr(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 Ar(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 xr(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 fe(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 nn(t,e){return t.getAttribute(e)??t.getAttribute(m(e))??t.getAttribute(`data-${e}`)}function Ir(t,e){if(!t||!e)return t;let n=nn(e,"max-width"),r=nn(e,"max-height");return fe(t,{width:n,height:r,crop:n||r?nn(e,"crop"):null})}var Lr=t=>t.replace(/\?.*$/,"");function me(t,e){return!t||!e?!1:Lr(t)===Lr(e)}function sa(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 O(t,e,n){if(!e)return;let r=Ir(e,t);if(t.tagName!=="IMG"){t.style.backgroundImage=sa(r);return}if(me(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 rn=new WeakMap,Yt=t=>!!rn.get(t),on=t=>t.cloneNode(!0);function Or(t){let e=rn.get(t);if(e!==void 0)return e;let n=t.firstElementChild,r=n?on(n):null;return rn.set(t,r),t.replaceChildren(),r}function H(t,e,n){let r=Or(t);if(!r){e.length&&v("repeater without a template child",t);return}t.replaceChildren(),e.forEach((o,i)=>{let s=on(r);n(s,o,i),t.appendChild(s)})}function aa(t,e){let n=()=>{t.remove()};if(!e){n();return}try{e(t,n)}catch(r){f(r,"repeater onLeave"),n()}}function ua(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){f(u,"repeater onEnter")}})}function sn(t,e,n,r,{onEnter:o,onLeave:i}={}){let s=Or(t);if(!s){v("repeater without a template child",t);return}let u=`data-${a.prefix}-key`,l=`data-${a.prefix}-leaving`,d=()=>[...t.children].filter(S=>S.hasAttribute(u)&&!S.hasAttribute(l)),g=new Map(d().map(S=>[S.getAttribute(u),S])),k=[],N=new Set;e.forEach((S,le)=>{let We=String(n(S,le)),Et=g.get(We);Et?g.delete(We):(Et=on(s),Et.setAttribute(u,We),N.add(Et)),r(Et,S,le,N.has(Et)),k.push(Et)});let G=k.filter(S=>!N.has(S)),jn=d().filter(S=>G.includes(S));if(!(jn.length===G.length&&jn.every((S,le)=>S===G[le]))){g.forEach(S=>{S.remove()}),k.forEach(S=>t.appendChild(S));return}ua(t,k,N,o),g.forEach(S=>{S.setAttribute(l,""),S.removeAttribute(u),S.style.pointerEvents="none",S.inert=!0,aa(S,i)})}var Mr="data-tether-seen",un="data-tether-shown",ge="data-tether-prev-display",ca=120;function Rt(t,e){return Ar(a.productPath||"/product",t,e)}function _r(t,e){try{return t()}catch(n){if(n instanceof RangeError)return e;throw n}}function Ur(t,e=a.locale){return t?_r(()=>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):vr(t,a.locale):""}function he(t){return t?_r(()=>new Date(t).toLocaleDateString(a.locale||void 0),""):""}function ye(t,e){t.replaceChildren(Tr(e,t.ownerDocument,a.embedOrigins))}var Fr=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA",Rr=t=>t.tagName==="INPUT";function w(t,e){let n=e==null?"":String(e);Fr(t)?t.value=n:t.textContent=n}var Nr=t=>Fr(t)?t.value:t.textContent;function lt(t,e){let n=Nr(t);if(w(t,e),n!==Nr(t)&&t.hasAttribute(Mr)&&a.onValueChange)try{a.onValueChange(t,n)}catch(r){f(r,"onValueChange")}t.setAttribute(Mr,"1")}function la(t){if(t.hasAttribute(un))return;t.setAttribute(un,""),t.removeAttribute("hidden");let e=t.getAttribute(ge);e!==null?(t.style.display=e,t.removeAttribute(ge)):t.style.display==="none"&&(t.style.display=""),typeof getComputedStyle=="function"&&getComputedStyle(t).display==="none"&&(t.style.display=t.getAttribute(m("display"))||"block")}function I(t,e){if(e){la(t);return}t.removeAttribute(un),!t.hasAttribute(ge)&&t.style.display!=="none"&&t.setAttribute(ge,t.style.display),t.style.display="none"}function be(t,e){t.classList.toggle("is-selected",e),t.setAttribute("aria-pressed",e?"true":"false"),Rr(t)&&(t.type==="radio"||t.type==="checkbox")&&(t.checked=e);let n=t.querySelector('input[type="radio"],input[type="checkbox"]');n&&Rr(n)&&(n.checked=e)}var $r,zt=t=>Reflect.get(window,t);function da(){let t=zt("ScrollTrigger");if(typeof t!="function")return;let e=Reflect.get(t,"refresh");typeof e=="function"&&Reflect.apply(e,t,[])}function dt(t){clearTimeout($r),$r=setTimeout(()=>{try{a.onLayoutChange?a.onLayoutChange(t):da()}catch(e){f(e,"layout-changed")}h("layout-changed",{reason:t})},ca)}function Dr(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 W(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 Pe(t,e){let n=t?p(t,e):null;if(!n)return null;try{return JSON.parse(n)}catch{return v(`invalid JSON in ${m(e)}`,t),null}}function an(t){return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}function Ee(t){return Array.isArray(t)?t.filter(C).map(n=>({key:an(n.key),value:an(n.value)})):C(t)?Object.entries(t).map(([e,n])=>({key:e,value:an(n)})):[]}function Jt(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",Vr={inventory:!0},Hr=t=>t.inventory?"quantityAvailable":"",pt="url altText width height";function pa(t){let e=[];for(let r of t){let o=Be(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 fa=` id name description recurringDeliveries options{name value}priceAdjustments{orderCount adjustmentValue{__typename ... on SellingPlanPercentagePriceAdjustment{adjustmentPercentage}... on SellingPlanFixedAmountPriceAdjustment{adjustmentAmount{${E}}}... on SellingPlanFixedPriceAdjustment{price{${E}}}}}`,ma=` sellingPlan{id}checkoutChargeAmount{${E}}remainingBalanceChargeAmount{${E}}priceAdjustments{price{${E}}compareAtPrice{${E}}perDeliveryPrice{${E}}unitPrice{${E}}}`;function qr(t=a,e=Vr){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}}}${pa(t.metafields)} sellingPlanGroups(first:${t.sellingPlanGroupsFirst}){nodes{name appName options{name values}sellingPlans(first:${t.sellingPlansFirst}){nodes{${fa}}}}}variants(first:${t.variantsFirst}){nodes{id title availableForSale currentlyNotInStock ${Hr(e)} sku barcode selectedOptions{name value}image{${pt}}price{${E}}compareAtPrice{${E}}unitPrice{${E}}sellingPlanAllocations(first:${t.sellingPlansFirst}){nodes{${ma}}}}}}`}function cn(t=Vr){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 ${Hr(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 jr(){return` id handle title description descriptionHtml image{${pt}}seo{title description}`}var pn={};Li(pn,{GID:()=>B,allPlans:()=>$,allocationFor:()=>_,findPlan:()=>$t,hasPlans:()=>ya,planAdjustment:()=>dn,planCheckoutCharge:()=>ln,planPrice:()=>Nt,planSavings:()=>Zt,plansForVariant:()=>ba,toGid:()=>we});var ga=/^(-?)(\d+)(?:\.(\d+))?$/;function Gr(t,e){let n=ga.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 Kr=t=>t.split(".")[1]?.length??0;function Br(t,e){if(t==null||e==null)return!1;let n=Math.max(Kr(t.trim()),Kr(e.trim())),r=Gr(t,n),o=Gr(e,n);return r===null||o===null?!1:r>o}var Qr=2,Wr=new Map;function Yr(t){let e=Wr.get(t);if(e!==void 0)return e;let n=Qr;try{n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??Qr}catch{}return Wr.set(t,n),n}function wt(t){return Math.round(parseFloat(t.amount)*10**Yr(t.currencyCode))}function Xt(t,e){let n=Yr(e);return{amount:(t/10**n).toFixed(n),currencyCode:e}}var ha=100;function we(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 B={product:t=>we(t,"Product"),variant:t=>we(t,"ProductVariant"),sellingPlan:t=>we(t,"SellingPlan")};function $(t){return(t?.sellingPlanGroups?.nodes??[]).flatMap(n=>n.sellingPlans.nodes.map(r=>({...r,group:n})))}function ya(t){return $(t).length>0}function _(t,e){return!t||!e?null:(t.sellingPlanAllocations?.nodes??[]).find(r=>r.sellingPlan.id===e)??null}function ba(t,e){return $(t).filter(n=>_(e,n.id))}function Nt(t,e){let n=_(t,e)?.priceAdjustments[0];return n?.perDeliveryPrice??n?.price??t?.price??null}function ln(t,e){let n=_(t,e);return n?.checkoutChargeAmount??n?.priceAdjustments[0]?.price??t?.price??null}function Zt(t,e){let n=Nt(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=wt(t.price)-wt(n);return{amount:Xt(i,t.price.currencyCode),percentage:Math.round((1-o/r)*ha)}}function dn(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 $t(t,e){if(!e)return null;let n=$(t),r=B.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 nt={amount:"string",currencyCode:"string"},_t={id:"string",handle:"string",title:"string",options:["object"],images:{nodes:["object"]},priceRange:{minVariantPrice:nt,maxVariantPrice:nt},variants:{nodes:[{id:"string",price:nt,selectedOptions:["object"]}]}},fn={nodes:[_t],pageInfo:{hasNextPage:"boolean"}},zr=t=>tt(t,"id")!==""&&tt(t,"handle")!==""&&et(t,_t),Jr=t=>C(t)&&(t.id===void 0||et(t,_t));var Pa={id:"string",quantity:"number",attributes:["object"],cost:{totalAmount:nt,subtotalAmount:nt,amountPerQuantity:nt},merchandise:{id:"string",selectedOptions:["object"],product:"object"}},mn={id:"string",checkoutUrl:"string",totalQuantity:"number",attributes:["object"],discountCodes:["object"],cost:{totalAmount:nt,subtotalAmount:nt},lines:{nodes:[Pa]}};var Ea='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',wa=60,gn=!1,Se=null,Sa=t=>t!==null&&"focus"in t,Xr=t=>y(t,Ea).filter(e=>e.offsetParent!==null||e===document.activeElement),St=()=>y(document,c("cart-drawer")),hn=t=>t.classList.contains(a.cartDrawerOpenClass);function J(){let t=St();return t.length?t.some(hn):gn}function Ce(t){y(document,c("cart-open")).forEach(e=>{e.setAttribute("aria-expanded",String(t))}),St().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)),!hn(e)&&(e.setAttribute("aria-hidden","true"),a.cartFocus&&(e.inert=!0))})}function Ca(t){let e=Xr(t)[0]??t;e===t&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),e.focus({preventScroll:!0})}function ke(){if(J())return;gn=!0;let t=St().filter(n=>p(n,"cart-drawer")!=="manual");t.forEach(n=>{n.inert=!1,n.classList.add(a.cartDrawerOpenClass),n.setAttribute("aria-hidden","false")}),Ce(!0);let[e]=t;a.cartFocus&&e&&(Se=Sa(document.activeElement)?document.activeElement:null,setTimeout(()=>{Ca(e)},wa)),a.onCartOpen?.(t),h("cart-toggled",{open:!0})}function yn(){if(!J())return;gn=!1;let t=St(),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)}),Ce(!1),e&&Se?.isConnected&&Se.focus({preventScroll:!0}),Se=null,a.onCartClose?.(t),h("cart-toggled",{open:!1})}function Zr(){J()?yn():ke()}function bn(t){if(t.key!=="Tab"||!a.cartFocus||!J())return;let e=St().find(hn);if(!e)return;let n=Xr(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 ka=1e4,Ta=6e4,q=new Map,Pn=new Map,Ct=new Set,Te=new Map,no=[],En=!1,te=0,to=t=>t.startsWith("gid://"),Ut=xr;function kt(t){if(!t)return;let e=Promise.resolve(t);q.set(t.handle,e),q.set(t.id,e)}function rt(t){let e=Ut(t);if(!e)return Promise.reject(new b("empty product key",{code:"NOT_FOUND"}));let n=q.get(e);if(n)return n;let r=new Promise((o,i)=>{Pn.set(e,{resolve:o,reject:i}),no.push(e),En||(En=!0,setTimeout(()=>void La(),0))});return q.set(e,r),r}var ve=t=>e=>`${t}${qr(a,e)}`;function va(t){let e=t.filter(to),n=t.filter(u=>!to(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:ve(`query TetherProducts(${r.join(",")}){${o.join(" ")}}`),variables:i,handles:n}}function eo(t,e){let n=Pn.get(t);Pn.delete(t),n&&e(n)}function Aa(t,e){if(e!==te)return;let n=q.get(t);setTimeout(()=>{q.get(t)===n&&q.delete(t)},ka)}function xa(t){if(!C(t))return!1;let{byId:e=[],...n}=t;return et(e,[D(Jr)])&&Object.values(n).every(D(_t))}async function La(){En=!1;let t=te,e=no.splice(0);if(!e.length)return;let{query:n,variables:r,handles:o}=va(e);L("fetch products",e);let i;try{i=await Q(n,r,xa)}catch(l){e.forEach(d=>{eo(d,g=>{t===te&&q.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=>{eo(l,d=>{let g=s.get(l);if(!g){Aa(l,t),d.reject(new b(`Product not found: ${l}`,{code:"NOT_FOUND"}));return}t===te&&(kt(g),Te.set(g.handle,u),Te.set(g.id,u)),d.resolve(g)})})}function Ae(){q.clear(),te+=1,Ct.clear(),Te.clear()}function ro(t){for(let e of t??[])!e.id||!e.handle||Date.now()-(Te.get(e.handle)??0)<Ta&&q.has(e.handle)||(kt(e),Ct.add(e.handle),Ct.add(e.id))}function oo(t){let e=Ut(t);return!e||!Ct.has(e)?!1:(Ct.delete(e),q.get(e)?.then(n=>{Ct.delete(n.handle),Ct.delete(n.id)},Ia),!0)}function Ia(){}function io(t){let e=Ut(t);return e&&q.delete(e),rt(t)}var Oa=z({collection:D({handle:"string",products:fn})}),Ma=z({products:fn}),Ra=z({productRecommendations:D([_t])}),Na=`query TetherCollection($handle:String!,$first:Int!,$after:String,$sortKey:ProductCollectionSortKeys,$reverse:Boolean,$filters:[ProductFilter!]){collection(handle:$handle){${jr()} products(first:$first,after:$after,sortKey:$sortKey,reverse:$reverse,filters:$filters){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}}`,$a="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 xe({collection:t,query:e,first:n=a.collectionFirst,after:r=null,sortKey:o,reverse:i=!1,filters:s}={}){if(t){let l=await Q(ve(Na),{handle:t,first:n,after:r,sortKey:o||void 0,reverse:i,filters:s??void 0},Oa);if(!l.collection)throw new b(`Collection not found: ${t}`,{code:"NOT_FOUND"});let{products:d,...g}=l.collection;return d.nodes.forEach(kt),{collection:g,products:d.nodes,pageInfo:d.pageInfo}}let u=await Q(ve($a),{first:n,after:r,query:e||void 0,sortKey:o||void 0,reverse:i},Ma);return u.products.nodes.forEach(kt),{collection:null,products:u.products.nodes,pageInfo:u.products.pageInfo}}async function Le(t,e="RELATED"){let n=Ut(typeof t=="object"?t?.id:t),r=n?.startsWith("gid://")??!1,i=(await Q(ve(`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},Ra)).productRecommendations??[];return i.forEach(kt),i}var _a=/^image:(\d+)$/,so="metafield:",Ua=/^(rich_text|multi_line_text)_field$/,Fa=["","true","all","*"],ee=t=>t.tagName==="SELECT",Tt=(t,e)=>t.$(`select${e}`).filter(ee);function Da(t,e){let n=e.images.nodes,r=[...t.children].map(i=>i.tagName==="IMG"?i:i.querySelector("img"));!Yt(t)&&r.length===n.length&&r.every((i,s)=>me(i?.getAttribute("src"),n[s]?.url))||H(t,n,(i,s)=>{let u=i.matches(`img,${c("bind","image")}`)?i:y(i,"img")[0]??i;O(u,s.url,s.altText||e.title)})}function Va(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){O(t,u.url,u.altText);return}Ua.test(s.type)&&(t.style.whiteSpace="pre-line"),w(t,s.value)}var Ha=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=>he(t.publishedAt),"min-price":t=>M(t.priceRange.minVariantPrice),"max-price":t=>M(t.priceRange.maxVariantPrice)}));function qa(t,e){let n=(t.getAttribute("exclude")??"").split(",").map(o=>o.trim()).filter(Boolean),r=e.tags.filter(o=>!n.includes(o));H(t,r,(o,i)=>{w(o,i)})}function ja(t,e,n){let r=Ha.get(e);if(r){w(t,r(n));return}switch(e){case"description":ye(t,n.descriptionHtml);break;case"featured-image":O(t,n.featuredImage?.url,n.featuredImage?.altText||n.title);break;case"url":case"link":{let o=Rt(n.handle,n.id);o&&t.setAttribute("href",o),e==="url"&&!t.firstElementChild&&!t.textContent.trim()&&w(t,n.title);break}case"images":Da(t,n);break;case"tags":qa(t,n);break;default:Ga(t,e,n)}}function Ga(t,e,n){let r=_a.exec(e);if(r){let o=n.images.nodes[Number(r[1])-1]??n.featuredImage;O(t,o?.url,o?.altText||n.title)}else e.startsWith(so)&&Va(t,n,e.slice(so.length))}function Ka(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&&V(n,"hide-single")){I(n,!1);return}H(n,o.optionValues,(i,s)=>{i.setAttribute(m("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&&O(l,d.image.previewImage.url,s.name))})})}function Qa(t){let{product:e}=t;Tt(t,c("option")).forEach(n=>{let r=e.options.find(o=>o.name===t.optName(p(n,"option")));if(!r){I(n,!1);return}n.replaceChildren(...r.optionValues.map(o=>new Option(o.name,o.name)))}),Tt(t,c("variant-select")).forEach(n=>{n.replaceChildren(...e.variants.nodes.map(r=>new Option(r.title,r.id)))}),Tt(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(m("one-time-label"))||"One-time purchase";n.replaceChildren(...o?[new Option(i,"")]:[],...r)})}function Wa(t){t.$(c("plan-list")).forEach(e=>{let n=(p(e,"plan-list")??"").trim(),r=Fa.includes(n.toLowerCase())?null:n,o=t.plans.filter(i=>!r||i.group.name===r);H(e,o,(i,s)=>{i.setAttribute(m("plan-value"),s.id),!i.firstElementChild&&!i.querySelector(c("plan-bind"))&&w(i,s.name)})})}function ao(t){t.$(c("bind")).forEach(e=>{ja(e,p(e,"bind")??"",t.product)}),Ka(t),Qa(t),Wa(t)}var uo="Default Title",wn=(t,e)=>e.get(t.id)?.quantity??t.quantity,co=t=>t.split("/").pop()??t;function Ba(t){let e=t.merchandise,n=Rt(e.product.handle,e.product.id);if(!n)return null;let r=new URLSearchParams;r.set("variant",co(e.id));let o=t.sellingPlanAllocation?.sellingPlan.id;return o&&r.set("selling_plan",co(o)),`${n}${n.includes("?")?"&":"?"}${r.toString()}`}var lo=t=>t.merchandise.product.title,po={title:lo,"product-title":lo,"variant-title":t=>t.merchandise.title===uo?"":t.merchandise.title,options:t=>t.merchandise.selectedOptions.filter(e=>e.value!==uo).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)=>wn(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(", ")},fo="attribute:";function Ya(t,e,n){if(Object.hasOwn(po,e))return po[e]?.(t,n);if(!e.startsWith(fo))return;let r=e.slice(fo.length);return t.attributes.find(o=>o.key===r)?.value??""}function za(t,e,n){let r=$(n),o=!n.requiresSellingPlan&&p(t,"line-plan")!=="subscription-only",i={value:"",label:t.getAttribute(m("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??"",I(t,r.length>0)}function Ja(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",Br(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&&I(u,d)})}function Xa(t,e,n){let r=e.merchandise;t.setAttribute(m("line-id"),e.id),y(t,c("line")).forEach(i=>{let s=p(i,"line")??"";if(s==="image"){O(i,r.image?.url??r.product.featuredImage?.url,r.product.title);return}if(s==="url"){let l=Ba(e);l&&i.setAttribute("href",l);return}let u=Ya(e,s,n);u!==void 0&&lt(i,u)}),Ja(t,e,n),y(t,c("line-plan")).filter(ee).forEach(i=>{rt(r.product.handle).then(s=>{za(i,e,s)}).catch(s=>{f(s,"line plan options")})})}function Za(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"))||I(i,u)}),y(document,c("checkout")).forEach(i=>{i.classList.toggle("is-disabled",!n),i.setAttribute("aria-disabled",String(!n))})}function tu(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=>{H(e,t?.discountCodes??[],(n,r)=>{n.setAttribute(m("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 mo(t){let{cart:e}=t,n=r=>e?M(e.cost[r]):"";Ce(J()),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"))}),Za(e,t),y(document,c("cart-warning")).forEach(r=>{lt(r,[...new Set(t.warnings.map(o=>o.message))].join(" "))}),tu(e),y(document,c("cart-lines")).forEach(r=>{sn(r,e?.lines.nodes??[],o=>o.id,(o,i)=>{Xa(o,i,t)},{onEnter:a.onLineEnter,onLeave:a.onLineLeave})}),e&&dt("cart")}function go(t){y(document,c("cart-count")).forEach(e=>{/^\s*0?\s*$/.test(e.textContent)&&(e.textContent=String(t))})}function vt(t,e="localStorage"){try{return window[e].getItem(t)}catch{return null}}function Ie(t,e,n="localStorage"){try{window[n].setItem(t,e)}catch{}}function ne(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var ho=/^gid:\/\/shopify\/Cart\/[\w-]+(\?key=[\w-]+)?$/;var j={kind:"unknown"},Ft=[],At=new Map,Oe=()=>j;function A(){switch(j.kind){case"ready":case"error":return j.cart;case"unknown":case"empty":return null}}var bo=()=>Ft,Sn=t=>t?{kind:"ready",cart:t}:{kind:"empty"},Po=()=>`${a.storageKey}:seen`;function ft(){let t=vt(a.storageKey);return t?ho.test(t)?t:(mt(),null):null}function mt(){ne(a.storageKey)}function Cn(t){j=Sn(t),t&&Ie(a.storageKey,t.id)}function re(){mo({cart:A(),warnings:Ft,pending:At,failed:j.kind==="error"})}function oe(t){re(),h("cart-updated",{cart:A(),reason:t})}function Y(t,e){return Cn(t),Ie(Po(),`${Date.now()}|${t?.totalQuantity??0}`),oe(e),t}function ie(t){j=t.kind==="loaded"?Sn(t.cart):{kind:"error",error:t.error,cart:null},oe("load")}function eu(){let t=vt(Po())?.split("|")[1]??"",e=Number(t);return/^\d+$/.test(t)&&Number.isSafeInteger(e)?e:null}function Eo(){if(j.kind!=="unknown")return;let t=eu();t!==null&&go(t)}function wo(t){Ft=t.filter((e,n)=>t.findIndex(r=>r.message===e.message)===n).map(e=>({...e,message:a.warningText?.(e)||e.message})),Ft.length&&h("cart-warning",{warnings:Ft})}var yo=()=>{};function nu(){let t=Promise.resolve();return e=>{let n=t.then(e);return t=n.then(yo,yo),n}}var ru=nu();function So(t){return ru(t).then(e=>(j.kind==="error"&&(j=Sn(j.cart),re()),e),e=>{throw j={kind:"error",error:e,cart:A()},re(),h("cart-error",{error:e}),e})}var kn=t=>wn(t,At),ou=()=>({open:J(),count:A()?.totalQuantity??0,loaded:j.kind!=="unknown",warnings:[...Ft]});function Co(t){let e=["cart-updated","cart-toggled"].map(r=>`${a.prefix}:${r}`),n=()=>{t(A(),ou())};return e.forEach(r=>{document.addEventListener(r,n)}),n(),()=>{e.forEach(r=>{document.removeEventListener(r,n)})}}var iu=/does not exist|not found|invalid id/i,su=t=>z({[t]:D({cart:D(mn)})});function Me(t){return t instanceof b?t.userErrors?.some(e=>e.field?.[0]==="cartId")?!0:(t.errors??[]).some(e=>iu.test(e.message)):!1}function To(t){if(!(t instanceof b))return!1;let{code:e,status:n=0}=t;return e==="NETWORK"||e==="INVALID_RESPONSE"||e==="SERVER_ERROR"||n>=500}function vo(t,e=1,n={}){let r=typeof t=="object"&&t!==null?t:{...n,quantity:e,...t==null?{}:{variantId:t}},o=B.variant(r.merchandiseId||r.variantId||r.id);if(!o)throw new b("add(): variantId is required");let i=parseInt(String(r.quantity??1),10),s={merchandiseId:o,quantity:Math.max(1,i||1)},u=B.sellingPlan(r.sellingPlanId||r.sellingPlan);u&&(s.sellingPlanId=u);let l=Jt(r.attributes);return l.length&&(s.attributes=l),s}function au(t,e,n){return r=>`mutation Tether_${t}(${e}){${t}(${n}){cart{...TetherCart}userErrors{field message}warnings{code message target}}}${cn(r)}`}async function Ao(t,e,n,r){let o=await Q(au(t,e,n),r,su(t),{operation:"mutation"}),i=br(o[t],t);return wo(i.warnings??[]),i.cart}function ko(t){let e=a.country?{buyerIdentity:{countryCode:a.country},...t}:t;return Ao("cartCreate","$input: CartInput!","input: $input",{input:e})}async function gt({name:t,args:e,inner:n,variables:r,createInput:o}){let i=ft();if(!i)return o?ko(o):null;try{return await Ao(t,`$cartId: ID!, ${e}`,`cartId: $cartId, ${n}`,{...r,cartId:i})}catch(s){if(!Me(s)||(mt(),!o))throw s;return L("cart expired, creating a new one"),ko(o)}}async function Tn(t){return(await Q(n=>`query TetherCart($id:ID!){cart(id:$id){...TetherCart}}${cn(n)}`,{id:t},z({cart:D(mn)}))).cart}async function xo(t){return(await Q("query TetherCheckout($id:ID!){cart(id:$id){checkoutUrl}}",{id:t},z({cart:D({checkoutUrl:"string"})}))).cart?.checkoutUrl??null}function Lo(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?B.sellingPlan(n.sellingPlanId):null),n.attributes&&(r.attributes=Jt(n.attributes));let o=n.merchandiseId||n.variantId;return o&&(r.merchandiseId=B.variant(o)),r}var vn=t=>gt({name:"cartLinesUpdate",args:"$lines: [CartLineUpdateInput!]!",inner:"lines: $lines",variables:{lines:t},createInput:null}),Re=t=>gt({name:"cartLinesRemove",args:"$lineIds: [ID!]!",inner:"lineIds: $lineIds",variables:{lineIds:t},createInput:null}),Io=(t,e)=>e>0?vn([{id:t,quantity:e}]):Re([t]);var An=null;function Oo(t){An=t}var uu=t=>xo(t).then(e=>({kind:"url",url:e}),e=>({kind:"failed",error:e}));async function cu(){if(!An)return null;try{let t=await An();return t&&`${t}${t.includes("?")?"&":"?"}logged_in=true`}catch(t){return f(t,"account checkout"),null}}async function lu(t){let e=uu(t),n=await cu();if(n)return n;let r=await e;if(r.kind==="failed")throw r.error;if(!r.url)throw new b("No checkoutUrl (cart empty or expired)");return r.url}function du(t){try{t.opener=null}catch{}}async function Mo(t=a.checkoutTarget){let e=ft(),n=A();if(!e||n&&!n.totalQuantity)return null;let r=t==="_blank"?window.open("","_blank"):null;r&&du(r);try{let o=await lu(e);if(!pe(o))throw new b("The checkout URL is not https: not opened");return h("checkout",{url:o,cart:A()}),r&&!r.closed?r.location.href=o:window.location.href=o,o}catch(o){return r?.close(),f(o,"checkout failed"),null}}var Ne=()=>A()?.lines.nodes??[];async function pu(){let t=ft();if(t)try{let e=await Tn(t);e||mt(),Y(e,"load")}catch(e){f(e,"cart reload after a failed change")}}function ot(t){return So(()=>t().catch(async e=>{throw To(e)&&await pu(),e}))}function fu(t,e){let n=Ne().find(u=>u.id===t);if(!n)return Promise.resolve(A());let r=Math.max(0,kn(n)+e),o={quantity:r};At.set(t,o),oe("pending");let i=()=>At.get(t)===o;return ot(async()=>{if(!i())return A();if(Ne().find(d=>d.id===t)?.quantity===r)return A();let l=await Io(t,r);return i()?Y(l,r>0?"update":"remove"):(Cn(l),l)}).finally(()=>{i()&&(At.delete(t),oe("settled"))})}function mu(t){let e=(A()?.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 gu(t){let e=new Map((A()?.attributes??[]).map(n=>[n.key,n.value]));return Jt(t).forEach(n=>e.set(n.key,n.value)),[...e].filter(([,n])=>n!=="").map(([n,r])=>({key:n,value:r}))}async function hu(){let t=ft();if(!t)return ie({kind:"loaded",cart:null}),null;Eo();try{let e=await Tn(t);e||mt(),ie({kind:"loaded",cart:e})}catch(e){f(e,"cart load failed"),Me(e)&&mt(),ie({kind:"failed",error:e})}return A()}var P={init:hu,id:ft,get status(){return Oe()},get state(){return A()},get lines(){return[...Ne()]},get count(){return A()?.totalQuantity??0},get loaded(){return Oe().kind!=="unknown"},get lastError(){let t=Oe();return t.kind!=="error"?null:t.error instanceof Error?t.error:new Error(String(t.error))},get warnings(){return[...bo()]},get pendingQty(){return At},setCheckoutResolver:Oo,forgetSaved(){mt(),ie({kind:"loaded",cart:null})},render:re,subscribe:Co,add(t,e=1,n={}){let r=(Array.isArray(t)?t:[t]).map(o=>vo(o,e,n));return ot(async()=>{let o=await gt({name:"cartLinesAdd",args:"$lines: [CartLineInput!]!",inner:"lines: $lines",variables:{lines:r},createInput:{lines:r}});if(!o)throw new b("Shopify answered the add without a cart");return Y(o,"add"),h("added",{cart:o,lines:r}),a.openCartOnAdd&&ke(),o})},updateLine(t,e){let n=typeof e=="number"?e:e.quantity;if(n!==void 0&&n<=0)return P.removeLine(t);let r=Lo(t,e);return ot(async()=>Y(await vn([r]),"update"))},changeQuantity:fu,quantityOf:kn,removeLine(t){let e=Array.isArray(t)?t:[t];return ot(async()=>Y(await Re(e),"remove"))},clear(){return ot(async()=>{let t=Ne().map(e=>e.id);return t.length?Y(await Re(t),"remove"):A()})},setNote(t){let e={note:t??""};return ot(async()=>Y(await gt({name:"cartNoteUpdate",args:"$note: String!",inner:"note: $note",variables:e,createInput:e}),"note"))},setAttributes(t){return ot(async()=>{let e={attributes:gu(t)},n=await gt({name:"cartAttributesUpdate",args:"$attributes: [AttributeInput!]!",inner:"attributes: $attributes",variables:e,createInput:e});return Y(n,"attributes")})},setDiscountCodes(t){return ot(async()=>{let e={discountCodes:mu(t)},n=await gt({name:"cartDiscountCodesUpdate",args:"$discountCodes: [String!]!",inner:"discountCodes: $discountCodes",variables:e,createInput:e});return Y(n,"discount")})},async applyDiscount(t){let e=await P.setDiscountCodes(o=>[...new Set([...o,t])]),n=t.toLowerCase();if((e?.discountCodes??[]).find(o=>o.code.toLowerCase()===n)?.applicable)return e;try{await P.removeDiscount(t)}catch(o){f(o,"removing a discount code Shopify refused")}throw new b(`Discount code not valid: ${t}`,{code:"INVALID_DISCOUNT"})},removeDiscount(t){let e=t.toLowerCase();return P.setDiscountCodes(n=>n.filter(r=>r.toLowerCase()!==e))},setBuyerIdentity(t,{create:e=!0}={}){return ot(async()=>{let n=await gt({name:"cartBuyerIdentityUpdate",args:"$buyerIdentity: CartBuyerIdentityInput!",inner:"buyerIdentity: $buyerIdentity",variables:{buyerIdentity:t},createInput:e?{buyerIdentity:t}:null}).catch(r=>{if(e||!Me(r))throw r;return null});return Y(n,"buyer-identity")})},checkout:Mo,drawers:St,isOpen:J,open:ke,close:yn,toggle:Zr};var yu=100,bu=(t,e)=>Xt(wt(t)*e,t.currencyCode),Vt=t=>Object.fromEntries(t.selectedOptions.map(e=>[e.name,e.value]));function Pu(t,e){return t.variants.nodes.find(n=>n.selectedOptions.every(r=>e[r.name]===r.value))??null}function Ro(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 Dt=t=>t.kind==="subscription"?t.planId:t.offeredPlanId;function $e(t,e){return t.kind==="subscription"&&_(e,t.planId)?t:{kind:"one-time"}}function _e(t,e,n,r){let o=$(t),i=o.find(u=>u.id===r)??o[0];if(!i)return{kind:"one-time",offeredPlanId:null};let s=_(e,i.id)?i:o.find(u=>_(e,u.id))??i;return t.requiresSellingPlan||n==="subscription"?{kind:"subscription",planId:s.id}:{kind:"one-time",offeredPlanId:s.id}}function No(t,{variant:e,sellingPlan:n,defaultPlan:r,defaultPurchase:o}){let i=t.variants.nodes,s=B.variant(e),u=i.find(k=>k.id===s)??i.find(k=>k.availableForSale)??i[0]??null,l=$t(t,n),d=l??$t(t,r),g=l||o==="subscription"?"subscription":"one-time";return{selected:u?Vt(u):{},purchase:_e(t,u,g,d?.id??null)}}function Eu(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 $o(t,e,n){let r=Pu(t,e.selected),o=r??t.variants.nodes[0];if(!o)return null;let i=_e(t,o,e.purchase.kind,Dt(e.purchase)),s=Dt(i),u=$(t),l=$e(i,o),d=l.kind==="subscription"?_(o,l.planId):null,g=d?Nt(o,s)??o.price:o.price,k=d?.priceAdjustments[0]?.compareAtPrice??o.compareAtPrice,N={line:l,subscriptionAvailable:u.some(G=>_(o,G.id)),compareAtPrice:k&&parseFloat(k.amount)>parseFloat(g.amount)?k:null,savings:Zt(o,s)};return{...N,variant:o,selected:r?e.selected:Vt(o),purchase:i,plan:u.find(G=>G.id===s)??null,quantity:e.quantity,price:g,show:Eu(o,n,t.variants.nodes.length,N,t.requiresSellingPlan)}}function _o(t,e){let{variant:n,plan:r,price:o,compareAtPrice:i,quantity:s}=t,u=Dt(t.purchase),l=G=>bu(G,Math.max(1,s)),N={price:()=>e.money(o),"total-price":()=>e.money(l(o)),"one-time-price":()=>e.money(n.price),"subscription-price":()=>e.money(u?Nt(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"?ln(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))*yu)}%`:"0%","discount-amount":()=>i?e.money(Xt(wt(i)-wt(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(N))}function Uo(t,e,n,r){let i={name:()=>n?.name,option:()=>(n?.options??[]).map(s=>s.value).join(", "),description:()=>n?.description,price:()=>r.money(Nt(t,e)),savings:()=>r.percent(Zt(t,e).percentage),"savings-amount":()=>r.money(Zt(t,e).amount),adjustment:()=>{let s=dn(n);return s?s.type==="percentage"?`${s.value}%`:r.money(s.value):""}};return new Map(Object.entries(i))}function xn(t){try{return decodeURIComponent(t)}catch(e){if(e instanceof URIError)return t;throw e}}var Fo="url:";function X(t,e=window.location,n="product"){let r=(p(t,n)??"").trim();if(!r.toLowerCase().startsWith(Fo))return{key:r||null,fromUrl:!1,raw:r};let o=r.slice(Fo.length).trim(),i;if(o.toLowerCase()==="path"){let s=e.pathname.split("/").filter(Boolean),u=s[s.length-1];i=u===void 0?null:xn(u)}else i=new URLSearchParams(e.search).get(o||"handle");return{key:i?.trim()||null,fromUrl:!0,raw:r}}var Ue=["loading","ready","error","not-found"],wu=t=>Ue.some(e=>e===t),Do=t=>typeof t=="object"&&t!==null&&"code"in t?t.code:void 0,ae=t=>Do(t)==="NOT_FOUND",se=()=>["product","collection","products","recommendations"].map(t=>c(t)).join(","),Vo=(t,e)=>t===e||t.parentElement?.closest(se())===e;function Su(t){let e=Do(t);return typeof e=="string"&&e?e:"error"}function ht(t,e,n){let r=e==="not-found",o=e==="error"||r;t.setAttribute(m("state"),r?"error":e),o?t.setAttribute(m("error"),r?"not-found":Su(n)):t.removeAttribute(m("error")),ut(t,c("show"),se()).forEach(i=>{let s=p(i,"show");wu(s)&&I(i,s===e)}),o&&ut(t,c("add-to-cart"),se()).forEach(i=>{i.classList.add("is-disabled"),i.setAttribute("aria-disabled","true"),"disabled"in i&&(i.disabled=!0)})}var Ho={money:M,percent:Ur},Cu=t=>t.tagName==="INPUT";function Ln(t){let e=y(t,c("add-label"))[0]??t,n=e.dataset.tetherLabel??(Cu(e)?e.value:e.textContent);return e.dataset.tetherLabel=n,{label:e,original:n}}function ku(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")??"";be(s,e.selected[i]===u);let l=!Ro(n,e.selected,i,u);s.classList.toggle("is-unavailable",l),s.setAttribute("data-unavailable",l?"true":"false")})}),Tt(t,c("option")).forEach(o=>{o.value=r(p(o,"option"))}),Tt(t,c("variant-select")).forEach(o=>{o.value=e.variant.id})}function Tu(t,e){let{variant:n,purchase:r,line:o}=e;t.$(c("purchase")).forEach(i=>{if(ee(i)){i.value=r.kind;return}let s=p(i,"purchase");be(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")??"";be(i,o.kind==="subscription"&&s===o.planId),i.classList.toggle("is-unavailable",!_(n,s));let u=t.plans.find(d=>d.id===s),l=Uo(n,s,u,Ho);y(i,c("plan-bind")).forEach(d=>{let g=l.get(p(d,"plan-bind")??"");g&&w(d,g())})}),Tt(t,c("plan")).forEach(i=>{i.value=o.kind==="subscription"?o.planId:""})}function vu(t,e){let n=new Map(Object.entries(e.show));Ue.forEach(r=>n.set(r,r==="ready")),t.$(c("show")).forEach(r=>{let o=p(r,"show")??"",i=n.get(o);i!==void 0&&(Ue.some(s=>s===o)&&!Vo(r,t.root)||I(r,i))})}function Au(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}=Ln(r),l=u;e.line.kind==="subscription"&&i&&(l=i),n&&o&&(l=o),r.getAttribute("aria-busy")!=="true"&&w(s,l)})}function qo(t,e){let{variant:n}=e,{product:r}=t,o=_o(e,Ho);t.$(c("bind")).forEach(i=>{let s=p(i,"bind")??"";if(s==="variant-image"){O(i,n.image?.url||r.featuredImage?.url,n.image?.altText||r.title);return}let u=o.get(s);u&&w(i,u())}),ku(t,e),Tu(t,e),vu(t,e),t.root.classList.toggle("is-subscription",e.line.kind==="subscription"),t.root.setAttribute(m("purchase-mode"),e.line.kind),Au(t,e)}var Go=()=>c("product"),xu=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA",jo=t=>t instanceof window.Element;function Ht(t,e,n){let r=e.closest(n);return r?.closest(Go())===t.root?r:null}function Lu(t,e){let{label:n,original:r}=Ln(e),o=p(e,"adding-text");W(e,async()=>{o&&w(n,o);try{await t.addToCart()}catch(i){f(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=>{f(i,"add to cart render")})}function Iu(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(Ko(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(),Lu(t,d))}var Ko=t=>t==="subscription"?"subscription":"one-time";function Ou(t,e){let n=xu(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(Ko(n)):e.matches(c("qty"))&&t.setQuantity(n)}function Qo(t){t.root.addEventListener("click",e=>{jo(e.target)&&Iu(t,e,e.target)}),t.root.addEventListener("change",e=>{let{target:n}=e;jo(n)&&n.closest(Go())===t.root&&Ou(t,n)})}var it=new WeakMap,Mu=()=>c("product"),Fe=new Map;function In(t){t.forEach(e=>{Fe.has(e.handle)||Fe.set(e.handle,e.options.map(n=>n.name))})}var Wo=t=>t.tagName==="INPUT",Ru=t=>t.tagName==="INPUT"||t.tagName==="SELECT"||t.tagName==="TEXTAREA";function Nu(t){return Wo(t)&&t.type==="checkbox"?t.checked?t.value&&t.value!=="on"?t.value:"Yes":null:Wo(t)&&t.type==="radio"?t.checked?t.value:null:Ru(t)&&t.value||null}var De=class{constructor(e,n){T(this,"root");T(this,"product");T(this,"plans");T(this,"selected");T(this,"purchase");T(this,"variant");T(this,"quantity");this.root=e,this.product=n,this.plans=$(n);let r=new URLSearchParams(window.location.search),o=No(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=V(e,"quantity")?Math.max(0,parseInt(p(e,"quantity")??"",10)||0):1,it.set(e,this),e.setAttribute(m("state"),"ready"),e.removeAttribute(m("error")),this.renderProduct(),Qo(this),this.renderVariant(),Dr(e,"product"),dt("product"),h("product-ready",{product:n,scope:this},e)}update(e){let n=this.variant?.id;this.product=e,this.plans=$(e);let r=e.variants.nodes.find(o=>o.id===n);r&&(this.selected=Vt(r)),this.root.setAttribute(m("state"),"ready"),this.root.removeAttribute(m("error")),this.renderProduct(),this.renderVariant(),dt("product"),h("product-updated",{product:e,scope:this},this.root)}$(e){let n=ut(this.root,e,Mu());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=(Fe.get(this.product.handle)??[]).indexOf(e);return n[r]?.name??e}get plan(){let e=Dt(this.purchase);return this.plans.find(n=>n.id===e)??null}get subscriptionAvailable(){return this.plans.some(e=>_(this.variant,e.id))}get isSubscription(){return $e(this.purchase,this.variant).kind==="subscription"}getLine(){if(!this.variant)return null;let e={merchandiseId:this.variant.id,quantity:this.quantity},n=$e(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=Ee(Pe(this.root,"line-attributes")),n=this.$(c("line-attribute")).flatMap(r=>{let o=Nu(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,Vt(u))}this.selected=i,this.renderVariant()}selectVariant(e){let n=this.product.variants.nodes.find(r=>r.id===B.variant(e));n&&(this.selected=Vt(n),this.renderVariant())}setPurchase(e){let n=_e(this.product,this.variant,e,Dt(this.purchase));n.kind!==this.purchase.kind&&(this.purchase=n,this.renderVariant())}selectPlan(e){let n=$t(this.product,e);n&&(this.purchase={kind:"subscription",planId:n.id},this.renderVariant())}setQuantity(e){let n=V(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 P.add(e);return h("product-added",{product:this.product,variant:this.variant,line:e},this.root),n}renderProduct(){let{product:e}=this;Fe.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))&&In([e]),ao(this)}renderVariant(){let e=$o(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,qo(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 Bo="url:",yt=()=>`${c("collection")},${c("products")},${c("recommendations")}`,$u=t=>t instanceof window.Element,Yo=t=>parseInt(t??"",10)||void 0,_u=t=>t==="COMPLEMENTARY"?"COMPLEMENTARY":"RELATED",Ve=class{constructor(e){T(this,"root");T(this,"products",[]);T(this,"pageInfo",null);T(this,"collection",null);T(this,"loadToken",0);this.root=e,ht(e,"loading"),e.addEventListener("click",n=>{if(!$u(n.target))return;let r=n.target.closest(c("load-more"));r?.closest(yt())===e&&(n.preventDefault(),W(r,()=>this.load(!0)))})}$(e){return ut(this.root,e,yt())}options(){let{root:e}=this,n={reverse:p(e,"reverse")==="true"},r=Yo(p(e,"limit"));r&&(n.first=r);let o=p(e,"sort");if(o&&(n.sortKey=o),V(e,"collection"))return n.collection=p(e,"collection")??"",n;let i=p(e,"products")??"";return n.query=i.startsWith(Bo)?new URL(window.location.href).searchParams.get(i.slice(Bo.length))||"":i,n}async loadRecommendations(){let{key:e}=X(this.root,window.location,"recommendations"),n=this.root.closest(c("product"));if(!e&&n&&({key:e}=X(n)),!e)throw new b("No product for recommendations",{code:"NOT_FOUND"});return Le(e,_u(p(this.root,"intent")))}async load(e=!1){this.loadToken+=1;let n=this.loadToken,r=()=>n!==this.loadToken;try{if(V(this.root,"recommendations")){let o=await this.loadRecommendations();if(r())return;let i=Yo(p(this.root,"limit"));this.products=i?o.slice(0,i):o}else{let o=await xe({...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(),ht(this.root,"ready"),h("list-ready",{products:this.products,collection:this.collection},this.root)}catch(o){if(r())return;e||ht(this.root,ae(o)?"not-found":"error",o),ae(o)&&V(this.root,"recommendations")||f(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":ye(r,e?.descriptionHtml);break;case"image":O(r,e?.image?.url,e?.image?.altText||e?.title);break;case"count":w(r,this.products.length);break}}),this.$(c("list")).forEach(r=>{H(r,this.products,(o,i)=>{o.setAttribute(m("product"),i.handle),o.removeAttribute(m("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"&&I(r,n),o==="list-filled"&&I(r,!n)}),this.$(c("load-more")).forEach(r=>{I(r,!!this.pageInfo?.hasNextPage)}),dt("list")}};var Uu='script[type="application/json"][data-tether-hydrate]',qt=new WeakSet,On=new WeakSet,xt=new Set,bt=new Set,zo=new WeakMap;function jt(){xt.forEach(t=>{t.isConnected||xt.delete(t)}),bt.forEach(t=>{t.root.isConnected||bt.delete(t)})}function Z(t,e){return[...t.matches?.(e)?[t]:[],...y(t,e)]}function Fu(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 Du(t,{fromUrl:e,raw:n}){e?(qt.add(t),ht(t,"not-found"),h("product-not-found",{key:null,source:n},t)):t.closest(yt())||v(`[${m("product")}] without a value. Bind it to the Shopify handle field, or use "url:handle".`,t)}function Vu(t,e,{fromUrl:n,raw:r},o){let i=ae(o);if(ht(t,i?"not-found":"error",o),!i){f(o,`product ${e}`),h("error",{error:o,context:"product",key:e},t);return}h("product-not-found",{key:e,source:r},t),n?L(`product not found: ${e}`):f(o,`product ${e}`)}function ue(t){if(qt.has(t))return!1;let{key:e,...n}=X(t);if(!e)return Du(t,n),!1;qt.add(t),xt.add(t);let r={};zo.set(t,r);let o=()=>zo.get(t)===r;return it.get(t)?t.setAttribute(m("state"),"updating"):ht(t,"loading"),Mn(rt(e)).then(s=>{if(!o())return;let u=it.get(t);u?u.update(s):new De(t,s),Fu(t,s),a.revalidate&&oo(e)&&Hu(e)}).catch(s=>{o()&&Vu(t,e,n,s)}),!0}function Xo(){jt(),xt.forEach(t=>{t.getAttribute(m("state"))!=="error"||t.getAttribute(m("error"))==="not-found"||(qt.delete(t),ue(t))})}var He=new Set;function Hu(t){He.size||setTimeout(ju,0),He.add(t)}function qu(t,e){xt.forEach(n=>{let r=it.get(n);if(!r||!n.isConnected)return;let o=X(n).key;o!==t&&o!==e.handle&&o!==e.id||JSON.stringify(r.product)!==JSON.stringify(e)&&r.update(e)})}function ju(){let t=[...He];He=new Set,t.forEach(e=>{io(e).then(n=>{qu(e,n)}).catch(n=>{f(n,`refresh ${e}`)})})}var st=null,Mn=t=>(st?.add(t),t);function qe(){if(!st)return;let t=[...st];Promise.allSettled(t).then(()=>{if(!(!st||t.some(e=>!st?.has(e)))){if(t.length!==st.size){qe();return}st=null,document.documentElement.classList.remove(`${a.prefix}-market-pending`)}})}function Gu(t){if(!C(t))return{country:void 0,language:void 0,products:[]};let{products:e}=t,n=Array.isArray(e)?e:[];return{country:U(t.country)??void 0,language:F(t.language)??void 0,products:n.filter(zr)}}var Jo=new WeakSet;function Rn(t=document){Z(t,Uu).forEach(e=>{if(Jo.has(e))return;Jo.add(e);let n;try{n=JSON.parse(e.textContent)}catch(s){v("bad data-tether-hydrate",s);return}let{country:r,language:o,products:i}=Gu(n);if(In(i),r===a.country&&o===a.language){ro(i);return}L("hydration skipped: other market"),st||(st=new Set,document.documentElement.classList.add(`${a.prefix}-market-pending`))})}var Ku=()=>`${a.prefix}:market:${a.domain}`,Qu={getItem:t=>vt(t)};function Wu(t){try{return JSON.parse(t)}catch(e){if(e instanceof SyntaxError)return null;throw e}}function Bu(t){if(typeof t!="object"||t===null)return null;let e=U(Reflect.get(t,"country"));if(!e)return null;let n=Reflect.get(t,"locale");return{country:e,language:F(Reflect.get(t,"language"))??void 0,locale:typeof n=="string"&&n?n:void 0}}var Yu=t=>Bu(Wu(t));function Nn(t=Qu){let e=t.getItem(Ku());return e?Yu(e):null}var ti={country:void 0,language:void 0,locale:void 0},$n=!1;function ei(){let t=n=>document.querySelector(`meta[name="${a.prefix}-page-${n}"]`)?.getAttribute("content")||void 0,e=U(t("country"));return e?{country:e,language:F(t("language"))??void 0,locale:t("locale")}:null}async function zu(){let t=a.markets??{};if(t.detect===!1)return null;if(!t.detect)return t.remember===!1?null:Nn();try{return(await x("markets")).detectMarket(t)}catch(e){return f(e,"markets"),null}}async function ni(t){ti={country:a.country,language:a.language,locale:a.locale};let e=ei();if($n=e!==null,e){a.country=e.country,a.language=e.language,e.locale&&(a.locale=e.locale);return}let n=await zu();n&&(n.country&&(a.country=n.country),n.language&&(a.language=n.language),n.locale&&!t.locale&&(a.locale=n.locale),L("market",n))}var Zo=(t,e)=>(t??"").toUpperCase()===(e??"").toUpperCase();function ri(){let t=ei(),e=t===null&&$n;$n=t!==null;let n=t??(e?Nn()??ti:null);return!n?.country||Zo(n.country,a.country)&&Zo(n.language,a.language)?null:{country:n.country,language:n.language,locale:n.locale}}function Lt(t,e){return x("markets").then(n=>n.setCountry(t,e))}var oi={"tether.diagnose.min.js":"sha384-GoSabxXrpEUWCpbWmyCt6Eby/SRGcvuJ1c8lQFVaLprF1MbfyZwlfundN9SJzHlS","tether.markets.min.js":"sha384-ZCR9y6ze/DzdKq13UxtHqcuWrujwCRgkMkock5VjQXA6svPWzCbim2/jseMyhsji","tether.search.min.js":"sha384-LdRf9V4s9Z9Jq0JASRj5LoGHLRYj98SnSKldeLxslwGFEuYTFVMYviMDVYORA9sN","tether.extras.min.js":"sha384-xKG8mQaRI9O7rOHGPtEMFCjCa5GJt8v1Pg+aUi1DnKMMCcRhbtXeB66FkiIBValW","tether.account.min.js":"sha384-bsEg4NX+L08ZQv6v4gRa9tvI5FBWjVBUPfgb7MAB9P0htKO+vWs0AetLGfVcHPWU","tether.account-pages.min.js":"sha384-PmV835ZgO/6emk4R8FSrpmAbAL4l9uacnyY6qc4RPauLLwB3GCQzxIKjbhlvKhak","tether.analytics.min.js":"sha384-PCfUr7l9kFJGvf6kowF32Q4j+PYp6VbtG+RAiqU7A1rXqHlSE3mf+NlhiOInGIC6"};function _n(t){return C(t)&&C(t.__core)&&C(t.__parts)}var ce="0.8.1";var si={get"config.ts"(){return[a,Mt,L,Kt,ze,f,v]},get"client.ts"(){return[Ze,Q,D,z,b]},get"dom.ts"(){return[Bt,m,Ee,h,he,M,p,V,Yt,ct,Pe,Rt,y,H,c,O,w,I]},get"loader.ts"(){return[Ae,rt]},get"selling-plans.ts"(){return[$]},get"status.ts"(){return[se,X]},get"cart.ts"(){return[P]},get"product.ts"(){return[it]},get"collection.ts"(){return[yt]},get"mounting.ts"(){return[bt,xt,qt,ue,jt,Z]},get"market-codes.ts"(){return[U,F]},get"page-market.ts"(){return[Lt]},get"shopify-values.ts"(){return[pe]},get"lazy.ts"(){return[x]}},Ju=/\.min\.js(\?|$)/,ii=typeof document>"u"?"":document.currentScript?.getAttribute("src")??"",je=ii?new URL(ii,document.baseURI).href:"",Xu=/^(https:\/\/cdn\.jsdelivr\.net\/(gh|npm)\/@?[^/@]+\/[^/@]+)(@(latest|\d+(\.\d+)?))?\//;function Zu(t){return t.replace(Xu,(e,n,r)=>`${n}@${r==="gh"?"v":""}${ce}/`)}var Ge=new Map;function tc(){return a.partsUrl?new URL(a.partsUrl,document.baseURI).href:je?Zu(je.replace(/[^/]*$/,"")):null}function ec(t,e){t.integrity=e,new URL(t.src).origin!==window.location.origin&&(t.crossOrigin="anonymous")}function nc(t,e,n,r){return new Promise((o,i)=>{let s=`${e.replace(/\/?$/,"/")}${n}`,u=document.createElement("script");u.src=s,u.async=!0,ec(u,r),u.onload=()=>{let l=Reflect.get(window,"Tether"),d=_n(l)?l.__parts[t]:void 0;if(d){o(d);return}Ge.delete(t);let g=_n(l)?"did not register":"can't register: window.Tether is no longer this Tether script's";i(new Error(`${s} ${g}`))},u.onerror=()=>{Ge.delete(t),i(new Error(`Could not load ${s}, or it is not the file built with this Tether script`))},document.head.appendChild(u)})}function x(t){let e=Ge.get(t);if(!e){let n=tc();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=Ju.test(je)||!je?".min":"",o=`tether.${t}${r}.js`,i=oi[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=nc(t,n,o,i),Ge.set(t,e)}return e}var ui=()=>`${a.prefix}:account-hint:${a.domain}`;function ai(t){ne(t,"sessionStorage"),ne(t,"localStorage")}function ci(){ai(`${a.prefix}:account:${a.domain}`),ai(`${a.prefix}:account-login:${a.domain}`)}var li=t=>t==="in"||t==="expired"||t==="error";var rc=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],oc=()=>[...rc.map(t=>`[${m(t)}]`),`[${m("show")}^="logged-"]`].join(",");function ic(){return!!vt(ui())}function di(t){!a.account||!(Z(t,oc()).length>0||li(new URLSearchParams(window.location.search).get("account"))||ic())||x("account").then(n=>n.mountAccount(t)).catch(n=>{f(n,"account")})}function R(t){return(...e)=>x("account").then(n=>{let r=n[t];return r(...e)})}var pi={login:R("login"),logout:R("logout"),isLoggedIn:R("isLoggedIn"),customer:R("customer"),orders:R("orders"),order:R("order"),updateProfile:R("updateProfile"),addresses:R("addresses"),saveAddress:R("saveAddress"),deleteAddress:R("deleteAddress"),subscriptions:R("subscriptions"),subscriptionAction:R("subscriptionAction"),requestReturn:R("requestReturn"),render:R("render"),mountAccount:R("mountAccount")};var fi=()=>`data-${a.prefix}-key`,gi=t=>t instanceof window.Element;function hi(t){let e=t.closest(`[${fi()}]`),n=e?.getAttribute(fi());return e&&n?{line:e,id:n}:null}function Ke(t,e){t.catch(n=>{f(n,e)})}function sc(t,e){let n=hi(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"),Ke(P.removeLine(o),"cart line");return}let i=ac(e);!i||!P.lines.some(s=>s.id===o)||(t.preventDefault(),Ke(P.changeQuantity(o,i),"cart line"))}function ac(t){return t.closest(c("line-plus"))?1:t.closest(c("line-minus"))?-1:0}function uc(t){let{target:e}=t;if(!gi(e))return;if(e.closest(c("cart-open"))){t.preventDefault(),P.toggle();return}if(e.closest(c("cart-close"))){t.preventDefault(),P.close();return}let n=e.closest(c("cart-clear"));if(n){t.preventDefault(),W(n,()=>P.clear().catch(o=>{f(o,"cart clear")}));return}let r=e.closest(c("checkout"));if(r){t.preventDefault(),W(r,()=>P.checkout());return}sc(t,e)}function mi(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),Ke(e,n)}function cc(t){let{target:e}=t;if(!gi(e))return;let n=hi(e);n&&e instanceof window.HTMLInputElement&&e.matches(c("line","quantity"))?mi(n.line,P.updateLine(n.id,parseInt(e.value,10)||0),"cart line"):n&&e instanceof window.HTMLSelectElement&&e.matches(c("line-plan"))?mi(n.line,P.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):lc(e)&&e.matches(c("cart-note"))&&Ke(P.setNote(e.value),"cart note")}var lc=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function dc(t){if(P.isOpen()){if(t.key==="Escape"){P.close();return}bn(t)}}function yi(){document.addEventListener("click",uc),document.addEventListener("change",cc),document.addEventListener("keydown",dc)}var Un=t=>t instanceof window.Element;function pc(t){let e=t.querySelector(c("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function bi(t,e,n){t.classList.toggle("is-invalid",n),n?e?.setAttribute("aria-invalid","true"):e?.removeAttribute("aria-invalid")}async function fc(t,e,n){try{await P.applyDiscount(n),bi(t,e,!1),h("discount-applied",{code:n},t),e&&(e.value="")}catch(r){bi(t,e,!0),r instanceof b&&r.code==="INVALID_DISCOUNT"?h("discount-invalid",{code:n},t):f(r,"discount")}}function mc(t){let{target:e}=t,n=Un(e)?e.closest(c("discount-form")):null;if(!n)return;t.preventDefault();let r=pc(n),o=r?.value.trim();o&&W(n,()=>fc(n,r,o))}function gc(t){let{target:e}=t;if(!Un(e))return;let n=e.closest(c("discount-form"));n&&(n.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"))}function hc(t){let{target:e}=t,n=Un(e)?e.closest(c("discount-remove")):null;if(!n)return;t.preventDefault();let r=n.closest(c("discount-code"))?.getAttribute(m("discount-code"));r&&P.removeDiscount(r).catch(o=>{f(o,"discount")})}function Pi(){document.addEventListener("submit",mc,!0),document.addEventListener("input",gc),document.addEventListener("click",hc)}var Fn=t=>x("extras").then(e=>e.addGroup(t)),Dn=t=>{f(t,"extras")};function yc(t){let{target:e}=t,n=e instanceof window.Element?e.closest(c("group-add")):null;n&&(t.preventDefault(),W(n,()=>Fn(n)).catch(Dn))}function bc(t){!a.domain||!t.key?.startsWith(`${a.prefix}:`)||x("extras").then(e=>{e.onStorage(t)}).catch(Dn)}function Pc(t){if(!ct(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!a.variantUrl&&!e.hasAttribute(m("variant-url"))||x("extras").then(n=>{n.writeVariantUrl(e,t.detail)}).catch(Dn))}function Ei(){document.addEventListener("click",yc),window.addEventListener("storage",bc),document.addEventListener(`${a.prefix}:variant-changed`,Pc)}var Vn=null;function wi(){Vn=document.body}async function Ec(t){await t.ready();let e=ri();if(!e){Vn!==document.body&&t.mount(document);return}try{await Lt(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){f(n,"country")}t.mount(document)}function wc(t){document.addEventListener("astro:page-load",()=>{Ec(t).catch(e=>{f(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{Vn=null,t.unmount()})}function Sc(t){let{target:e}=t;!(e instanceof window.HTMLSelectElement)||!e.matches(c("country-select"))||e.value&&Lt(e.value).catch(n=>{f(n,"country")})}function Cc(){Xo(),bt.forEach(t=>{t.root.getAttribute(m("state"))==="error"&&t.load()})}function Si(t){a.astro&&wc(t),document.addEventListener("change",Sc),window.addEventListener("online",Cc)}var kc=50;function Tc(){let t=zt("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var Pt=null,Hn=null,ki=null,Ci=!1;function vc(t){let e=0;return Z(t,yt()).forEach(n=>{if(On.has(n))return;On.add(n),e++;let r=new Ve(n);bt.add(r),n.addEventListener(`${a.prefix}:list-rendered`,o=>{ct(o,"list-rendered")&&Qe(o.detail.container)}),Mn(r.load())}),e}function Ac(t){Z(t,`${c("country-select")},${c("country-bind")}`).length&&x("markets").then(e=>e.renderCountrySelects(t)).catch(e=>{f(e,"markets")}),di(t),Z(t,c("search")).length&&x("search").then(e=>{e.mountSearch(t)}).catch(e=>{f(e,"search")})}function Ti(t){let e=vc(t);return Z(t,c("product")).forEach(n=>{ue(n)&&e++}),Ac(t),e}function Qe(t=document){if(!Mt())return 0;t===document&&wi(),jt(),Rn(t.ownerDocument??document);let e=Ti(t);return qe(),P.render(),L(`mounted ${e} scope(s)`,t),e}function xc(t){let e=t.filter(r=>r.isConnected&&!t.some(o=>o!==r&&o.contains(r)));if(!e.length||!Mt())return;jt(),e.forEach(r=>{Rn(r)});let n=e.reduce((r,o)=>r+Ti(o),0);qe(),P.render(),L(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function vi(){P.close()}function Lc(t){let e=t?.closest(c("product"));return e?it.get(e)??null:null}function Ic(){Ci||(Ci=!0,yi(),Pi(),Ei(),Si({ready:()=>Pt??Promise.resolve(null),mount:Qe,unmount:vi}))}function Oc(){let t=[];ki=t,Bt.forEach(e=>{document.addEventListener(`${a.prefix}:${e}`,n=>t.push(n))}),document.addEventListener("astro:page-load",e=>t.push(e)),x("analytics").then(e=>e.startAnalytics(t)).catch(e=>{f(e,"analytics")})}async function Mc(t){let e=a.country,n=t?.buyerIdentity.countryCode;if(!t||!e||!n||n===e)return t;try{return await P.setBuyerIdentity({countryCode:e},{create:!1})}catch(r){return f(r,"cart country"),t}}function Ai(t={}){return Pt&&!Object.keys(t).length?Pt:(ar({...Tc(),...t}),Mt()?(ci(),Ic(),a.observe&&Rc(),a.analytics&&!ki&&Oc(),Pt=ni(t).then(()=>P.init()).then(Mc).then(e=>(h("ready",{cart:e}),qn)),Pt):(v("TETHER_CONFIG is missing domain or token. Tether is idle."),Pt=Promise.resolve(null),Pt))}function Rc(){if(Hn||typeof MutationObserver>"u")return;let t,e=new Set;Hn=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(),xc(r)},kc)}),Hn.observe(document.body,{childList:!0,subtree:!0})}var Nc=t=>x("markets").then(e=>e.detectMarket(t??a.markets)),$c=()=>x("markets").then(t=>t.getLocalization()),_c=t=>x("diagnose").then(e=>e.diagnose({...t,version:ce}));function Uc(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 Fc={VERSION:ce,init:Ai,mount:Qe,unmount:vi,get config(){return sr},get ready(){return Pt??Promise.resolve(null)},query:yr,withContext:gr,cart:P,getProduct:rt,getProducts:xe,getRecommendations:Le,getScope:Lc,addGroup:Fn,account:pi,primeProduct:kt,normalizeProductKey:Ut,clearProductCache:Ae,formatMoney:M,imageUrl:fe,plans:pn,TetherError:b,resolveProductKey:X,setCountry:Lt,detectMarket:Nc,getLocalization:$c,diagnose:_c,on:Uc},Dc={__core:si,__parts:{}},qn=Object.assign(Fc,Dc),zf=qn;function Vc(){Reflect.set(window,"Tether",qn);let t=zt("TETHER_CONFIG");if(!t||tt(t,"autoMount")===!1||zt("TETHER_INTEGRATION"))return;let e=()=>{Ai().then(()=>Qe(document)).catch(n=>{f(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&Vc();})();
5
2
  //# sourceMappingURL=tether.min.js.map