@occluze/tether 0.8.1 → 0.9.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 (73) hide show
  1. package/README.md +5 -5
  2. package/dist/esm/astro.js +1 -1
  3. package/dist/esm/chunks/account-LCMJ7QU5.js +1 -0
  4. package/dist/esm/chunks/{account-pages-XR6QZ3DX.js → account-pages-3C5KTPQV.js} +1 -1
  5. package/dist/esm/chunks/analytics-VWSZOX2D.js +1 -0
  6. package/dist/esm/chunks/{chunk-HXZSNZOV.js → chunk-2A2GN3Z7.js} +1 -1
  7. package/dist/esm/chunks/{chunk-A3GXCQJ4.js → chunk-2IGCUTG5.js} +1 -1
  8. package/dist/esm/chunks/{chunk-COQ6ATC6.js → chunk-3UCVDDK6.js} +1 -1
  9. package/dist/esm/chunks/chunk-D3MRWOFI.js +1 -0
  10. package/dist/esm/chunks/chunk-EUCFOBIT.js +1 -0
  11. package/dist/esm/chunks/{chunk-A2PCQK2F.js → chunk-F2BYVA7V.js} +1 -1
  12. package/dist/esm/chunks/chunk-HROQXZYN.js +1 -0
  13. package/dist/esm/chunks/{chunk-X2JZPXLF.js → chunk-MJNPD6LB.js} +1 -1
  14. package/dist/esm/chunks/{chunk-FM7ZLLVP.js → chunk-OURC3H6L.js} +1 -1
  15. package/dist/esm/chunks/chunk-P6DV24RG.js +1 -0
  16. package/dist/esm/chunks/chunk-P73VN3B6.js +1 -0
  17. package/dist/esm/chunks/chunk-S5BUUIB6.js +1 -0
  18. package/dist/esm/chunks/chunk-SOFWDTR7.js +1 -0
  19. package/dist/esm/chunks/{chunk-FPJGQ7Z5.js → chunk-XU27NSXT.js} +1 -1
  20. package/dist/esm/chunks/chunk-YJC3CSEG.js +1 -0
  21. package/dist/esm/chunks/chunk-ZBV2JSHE.js +1 -0
  22. package/dist/esm/chunks/{diagnose-IFRNCEYG.js → diagnose-TE72GNOO.js} +1 -1
  23. package/dist/esm/chunks/extras-7GTMJMOZ.js +1 -0
  24. package/dist/esm/chunks/lists-ZMVRGD6L.js +1 -0
  25. package/dist/esm/chunks/markets-ui-AAQM4PEE.js +1 -0
  26. package/dist/esm/chunks/search-PWF4YZQO.js +1 -0
  27. package/dist/esm/index.js +1 -1
  28. package/dist/esm/server.js +2 -2
  29. package/dist/tether.account-pages.js +2 -2
  30. package/dist/tether.account-pages.min.js +1 -1
  31. package/dist/tether.account.js +2 -2
  32. package/dist/tether.account.min.js +1 -1
  33. package/dist/tether.analytics.js +2 -2
  34. package/dist/tether.analytics.min.js +1 -1
  35. package/dist/tether.diagnose.js +4 -4
  36. package/dist/tether.diagnose.min.js +2 -2
  37. package/dist/tether.extras.js +1 -1
  38. package/dist/tether.extras.min.js +1 -1
  39. package/dist/tether.js +85 -201
  40. package/dist/tether.lists.js +268 -0
  41. package/dist/tether.lists.min.js +1 -0
  42. package/dist/tether.markets.js +3 -3
  43. package/dist/tether.markets.min.js +1 -1
  44. package/dist/tether.min.js +1 -1
  45. package/dist/tether.min.js.map +4 -4
  46. package/dist/tether.search.js +2 -2
  47. package/dist/tether.search.min.js +1 -1
  48. package/dist/types/src/client.d.ts +6 -6
  49. package/dist/types/src/collection.d.ts +7 -23
  50. package/dist/types/src/config-sections.d.ts +7 -0
  51. package/dist/types/src/config.d.ts +6 -0
  52. package/dist/types/src/index.d.ts +4 -3
  53. package/dist/types/src/lazy.d.ts +1 -0
  54. package/dist/types/src/lists.d.ts +20 -0
  55. package/dist/types/src/loader.d.ts +7 -27
  56. package/dist/types/src/mounting.d.ts +1 -6
  57. package/dist/types/src/product-shape.d.ts +13 -36
  58. package/dist/types/src/server.d.ts +5 -4
  59. package/dist/types/src/shopify-values.d.ts +6 -0
  60. package/dist/types/src/storefront/catalog.d.ts +2 -4
  61. package/dist/types/src/version.d.ts +1 -1
  62. package/package.json +7 -6
  63. package/dist/esm/chunks/account-BS5MCC2R.js +0 -1
  64. package/dist/esm/chunks/analytics-BYN3QHBA.js +0 -1
  65. package/dist/esm/chunks/chunk-2IVIZDT5.js +0 -1
  66. package/dist/esm/chunks/chunk-EGIDFV3T.js +0 -1
  67. package/dist/esm/chunks/chunk-EW3GKRT4.js +0 -1
  68. package/dist/esm/chunks/chunk-GXCCTPDF.js +0 -1
  69. package/dist/esm/chunks/chunk-MJFKAMFM.js +0 -1
  70. package/dist/esm/chunks/chunk-TE5PNI76.js +0 -1
  71. package/dist/esm/chunks/extras-3477M6Y7.js +0 -1
  72. package/dist/esm/chunks/markets-ui-3L2UZ7PK.js +0 -1
  73. package/dist/esm/chunks/search-YR73GIWY.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as E,c as P,d as k,e as T,f as p,g as A}from"./chunk-HROQXZYN.js";import{a as I}from"./chunk-SOFWDTR7.js";import{d as F,e as x}from"./chunk-2A2GN3Z7.js";import"./chunk-F2BYVA7V.js";import{h as u}from"./chunk-P6DV24RG.js";import"./chunk-XU27NSXT.js";import"./chunk-S5BUUIB6.js";import"./chunk-YJC3CSEG.js";import"./chunk-2IGCUTG5.js";import{e as w}from"./chunk-EUCFOBIT.js";import"./chunk-ZBV2JSHE.js";import{a as L,d as h,h as b,l as s,m as C,n as v,t as z}from"./chunk-P73VN3B6.js";import{o as f,p as g,r as a,z as y}from"./chunk-D3MRWOFI.js";var _="{name} ({currency})",j="name",d=null;function B(){d=null}var D="query TetherLocalization{localization{country{isoCode name currency{isoCode symbol}}language{isoCode name}availableCountries{isoCode name currency{isoCode symbol}availableLanguages{isoCode name}}}}",O={isoCode:"string",name:"string",currency:"object"},H=h({localization:{country:O,availableCountries:[O]}});function R(){return d??(d=b(D,{},H).then(e=>e.localization,e=>{throw d=null,e})),d}function U(e,n){switch(n){case"name":return e.name;case"code":return e.isoCode;case"currency":return e.currency.isoCode;case"symbol":return e.currency.symbol;default:return""}}var Y=(e,n)=>e.replace(/\{(name|code|currency|symbol)\}/g,(o,i)=>U(n,i));function q(e,n,o){let i=e.getAttribute(s("country-label"))||_,r=(e.getAttribute(s("countries"))||"").toUpperCase().split(/[\s,]+/).filter(Boolean),c=r.length?r.map(t=>n.find(l=>l.isoCode===t)).filter(t=>t!==void 0):n;e.replaceChildren(...c.map(t=>new Option(Y(i,t),t.isoCode))),e.value=o,e.value!==o&&(e.selectedIndex=-1),e.disabled=c.length<2&&!e.hasAttribute(s("always-enabled"))}function $(e,n,o){let i=(a.country||o.country.isoCode).toUpperCase(),r=[...o.availableCountries].sort((t,l)=>t.name.localeCompare(l.name,a.locale||void 0)),c=r.find(t=>t.isoCode===i)??o.country;e.forEach(t=>{q(t,r,i)}),n.forEach(t=>{t.textContent=U(c,v(t,"country-bind")||j)})}function S(e=document){let n=p(e,`select${C("country-select")}`),o=p(e,C("country-bind"));return!n.length&&!o.length?Promise.resolve():R().then(i=>{$(n,o,i)}).catch(i=>{y(i,"country select")})}var Q=e=>Object.values(a.markets?.locales??{}).find(n=>f(n.country)===e);function V(e,n){return e!==void 0?g(e):n?n.language?g(n.language):void 0:a.language}function Z(e){w();let n=[];return u.id()&&n.push(u.setBuyerIdentity({countryCode:e},{create:!1}).catch(o=>{y(o,"cart country")})),T(),k.forEach(o=>n.push(o.load())),P.forEach(o=>{o.closest(I())||(E.delete(o),A(o))}),n}async function re(e,{language:n,locale:o,remember:i=!0}={}){let r=f(e);if(!r)throw new L(`Not a country code: ${e}`,{code:"INVALID_COUNTRY"});let c=Q(r),t=o||c?.locale,l=t||a.locale,m=V(n,c),M=r!==a.country||m!==a.language||l!==a.locale;if(a.country=r,a.language=m||void 0,a.locale=l,i&&x({country:r,language:m,locale:t}),!M)return S(),u.state;n!==void 0&&B();let N=Z(r);return S(),z("country-changed",{country:r,language:a.language}),await Promise.all(N),u.state}export{F as detectMarket,R as getLocalization,S as renderCountrySelects,re as setCountry};
@@ -0,0 +1 @@
1
+ import{f as M}from"./chunk-HROQXZYN.js";import"./chunk-SOFWDTR7.js";import"./chunk-F2BYVA7V.js";import"./chunk-P6DV24RG.js";import"./chunk-XU27NSXT.js";import"./chunk-S5BUUIB6.js";import"./chunk-YJC3CSEG.js";import"./chunk-2IGCUTG5.js";import"./chunk-EUCFOBIT.js";import"./chunk-ZBV2JSHE.js";import{A as x,C,F as q,H as d,c as S,d as E,h as T,l as A,m as o,n as m,p as h,t as I,w as L,y as w}from"./chunk-P73VN3B6.js";import{b as a,r as u,x as b,z as y}from"./chunk-D3MRWOFI.js";var N=E({predictiveSearch:S({products:[{priceRange:"object"}],collections:["object"],queries:[{text:"string"}]})}),U="query TetherPredictive($q:String!,$limit:Int!){predictiveSearch(query:$q,limit:$limit,limitScope:EACH,types:[PRODUCT,COLLECTION,QUERY]){products{id handle title availableForSale featuredImage{url altText}priceRange{minVariantPrice{amount currencyCode}}}collections{handle title image{url altText}}queries{text}}}",D=6,V=2,F="/search",R=new WeakSet,v=0;function $(s,t,e){return parseInt(m(s,t)||"",10)||e}var H=s=>s.tagName==="A"?s:s.querySelector("a");function p(s,t){h(s,o("search-bind")).forEach(e=>{let i=m(e,"search-bind");i==="image"?L(e,t.image?.url,t.image?.altText||t.title):(i==="title"||i==="price"||i==="text")&&t[i]!=null&&q(e,t[i])})}function k(s,t){let e=H(s);e&&(t&&e.setAttribute("href",t),e.setAttribute("role","option"))}var f=class{constructor(t,e,i){a(this,"root");a(this,"input");a(this,"results");a(this,"limit");a(this,"minCharacters");a(this,"resultsId");a(this,"searchNumber",0);a(this,"timer");a(this,"lastTerm","");a(this,"cache",new Map);this.root=t,this.input=e,this.results=i,this.limit=$(t,"search-limit",D),this.minCharacters=$(t,"search-min",V),i.id||(v+=1,i.id=`${u.prefix}-search-${v}`),this.resultsId=i.id,this.setUpAria(),this.listen()}setUpAria(){this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-autocomplete","list"),this.input.setAttribute("aria-controls",this.resultsId),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("autocomplete","off"),this.results.hasAttribute("role")||this.results.setAttribute("role","listbox"),this.results.hidden=!0}listen(){this.input.addEventListener("input",()=>{let t=this.input.value.trim();t!==this.lastTerm&&(this.lastTerm=t,clearTimeout(this.timer),this.timer=setTimeout(()=>void this.search(t),u.searchDelay))}),this.input.addEventListener("focus",()=>{this.input.value.trim().length>=this.minCharacters&&this.options().length&&this.open(!0)}),this.input.addEventListener("keydown",t=>{this.onKeydown(t)}),document.addEventListener("click",t=>{this.root.contains(t.target)||this.open(!1)})}setState(t){this.root.setAttribute(A("search-state"),t)}open(t){this.root.classList.toggle("is-open",t),this.results.hidden=!t,this.input.setAttribute("aria-expanded",String(t)),t||this.input.removeAttribute("aria-activedescendant")}options(){return h(this.results,'[role="option"]')}async fetchResults(t){let e=this.cache.get(t);if(e)return e;let i=await T(U,{q:t,limit:this.limit},N);return this.cache.set(t,i.predictiveSearch),i.predictiveSearch}async search(t){this.searchNumber+=1;let e=this.searchNumber;if(t.length<this.minCharacters){this.open(!1),this.setState("idle");return}this.setState("loading");try{let i=await this.fetchResults(t);e===this.searchNumber&&this.render(i,t)}catch(i){if(e!==this.searchNumber){b("a superseded search failed",i);return}this.setState("error"),y(i,"search")}}fillList(t,e,i){h(this.results,o(t)).forEach(l=>{w(l,e,i),d(l,e.length>0)})}queryUrl(t){let e=this.root.getAttribute("action")||F,i=e.includes("?")?"&":"?";return`${e}${i}${this.input.name||"q"}=${encodeURIComponent(t)}`}render(t,e){let i=t?.products??[],l=t?.collections??[],c=(t?.queries??[]).filter(n=>n.text.toLowerCase()!==e.toLowerCase());this.fillList("search-products",i,(n,r)=>{let P=C(r.priceRange.minVariantPrice);p(n,{title:r.title,price:P,image:r.featuredImage}),k(n,x(r.handle,r.id)),n.classList.toggle("is-sold-out",!r.availableForSale)}),this.fillList("search-collections",l,(n,r)=>{p(n,{title:r.title,image:r.image}),k(n,`${(u.collectionPath||"/collection").replace(/\/$/,"")}/${r.handle}`)}),this.fillList("search-queries",c,(n,r)=>{p(n,{text:r.text}),H(n)?.setAttribute("href",this.queryUrl(r.text))});let g=i.length+l.length+c.length;this.showCount(g),this.setState(g?"ready":"empty"),this.open(!0),I("search",{term:e,products:i,collections:l,queries:c},this.root)}showCount(t){h(this.root,o("show")).forEach(e=>{let i=m(e,"show");i==="search-empty"&&d(e,t===0),i==="search-results"&&d(e,t>0)}),this.options().forEach((e,i)=>{e.id||(e.id=`${this.resultsId}-${i}`),e.setAttribute("aria-selected","false")})}highlight(t,e){t.forEach((l,c)=>{l.setAttribute("aria-selected",String(c===e))});let i=t[e];i&&(this.input.setAttribute("aria-activedescendant",i.id),i.scrollIntoView?.({block:"nearest"}))}onKeydown(t){let e=this.options(),i=e.findIndex(l=>l.getAttribute("aria-selected")==="true");t.key==="ArrowDown"&&e.length?(t.preventDefault(),this.open(!0),this.highlight(e,(i+1)%e.length)):t.key==="ArrowUp"&&e.length?(t.preventDefault(),this.highlight(e,i<=0?e.length-1:i-1)):t.key==="Enter"&&i>=0?(t.preventDefault(),e[i]?.click()):t.key==="Escape"&&this.open(!1)}};function j(s=document){for(let t of M(s,o("search"))){if(R.has(t))continue;R.add(t);let e=t.querySelector(o("search-input"))??t.querySelector("input"),i=t.querySelector(o("search-results"));e&&i&&new f(t,e,i)}}export{j as mountSearch};
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{a as ot,b as rt,d as C,f as w,g as T,h as p,i as it,j as st,k as at,l as S,m as k}from"./chunks/chunk-TE5PNI76.js";import{a as ct,b as ut,c as h}from"./chunks/chunk-COQ6ATC6.js";import"./chunks/chunk-HXZSNZOV.js";import{a as nt}from"./chunks/chunk-A2PCQK2F.js";import"./chunks/chunk-FPJGQ7Z5.js";import{b as et}from"./chunks/chunk-A3GXCQJ4.js";import{a as lt,b as dt,c as mt}from"./chunks/chunk-X2JZPXLF.js";import{a as l,b as ft}from"./chunks/chunk-EGIDFV3T.js";import{a as K,e as tt,h as s}from"./chunks/chunk-MJFKAMFM.js";import{D as X,E as Z,o as z,t as Q,u as W,v as Y,w as J}from"./chunks/chunk-2IVIZDT5.js";import{C as q,J as P,M as f,a as v,f as G,j as U,l as d,m as r,r as B,s as g,t as y,u as j}from"./chunks/chunk-EW3GKRT4.js";import{e as $,r as c,s as V,v as F,w as E,x as L,y as _,z as a}from"./chunks/chunk-GXCCTPDF.js";var x="0.8.1";var Nt=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],Ot=()=>[...Nt.map(t=>`[${d(t)}]`),`[${d("show")}^="logged-"]`].join(",");function Dt(){return!!tt(lt())}function pt(t){!c.account||!(p(t,Ot()).length>0||mt(new URLSearchParams(window.location.search).get("account"))||Dt())||l("account").then(n=>n.mountAccount(t)).catch(n=>{a(n,"account")})}function u(t){return(...e)=>l("account").then(n=>{let o=n[t];return o(...e)})}var gt={login:u("login"),logout:u("logout"),isLoggedIn:u("isLoggedIn"),customer:u("customer"),orders:u("orders"),order:u("order"),updateProfile:u("updateProfile"),addresses:u("addresses"),saveAddress:u("saveAddress"),deleteAddress:u("deleteAddress"),subscriptions:u("subscriptions"),subscriptionAction:u("subscriptionAction"),requestReturn:u("requestReturn"),render:u("render"),mountAccount:u("mountAccount")};var yt=()=>`data-${c.prefix}-key`,Et=t=>t instanceof window.Element;function vt(t){let e=t.closest(`[${yt()}]`),n=e?.getAttribute(yt());return e&&n?{line:e,id:n}:null}function A(t,e){t.catch(n=>{a(n,e)})}function Rt(t,e){let n=vt(e);if(!n?.line.closest(r("cart-lines")))return;let{line:o,id:i}=n;if(e.closest(r("line-remove"))){t.preventDefault(),o.classList.add("is-busy"),A(s.removeLine(i),"cart line");return}let H=Ht(e);!H||!s.lines.some(It=>It.id===i)||(t.preventDefault(),A(s.changeQuantity(i,H),"cart line"))}function Ht(t){return t.closest(r("line-plus"))?1:t.closest(r("line-minus"))?-1:0}function $t(t){let{target:e}=t;if(!Et(e))return;if(e.closest(r("cart-open"))){t.preventDefault(),s.toggle();return}if(e.closest(r("cart-close"))){t.preventDefault(),s.close();return}let n=e.closest(r("cart-clear"));if(n){t.preventDefault(),f(n,()=>s.clear().catch(i=>{a(i,"cart clear")}));return}let o=e.closest(r("checkout"));if(o){t.preventDefault(),f(o,()=>s.checkout());return}Rt(t,e)}function ht(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),A(e,n)}function Vt(t){let{target:e}=t;if(!Et(e))return;let n=vt(e);n&&e instanceof window.HTMLInputElement&&e.matches(r("line","quantity"))?ht(n.line,s.updateLine(n.id,parseInt(e.value,10)||0),"cart line"):n&&e instanceof window.HTMLSelectElement&&e.matches(r("line-plan"))?ht(n.line,s.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):Ft(e)&&e.matches(r("cart-note"))&&A(s.setNote(e.value),"cart note")}var Ft=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function _t(t){if(s.isOpen()){if(t.key==="Escape"){s.close();return}K(t)}}function Pt(){document.addEventListener("click",$t),document.addEventListener("change",Vt),document.addEventListener("keydown",_t)}var M=t=>t instanceof window.Element;function Gt(t){let e=t.querySelector(r("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function wt(t,e,n){t.classList.toggle("is-invalid",n),n?e?.setAttribute("aria-invalid","true"):e?.removeAttribute("aria-invalid")}async function Ut(t,e,n){try{await s.applyDiscount(n),wt(t,e,!1),y("discount-applied",{code:n},t),e&&(e.value="")}catch(o){wt(t,e,!0),o instanceof v&&o.code==="INVALID_DISCOUNT"?y("discount-invalid",{code:n},t):a(o,"discount")}}function Bt(t){let{target:e}=t,n=M(e)?e.closest(r("discount-form")):null;if(!n)return;t.preventDefault();let o=Gt(n),i=o?.value.trim();i&&f(n,()=>Ut(n,o,i))}function jt(t){let{target:e}=t;if(!M(e))return;let n=e.closest(r("discount-form"));n&&(n.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"))}function qt(t){let{target:e}=t,n=M(e)?e.closest(r("discount-remove")):null;if(!n)return;t.preventDefault();let o=n.closest(r("discount-code"))?.getAttribute(d("discount-code"));o&&s.removeDiscount(o).catch(i=>{a(i,"discount")})}function At(){document.addEventListener("submit",Bt,!0),document.addEventListener("input",jt),document.addEventListener("click",qt)}var I=t=>l("extras").then(e=>e.addGroup(t)),N=t=>{a(t,"extras")};function zt(t){let{target:e}=t,n=e instanceof window.Element?e.closest(r("group-add")):null;n&&(t.preventDefault(),f(n,()=>I(n)).catch(N))}function Kt(t){!c.domain||!t.key?.startsWith(`${c.prefix}:`)||l("extras").then(e=>{e.onStorage(t)}).catch(N)}function Qt(t){if(!g(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!c.variantUrl&&!e.hasAttribute(d("variant-url"))||l("extras").then(n=>{n.writeVariantUrl(e,t.detail)}).catch(N))}function bt(){document.addEventListener("click",zt),window.addEventListener("storage",Kt),document.addEventListener(`${c.prefix}:variant-changed`,Qt)}var O=null;function Lt(){O=document.body}async function Wt(t){await t.ready();let e=ut();if(!e){O!==document.body&&t.mount(document);return}try{await h(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){a(n,"country")}t.mount(document)}function Yt(t){document.addEventListener("astro:page-load",()=>{Wt(t).catch(e=>{a(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{O=null,t.unmount()})}function Jt(t){let{target:e}=t;!(e instanceof window.HTMLSelectElement)||!e.matches(r("country-select"))||e.value&&h(e.value).catch(n=>{a(n,"country")})}function Xt(){st(),w.forEach(t=>{t.root.getAttribute(d("state"))==="error"&&t.load()})}function Ct(t){c.astro&&Yt(t),document.addEventListener("change",Jt),window.addEventListener("online",Xt)}var Zt=50;function te(){let t=P("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var m=null,D=null,St=null,Tt=!1;function ee(t){let e=0;return p(t,ot()).forEach(n=>{if(C.has(n))return;C.add(n),e++;let o=new rt(n);w.add(o),n.addEventListener(`${c.prefix}:list-rendered`,i=>{g(i,"list-rendered")&&b(i.detail.container)}),at(o.load())}),e}function ne(t){p(t,`${r("country-select")},${r("country-bind")}`).length&&l("markets").then(e=>e.renderCountrySelects(t)).catch(e=>{a(e,"markets")}),pt(t),p(t,r("search")).length&&l("search").then(e=>{e.mountSearch(t)}).catch(e=>{a(e,"search")})}function kt(t){let e=ee(t);return p(t,r("product")).forEach(n=>{it(n)&&e++}),ne(t),e}function b(t=document){if(!E())return 0;t===document&&Lt(),T(),k(t.ownerDocument??document);let e=kt(t);return S(),s.render(),L(`mounted ${e} scope(s)`,t),e}function oe(t){let e=t.filter(o=>o.isConnected&&!t.some(i=>i!==o&&i.contains(o)));if(!e.length||!E())return;T(),e.forEach(o=>{k(o)});let n=e.reduce((o,i)=>o+kt(i),0);S(),s.render(),L(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function xt(){s.close()}function re(t){let e=t?.closest(r("product"));return e?nt.get(e)??null:null}function ie(){Tt||(Tt=!0,Pt(),At(),bt(),Ct({ready:()=>m??Promise.resolve(null),mount:b,unmount:xt}))}function se(){let t=[];St=t,B.forEach(e=>{document.addEventListener(`${c.prefix}:${e}`,n=>t.push(n))}),document.addEventListener("astro:page-load",e=>t.push(e)),l("analytics").then(e=>e.startAnalytics(t)).catch(e=>{a(e,"analytics")})}async function ae(t){let e=c.country,n=t?.buyerIdentity.countryCode;if(!t||!e||!n||n===e)return t;try{return await s.setBuyerIdentity({countryCode:e},{create:!1})}catch(o){return a(o,"cart country"),t}}function Mt(t={}){return m&&!Object.keys(t).length?m:(F({...te(),...t}),E()?(dt(),ie(),c.observe&&ce(),c.analytics&&!St&&se(),m=ct(t).then(()=>s.init()).then(ae).then(e=>(y("ready",{cart:e}),R)),m):(_("TETHER_CONFIG is missing domain or token. Tether is idle."),m=Promise.resolve(null),m))}function ce(){if(D||typeof MutationObserver>"u")return;let t,e=new Set;D=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(i=>{i instanceof window.Element&&e.add(i)})}),clearTimeout(t),t=setTimeout(()=>{let o=[...e];e.clear(),oe(o)},Zt)}),D.observe(document.body,{childList:!0,subtree:!0})}var ue=t=>l("markets").then(e=>e.detectMarket(t??c.markets)),le=()=>l("markets").then(t=>t.getLocalization()),de=t=>l("diagnose").then(e=>e.diagnose({...t,version:x}));function me(t,e){let n=`${c.prefix}:${t}`,o=i=>{g(i,t)&&e(i.detail,i)};return document.addEventListener(n,o),()=>{document.removeEventListener(n,o)}}var fe={VERSION:x,init:Mt,mount:b,unmount:xt,get config(){return V},get ready(){return m??Promise.resolve(null)},query:U,withContext:G,cart:s,getProduct:Y,getProducts:X,getRecommendations:Z,getScope:re,addGroup:I,account:gt,primeProduct:W,normalizeProductKey:Q,clearProductCache:J,formatMoney:q,imageUrl:j,plans:z,TetherError:v,resolveProductKey:et,setCountry:h,detectMarket:ue,getLocalization:le,diagnose:de,on:me},pe={__core:ft,__parts:{}},R=Object.assign(fe,pe),cn=R;function ge(){Reflect.set(window,"Tether",R);let t=P("TETHER_CONFIG");if(!t||$(t,"autoMount")===!1||P("TETHER_INTEGRATION"))return;let e=()=>{Mt().then(()=>b(document)).catch(n=>{a(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&ge();export{x as VERSION,I as addGroup,R as api,cn as default,re as getScope,Mt as init,b as mount,h as setCountry,xt as unmount};
1
+ import{a as st,b as at,c as ct}from"./chunks/chunk-MJNPD6LB.js";import{b as C,d as w,e as T,f as p,g as et,h as nt,i as ot,j as k,k as S}from"./chunks/chunk-HROQXZYN.js";import{a as lt,b as dt}from"./chunks/chunk-SOFWDTR7.js";import{a as rt,b as it,c as h}from"./chunks/chunk-3UCVDDK6.js";import"./chunks/chunk-2A2GN3Z7.js";import{a as tt}from"./chunks/chunk-F2BYVA7V.js";import{a as z,e as X,h as s}from"./chunks/chunk-P6DV24RG.js";import"./chunks/chunk-XU27NSXT.js";import{l as Q}from"./chunks/chunk-S5BUUIB6.js";import{a as u,b as ut}from"./chunks/chunk-YJC3CSEG.js";import{b as Z}from"./chunks/chunk-2IGCUTG5.js";import{a as K,b as W,c as Y,e as J}from"./chunks/chunk-EUCFOBIT.js";import"./chunks/chunk-ZBV2JSHE.js";import{C as q,J as P,M as f,a as v,f as G,j as U,l as d,m as r,r as B,s as g,t as y,u as j}from"./chunks/chunk-P73VN3B6.js";import{e as $,r as c,s as V,v as F,w as E,x as L,y as _,z as a}from"./chunks/chunk-D3MRWOFI.js";var x="0.9.1";var Mt=["account-login","account-bind","account-link","orders","order","addresses","subscriptions","profile-form","address-form"],It=()=>[...Mt.map(t=>`[${d(t)}]`),`[${d("show")}^="logged-"]`].join(",");function Nt(){return!!X(st())}function mt(t){!c.account||!(p(t,It()).length>0||ct(new URLSearchParams(window.location.search).get("account"))||Nt())||u("account").then(n=>n.mountAccount(t)).catch(n=>{a(n,"account")})}function l(t){return(...e)=>u("account").then(n=>{let o=n[t];return o(...e)})}var ft={login:l("login"),logout:l("logout"),isLoggedIn:l("isLoggedIn"),customer:l("customer"),orders:l("orders"),order:l("order"),updateProfile:l("updateProfile"),addresses:l("addresses"),saveAddress:l("saveAddress"),deleteAddress:l("deleteAddress"),subscriptions:l("subscriptions"),subscriptionAction:l("subscriptionAction"),requestReturn:l("requestReturn"),render:l("render"),mountAccount:l("mountAccount")};var pt=()=>`data-${c.prefix}-key`,yt=t=>t instanceof window.Element;function ht(t){let e=t.closest(`[${pt()}]`),n=e?.getAttribute(pt());return e&&n?{line:e,id:n}:null}function A(t,e){t.catch(n=>{a(n,e)})}function Ot(t,e){let n=ht(e);if(!n?.line.closest(r("cart-lines")))return;let{line:o,id:i}=n;if(e.closest(r("line-remove"))){t.preventDefault(),o.classList.add("is-busy"),A(s.removeLine(i),"cart line");return}let H=Dt(e);!H||!s.lines.some(xt=>xt.id===i)||(t.preventDefault(),A(s.changeQuantity(i,H),"cart line"))}function Dt(t){return t.closest(r("line-plus"))?1:t.closest(r("line-minus"))?-1:0}function Rt(t){let{target:e}=t;if(!yt(e))return;if(e.closest(r("cart-open"))){t.preventDefault(),s.toggle();return}if(e.closest(r("cart-close"))){t.preventDefault(),s.close();return}let n=e.closest(r("cart-clear"));if(n){t.preventDefault(),f(n,()=>s.clear().catch(i=>{a(i,"cart clear")}));return}let o=e.closest(r("checkout"));if(o){t.preventDefault(),f(o,()=>s.checkout());return}Ot(t,e)}function gt(t,e,n){t.classList.add("is-busy"),t.setAttribute("aria-busy","true"),A(e,n)}function Ht(t){let{target:e}=t;if(!yt(e))return;let n=ht(e);n&&e instanceof window.HTMLInputElement&&e.matches(r("line","quantity"))?gt(n.line,s.updateLine(n.id,parseInt(e.value,10)||0),"cart line"):n&&e instanceof window.HTMLSelectElement&&e.matches(r("line-plan"))?gt(n.line,s.updateLine(n.id,{sellingPlanId:e.value||null}),"cart line plan"):$t(e)&&e.matches(r("cart-note"))&&A(s.setNote(e.value),"cart note")}var $t=t=>t instanceof window.HTMLInputElement||t instanceof window.HTMLTextAreaElement||t instanceof window.HTMLSelectElement;function Vt(t){if(s.isOpen()){if(t.key==="Escape"){s.close();return}z(t)}}function Et(){document.addEventListener("click",Rt),document.addEventListener("change",Ht),document.addEventListener("keydown",Vt)}var M=t=>t instanceof window.Element;function Ft(t){let e=t.querySelector(r("discount-input"))??t.querySelector("input");return e instanceof window.HTMLInputElement?e:null}function vt(t,e,n){t.classList.toggle("is-invalid",n),n?e?.setAttribute("aria-invalid","true"):e?.removeAttribute("aria-invalid")}async function _t(t,e,n){try{await s.applyDiscount(n),vt(t,e,!1),y("discount-applied",{code:n},t),e&&(e.value="")}catch(o){vt(t,e,!0),o instanceof v&&o.code==="INVALID_DISCOUNT"?y("discount-invalid",{code:n},t):a(o,"discount")}}function Gt(t){let{target:e}=t,n=M(e)?e.closest(r("discount-form")):null;if(!n)return;t.preventDefault();let o=Ft(n),i=o?.value.trim();i&&f(n,()=>_t(n,o,i))}function Ut(t){let{target:e}=t;if(!M(e))return;let n=e.closest(r("discount-form"));n&&(n.classList.remove("is-invalid"),e.removeAttribute("aria-invalid"))}function Bt(t){let{target:e}=t,n=M(e)?e.closest(r("discount-remove")):null;if(!n)return;t.preventDefault();let o=n.closest(r("discount-code"))?.getAttribute(d("discount-code"));o&&s.removeDiscount(o).catch(i=>{a(i,"discount")})}function Pt(){document.addEventListener("submit",Gt,!0),document.addEventListener("input",Ut),document.addEventListener("click",Bt)}var I=t=>u("extras").then(e=>e.addGroup(t)),N=t=>{a(t,"extras")};function jt(t){let{target:e}=t,n=e instanceof window.Element?e.closest(r("group-add")):null;n&&(t.preventDefault(),f(n,()=>I(n)).catch(N))}function qt(t){!c.domain||!t.key?.startsWith(`${c.prefix}:`)||u("extras").then(e=>{e.onStorage(t)}).catch(N)}function Qt(t){if(!g(t,"variant-changed"))return;let{target:e}=t;e instanceof window.Element&&(!c.variantUrl&&!e.hasAttribute(d("variant-url"))||u("extras").then(n=>{n.writeVariantUrl(e,t.detail)}).catch(N))}function wt(){document.addEventListener("click",jt),window.addEventListener("storage",qt),document.addEventListener(`${c.prefix}:variant-changed`,Qt)}var O=null;function At(){O=document.body}async function zt(t){await t.ready();let e=it();if(!e){O!==document.body&&t.mount(document);return}try{await h(e.country,{language:e.language??null,locale:e.locale,remember:!1})}catch(n){a(n,"country")}t.mount(document)}function Kt(t){document.addEventListener("astro:page-load",()=>{zt(t).catch(e=>{a(e,"page mount")})}),document.addEventListener("astro:before-swap",()=>{O=null,t.unmount()})}function Wt(t){let{target:e}=t;!(e instanceof window.HTMLSelectElement)||!e.matches(r("country-select"))||e.value&&h(e.value).catch(n=>{a(n,"country")})}function Yt(){nt(),w.forEach(t=>{t.root.getAttribute(d("state"))==="error"&&t.load()})}function bt(t){c.astro&&Kt(t),document.addEventListener("change",Wt),window.addEventListener("online",Yt)}var Jt=50;function Xt(){let t=P("TETHER_CONFIG");return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}var m=null,D=null,Ct=null,Lt=!1;function Zt(t){let e=0;return p(t,lt()).forEach(n=>{if(C.has(n))return;C.add(n),e++;let o=dt(n);w.add(o),n.addEventListener(`${c.prefix}:list-rendered`,i=>{g(i,"list-rendered")&&b(i.detail.container)}),ot(o.load())}),e}function te(t){p(t,`${r("country-select")},${r("country-bind")}`).length&&u("markets").then(e=>e.renderCountrySelects(t)).catch(e=>{a(e,"markets")}),mt(t),p(t,r("search")).length&&u("search").then(e=>{e.mountSearch(t)}).catch(e=>{a(e,"search")})}function Tt(t){let e=Zt(t);return p(t,r("product")).forEach(n=>{et(n)&&e++}),te(t),e}function b(t=document){if(!E())return 0;t===document&&At(),T(),S(t.ownerDocument??document);let e=Tt(t);return k(),s.render(),L(`mounted ${e} scope(s)`,t),e}function ee(t){let e=t.filter(o=>o.isConnected&&!t.some(i=>i!==o&&i.contains(o)));if(!e.length||!E())return;T(),e.forEach(o=>{S(o)});let n=e.reduce((o,i)=>o+Tt(i),0);k(),s.render(),L(`mounted ${n} scope(s) in ${e.length} added element(s)`)}function kt(){s.close()}function ne(t){let e=t?.closest(r("product"));return e?tt.get(e)??null:null}function oe(){Lt||(Lt=!0,Et(),Pt(),wt(),bt({ready:()=>m??Promise.resolve(null),mount:b,unmount:kt}))}function re(){let t=[];Ct=t,B.forEach(e=>{document.addEventListener(`${c.prefix}:${e}`,n=>t.push(n))}),document.addEventListener("astro:page-load",e=>t.push(e)),u("analytics").then(e=>e.startAnalytics(t)).catch(e=>{a(e,"analytics")})}async function ie(t){let e=c.country,n=t?.buyerIdentity.countryCode;if(!t||!e||!n||n===e)return t;try{return await s.setBuyerIdentity({countryCode:e},{create:!1})}catch(o){return a(o,"cart country"),t}}function St(t={}){return m&&!Object.keys(t).length?m:(F({...Xt(),...t}),E()?(at(),oe(),c.observe&&se(),c.analytics&&!Ct&&re(),m=rt(t).then(()=>s.init()).then(ie).then(e=>(y("ready",{cart:e}),R)),m):(_("TETHER_CONFIG is missing domain or token. Tether is idle."),m=Promise.resolve(null),m))}function se(){if(D||typeof MutationObserver>"u")return;let t,e=new Set;D=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(i=>{i instanceof window.Element&&e.add(i)})}),clearTimeout(t),t=setTimeout(()=>{let o=[...e];e.clear(),ee(o)},Jt)}),D.observe(document.body,{childList:!0,subtree:!0})}var ae=t=>u("markets").then(e=>e.detectMarket(t??c.markets)),ce=t=>u("lists").then(e=>e.getProducts(t)),ue=(t,e)=>u("lists").then(n=>n.getRecommendations(t,e)),le=()=>u("markets").then(t=>t.getLocalization()),de=t=>u("diagnose").then(e=>e.diagnose({...t,version:x}));function me(t,e){let n=`${c.prefix}:${t}`,o=i=>{g(i,t)&&e(i.detail,i)};return document.addEventListener(n,o),()=>{document.removeEventListener(n,o)}}var fe={VERSION:x,init:St,mount:b,unmount:kt,get config(){return V},get ready(){return m??Promise.resolve(null)},query:U,withContext:G,cart:s,getProduct:Y,getProducts:ce,getRecommendations:ue,getScope:ne,addGroup:I,account:ft,primeProduct:W,normalizeProductKey:K,clearProductCache:J,formatMoney:q,imageUrl:j,plans:Q,TetherError:v,resolveProductKey:Z,setCountry:h,detectMarket:ae,getLocalization:le,diagnose:de,on:me},pe={__core:ut,__parts:{}},R=Object.assign(fe,pe),cn=R;function ge(){Reflect.set(window,"Tether",R);let t=P("TETHER_CONFIG");if(!t||$(t,"autoMount")===!1||P("TETHER_INTEGRATION"))return;let e=()=>{St().then(()=>b(document)).catch(n=>{a(n,"init")})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}typeof window<"u"&&typeof document<"u"&&ge();export{x as VERSION,I as addGroup,R as api,cn as default,ne as getScope,St as init,b as mount,h as setCountry,kt as unmount};
@@ -1,2 +1,2 @@
1
- import{b as j,f as Q,g as G}from"./chunks/chunk-FPJGQ7Z5.js";import{A as B,B as J,C as K,a as D,c as R,h as O,i as v,j as b,l as M,o as F,q,s as V}from"./chunks/chunk-2IVIZDT5.js";import{B as _,a as h,c as w,d as S,f as nt,g as k,i as L,u as U}from"./chunks/chunk-EW3GKRT4.js";import{B as E,E as N,F as C,G as I,q as g,t as A}from"./chunks/chunk-GXCCTPDF.js";function H(t,e={}){if(!t)return null;let{variant:r,sellingPlan:a,defaultPurchase:c=g.defaultPurchase,lowStock:u=g.lowStock}=e,d=Q(t,{variant:r,sellingPlan:a,defaultPurchase:c}),n=G(t,{...d,quantity:1},u);if(!n)throw new h(`Product ${t.handle} has no variants`);let{selected:l,line:p}=n,i=(o,s)=>!j(t,l,o,s);return{variant:n.variant,selected:l,purchase:n.purchase.kind,plan:p.kind==="subscription"?n.plan:null,plans:O(t).map(o=>({id:o.id,name:o.name,price:b(n.variant,o.id),savings:M(n.variant,o.id).percentage,selected:p.kind==="subscription"&&o.id===p.planId,available:!!v(n.variant,o.id)})),savings:n.savings.percentage,price:n.price,compareAtPrice:n.compareAtPrice,available:n.variant.availableForSale,show:n.show,unavailable:Object.fromEntries(t.options.map(o=>[o.name,o.optionValues.map(s=>s.name).filter(s=>i(o.name,s))])),isUnavailable:i}}var rt=500,ot=100,it=100,at="query TetherServerProductById($id:ID!){node(id:$id){... on Product{...TetherProduct}}}",st="query TetherServerProduct($handle:String!){product(handle:$handle){...TetherProduct}}",lt=()=>`query TetherServerCollection($handle:String!,$first:Int!,$after:String,$sortKey:ProductCollectionSortKeys,$reverse:Boolean,$filters:[ProductFilter!]){collection(handle:$handle){${R()} products(first:$first,after:$after,sortKey:$sortKey,reverse:$reverse,filters:$filters){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}}`,ct="query TetherServerProducts($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}}}",ut=()=>`query TetherServerCollections($first:Int!,$after:String){collections(first:$first,after:$after){nodes{${R()}}pageInfo{hasNextPage endCursor}}}`,dt=t=>`query TetherServerRecs(${t?"$id: ID!":"$handle: String!"},$intent:ProductRecommendationIntent){productRecommendations(${t?"productId: $id":"productHandle: $handle"},intent:$intent){...TetherProduct}}`,ft=S({product:w(q)}),pt=S({node:w(V)}),mt=S({collections:{nodes:[{handle:"string"}],pageInfo:{hasNextPage:"boolean"}}});async function gt(t){let e=[],r=null;for(let a=0;a<it;a++){let c=await k(t,ut(),{first:ot,after:r},mt);if(e.push(...c.collections.nodes),!c.collections.pageInfo.hasNextPage)break;r=c.collections.pageInfo.endCursor}return e}function Y(t,e){let r=(i,o,s)=>k(t,f=>`${i}
2
- ${D(t,f)}`,o,s);async function a(i){let o=I(i);if(!o)return null;if(o.startsWith("gid://")){let{node:f}=await r(at,{id:o},pt);return f?.id?f:null}return(await r(st,{handle:o},ft)).product}async function c(i,{first:o=e,after:s=null,sortKey:f,reverse:m=!1,filters:$}){let P=await r(lt(),{handle:i,first:o,after:s,sortKey:f||void 0,reverse:m,filters:$??void 0},B);if(!P.collection)return{collection:null,products:[],pageInfo:{hasNextPage:!1,endCursor:null}};let{products:y,...et}=P.collection;return{collection:et,products:y.nodes,pageInfo:y.pageInfo}}async function u(i={}){let{collection:o,query:s,first:f=e,after:m=null,sortKey:$,reverse:P=!1}=i;if(o)return c(o,i);let y=await r(ct,{first:f,after:m,query:s||void 0,sortKey:$||void 0,reverse:P},J);return{collection:null,products:y.products.nodes,pageInfo:y.products.pageInfo}}async function d(i={}){let o=[],s=null;for(let f=0;f<rt;f++){let m=await u({...i,first:e,after:s});if(o.push(...m.products),!m.pageInfo.hasNextPage)break;s=m.pageInfo.endCursor}return o}async function n(i,o={}){let s=await u({...o,collection:i});return s.collection?{...s.collection,products:s.products,pageInfo:s.pageInfo}:null}async function l(i,o="RELATED"){let s=I(typeof i=="object"?i?.id:i),f=s?.startsWith("gid://")??!1;return(await r(dt(f),f?{id:s,intent:o}:{handle:s,intent:o},K)).productRecommendations??[]}return{getProduct:a,getProducts:u,allProducts:d,getCollection:n,allCollections:()=>gt(t),getRecommendations:l}}var W={size:"https://schema.org/size",color:"https://schema.org/color",colour:"https://schema.org/color",material:"https://schema.org/material"},T=t=>JSON.stringify(t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");function z(t){return JSON.parse(JSON.stringify(t))}var X=t=>t.split("/").pop()??t;function yt(t){return t.availableForSale?t.currentlyNotInStock?"https://schema.org/BackOrder":"https://schema.org/InStock":"https://schema.org/OutOfStock"}function Pt(t,e){if(!t.requiresSellingPlan)return e.price;let r=O(t).find(a=>v(e,a.id));return(r&&b(e,r.id))??e.price}function Z(t,e,r){let a=Pt(t,e),c=r?.includes("?")?"&":"?";return{"@type":"Offer",price:a.amount,priceCurrency:a.currencyCode,availability:yt(e),url:r?`${r}${c}variant=${X(e.id)}`:void 0}}function ht(t,e,r,a){let c=e.selectedOptions.flatMap(u=>{let d=W[u.name.toLowerCase()];return d?[[d.split("/").pop()??d,u.value]]:[]});return{"@type":"Product",name:`${t.title} - ${e.title}`,sku:e.sku||void 0,image:e.image?.url||a[0],...Object.fromEntries(c),offers:Z(t,e,r)}}function St(t,{url:e},r){if(e)return e;let a=C(r.productPath,t.handle,t.id);if(!(!r.siteUrl||!a))return new URL(a,r.siteUrl).toString()}function x(t,e,r){if(!t)return null;let a=St(t,e,r),c=t.images.nodes.map(i=>i.url).filter(Boolean),u=e.brand||t.vendor,d=u?{"@type":"Brand",name:u}:void 0,n=t.description.trim()||void 0,l=t.variants.nodes;if(l.length<=1){let[i]=l;return z({"@context":"https://schema.org","@type":"Product",name:t.title,description:n,url:a,image:c,sku:i?.sku||void 0,brand:d,offers:i?Z(t,i,a):void 0})}let p=t.options.map(i=>W[i.name.toLowerCase()]).filter(Boolean);return z({"@context":"https://schema.org","@type":"ProductGroup",name:t.title,description:n,url:a,productGroupID:X(t.id),image:c,brand:d,variesBy:[...new Set(p)],hasVariant:l.map(i=>ht(t,i,a,c))})}var Ct=25,It=2,Ot=1;function vt(t,{productPath:e=g.productPath,id:r}={}){return C(e,t,r)}function tt(t,e){for(let r of e){let a=t[r];if(typeof a=="string"&&a)return a}return""}function bt(t){let e={};for(let[u,d]of Object.entries(t))u in g&&(e[u]=d);let r=typeof t.domain=="string"&&t.domain?t.domain:"",a=typeof t.token=="string"&&t.token?t.token:"",c=A({...e,domain:r||tt(t,E.domain),token:a||tt(t,E.token)});return t.fetch&&(c.fetch=t.fetch),t.pageSize!==void 0&&(c.pageSize=t.pageSize),t.siteUrl!==void 0&&(c.siteUrl=t.siteUrl),c}var $t=t=>typeof t=="number"&&Number.isInteger(t)&&t>0?t:Ct;function wt(t,e){return{...t,description:"",descriptionHtml:"",images:{nodes:t.images.nodes.slice(0,Math.max(1,e))},variants:{nodes:t.variants.nodes.map(r=>({...r,image:null}))}}}function Ht(t={}){let e=bt(t);if(!e.domain||!e.token)throw new h("createStorefront needs domain and token: pass them, or import.meta.env with PUBLIC_SHOPIFY_DOMAIN and PUBLIC_SHOPIFY_STOREFRONT_TOKEN",{code:"NOT_CONFIGURED"});let r=Y(e,$t(e.pageSize)),a={productPath:e.productPath,siteUrl:e.siteUrl};function c(n,{card:l=!1,images:p=It}={}){let i=(Array.isArray(n)?n:[n]).filter(s=>s!=null),o={v:Ot,at:new Date().toISOString(),country:e.country||null,language:e.language||null,products:l?i.map(s=>wt(s,p)):i};return`<script type="application/json" data-tether-hydrate>${T(o)}<\/script>`}function u(n,l={}){return n?`<script type="application/ld+json">${T(x(n,l,a))}<\/script>`:""}function d(n,l={}){return H(n,{defaultPurchase:e.defaultPurchase,lowStock:e.lowStock,...l})}return{config:e,query:(n,l,p)=>L(e,n,l,p),...r,hydrate:c,formatMoney:(n,l=e.locale)=>N(n,l),formatPercent:(n,l=e.locale)=>_(n,l),imageUrl:U,jsonLd:u,jsonLdData:(n,l={})=>x(n,l,a),initialState:d,productUrl:(n,l={})=>vt(n,{productPath:e.productPath,...l}),plans:F}}export{h as TetherError,Ht as createStorefront,N as formatMoney,_ as formatPercent,U as imageUrl,H as initialState,F as plans,I as productKey,vt as productUrl,nt as withContext};
1
+ import{b as j,f as Q,g as G}from"./chunks/chunk-XU27NSXT.js";import{e as O,f as v,g as b,i as F,l as M}from"./chunks/chunk-S5BUUIB6.js";import{a as D,c as T,e as q,g as V,h as B,i as J,j as K}from"./chunks/chunk-ZBV2JSHE.js";import{B as _,a as y,c as $,d as S,f as nt,g as k,i as U,u as L}from"./chunks/chunk-P73VN3B6.js";import{B as R,E as A,F as C,G as I,q as g,t as N}from"./chunks/chunk-D3MRWOFI.js";function H(t,e={}){if(!t)return null;let{variant:r,sellingPlan:a,defaultPurchase:c=g.defaultPurchase,lowStock:u=g.lowStock}=e,d=Q(t,{variant:r,sellingPlan:a,defaultPurchase:c}),n=G(t,{...d,quantity:1},u);if(!n)throw new y(`Product ${t.handle} has no variants`);let{selected:l,line:p}=n,i=(o,s)=>!j(t,l,o,s);return{variant:n.variant,selected:l,purchase:n.purchase.kind,plan:p.kind==="subscription"?n.plan:null,plans:O(t).map(o=>({id:o.id,name:o.name,price:b(n.variant,o.id),savings:F(n.variant,o.id).percentage,selected:p.kind==="subscription"&&o.id===p.planId,available:!!v(n.variant,o.id)})),savings:n.savings.percentage,price:n.price,compareAtPrice:n.compareAtPrice,available:n.variant.availableForSale,show:n.show,unavailable:Object.fromEntries(t.options.map(o=>[o.name,o.optionValues.map(s=>s.name).filter(s=>i(o.name,s))])),isUnavailable:i}}var rt=500,ot=100,it=100,at="query TetherServerProductById($id:ID!){node(id:$id){... on Product{...TetherProduct}}}",st="query TetherServerProduct($handle:String!){product(handle:$handle){...TetherProduct}}",lt=()=>`query TetherServerCollection($handle:String!,$first:Int!,$after:String,$sortKey:ProductCollectionSortKeys,$reverse:Boolean,$filters:[ProductFilter!]){collection(handle:$handle){${T()} products(first:$first,after:$after,sortKey:$sortKey,reverse:$reverse,filters:$filters){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}}`,ct="query TetherServerProducts($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}}}",ut=()=>`query TetherServerCollections($first:Int!,$after:String){collections(first:$first,after:$after){nodes{${T()}}pageInfo{hasNextPage endCursor}}}`,dt=t=>`query TetherServerRecs(${t?"$id: ID!":"$handle: String!"},$intent:ProductRecommendationIntent){productRecommendations(${t?"productId: $id":"productHandle: $handle"},intent:$intent){...TetherProduct}}`,ft=S({product:$(q)}),pt=S({node:$(V)}),mt=S({collections:{nodes:[{handle:"string"}],pageInfo:{hasNextPage:"boolean"}}});async function gt(t){let e=[],r=null;for(let a=0;a<it;a++){let c=await k(t,ut(),{first:ot,after:r},mt);if(e.push(...c.collections.nodes),!c.collections.pageInfo.hasNextPage)break;r=c.collections.pageInfo.endCursor}return e}function Y(t,e){let r=(i,o,s)=>k(t,f=>`${i}
2
+ ${D(t,f)}`,o,s);async function a(i){let o=I(i);if(!o)return null;if(o.startsWith("gid://")){let{node:f}=await r(at,{id:o},pt);return f?.id?f:null}return(await r(st,{handle:o},ft)).product}async function c(i,{first:o=e,after:s=null,sortKey:f,reverse:m=!1,filters:w}){let h=await r(lt(),{handle:i,first:o,after:s,sortKey:f||void 0,reverse:m,filters:w??void 0},B);if(!h.collection)return{collection:null,products:[],pageInfo:{hasNextPage:!1,endCursor:null}};let{products:P,...et}=h.collection;return{collection:et,products:P.nodes,pageInfo:P.pageInfo}}async function u(i={}){let{collection:o,query:s,first:f=e,after:m=null,sortKey:w,reverse:h=!1}=i;if(o)return c(o,i);let P=await r(ct,{first:f,after:m,query:s||void 0,sortKey:w||void 0,reverse:h},J);return{collection:null,products:P.products.nodes,pageInfo:P.products.pageInfo}}async function d(i={}){let o=[],s=null;for(let f=0;f<rt;f++){let m=await u({...i,first:e,after:s});if(o.push(...m.products),!m.pageInfo.hasNextPage)break;s=m.pageInfo.endCursor}return o}async function n(i,o={}){let s=await u({...o,collection:i});return s.collection?{...s.collection,products:s.products,pageInfo:s.pageInfo}:null}async function l(i,o="RELATED"){let s=I(typeof i=="object"?i?.id:i);if(!s)throw new y("No product for recommendations",{code:"NOT_FOUND"});let f=s.startsWith("gid://");return(await r(dt(f),f?{id:s,intent:o}:{handle:s,intent:o},K)).productRecommendations??[]}return{getProduct:a,getProducts:u,allProducts:d,getCollection:n,allCollections:()=>gt(t),getRecommendations:l}}var W={size:"https://schema.org/size",color:"https://schema.org/color",colour:"https://schema.org/color",material:"https://schema.org/material"},E=t=>JSON.stringify(t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");function z(t){return JSON.parse(JSON.stringify(t))}var X=t=>t.split("/").pop()??t;function yt(t){return t.availableForSale?t.currentlyNotInStock?"https://schema.org/BackOrder":"https://schema.org/InStock":"https://schema.org/OutOfStock"}function Pt(t,e){if(!t.requiresSellingPlan)return e.price;let r=O(t).find(a=>v(e,a.id));return(r&&b(e,r.id))??e.price}function Z(t,e,r){let a=Pt(t,e),c=r?.includes("?")?"&":"?";return{"@type":"Offer",price:a.amount,priceCurrency:a.currencyCode,availability:yt(e),url:r?`${r}${c}variant=${X(e.id)}`:void 0}}function ht(t,e,r,a){let c=e.selectedOptions.flatMap(u=>{let d=W[u.name.toLowerCase()];return d?[[d.split("/").pop()??d,u.value]]:[]});return{"@type":"Product",name:`${t.title} - ${e.title}`,sku:e.sku||void 0,image:e.image?.url||a[0],...Object.fromEntries(c),offers:Z(t,e,r)}}function St(t,{url:e},r){if(e)return e;let a=C(r.productPath,t.handle,t.id);if(!(!r.siteUrl||!a))return new URL(a,r.siteUrl).toString()}function x(t,e,r){if(!t)return null;let a=St(t,e,r),c=t.images.nodes.map(i=>i.url).filter(Boolean),u=e.brand||t.vendor,d=u?{"@type":"Brand",name:u}:void 0,n=t.description.trim()||void 0,l=t.variants.nodes;if(l.length<=1){let[i]=l;return z({"@context":"https://schema.org","@type":"Product",name:t.title,description:n,url:a,image:c,sku:i?.sku||void 0,brand:d,offers:i?Z(t,i,a):void 0})}let p=t.options.map(i=>W[i.name.toLowerCase()]).filter(Boolean);return z({"@context":"https://schema.org","@type":"ProductGroup",name:t.title,description:n,url:a,productGroupID:X(t.id),image:c,brand:d,variesBy:[...new Set(p)],hasVariant:l.map(i=>ht(t,i,a,c))})}var Ct=25,It=2,Ot=1;function vt(t,{productPath:e=g.productPath,id:r}={}){return C(e,t,r)}function tt(t,e){for(let r of e){let a=t[r];if(typeof a=="string"&&a)return a}return""}function bt(t){let e={};for(let[u,d]of Object.entries(t))u in g&&(e[u]=d);let r=typeof t.domain=="string"&&t.domain?t.domain:"",a=typeof t.token=="string"&&t.token?t.token:"",c=N({...e,domain:r||tt(t,R.domain),token:a||tt(t,R.token)});return t.fetch&&(c.fetch=t.fetch),t.pageSize!==void 0&&(c.pageSize=t.pageSize),t.siteUrl!==void 0&&(c.siteUrl=t.siteUrl),c}var wt=t=>typeof t=="number"&&Number.isInteger(t)&&t>0?t:Ct;function $t(t,e){return{...t,description:"",descriptionHtml:"",images:{nodes:t.images.nodes.slice(0,Math.max(1,e))},variants:{nodes:t.variants.nodes.map(r=>({...r,image:null}))}}}function Gt(t={}){let e=bt(t);if(!e.domain||!e.token)throw new y("createStorefront needs domain and token: pass them, or import.meta.env with PUBLIC_SHOPIFY_DOMAIN and PUBLIC_SHOPIFY_STOREFRONT_TOKEN",{code:"NOT_CONFIGURED"});let r=Y(e,wt(e.pageSize)),a={productPath:e.productPath,siteUrl:e.siteUrl};function c(n,{card:l=!1,images:p=It}={}){let i=(Array.isArray(n)?n:[n]).filter(s=>s!=null),o={v:Ot,at:new Date().toISOString(),country:e.country||null,language:e.language||null,products:l?i.map(s=>$t(s,p)):i};return`<script type="application/json" data-tether-hydrate>${E(o)}<\/script>`}function u(n,l={}){return n?`<script type="application/ld+json">${E(x(n,l,a))}<\/script>`:""}function d(n,l={}){return H(n,{defaultPurchase:e.defaultPurchase,lowStock:e.lowStock,...l})}return{config:e,query:(n,l,p)=>U(e,n,l,p),...r,hydrate:c,formatMoney:(n,l=e.locale)=>A(n,l),formatPercent:(n,l=e.locale)=>_(n,l),imageUrl:L,jsonLd:u,jsonLdData:(n,l={})=>x(n,l,a),initialState:d,productUrl:(n,l={})=>vt(n,{productPath:e.productPath,...l}),plans:M}}export{y as TetherError,Gt as createStorefront,A as formatMoney,_ as formatPercent,L as imageUrl,H as initialState,M as plans,I as productKey,vt as productUrl,nt as withContext};
@@ -27,11 +27,11 @@
27
27
 
28
28
  // tether-core:dom.ts
29
29
  var m2 = window.Tether.__core["dom.ts"];
30
- var [ANALYTICS_EVENTS, attr, attributesFromJson, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, parseJSONAttr, productUrl, qsa, repeat, sel, setImage, setText, show] = m2;
30
+ var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m2;
31
31
 
32
32
  // tether-core:client.ts
33
33
  var m3 = window.Tether.__core["client.ts"];
34
- var [endpoint, gql, orNull, shaped, TetherError] = m3;
34
+ var [endpoint, gql, matches, orNull, shaped, TetherError] = m3;
35
35
 
36
36
  // server/src/shared/account-routes.ts
37
37
  var OPERATION_ROUTES = {
@@ -1 +1 @@
1
- (()=>{var De=Object.defineProperty;var Me=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})};var oe={};Me(oe,{addresses:()=>G,deleteAddress:()=>V,order:()=>j,renderPages:()=>bt,requestReturn:()=>K,saveAddress:()=>H,setup:()=>Te,showUnavailable:()=>wt,subscriptionAction:()=>J,subscriptions:()=>Z,updateProfile:()=>z});var qe=window.Tether.__core["config.ts"],[Tt,Ot,Et,St,Lt,T,Pt]=qe;var ve=window.Tether.__core["dom.ts"],[It,h,Rt,ue,P,b,p,Ct,Nt,Dt,Mt,qt,l,A,u,_,y,B]=ve;var He=window.Tether.__core["client.ts"],[Ht,Ft,Ut,_t,C]=He;var de={order:{name:"order",method:"GET",path:"/order",fields:{id:!0}},addresses:{name:"addresses",method:"GET",path:"/addresses",fields:{}},subscriptions:{name:"subscriptions",method:"GET",path:"/subscriptions",fields:{}},profile:{name:"profile",method:"POST",path:"/profile",fields:{firstName:!0,lastName:!0}},saveAddress:{name:"saveAddress",method:"POST",path:"/address",fields:{id:!0,address:!0,isDefault:!0}},deleteAddress:{name:"deleteAddress",method:"POST",path:"/address/delete",fields:{id:!0}},subscription:{name:"subscription",method:"POST",path:"/subscription",fields:{id:!0,action:!0}},requestReturn:{name:"requestReturn",method:"POST",path:"/return",fields:{orderId:!0,lines:!0}}},$t=new Map(Object.values(de).map(e=>[`${e.method} ${e.path}`,{...e,fields:Object.keys(e.fields)}]));function le(e,t){let n=de[e];if(n.method==="POST")return{method:"POST",path:n.path};let r=t,s=new URLSearchParams;for(let d of Object.keys(n.fields)){let c=r[d];(typeof c=="string"||typeof c=="number")&&s.set(d,String(c))}let o=s.toString();return{method:"GET",path:o?`${n.path}?${o}`:n.path}}function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function i(e,t){return g(e)?e[t]:void 0}function ce(e){return Array.isArray(e)?e:[]}function a(e){return typeof e=="string"&&e!==""?e:null}var $=e=>typeof e=="number"&&Number.isFinite(e)?e:null,N=e=>$(e)??0,k=(e,t)=>ce(e).map(n=>t(n)),x=(e,t)=>({nodes:k(i(e,"nodes"),t)}),W=e=>k(e,a).filter(t=>t!==null);function I(e){let t=a(i(e,"amount")),n=a(i(e,"currencyCode"));return t===null||n===null?null:{amount:t,currencyCode:n}}function X(e){let t=a(i(e,"url"));return t===null?null:{url:t,altText:a(i(e,"altText"))}}var me=e=>({title:a(i(e,"title")),variantTitle:a(i(e,"variantTitle")),quantity:N(i(e,"quantity")),image:X(i(e,"image"))});var ee=e=>new C(`Customer accounts: the answer has no ${e}`);function O(e,t){let n=a(e);if(!n)throw ee(t);return n}function fe(e){let t=n=>a(i(e,n));return{id:t("id"),firstName:t("firstName"),lastName:t("lastName"),company:t("company"),address1:t("address1"),address2:t("address2"),city:t("city"),province:t("province"),zoneCode:t("zoneCode"),zip:t("zip"),country:t("country"),countryCode:t("countryCode"),phoneNumber:t("phoneNumber"),formatted:W(i(e,"formatted"))}}var pe=e=>g(e)?fe(e):null,te=e=>({...fe(e),id:O(i(e,"id"),"address id")}),ge=e=>k(e,t=>({...te(t),isDefault:i(t,"isDefault")===!0})),Fe=e=>({...me(e),id:O(i(e,"id"),"line item id"),name:a(i(e,"name")),sku:a(i(e,"sku")),price:I(i(e,"price")),totalPrice:I(i(e,"totalPrice")),suggestedReturnReasonDefinitions:x(i(e,"suggestedReturnReasonDefinitions"),t=>({id:O(i(t,"id"),"return reason id"),name:a(i(t,"name")),handle:a(i(t,"handle"))}))}),Ue=e=>({id:a(i(e,"id")),status:a(i(e,"status")),createdAt:a(i(e,"createdAt")),estimatedDeliveryAt:a(i(e,"estimatedDeliveryAt")),latestShipmentStatus:a(i(e,"latestShipmentStatus")),trackingInformation:k(i(e,"trackingInformation"),t=>({company:a(i(t,"company")),number:a(i(t,"number")),url:a(i(t,"url"))}))});function _e(e){let t=a(i(i(e,"lineItem"),"id"));return{quantity:N(i(e,"quantity")),lineItem:t===null?null:{id:t}}}function Be(e){return g(e)?{returnableLineItems:x(e.returnableLineItems,_e)}:null}function ye(e){if(!g(e))return null;let t=s=>a(e[s]),n=s=>I(e[s]),r=e.requiresShipping;return{id:O(e.id,"order id"),name:t("name"),number:$(e.number),processedAt:t("processedAt"),cancelledAt:t("cancelledAt"),financialStatus:t("financialStatus"),fulfillmentStatus:t("fulfillmentStatus"),statusPageUrl:t("statusPageUrl"),requiresShipping:typeof r=="boolean"?r:null,totalPrice:n("totalPrice"),subtotal:n("subtotal"),totalShipping:n("totalShipping"),totalTax:n("totalTax"),shippingAddress:pe(e.shippingAddress),billingAddress:pe(e.billingAddress),lineItems:x(e.lineItems,Fe),fulfillments:x(e.fulfillments,Ue),returnInformation:Be(e.returnInformation),returns:x(e.returns,ne)}}var $e=e=>({id:a(i(e,"id")),name:a(i(e,"name")),title:a(i(e,"title")),variantTitle:a(i(e,"variantTitle")),quantity:N(i(e,"quantity")),sku:a(i(e,"sku")),currentPrice:I(i(e,"currentPrice")),lineDiscountedPrice:I(i(e,"lineDiscountedPrice")),image:X(i(e,"image"))}),he=e=>({cycleIndex:$(i(e,"cycleIndex")),skipped:i(e,"skipped")===!0,billingAttemptExpectedDate:a(i(e,"billingAttemptExpectedDate"))});function je(e){if(!g(e))return null;let t=e.intervalCount;return{interval:a(e.interval),intervalCount:g(t)?{count:N(t.count)}:null}}var ze=e=>({id:O(i(e,"id"),"subscription id"),status:a(i(e,"status")),nextBillingDate:a(i(e,"nextBillingDate")),currencyCode:a(i(e,"currencyCode")),deliveryPrice:I(i(e,"deliveryPrice")),deliveryPolicy:je(i(e,"deliveryPolicy")),lines:x(i(e,"lines"),$e),upcomingBillingCycles:x(i(e,"upcomingBillingCycles"),he)}),be=e=>k(e,ze);function we(e){let{contract:t,billingCycle:n}=e;if(g(t))return{contract:{id:a(t.id),status:a(t.status)}};if(g(n)){let{cycleIndex:r,skipped:s}=he(n);return{billingCycle:{cycleIndex:r,skipped:s}}}throw ee("changed subscription")}function ne(e){return{id:O(i(e,"id"),"return id"),status:a(i(e,"status"))}}var Ae=e=>O(e,"deleted address id"),xe=e=>({firstName:a(i(e,"firstName")),lastName:a(i(e,"lastName"))});var re=null;function Te(e){re=e}function D(){if(!re)throw new Error("account-pages: loaded without the account part");return re}async function E(e,t){let{serverFetch:n}=D(),{method:r,path:s}=le(e,t),o=await n(s,r==="POST"?{method:r,body:t}:{});if(o.kind==="logged-out")throw new C("Not logged in",{code:"NOT_LOGGED_IN",status:401});return o.data}function v(e){D().reset(),ue("account-updated",{what:e})}async function j(e){let t=await E("order",{id:e});return ye(t.order)}async function z({firstName:e,lastName:t}={}){let n=await E("profile",{firstName:e,lastName:t});return v("profile"),xe(n.customer)}async function G(){let e=await E("addresses",{});return ge(e.addresses)}async function H(e,{id:t,isDefault:n}={}){let r=await E("saveAddress",{id:t,address:e,isDefault:n});return v("addresses"),te(r.address)}async function V(e){let t=await E("deleteAddress",{id:e});return v("addresses"),Ae(t.deleted)}async function Z(){let e=await E("subscriptions",{});return be(e.subscriptions)}async function J(e,t){let n=await E("subscription",{id:e,action:t});return v("subscriptions"),we(n)}async function K(e,t){let n=await E("requestReturn",{orderId:e,lines:t});return v("orders"),ne(n.return)}var Ge=window.Tether.__core["shopify-values.ts"],[se]=Ge;function m(e,t,n){l(e,u(t)).forEach(r=>{let s=p(r,t)??"";Object.hasOwn(n,s)&&B(r,n[s]===!0)})}var S=(e,t)=>l(e,u(t)).concat(e.matches(u(t))?[e]:[]),L=e=>e?e.toLowerCase().replace(/_/g," "):"",F=e=>(e?.formatted??[]).join(", "),w=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0;var Ve=(e,t)=>({title:e.title||e.name||"","variant-title":e.variantTitle||"",quantity:String(e.quantity),price:b(e.price),total:b(e.totalPrice),sku:e.sku||"",returnable:t===null?void 0:String(t)}),Ze=e=>e.tagName==="INPUT";function Je(e,t,n){m(e,"order-line-show",{returnable:n>0}),l(e,u("return-quantity")).forEach(r=>{Ze(r)&&(r.max=String(n),r.min="0",r.value||(r.value="0"),r.disabled=n<1)}),l(e,`select${u("return-reason")}`).forEach(r=>{r.dataset.tetherFilled!==t.id&&(r.dataset.tetherFilled=t.id,(t.suggestedReturnReasonDefinitions?.nodes??[]).forEach(s=>{r.appendChild(new Option(s.name??"",s.id))}))})}function Oe(e,t,n){A(e,t,(r,s)=>{let o=s.id,d=n&&o?n.get(o)??0:null;o&&(r.dataset.tetherLine=o);let c=Ve(s,d);S(r,"order-line").forEach(f=>{let R=p(f,"order-line")??"";if(R==="image"){s.image&&_(f,s.image.url,s.image.altText||s.title||"");return}let ae=w(c,R);ae!==void 0&&y(f,ae)}),o&&d!==null&&Je(r,{...s,id:o},d)})}function Ke(e){let t=p(e,"order")||"";return t.startsWith("url:")?new URL(window.location.href).searchParams.get(t.slice(4)||"id"):t}function U(e,t){e.setAttribute(h("order-state"),t),m(e,"order-show",{loading:t==="loading",ready:!1,"not-found":t==="not-found",error:t==="error"})}var Ye=e=>({name:e.name??"",date:P(e.processedAt),total:b(e.totalPrice),subtotal:b(e.subtotal),shipping:b(e.totalShipping),tax:b(e.totalTax),status:L(e.financialStatus),fulfillment:L(e.fulfillmentStatus),"shipping-address":F(e.shippingAddress),"billing-address":F(e.billingAddress),items:e.lineItems.nodes.map(t=>`${String(t.quantity)}\xD7 ${t.title||t.name||""}`).join(", "),cancelled:P(e.cancelledAt)});function Qe(e,t){let n=t.trackingInformation[0],r={status:L(t.latestShipmentStatus||t.status),date:P(t.createdAt),eta:P(t.estimatedDeliveryAt),company:n?.company||"",number:n?.number||""};S(e,"fulfillment-bind").forEach(s=>{let o=p(s,"fulfillment-bind")??"";if(o==="url"){let c=n?.url??null,f=c!==null&&se(c);f&&s.setAttribute("href",c),B(s,f);return}let d=w(r,o);d!==void 0&&y(s,d)})}function We(e,t){let n=new Map((t.returnInformation?.returnableLineItems.nodes??[]).map(d=>[d.lineItem?.id??"",d.quantity])),r=t.fulfillments.nodes,s=Ye(t);l(e,u("order-bind")).forEach(d=>{let c=p(d,"order-bind")??"";if(c==="url"){let R=t.statusPageUrl;R!==null&&se(R)&&d.setAttribute("href",R);return}let f=w(s,c);f!==void 0&&y(d,f)}),l(e,u("order-lines")).forEach(d=>{Oe(d,t.lineItems.nodes,n)}),l(e,u("order-fulfillments")).forEach(d=>{A(d,r,Qe)});let o=e.dataset.tetherReturned==="1";m(e,"order-show",{loading:!1,ready:!0,error:!1,"not-found":!1,cancelled:!!t.cancelledAt,shipped:r.length>0,returnable:[...n.values()].some(d=>d>0),"has-returns":!o&&t.returns.nodes.length>0,"return-requested":o}),e.setAttribute(h("order-state"),"ready")}async function Y(e){let t=Ke(e);if(!t){e.setAttribute(h("order-state"),"not-found"),m(e,"order-show",{"not-found":!0});return}U(e,"loading");let n;try{n=await j(t)}catch(r){T(r,"order"),U(e,"error");return}if(!n){U(e,"not-found");return}e.dataset.tetherOrderId=n.id,We(e,n)}var Ee=[],Se=e=>Ee.find(t=>t.id===e),Xe=e=>({formatted:F(e),name:[e.firstName,e.lastName].filter(Boolean).join(" "),company:e.company||"",address1:e.address1||"",address2:e.address2||"",city:e.city||"",zip:e.zip||"",province:e.province||"",country:e.country||"",phone:e.phoneNumber||""});function et(e,t){e.dataset.tetherAddress=t.id;let n=Xe(t);S(e,"address-bind").forEach(r=>{let s=w(n,p(r,"address-bind")??"");s!==void 0&&y(r,s)}),m(e,"address-show",{default:t.isDefault,"not-default":!t.isDefault})}async function M(e){let t=l(e,u("addresses"));if(!t.length)return;m(e,"show",{"addresses-loading":!0,"addresses-empty":!1});let n;try{n=await G()}catch(r){T(r,"addresses"),m(e,"show",{"addresses-loading":!1,"addresses-error":!0});return}Ee=n,m(e,"show",{"addresses-loading":!1,"addresses-empty":n.length===0,"addresses-error":!1}),t.forEach(r=>{A(r,n,et)})}function tt(e){let t=e.upcomingBillingCycles.nodes[0],n=e.status,r=n==="ACTIVE";return{active:r,paused:n==="PAUSED",cancelled:n==="CANCELLED",expired:n==="EXPIRED",failed:n==="FAILED",skipped:!!t?.skipped,"can-pause":r,"can-resume":n==="PAUSED"||n==="FAILED","can-skip":r&&t!==void 0&&!t.skipped,"can-unskip":r&&!!t?.skipped,"can-cancel":r||n==="PAUSED"||n==="FAILED"}}function nt(e){let t=L(e.deliveryPolicy?.interval);if(!t)return"";let n=e.deliveryPolicy?.intervalCount?.count??1;return n<=1?t:`${String(n)} ${t}s`}function rt(e){let t=e.lines.nodes,n=t.reduce((r,s)=>r+Number.parseFloat(s.lineDiscountedPrice?.amount??"0"),0);return{status:L(e.status),next:P(e.nextBillingDate),interval:nt(e),products:t.map(r=>`${String(r.quantity)}\xD7 ${r.title??""}`).join(", "),total:b(t.length&&e.currencyCode?{amount:String(n),currencyCode:e.currencyCode}:null),delivery:b(e.deliveryPrice)}}function st(e,t){let n={title:t.title??"","variant-title":t.variantTitle||"",quantity:String(t.quantity),price:b(t.currentPrice)};S(e,"subscription-line").forEach(r=>{let s=p(r,"subscription-line")??"";if(s==="image"){t.image&&_(r,t.image.url,t.image.altText||t.title||"");return}let o=w(n,s);o!==void 0&&y(r,o)})}function it(e,t){e.dataset.tetherSubscription=t.id,e.setAttribute(h("subscription-status"),L(t.status));let n=rt(t);l(e,u("subscription-bind")).forEach(s=>{let o=w(n,p(s,"subscription-bind")??"");o!==void 0&&y(s,o)}),l(e,u("subscription-lines")).forEach(s=>{A(s,t.lines.nodes,st)});let r=tt(t);m(e,"subscription-show",r),l(e,u("subscription-action")).forEach(s=>{let o=w(r,`can-${p(s,"subscription-action")??""}`)===!0;"disabled"in s&&(s.disabled=!o),s.classList.toggle("is-disabled",!o)})}async function Q(e){let t=l(e,u("subscriptions"));if(!t.length)return;m(e,"show",{"subscriptions-loading":!0,"subscriptions-empty":!1});let n;try{n=await Z()}catch(r){T(r,"subscriptions"),m(e,"show",{"subscriptions-loading":!1,"subscriptions-error":!0});return}m(e,"show",{"subscriptions-loading":!1,"subscriptions-empty":n.length===0,"subscriptions-error":!1}),t.forEach(r=>{A(r,n,it)})}var ot=["pause","resume","skip","unskip","cancel"],at=e=>ot.some(t=>t===e),Pe=e=>e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement,ke=e=>e instanceof window.HTMLFormElement;function Le(e){let t={};for(let n of e.elements)Pe(n)&&(!n.name||n.type==="submit"||n.type==="button"||n.type==="checkbox"||(t[n.name]=n.value));return t}function ut(e){let n=(e instanceof C?e.userErrors??[]:[]).map(s=>s.message).join(" ");return n||(e instanceof Error&&e.message?e.message:"Something went wrong").replace(/^Customer accounts: /,"")}async function q(e,t){if(e.getAttribute("aria-busy")==="true")return"busy";e.classList.add("is-busy"),e.setAttribute("aria-busy","true"),e.setAttribute(h("form-state"),"pending");let n=l(e,u("form-error"));n.forEach(r=>{y(r,"")});try{return await t(),e.setAttribute(h("form-state"),"saved"),"saved"}catch(r){return e.setAttribute(h("form-state"),"error"),n.forEach(s=>{y(s,ut(r))}),"error"}finally{e.classList.remove("is-busy"),e.removeAttribute("aria-busy")}}var ie=e=>{let t=p(e,"confirm");return!t||window.confirm(t)},Ie=e=>{e.reset(),delete e.dataset.tetherAddressId};function dt(e){let t=e.target;if(t instanceof window.HTMLFormElement){if(t.matches(u("profile-form")))e.preventDefault(),q(t,async()=>{await z(Le(t)),await D().bindCustomer(document)});else if(t.matches(u("address-form"))){e.preventDefault();let n=t.dataset.tetherAddressId,r=t.elements.namedItem("isDefault"),s=r instanceof window.HTMLInputElement&&r.checked;q(t,async()=>{await H(Le(t),{id:n,isDefault:s}),Ie(t),await M(document)})}}}function lt(e){let t=Se(e),n=document.querySelector(u("address-form"));if(!t||!n||!ke(n))return;n.dataset.tetherAddressId=t.id;let r={...t};for(let s of n.elements)if(Pe(s)){if(s.name==="isDefault")s instanceof window.HTMLInputElement&&(s.checked=t.isDefault);else if(s.name&&Object.hasOwn(r,s.name)){let o=r[s.name];s.value=typeof o=="string"?o:""}}n.scrollIntoView({block:"nearest"})}function ct(e,t){let n=t.closest("[data-tether-address]"),r=n instanceof window.HTMLElement?n.dataset.tetherAddress:void 0;if(t.closest(u("address-new"))){let o=document.querySelector(u("address-form"));return o&&ke(o)&&Ie(o),!0}if(!(n instanceof window.HTMLElement)||!r)return!1;let s=t.closest(u("address-delete"));if(s){if(e.preventDefault(),!ie(s))return!0;q(n,async()=>{await V(r),await M(document)})}else if(t.closest(u("address-default")))e.preventDefault(),q(n,async()=>{await H(null,{id:r,isDefault:!0}),await M(document)});else if(t.closest(u("address-edit")))e.preventDefault(),lt(r);else return!1;return!0}function mt(e){let t=e.closest("[data-tether-subscription]"),n=p(e,"subscription-action"),r="disabled"in e&&e.disabled===!0||e.classList.contains("is-disabled");if(!(t instanceof window.HTMLElement)||!at(n)||r||!ie(e))return;let s=t.dataset.tetherSubscription??"";t.setAttribute(h("subscription-state"),"pending"),q(t,async()=>{await J(s,n),await Q(document)}).then(o=>{let d=o==="error"?"error":"done";l(document,"[data-tether-subscription]").filter(c=>c===t||c.dataset.tetherSubscription===s).forEach(c=>{c.setAttribute(h("subscription-state"),d)})})}function pt(e){let t=e.querySelector(u("return-quantity")),n=e.querySelector(u("return-reason")),r=e.querySelector(u("return-note")),s=f=>f&&"value"in f&&typeof f.value=="string"?f.value:"",o={lineItemId:e.dataset.tetherLine??"",quantity:Number.parseInt(s(t)||"0",10)},d=s(n);d&&(o.reasonId=d);let c=s(r);return c&&(o.note=c),o}function ft(e){let t=e.closest(u("order"));if(!(t instanceof window.HTMLElement))return;let n=t.dataset.tetherOrderId;if(!n)return;let r=l(t,"[data-tether-line]").map(pt).filter(s=>s.quantity>0);!r.length||!ie(e)||q(t,async()=>{await K(n,r),t.dataset.tetherReturned="1",await Y(t)})}function gt(e){let t=e.target;if(!(t instanceof window.Element)||ct(e,t))return;let n=t.closest(u("subscription-action"));if(n instanceof window.HTMLElement){e.preventDefault(),mt(n);return}let r=t.closest(u("order-return"));r instanceof window.HTMLElement&&(e.preventDefault(),ft(r))}function Re(){document.addEventListener("submit",dt,!0),document.addEventListener("input",e=>{let t=e.target;t instanceof window.HTMLElement&&t.closest(u("profile-form"))&&(t.dataset.tetherTouched="1")}),document.addEventListener("click",gt)}var yt=["firstName","lastName"];async function ht(e){if(!(e instanceof window.HTMLFormElement))return;let t;try{t=await D().customer()}catch(r){T(r,"account");return}if(!t)return;let n=e.elements;yt.forEach(r=>{let s=n.namedItem(r);(s instanceof window.HTMLInputElement||s instanceof window.HTMLTextAreaElement)&&!s.dataset.tetherTouched&&(s.value=t[r]??"")})}var Ce=!1;async function bt(e=document){Ce||(Ce=!0,Re()),await Promise.all([...l(e,u("order")).map(t=>Y(t)),...l(e,u("profile-form")).map(t=>ht(t)),M(e),Q(e)])}function wt(e){l(e,u("order")).forEach(t=>{U(t,"error")}),m(e,"show",{"addresses-loading":!1,"addresses-error":!0,"subscriptions-loading":!1,"subscriptions-error":!0})}function At(e){return g(e)&&g(e.__core)&&g(e.__parts)}function Ne(e,t){let n=Reflect.get(window,"Tether");if(!At(n))throw new Error(`tether.${e}.js runs after the Tether script, which loads it, and needs its window.Tether`);n.__parts[e]=t}Ne("account-pages",oe);})();
1
+ (()=>{var De=Object.defineProperty;var Me=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})};var oe={};Me(oe,{addresses:()=>G,deleteAddress:()=>V,order:()=>j,renderPages:()=>bt,requestReturn:()=>K,saveAddress:()=>H,setup:()=>Te,showUnavailable:()=>wt,subscriptionAction:()=>J,subscriptions:()=>Z,updateProfile:()=>z});var qe=window.Tether.__core["config.ts"],[Tt,Ot,Et,St,Lt,T,Pt]=qe;var ve=window.Tether.__core["dom.ts"],[It,h,Rt,Ct,ue,P,b,p,Nt,Dt,Mt,qt,vt,Ht,l,A,Ft,u,_,Ut,y,B]=ve;var He=window.Tether.__core["client.ts"],[Bt,$t,jt,zt,Gt,C]=He;var de={order:{name:"order",method:"GET",path:"/order",fields:{id:!0}},addresses:{name:"addresses",method:"GET",path:"/addresses",fields:{}},subscriptions:{name:"subscriptions",method:"GET",path:"/subscriptions",fields:{}},profile:{name:"profile",method:"POST",path:"/profile",fields:{firstName:!0,lastName:!0}},saveAddress:{name:"saveAddress",method:"POST",path:"/address",fields:{id:!0,address:!0,isDefault:!0}},deleteAddress:{name:"deleteAddress",method:"POST",path:"/address/delete",fields:{id:!0}},subscription:{name:"subscription",method:"POST",path:"/subscription",fields:{id:!0,action:!0}},requestReturn:{name:"requestReturn",method:"POST",path:"/return",fields:{orderId:!0,lines:!0}}},Zt=new Map(Object.values(de).map(e=>[`${e.method} ${e.path}`,{...e,fields:Object.keys(e.fields)}]));function le(e,t){let n=de[e];if(n.method==="POST")return{method:"POST",path:n.path};let r=t,s=new URLSearchParams;for(let d of Object.keys(n.fields)){let c=r[d];(typeof c=="string"||typeof c=="number")&&s.set(d,String(c))}let o=s.toString();return{method:"GET",path:o?`${n.path}?${o}`:n.path}}function g(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function i(e,t){return g(e)?e[t]:void 0}function ce(e){return Array.isArray(e)?e:[]}function a(e){return typeof e=="string"&&e!==""?e:null}var $=e=>typeof e=="number"&&Number.isFinite(e)?e:null,N=e=>$(e)??0,k=(e,t)=>ce(e).map(n=>t(n)),x=(e,t)=>({nodes:k(i(e,"nodes"),t)}),W=e=>k(e,a).filter(t=>t!==null);function I(e){let t=a(i(e,"amount")),n=a(i(e,"currencyCode"));return t===null||n===null?null:{amount:t,currencyCode:n}}function X(e){let t=a(i(e,"url"));return t===null?null:{url:t,altText:a(i(e,"altText"))}}var me=e=>({title:a(i(e,"title")),variantTitle:a(i(e,"variantTitle")),quantity:N(i(e,"quantity")),image:X(i(e,"image"))});var ee=e=>new C(`Customer accounts: the answer has no ${e}`);function O(e,t){let n=a(e);if(!n)throw ee(t);return n}function fe(e){let t=n=>a(i(e,n));return{id:t("id"),firstName:t("firstName"),lastName:t("lastName"),company:t("company"),address1:t("address1"),address2:t("address2"),city:t("city"),province:t("province"),zoneCode:t("zoneCode"),zip:t("zip"),country:t("country"),countryCode:t("countryCode"),phoneNumber:t("phoneNumber"),formatted:W(i(e,"formatted"))}}var pe=e=>g(e)?fe(e):null,te=e=>({...fe(e),id:O(i(e,"id"),"address id")}),ge=e=>k(e,t=>({...te(t),isDefault:i(t,"isDefault")===!0})),Fe=e=>({...me(e),id:O(i(e,"id"),"line item id"),name:a(i(e,"name")),sku:a(i(e,"sku")),price:I(i(e,"price")),totalPrice:I(i(e,"totalPrice")),suggestedReturnReasonDefinitions:x(i(e,"suggestedReturnReasonDefinitions"),t=>({id:O(i(t,"id"),"return reason id"),name:a(i(t,"name")),handle:a(i(t,"handle"))}))}),Ue=e=>({id:a(i(e,"id")),status:a(i(e,"status")),createdAt:a(i(e,"createdAt")),estimatedDeliveryAt:a(i(e,"estimatedDeliveryAt")),latestShipmentStatus:a(i(e,"latestShipmentStatus")),trackingInformation:k(i(e,"trackingInformation"),t=>({company:a(i(t,"company")),number:a(i(t,"number")),url:a(i(t,"url"))}))});function _e(e){let t=a(i(i(e,"lineItem"),"id"));return{quantity:N(i(e,"quantity")),lineItem:t===null?null:{id:t}}}function Be(e){return g(e)?{returnableLineItems:x(e.returnableLineItems,_e)}:null}function ye(e){if(!g(e))return null;let t=s=>a(e[s]),n=s=>I(e[s]),r=e.requiresShipping;return{id:O(e.id,"order id"),name:t("name"),number:$(e.number),processedAt:t("processedAt"),cancelledAt:t("cancelledAt"),financialStatus:t("financialStatus"),fulfillmentStatus:t("fulfillmentStatus"),statusPageUrl:t("statusPageUrl"),requiresShipping:typeof r=="boolean"?r:null,totalPrice:n("totalPrice"),subtotal:n("subtotal"),totalShipping:n("totalShipping"),totalTax:n("totalTax"),shippingAddress:pe(e.shippingAddress),billingAddress:pe(e.billingAddress),lineItems:x(e.lineItems,Fe),fulfillments:x(e.fulfillments,Ue),returnInformation:Be(e.returnInformation),returns:x(e.returns,ne)}}var $e=e=>({id:a(i(e,"id")),name:a(i(e,"name")),title:a(i(e,"title")),variantTitle:a(i(e,"variantTitle")),quantity:N(i(e,"quantity")),sku:a(i(e,"sku")),currentPrice:I(i(e,"currentPrice")),lineDiscountedPrice:I(i(e,"lineDiscountedPrice")),image:X(i(e,"image"))}),he=e=>({cycleIndex:$(i(e,"cycleIndex")),skipped:i(e,"skipped")===!0,billingAttemptExpectedDate:a(i(e,"billingAttemptExpectedDate"))});function je(e){if(!g(e))return null;let t=e.intervalCount;return{interval:a(e.interval),intervalCount:g(t)?{count:N(t.count)}:null}}var ze=e=>({id:O(i(e,"id"),"subscription id"),status:a(i(e,"status")),nextBillingDate:a(i(e,"nextBillingDate")),currencyCode:a(i(e,"currencyCode")),deliveryPrice:I(i(e,"deliveryPrice")),deliveryPolicy:je(i(e,"deliveryPolicy")),lines:x(i(e,"lines"),$e),upcomingBillingCycles:x(i(e,"upcomingBillingCycles"),he)}),be=e=>k(e,ze);function we(e){let{contract:t,billingCycle:n}=e;if(g(t))return{contract:{id:a(t.id),status:a(t.status)}};if(g(n)){let{cycleIndex:r,skipped:s}=he(n);return{billingCycle:{cycleIndex:r,skipped:s}}}throw ee("changed subscription")}function ne(e){return{id:O(i(e,"id"),"return id"),status:a(i(e,"status"))}}var Ae=e=>O(e,"deleted address id"),xe=e=>({firstName:a(i(e,"firstName")),lastName:a(i(e,"lastName"))});var re=null;function Te(e){re=e}function D(){if(!re)throw new Error("account-pages: loaded without the account part");return re}async function E(e,t){let{serverFetch:n}=D(),{method:r,path:s}=le(e,t),o=await n(s,r==="POST"?{method:r,body:t}:{});if(o.kind==="logged-out")throw new C("Not logged in",{code:"NOT_LOGGED_IN",status:401});return o.data}function v(e){D().reset(),ue("account-updated",{what:e})}async function j(e){let t=await E("order",{id:e});return ye(t.order)}async function z({firstName:e,lastName:t}={}){let n=await E("profile",{firstName:e,lastName:t});return v("profile"),xe(n.customer)}async function G(){let e=await E("addresses",{});return ge(e.addresses)}async function H(e,{id:t,isDefault:n}={}){let r=await E("saveAddress",{id:t,address:e,isDefault:n});return v("addresses"),te(r.address)}async function V(e){let t=await E("deleteAddress",{id:e});return v("addresses"),Ae(t.deleted)}async function Z(){let e=await E("subscriptions",{});return be(e.subscriptions)}async function J(e,t){let n=await E("subscription",{id:e,action:t});return v("subscriptions"),we(n)}async function K(e,t){let n=await E("requestReturn",{orderId:e,lines:t});return v("orders"),ne(n.return)}var Ge=window.Tether.__core["shopify-values.ts"],[se]=Ge;function m(e,t,n){l(e,u(t)).forEach(r=>{let s=p(r,t)??"";Object.hasOwn(n,s)&&B(r,n[s]===!0)})}var S=(e,t)=>l(e,u(t)).concat(e.matches(u(t))?[e]:[]),L=e=>e?e.toLowerCase().replace(/_/g," "):"",F=e=>(e?.formatted??[]).join(", "),w=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0;var Ve=(e,t)=>({title:e.title||e.name||"","variant-title":e.variantTitle||"",quantity:String(e.quantity),price:b(e.price),total:b(e.totalPrice),sku:e.sku||"",returnable:t===null?void 0:String(t)}),Ze=e=>e.tagName==="INPUT";function Je(e,t,n){m(e,"order-line-show",{returnable:n>0}),l(e,u("return-quantity")).forEach(r=>{Ze(r)&&(r.max=String(n),r.min="0",r.value||(r.value="0"),r.disabled=n<1)}),l(e,`select${u("return-reason")}`).forEach(r=>{r.dataset.tetherFilled!==t.id&&(r.dataset.tetherFilled=t.id,(t.suggestedReturnReasonDefinitions?.nodes??[]).forEach(s=>{r.appendChild(new Option(s.name??"",s.id))}))})}function Oe(e,t,n){A(e,t,(r,s)=>{let o=s.id,d=n&&o?n.get(o)??0:null;o&&(r.dataset.tetherLine=o);let c=Ve(s,d);S(r,"order-line").forEach(f=>{let R=p(f,"order-line")??"";if(R==="image"){s.image&&_(f,s.image.url,s.image.altText||s.title||"");return}let ae=w(c,R);ae!==void 0&&y(f,ae)}),o&&d!==null&&Je(r,{...s,id:o},d)})}function Ke(e){let t=p(e,"order")||"";return t.startsWith("url:")?new URL(window.location.href).searchParams.get(t.slice(4)||"id"):t}function U(e,t){e.setAttribute(h("order-state"),t),m(e,"order-show",{loading:t==="loading",ready:!1,"not-found":t==="not-found",error:t==="error"})}var Ye=e=>({name:e.name??"",date:P(e.processedAt),total:b(e.totalPrice),subtotal:b(e.subtotal),shipping:b(e.totalShipping),tax:b(e.totalTax),status:L(e.financialStatus),fulfillment:L(e.fulfillmentStatus),"shipping-address":F(e.shippingAddress),"billing-address":F(e.billingAddress),items:e.lineItems.nodes.map(t=>`${String(t.quantity)}\xD7 ${t.title||t.name||""}`).join(", "),cancelled:P(e.cancelledAt)});function Qe(e,t){let n=t.trackingInformation[0],r={status:L(t.latestShipmentStatus||t.status),date:P(t.createdAt),eta:P(t.estimatedDeliveryAt),company:n?.company||"",number:n?.number||""};S(e,"fulfillment-bind").forEach(s=>{let o=p(s,"fulfillment-bind")??"";if(o==="url"){let c=n?.url??null,f=c!==null&&se(c);f&&s.setAttribute("href",c),B(s,f);return}let d=w(r,o);d!==void 0&&y(s,d)})}function We(e,t){let n=new Map((t.returnInformation?.returnableLineItems.nodes??[]).map(d=>[d.lineItem?.id??"",d.quantity])),r=t.fulfillments.nodes,s=Ye(t);l(e,u("order-bind")).forEach(d=>{let c=p(d,"order-bind")??"";if(c==="url"){let R=t.statusPageUrl;R!==null&&se(R)&&d.setAttribute("href",R);return}let f=w(s,c);f!==void 0&&y(d,f)}),l(e,u("order-lines")).forEach(d=>{Oe(d,t.lineItems.nodes,n)}),l(e,u("order-fulfillments")).forEach(d=>{A(d,r,Qe)});let o=e.dataset.tetherReturned==="1";m(e,"order-show",{loading:!1,ready:!0,error:!1,"not-found":!1,cancelled:!!t.cancelledAt,shipped:r.length>0,returnable:[...n.values()].some(d=>d>0),"has-returns":!o&&t.returns.nodes.length>0,"return-requested":o}),e.setAttribute(h("order-state"),"ready")}async function Y(e){let t=Ke(e);if(!t){e.setAttribute(h("order-state"),"not-found"),m(e,"order-show",{"not-found":!0});return}U(e,"loading");let n;try{n=await j(t)}catch(r){T(r,"order"),U(e,"error");return}if(!n){U(e,"not-found");return}e.dataset.tetherOrderId=n.id,We(e,n)}var Ee=[],Se=e=>Ee.find(t=>t.id===e),Xe=e=>({formatted:F(e),name:[e.firstName,e.lastName].filter(Boolean).join(" "),company:e.company||"",address1:e.address1||"",address2:e.address2||"",city:e.city||"",zip:e.zip||"",province:e.province||"",country:e.country||"",phone:e.phoneNumber||""});function et(e,t){e.dataset.tetherAddress=t.id;let n=Xe(t);S(e,"address-bind").forEach(r=>{let s=w(n,p(r,"address-bind")??"");s!==void 0&&y(r,s)}),m(e,"address-show",{default:t.isDefault,"not-default":!t.isDefault})}async function M(e){let t=l(e,u("addresses"));if(!t.length)return;m(e,"show",{"addresses-loading":!0,"addresses-empty":!1});let n;try{n=await G()}catch(r){T(r,"addresses"),m(e,"show",{"addresses-loading":!1,"addresses-error":!0});return}Ee=n,m(e,"show",{"addresses-loading":!1,"addresses-empty":n.length===0,"addresses-error":!1}),t.forEach(r=>{A(r,n,et)})}function tt(e){let t=e.upcomingBillingCycles.nodes[0],n=e.status,r=n==="ACTIVE";return{active:r,paused:n==="PAUSED",cancelled:n==="CANCELLED",expired:n==="EXPIRED",failed:n==="FAILED",skipped:!!t?.skipped,"can-pause":r,"can-resume":n==="PAUSED"||n==="FAILED","can-skip":r&&t!==void 0&&!t.skipped,"can-unskip":r&&!!t?.skipped,"can-cancel":r||n==="PAUSED"||n==="FAILED"}}function nt(e){let t=L(e.deliveryPolicy?.interval);if(!t)return"";let n=e.deliveryPolicy?.intervalCount?.count??1;return n<=1?t:`${String(n)} ${t}s`}function rt(e){let t=e.lines.nodes,n=t.reduce((r,s)=>r+Number.parseFloat(s.lineDiscountedPrice?.amount??"0"),0);return{status:L(e.status),next:P(e.nextBillingDate),interval:nt(e),products:t.map(r=>`${String(r.quantity)}\xD7 ${r.title??""}`).join(", "),total:b(t.length&&e.currencyCode?{amount:String(n),currencyCode:e.currencyCode}:null),delivery:b(e.deliveryPrice)}}function st(e,t){let n={title:t.title??"","variant-title":t.variantTitle||"",quantity:String(t.quantity),price:b(t.currentPrice)};S(e,"subscription-line").forEach(r=>{let s=p(r,"subscription-line")??"";if(s==="image"){t.image&&_(r,t.image.url,t.image.altText||t.title||"");return}let o=w(n,s);o!==void 0&&y(r,o)})}function it(e,t){e.dataset.tetherSubscription=t.id,e.setAttribute(h("subscription-status"),L(t.status));let n=rt(t);l(e,u("subscription-bind")).forEach(s=>{let o=w(n,p(s,"subscription-bind")??"");o!==void 0&&y(s,o)}),l(e,u("subscription-lines")).forEach(s=>{A(s,t.lines.nodes,st)});let r=tt(t);m(e,"subscription-show",r),l(e,u("subscription-action")).forEach(s=>{let o=w(r,`can-${p(s,"subscription-action")??""}`)===!0;"disabled"in s&&(s.disabled=!o),s.classList.toggle("is-disabled",!o)})}async function Q(e){let t=l(e,u("subscriptions"));if(!t.length)return;m(e,"show",{"subscriptions-loading":!0,"subscriptions-empty":!1});let n;try{n=await Z()}catch(r){T(r,"subscriptions"),m(e,"show",{"subscriptions-loading":!1,"subscriptions-error":!0});return}m(e,"show",{"subscriptions-loading":!1,"subscriptions-empty":n.length===0,"subscriptions-error":!1}),t.forEach(r=>{A(r,n,it)})}var ot=["pause","resume","skip","unskip","cancel"],at=e=>ot.some(t=>t===e),Pe=e=>e instanceof window.HTMLInputElement||e instanceof window.HTMLSelectElement||e instanceof window.HTMLTextAreaElement,ke=e=>e instanceof window.HTMLFormElement;function Le(e){let t={};for(let n of e.elements)Pe(n)&&(!n.name||n.type==="submit"||n.type==="button"||n.type==="checkbox"||(t[n.name]=n.value));return t}function ut(e){let n=(e instanceof C?e.userErrors??[]:[]).map(s=>s.message).join(" ");return n||(e instanceof Error&&e.message?e.message:"Something went wrong").replace(/^Customer accounts: /,"")}async function q(e,t){if(e.getAttribute("aria-busy")==="true")return"busy";e.classList.add("is-busy"),e.setAttribute("aria-busy","true"),e.setAttribute(h("form-state"),"pending");let n=l(e,u("form-error"));n.forEach(r=>{y(r,"")});try{return await t(),e.setAttribute(h("form-state"),"saved"),"saved"}catch(r){return e.setAttribute(h("form-state"),"error"),n.forEach(s=>{y(s,ut(r))}),"error"}finally{e.classList.remove("is-busy"),e.removeAttribute("aria-busy")}}var ie=e=>{let t=p(e,"confirm");return!t||window.confirm(t)},Ie=e=>{e.reset(),delete e.dataset.tetherAddressId};function dt(e){let t=e.target;if(t instanceof window.HTMLFormElement){if(t.matches(u("profile-form")))e.preventDefault(),q(t,async()=>{await z(Le(t)),await D().bindCustomer(document)});else if(t.matches(u("address-form"))){e.preventDefault();let n=t.dataset.tetherAddressId,r=t.elements.namedItem("isDefault"),s=r instanceof window.HTMLInputElement&&r.checked;q(t,async()=>{await H(Le(t),{id:n,isDefault:s}),Ie(t),await M(document)})}}}function lt(e){let t=Se(e),n=document.querySelector(u("address-form"));if(!t||!n||!ke(n))return;n.dataset.tetherAddressId=t.id;let r={...t};for(let s of n.elements)if(Pe(s)){if(s.name==="isDefault")s instanceof window.HTMLInputElement&&(s.checked=t.isDefault);else if(s.name&&Object.hasOwn(r,s.name)){let o=r[s.name];s.value=typeof o=="string"?o:""}}n.scrollIntoView({block:"nearest"})}function ct(e,t){let n=t.closest("[data-tether-address]"),r=n instanceof window.HTMLElement?n.dataset.tetherAddress:void 0;if(t.closest(u("address-new"))){let o=document.querySelector(u("address-form"));return o&&ke(o)&&Ie(o),!0}if(!(n instanceof window.HTMLElement)||!r)return!1;let s=t.closest(u("address-delete"));if(s){if(e.preventDefault(),!ie(s))return!0;q(n,async()=>{await V(r),await M(document)})}else if(t.closest(u("address-default")))e.preventDefault(),q(n,async()=>{await H(null,{id:r,isDefault:!0}),await M(document)});else if(t.closest(u("address-edit")))e.preventDefault(),lt(r);else return!1;return!0}function mt(e){let t=e.closest("[data-tether-subscription]"),n=p(e,"subscription-action"),r="disabled"in e&&e.disabled===!0||e.classList.contains("is-disabled");if(!(t instanceof window.HTMLElement)||!at(n)||r||!ie(e))return;let s=t.dataset.tetherSubscription??"";t.setAttribute(h("subscription-state"),"pending"),q(t,async()=>{await J(s,n),await Q(document)}).then(o=>{let d=o==="error"?"error":"done";l(document,"[data-tether-subscription]").filter(c=>c===t||c.dataset.tetherSubscription===s).forEach(c=>{c.setAttribute(h("subscription-state"),d)})})}function pt(e){let t=e.querySelector(u("return-quantity")),n=e.querySelector(u("return-reason")),r=e.querySelector(u("return-note")),s=f=>f&&"value"in f&&typeof f.value=="string"?f.value:"",o={lineItemId:e.dataset.tetherLine??"",quantity:Number.parseInt(s(t)||"0",10)},d=s(n);d&&(o.reasonId=d);let c=s(r);return c&&(o.note=c),o}function ft(e){let t=e.closest(u("order"));if(!(t instanceof window.HTMLElement))return;let n=t.dataset.tetherOrderId;if(!n)return;let r=l(t,"[data-tether-line]").map(pt).filter(s=>s.quantity>0);!r.length||!ie(e)||q(t,async()=>{await K(n,r),t.dataset.tetherReturned="1",await Y(t)})}function gt(e){let t=e.target;if(!(t instanceof window.Element)||ct(e,t))return;let n=t.closest(u("subscription-action"));if(n instanceof window.HTMLElement){e.preventDefault(),mt(n);return}let r=t.closest(u("order-return"));r instanceof window.HTMLElement&&(e.preventDefault(),ft(r))}function Re(){document.addEventListener("submit",dt,!0),document.addEventListener("input",e=>{let t=e.target;t instanceof window.HTMLElement&&t.closest(u("profile-form"))&&(t.dataset.tetherTouched="1")}),document.addEventListener("click",gt)}var yt=["firstName","lastName"];async function ht(e){if(!(e instanceof window.HTMLFormElement))return;let t;try{t=await D().customer()}catch(r){T(r,"account");return}if(!t)return;let n=e.elements;yt.forEach(r=>{let s=n.namedItem(r);(s instanceof window.HTMLInputElement||s instanceof window.HTMLTextAreaElement)&&!s.dataset.tetherTouched&&(s.value=t[r]??"")})}var Ce=!1;async function bt(e=document){Ce||(Ce=!0,Re()),await Promise.all([...l(e,u("order")).map(t=>Y(t)),...l(e,u("profile-form")).map(t=>ht(t)),M(e),Q(e)])}function wt(e){l(e,u("order")).forEach(t=>{U(t,"error")}),m(e,"show",{"addresses-loading":!1,"addresses-error":!0,"subscriptions-loading":!1,"subscriptions-error":!0})}function At(e){return g(e)&&g(e.__core)&&g(e.__parts)}function Ne(e,t){let n=Reflect.get(window,"Tether");if(!At(n))throw new Error(`tether.${e}.js runs after the Tether script, which loads it, and needs its window.Tether`);n.__parts[e]=t}Ne("account-pages",oe);})();
@@ -31,11 +31,11 @@
31
31
 
32
32
  // tether-core:client.ts
33
33
  var m2 = window.Tether.__core["client.ts"];
34
- var [endpoint, gql, orNull, shaped, TetherError] = m2;
34
+ var [endpoint, gql, matches, orNull, shaped, TetherError] = m2;
35
35
 
36
36
  // tether-core:dom.ts
37
37
  var m3 = window.Tether.__core["dom.ts"];
38
- var [ANALYTICS_EVENTS, attr, attributesFromJson, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, parseJSONAttr, productUrl, qsa, repeat, sel, setImage, setText, show] = m3;
38
+ var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m3;
39
39
 
40
40
  // tether-core:cart.ts
41
41
  var m4 = window.Tether.__core["cart.ts"];
@@ -1 +1 @@
1
- (()=>{var Pt=Object.defineProperty;var Tt=(t,e)=>{for(var r in e)Pt(t,r,{get:e[r],enumerable:!0})};var j={};Tt(j,{addresses:()=>ee,customer:()=>F,deleteAddress:()=>ne,isLoggedIn:()=>ht,login:()=>yt,logout:()=>At,mountAccount:()=>ue,order:()=>Qt,orders:()=>xt,render:()=>_,requestReturn:()=>ie,saveAddress:()=>re,subscriptionAction:()=>se,subscriptions:()=>oe,updateProfile:()=>te});var St=window.Tether.__core["config.ts"],[u,me,V,fe,ge,y,pe]=St;var Lt=window.Tether.__core["client.ts"],[he,ye,xe,Ae,p]=Lt;var bt=window.Tether.__core["dom.ts"],[ke,Pe,Te,P,B,T,m,Se,Le,be,Re,Ee,d,E,c,I,A,S]=bt;var Rt=window.Tether.__core["cart.ts"],[L]=Rt;var Et=window.Tether.__core["lazy.ts"],[G]=Et;function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function a(t,e){return g(t)?t[e]:void 0}function M(t){return Array.isArray(t)?t:[]}function i(t){return typeof t=="string"&&t!==""?t:null}var It=t=>typeof t=="number"&&Number.isFinite(t)?t:null,J=t=>It(t)??0,N=(t,e)=>M(t).map(r=>e(r)),K=(t,e)=>({nodes:N(a(t,"nodes"),e)}),$=t=>N(t,i).filter(e=>e!==null);function z(t){return t instanceof Error?t.message:String(t)}function W(t,e,r="localStorage"){try{window[r].setItem(t,e)}catch{}}function D(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var q=()=>`${u.prefix}:account-hint:${u.domain}`;var X=t=>t==="in"||t==="expired"||t==="error";function Nt(t){let e=i(a(t,"amount")),r=i(a(t,"currencyCode"));return e===null||r===null?null:{amount:e,currencyCode:r}}function vt(t){let e=i(a(t,"url"));return e===null?null:{url:e,altText:i(a(t,"altText"))}}var Ct=t=>({title:i(a(t,"title")),variantTitle:i(a(t,"variantTitle")),quantity:J(a(t,"quantity")),image:vt(a(t,"image"))}),Ut=(t,e)=>({id:e,name:i(a(t,"name")),processedAt:i(a(t,"processedAt")),financialStatus:i(a(t,"financialStatus")),fulfillmentStatus:i(a(t,"fulfillmentStatus")),statusPageUrl:i(a(t,"statusPageUrl")),totalPrice:Nt(a(t,"totalPrice")),lineItems:K(a(t,"lineItems"),Ct)});function Z(t){let e=[];for(let r of M(t)){let n=i(a(r,"id"));if(n===null)return{kind:"missing-id"};e.push(Ut(r,n))}return{kind:"read",orders:e}}var _t=t=>new p(`Customer accounts: the answer has no ${t}`);function Y(t){let e=g(t)?t:{},r=i(e.id),n=i(e.email),o=e.address;return{...r===null?{}:{id:r},firstName:i(e.firstName),lastName:i(e.lastName),displayName:i(e.displayName),emailAddress:n===null?null:{emailAddress:n},defaultAddress:Array.isArray(o)?{formatted:$(o)}:null}}function Q(t){let e=Z(t);if(e.kind==="missing-id")throw _t("order id");return e.orders}function Mt(t){let e=i(a(t,"message"));if(e===null)return null;let r=a(t,"field");return{message:e,field:Array.isArray(r)?$(r):null,code:i(a(t,"code"))}}var tt=t=>N(t,Mt).filter(e=>e!==null);var x=null;function et(){let t=u.account?.server;if(!t)throw new p("Customer accounts need the Worker: set account.server",{code:"NOT_CONFIGURED"});return new URL(t,window.location.href).href.replace(/\/$/,"")}function rt(t){t?W(q(),"1"):D(q())}async function $t(t,e){try{return await fetch(t,e)}catch(r){throw new p(`Network error: ${z(r)}`,{code:"NETWORK"})}}async function Dt(t){let e;try{e=await t.json()}catch{return{}}return g(e)?e:{}}async function O(t,{method:e="GET",body:r}={}){let n={method:e,credentials:"include"};e==="POST"&&(n.headers={"Content-Type":"application/json","X-Tether-Account":"1"}),r&&(n.body=JSON.stringify(r));let o=await $t(`${et()}${t}`,n);if(o.status===401)return{kind:"logged-out"};let s=await Dt(o);if(!o.ok){let l=i(s.error)??String(o.status),w=tt(s.userErrors);throw new p(`Customer accounts: ${l}`,{status:o.status,...w.length>0&&{userErrors:w},...s.code==="INVALID"&&{code:"INVALID"}})}return{kind:"answer",data:s}}async function v(){if(!x){let t=await O("/me");x=t.kind==="answer"&&t.data.loggedIn===!0?{loggedIn:!0,customer:Y(t.data.customer)}:{loggedIn:!1}}return rt(x.loggedIn),x}var nt=()=>x?.loggedIn===!0;function ot(){x=null}function st(t){let e=u.account?.navigate;e?e(t):window.location.assign(t)}var qt=t=>t||u.account?.locale||(u.locale||"").split("-")[0]||"";function it({returnTo:t,locale:e}){let r=new URL(`${et()}/login`);r.searchParams.set("returnTo",t);let n=qt(e);n&&r.searchParams.set("locale",n),u.country&&r.searchParams.set("country",u.country.toUpperCase()),st(r.toString())}async function at(){let t=L.id();if(!(await v()).loggedIn||!t)return null;let e=await O("/cart",{method:"POST",body:{cartId:t}});return e.kind==="logged-out"?null:i(e.data.checkoutUrl)}async function ct(t){let e=await O("/logout",{method:"POST",body:{returnTo:t,cartId:L.id()}});x=null,rt(!1),P("account-logout",{});let r=e.kind==="answer"?i(e.data.logoutUrl):null;return r?(st(r),"redirected"):"stayed"}var Ft=window.Tether.__core["shopify-values.ts"],[ut]=Ft;function b(t,e,r){d(t,c(e)).forEach(n=>{let o=m(n,e)??"";Object.hasOwn(r,o)&&S(n,r[o]===!0)})}var dt=(t,e)=>d(t,c(e)).concat(t.matches(c(e))?[t]:[]);var k=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0;var jt=(t,e)=>({title:t.title||t.name||"","variant-title":t.variantTitle||"",quantity:String(t.quantity),price:T(t.price),total:T(t.totalPrice),sku:t.sku||"",returnable:e===null?void 0:String(e)}),Ht=t=>t.tagName==="INPUT";function Vt(t,e,r){b(t,"order-line-show",{returnable:r>0}),d(t,c("return-quantity")).forEach(n=>{Ht(n)&&(n.max=String(r),n.min="0",n.value||(n.value="0"),n.disabled=r<1)}),d(t,`select${c("return-reason")}`).forEach(n=>{n.dataset.tetherFilled!==e.id&&(n.dataset.tetherFilled=e.id,(e.suggestedReturnReasonDefinitions?.nodes??[]).forEach(o=>{n.appendChild(new Option(o.name??"",o.id))}))})}function lt(t,e,r){E(t,e,(n,o)=>{let s=o.id,l=r&&s?r.get(s)??0:null;s&&(n.dataset.tetherLine=s);let w=jt(o,l);dt(n,"order-line").forEach(h=>{let R=m(h,"order-line")??"";if(R==="image"){o.image&&I(h,o.image.url,o.image.altText||o.title||"");return}let H=k(w,R);H!==void 0&&A(h,H)}),s&&l!==null&&Vt(n,{...o,id:s},l)})}var C=10,U=50,mt=t=>typeof t=="number"&&Number.isInteger(t)&&t>=1&&t<=U;function Bt(t){let e=Number.parseInt(t||String(C),10)||C;return Math.min(Math.max(e,1),U)}var Gt=t=>t.replace(/\?.*$/,"").replace(/^.*\//,"");function Jt(t){let e=u.account?.orderUrl;if(e)return e.replaceAll("{id}",encodeURIComponent(Gt(t.id)));let r=t.statusPageUrl;return r!==null&&ut(r)?r:null}var Kt=t=>({name:t.name??"",date:B(t.processedAt),total:T(t.totalPrice),status:t.financialStatus?.toLowerCase(),fulfillment:t.fulfillmentStatus?.toLowerCase(),items:t.lineItems.nodes.map(e=>`${String(e.quantity)}\xD7 ${e.title??""}`).join(", ")});function zt(t,e){let r=e.lineItems.nodes,n=Jt(e),o=Kt(e);d(t,c("order-bind")).forEach(s=>{let l=m(s,"order-bind")??"";if(l==="url"){n&&s.setAttribute("href",n);return}if(l==="image"){let h=r.find(R=>R.image)?.image;h&&I(s,h.url,h.altText||r[0]?.title||"");return}let w=k(o,l);w!==void 0&&A(s,w)}),d(t,c("order-lines")).forEach(s=>{lt(s,r,null)}),m(t,"order-bind")==="url"&&n&&t.setAttribute("href",n)}async function ft(t,e){let r=d(t,c("orders")),n=r[0];if(!n)return;b(t,"show",{"orders-loading":!0,"orders-empty":!1});let o=Bt(m(n,"limit")),s;try{s=await e(o)}catch(l){y(l,"orders"),s=null}b(t,"show",{"orders-loading":!1,"orders-empty":s?.length===0}),r.forEach(l=>{E(l,s??[],zt)})}var Wt=["order","addresses","subscriptions","profile-form","address-form"],ht=nt;function yt({returnTo:t=window.location.href,locale:e}={}){return new Promise(r=>{it({returnTo:t,locale:e}),r()})}async function F(){let t=await v();return t.loggedIn?t.customer:null}async function xt({first:t=C}={}){if(!mt(t))throw new p(`Customer accounts: orders() takes first from 1 to ${String(U)}`,{code:"INVALID"});let e=await O(`/orders?${new URLSearchParams({first:String(t)}).toString()}`);return e.kind==="logged-out"?[]:Q(e.data.orders)}async function At({returnTo:t=u.account?.logoutUrl||`${window.location.origin}/`}={}){await ct(t)==="stayed"&&await _(document)}async function Xt(){try{return(await v()).loggedIn?{kind:"logged-in"}:{kind:"logged-out"}}catch(t){return{kind:"unknown",error:t}}}var gt=t=>Wt.some(e=>d(t,c(e)).length>0);function Zt(t){d(t,c("account-link")).forEach(e=>{e.setAttribute("href",Yt(m(e,"account-link")))})}function Yt(t){let e=u.account,r=`https://${u.domain}/account`;return t==="payment"?e?.paymentUrl||e?.subscriptionsUrl||r:t==="subscriptions"&&e?.subscriptionsUrl||r}async function _(t=document){let e=await Xt();e.kind==="unknown"&&y(e.error,"account");let r=e.kind==="logged-in";if(d(t,c("show")).forEach(n=>{let o=m(n,"show");o==="logged-in"&&S(n,r),o==="logged-out"&&S(n,!r)}),Zt(t),e.kind==="unknown"&&gt(t)){(await f()).showUnavailable(t);return}r&&(await Ot(t),await Promise.all([ft(t,n=>xt({first:n})),gt(t)?f().then(n=>n.renderPages(t)):null]))}async function Ot(t){let e=d(t,c("account-bind"));if(!e.length)return;let r;try{r=await F()}catch(o){y(o,"account");return}if(!r)return;let n={"first-name":r.firstName,"last-name":r.lastName,name:r.displayName,email:r.emailAddress?.emailAddress,address:r.defaultAddress?.formatted.join(", ")};e.forEach(o=>{let s=k(n,m(o,"account-bind")??"");s!=null&&A(o,s)})}var pt=null;function f(){return pt??(pt=G("account-pages").then(t=>(t.setup({serverFetch:O,customer:F,bindCustomer:Ot,reset:ot}),t))),pt}var Qt=t=>f().then(e=>e.order(t)),te=t=>f().then(e=>e.updateProfile(t)),ee=()=>f().then(t=>t.addresses()),re=(t,e)=>f().then(r=>r.saveAddress(t,e)),ne=t=>f().then(e=>e.deleteAddress(t)),oe=()=>f().then(t=>t.subscriptions()),se=(t,e)=>f().then(r=>r.subscriptionAction(t,e)),ie=(t,e)=>f().then(r=>r.requestReturn(t,e));function ae(t){let e=t.target;e instanceof window.Element&&(e.closest(c("account-login"))?(t.preventDefault(),yt().catch(r=>{y(r,"login")})):e.closest(c("account-logout"))&&(t.preventDefault(),At().catch(r=>{y(r,"logout")})))}function ce(){let t=new URL(window.location.href),e=t.searchParams.get("account");if(X(e))switch(t.searchParams.delete("account"),window.history.replaceState(window.history.state,"",t),e){case"in":P("account-login",{});break;case"expired":case"error":P("account-error",{error:e});break}}var wt=!1;async function ue(t=document){if(wt){await _(t);return}wt=!0,document.addEventListener("click",ae),ce(),L.setCheckoutResolver(at),await _(t),V("account",ht()?"logged in":"logged out")}function de(t){return g(t)&&g(t.__core)&&g(t.__parts)}function kt(t,e){let r=Reflect.get(window,"Tether");if(!de(r))throw new Error(`tether.${t}.js runs after the Tether script, which loads it, and needs its window.Tether`);r.__parts[t]=e}kt("account",j);})();
1
+ (()=>{var Pt=Object.defineProperty;var Tt=(t,e)=>{for(var r in e)Pt(t,r,{get:e[r],enumerable:!0})};var j={};Tt(j,{addresses:()=>ee,customer:()=>F,deleteAddress:()=>ne,isLoggedIn:()=>ht,login:()=>yt,logout:()=>At,mountAccount:()=>ue,order:()=>Qt,orders:()=>xt,render:()=>_,requestReturn:()=>ie,saveAddress:()=>re,subscriptionAction:()=>se,subscriptions:()=>oe,updateProfile:()=>te});var St=window.Tether.__core["config.ts"],[u,me,V,fe,ge,y,pe]=St;var Lt=window.Tether.__core["client.ts"],[he,ye,xe,Ae,Oe,p]=Lt;var bt=window.Tether.__core["dom.ts"],[Pe,Te,Se,Le,P,B,T,m,be,Re,Ee,Ie,Ne,Ce,d,E,ve,c,I,Ue,A,S]=bt;var Rt=window.Tether.__core["cart.ts"],[L]=Rt;var Et=window.Tether.__core["lazy.ts"],[G]=Et;function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function a(t,e){return g(t)?t[e]:void 0}function M(t){return Array.isArray(t)?t:[]}function i(t){return typeof t=="string"&&t!==""?t:null}var It=t=>typeof t=="number"&&Number.isFinite(t)?t:null,J=t=>It(t)??0,N=(t,e)=>M(t).map(r=>e(r)),K=(t,e)=>({nodes:N(a(t,"nodes"),e)}),$=t=>N(t,i).filter(e=>e!==null);function z(t){return t instanceof Error?t.message:String(t)}function W(t,e,r="localStorage"){try{window[r].setItem(t,e)}catch{}}function D(t,e="localStorage"){try{window[e].removeItem(t)}catch{}}var q=()=>`${u.prefix}:account-hint:${u.domain}`;var X=t=>t==="in"||t==="expired"||t==="error";function Nt(t){let e=i(a(t,"amount")),r=i(a(t,"currencyCode"));return e===null||r===null?null:{amount:e,currencyCode:r}}function Ct(t){let e=i(a(t,"url"));return e===null?null:{url:e,altText:i(a(t,"altText"))}}var vt=t=>({title:i(a(t,"title")),variantTitle:i(a(t,"variantTitle")),quantity:J(a(t,"quantity")),image:Ct(a(t,"image"))}),Ut=(t,e)=>({id:e,name:i(a(t,"name")),processedAt:i(a(t,"processedAt")),financialStatus:i(a(t,"financialStatus")),fulfillmentStatus:i(a(t,"fulfillmentStatus")),statusPageUrl:i(a(t,"statusPageUrl")),totalPrice:Nt(a(t,"totalPrice")),lineItems:K(a(t,"lineItems"),vt)});function Z(t){let e=[];for(let r of M(t)){let n=i(a(r,"id"));if(n===null)return{kind:"missing-id"};e.push(Ut(r,n))}return{kind:"read",orders:e}}var _t=t=>new p(`Customer accounts: the answer has no ${t}`);function Y(t){let e=g(t)?t:{},r=i(e.id),n=i(e.email),o=e.address;return{...r===null?{}:{id:r},firstName:i(e.firstName),lastName:i(e.lastName),displayName:i(e.displayName),emailAddress:n===null?null:{emailAddress:n},defaultAddress:Array.isArray(o)?{formatted:$(o)}:null}}function Q(t){let e=Z(t);if(e.kind==="missing-id")throw _t("order id");return e.orders}function Mt(t){let e=i(a(t,"message"));if(e===null)return null;let r=a(t,"field");return{message:e,field:Array.isArray(r)?$(r):null,code:i(a(t,"code"))}}var tt=t=>N(t,Mt).filter(e=>e!==null);var x=null;function et(){let t=u.account?.server;if(!t)throw new p("Customer accounts need the Worker: set account.server",{code:"NOT_CONFIGURED"});return new URL(t,window.location.href).href.replace(/\/$/,"")}function rt(t){t?W(q(),"1"):D(q())}async function $t(t,e){try{return await fetch(t,e)}catch(r){throw new p(`Network error: ${z(r)}`,{code:"NETWORK"})}}async function Dt(t){let e;try{e=await t.json()}catch{return{}}return g(e)?e:{}}async function O(t,{method:e="GET",body:r}={}){let n={method:e,credentials:"include"};e==="POST"&&(n.headers={"Content-Type":"application/json","X-Tether-Account":"1"}),r&&(n.body=JSON.stringify(r));let o=await $t(`${et()}${t}`,n);if(o.status===401)return{kind:"logged-out"};let s=await Dt(o);if(!o.ok){let l=i(s.error)??String(o.status),w=tt(s.userErrors);throw new p(`Customer accounts: ${l}`,{status:o.status,...w.length>0&&{userErrors:w},...s.code==="INVALID"&&{code:"INVALID"}})}return{kind:"answer",data:s}}async function C(){if(!x){let t=await O("/me");x=t.kind==="answer"&&t.data.loggedIn===!0?{loggedIn:!0,customer:Y(t.data.customer)}:{loggedIn:!1}}return rt(x.loggedIn),x}var nt=()=>x?.loggedIn===!0;function ot(){x=null}function st(t){let e=u.account?.navigate;e?e(t):window.location.assign(t)}var qt=t=>t||u.account?.locale||(u.locale||"").split("-")[0]||"";function it({returnTo:t,locale:e}){let r=new URL(`${et()}/login`);r.searchParams.set("returnTo",t);let n=qt(e);n&&r.searchParams.set("locale",n),u.country&&r.searchParams.set("country",u.country.toUpperCase()),st(r.toString())}async function at(){let t=L.id();if(!(await C()).loggedIn||!t)return null;let e=await O("/cart",{method:"POST",body:{cartId:t}});return e.kind==="logged-out"?null:i(e.data.checkoutUrl)}async function ct(t){let e=await O("/logout",{method:"POST",body:{returnTo:t,cartId:L.id()}});x=null,rt(!1),P("account-logout",{});let r=e.kind==="answer"?i(e.data.logoutUrl):null;return r?(st(r),"redirected"):"stayed"}var Ft=window.Tether.__core["shopify-values.ts"],[ut]=Ft;function b(t,e,r){d(t,c(e)).forEach(n=>{let o=m(n,e)??"";Object.hasOwn(r,o)&&S(n,r[o]===!0)})}var dt=(t,e)=>d(t,c(e)).concat(t.matches(c(e))?[t]:[]);var k=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0;var jt=(t,e)=>({title:t.title||t.name||"","variant-title":t.variantTitle||"",quantity:String(t.quantity),price:T(t.price),total:T(t.totalPrice),sku:t.sku||"",returnable:e===null?void 0:String(e)}),Ht=t=>t.tagName==="INPUT";function Vt(t,e,r){b(t,"order-line-show",{returnable:r>0}),d(t,c("return-quantity")).forEach(n=>{Ht(n)&&(n.max=String(r),n.min="0",n.value||(n.value="0"),n.disabled=r<1)}),d(t,`select${c("return-reason")}`).forEach(n=>{n.dataset.tetherFilled!==e.id&&(n.dataset.tetherFilled=e.id,(e.suggestedReturnReasonDefinitions?.nodes??[]).forEach(o=>{n.appendChild(new Option(o.name??"",o.id))}))})}function lt(t,e,r){E(t,e,(n,o)=>{let s=o.id,l=r&&s?r.get(s)??0:null;s&&(n.dataset.tetherLine=s);let w=jt(o,l);dt(n,"order-line").forEach(h=>{let R=m(h,"order-line")??"";if(R==="image"){o.image&&I(h,o.image.url,o.image.altText||o.title||"");return}let H=k(w,R);H!==void 0&&A(h,H)}),s&&l!==null&&Vt(n,{...o,id:s},l)})}var v=10,U=50,mt=t=>typeof t=="number"&&Number.isInteger(t)&&t>=1&&t<=U;function Bt(t){let e=Number.parseInt(t||String(v),10)||v;return Math.min(Math.max(e,1),U)}var Gt=t=>t.replace(/\?.*$/,"").replace(/^.*\//,"");function Jt(t){let e=u.account?.orderUrl;if(e)return e.replaceAll("{id}",encodeURIComponent(Gt(t.id)));let r=t.statusPageUrl;return r!==null&&ut(r)?r:null}var Kt=t=>({name:t.name??"",date:B(t.processedAt),total:T(t.totalPrice),status:t.financialStatus?.toLowerCase(),fulfillment:t.fulfillmentStatus?.toLowerCase(),items:t.lineItems.nodes.map(e=>`${String(e.quantity)}\xD7 ${e.title??""}`).join(", ")});function zt(t,e){let r=e.lineItems.nodes,n=Jt(e),o=Kt(e);d(t,c("order-bind")).forEach(s=>{let l=m(s,"order-bind")??"";if(l==="url"){n&&s.setAttribute("href",n);return}if(l==="image"){let h=r.find(R=>R.image)?.image;h&&I(s,h.url,h.altText||r[0]?.title||"");return}let w=k(o,l);w!==void 0&&A(s,w)}),d(t,c("order-lines")).forEach(s=>{lt(s,r,null)}),m(t,"order-bind")==="url"&&n&&t.setAttribute("href",n)}async function ft(t,e){let r=d(t,c("orders")),n=r[0];if(!n)return;b(t,"show",{"orders-loading":!0,"orders-empty":!1});let o=Bt(m(n,"limit")),s;try{s=await e(o)}catch(l){y(l,"orders"),s=null}b(t,"show",{"orders-loading":!1,"orders-empty":s?.length===0}),r.forEach(l=>{E(l,s??[],zt)})}var Wt=["order","addresses","subscriptions","profile-form","address-form"],ht=nt;function yt({returnTo:t=window.location.href,locale:e}={}){return new Promise(r=>{it({returnTo:t,locale:e}),r()})}async function F(){let t=await C();return t.loggedIn?t.customer:null}async function xt({first:t=v}={}){if(!mt(t))throw new p(`Customer accounts: orders() takes first from 1 to ${String(U)}`,{code:"INVALID"});let e=await O(`/orders?${new URLSearchParams({first:String(t)}).toString()}`);return e.kind==="logged-out"?[]:Q(e.data.orders)}async function At({returnTo:t=u.account?.logoutUrl||`${window.location.origin}/`}={}){await ct(t)==="stayed"&&await _(document)}async function Xt(){try{return(await C()).loggedIn?{kind:"logged-in"}:{kind:"logged-out"}}catch(t){return{kind:"unknown",error:t}}}var gt=t=>Wt.some(e=>d(t,c(e)).length>0);function Zt(t){d(t,c("account-link")).forEach(e=>{e.setAttribute("href",Yt(m(e,"account-link")))})}function Yt(t){let e=u.account,r=`https://${u.domain}/account`;return t==="payment"?e?.paymentUrl||e?.subscriptionsUrl||r:t==="subscriptions"&&e?.subscriptionsUrl||r}async function _(t=document){let e=await Xt();e.kind==="unknown"&&y(e.error,"account");let r=e.kind==="logged-in";if(d(t,c("show")).forEach(n=>{let o=m(n,"show");o==="logged-in"&&S(n,r),o==="logged-out"&&S(n,!r)}),Zt(t),e.kind==="unknown"&&gt(t)){(await f()).showUnavailable(t);return}r&&(await Ot(t),await Promise.all([ft(t,n=>xt({first:n})),gt(t)?f().then(n=>n.renderPages(t)):null]))}async function Ot(t){let e=d(t,c("account-bind"));if(!e.length)return;let r;try{r=await F()}catch(o){y(o,"account");return}if(!r)return;let n={"first-name":r.firstName,"last-name":r.lastName,name:r.displayName,email:r.emailAddress?.emailAddress,address:r.defaultAddress?.formatted.join(", ")};e.forEach(o=>{let s=k(n,m(o,"account-bind")??"");s!=null&&A(o,s)})}var pt=null;function f(){return pt??(pt=G("account-pages").then(t=>(t.setup({serverFetch:O,customer:F,bindCustomer:Ot,reset:ot}),t))),pt}var Qt=t=>f().then(e=>e.order(t)),te=t=>f().then(e=>e.updateProfile(t)),ee=()=>f().then(t=>t.addresses()),re=(t,e)=>f().then(r=>r.saveAddress(t,e)),ne=t=>f().then(e=>e.deleteAddress(t)),oe=()=>f().then(t=>t.subscriptions()),se=(t,e)=>f().then(r=>r.subscriptionAction(t,e)),ie=(t,e)=>f().then(r=>r.requestReturn(t,e));function ae(t){let e=t.target;e instanceof window.Element&&(e.closest(c("account-login"))?(t.preventDefault(),yt().catch(r=>{y(r,"login")})):e.closest(c("account-logout"))&&(t.preventDefault(),At().catch(r=>{y(r,"logout")})))}function ce(){let t=new URL(window.location.href),e=t.searchParams.get("account");if(X(e))switch(t.searchParams.delete("account"),window.history.replaceState(window.history.state,"",t),e){case"in":P("account-login",{});break;case"expired":case"error":P("account-error",{error:e});break}}var wt=!1;async function ue(t=document){if(wt){await _(t);return}wt=!0,document.addEventListener("click",ae),ce(),L.setCheckoutResolver(at),await _(t),V("account",ht()?"logged in":"logged out")}function de(t){return g(t)&&g(t.__core)&&g(t.__parts)}function kt(t,e){let r=Reflect.get(window,"Tether");if(!de(r))throw new Error(`tether.${t}.js runs after the Tether script, which loads it, and needs its window.Tether`);r.__parts[t]=e}kt("account",j);})();
@@ -17,7 +17,7 @@
17
17
 
18
18
  // tether-core:dom.ts
19
19
  var m2 = window.Tether.__core["dom.ts"];
20
- var [ANALYTICS_EVENTS, attr, attributesFromJson, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, parseJSONAttr, productUrl, qsa, repeat, sel, setImage, setText, show] = m2;
20
+ var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m2;
21
21
 
22
22
  // tether-core:cart.ts
23
23
  var m3 = window.Tether.__core["cart.ts"];
@@ -29,7 +29,7 @@
29
29
 
30
30
  // tether-core:client.ts
31
31
  var m5 = window.Tether.__core["client.ts"];
32
- var [endpoint, gql, orNull, shaped, TetherError] = m5;
32
+ var [endpoint, gql, matches, orNull, shaped, TetherError] = m5;
33
33
 
34
34
  // src/analytics-shopify.ts
35
35
  var BUFFER_SIZE = 500;
@@ -1 +1 @@
1
- (()=>{var U=Object.defineProperty;var $=(t,n)=>{for(var e in n)U(t,e,{get:n[e],enumerable:!0})};var k={};$(k,{startAnalytics:()=>yt});var G=window.Tether.__core["config.ts"],[a,bt,_,vt,wt,l,Tt]=G;var W=window.Tether.__core["dom.ts"],[C,_t,Ct,Et,xt,At,Pt,St,Lt,E,Nt,It,Rt,Vt,p,Dt,Mt,qt]=W;var Y=window.Tether.__core["cart.ts"],[b]=Y;var H=window.Tether.__core["product.ts"],[x]=H;var J=window.Tether.__core["client.ts"],[jt,A,Ut,P,$t]=J;var Z=500,S={"default-banner":"https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js",other:"https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.2/consent-tracking-api.js"},z="https://cdn.shopify.com/storefront/analytics/shopify.js",N=()=>window,y=()=>N().Shopify;function I(){let t=a.analytics?.shopify;return typeof t=="object"?t:{}}function R(){try{let t=y()?.customerPrivacy;return t?.consentStatus==="loaded"&&t.currentVisitorConsent?.()?.analytics!=="no"&&!!t.analyticsProcessingAllowed?.()}catch{return!1}}function K(t){let n=`hydrogen:${t}`;return{getTrackingValues:()=>{let e=R()?y()?.customerPrivacy?.__internal:void 0;return{uniqueToken:e?.uniqueToken?.({generateFallback:!0,tag:n})??"",visitToken:e?.visitToken?.({generateFallback:!0,tag:n})??""}}}}var X=t=>(n,e)=>{let r=t.subscribers.get(n)??new Set;return t.subscribers.set(n,r),r.add(e),()=>t.subscribers.get(n)?.delete(e)};function Q(t){let n=[],e=[],r={shop:{shopId:t,channel:"headless"},consent:{mode:I().consent||"no-banner"}},o=()=>{if(R())for(let i of n)for(;i.next<e.length;i.next+=1){let s=e[i.next];s&&tt(i,s)}},c={getConfig:()=>r,publish(i,s={}){if(e.push({event:i,payload:{shop:r.shop,url:window.location.href,...s}}),e.length>Z){e.shift();for(let u of n)u.next=Math.max(0,u.next-1)}o()},addDestination(i){let s={name:i.name,next:0,subscribers:new Map,context:K(i.name)};return Promise.resolve(i.setup?.({subscribe:X(s),getConfig:c.getConfig})).then(()=>{n.push(s),o()}).catch(u=>{l(u,`analytics ${i.name}`)}),()=>{let u=n.indexOf(s);u>=0&&n.splice(u,1)}}};return document.addEventListener("consentTrackingApiLoaded",o),document.addEventListener("visitorConsentCollected",o),c}function tt(t,{event:n,payload:e}){t.subscribers.get(n)?.forEach(r=>{try{r(e,t.context)}catch(o){l(o,`analytics ${t.name}`)}})}function L(t){let n=document.createElement("script");n.src=t,n.async=!0,document.head.appendChild(n)}async function V(t){let n=y();if(n?.analytics)return n.analytics;let e=await A("query TetherShopId { shop { id } }",{},P({shop:{id:"string"}}),{context:!1}),r=y()??{};N().Shopify=r,r.country=a.country??"US";let[o="en"]=(a.locale||"en").split("-");r.locale=o.toLowerCase(),r.shop=a.domain,r.routes={root:"/",match:()=>({pageTemplateName:t()?"product":"page"}),...r.routes};let{proxy:c,consent:i}=I();r.customerPrivacy={...r.customerPrivacy,config:c?{isHeadless:!0,asyncConsent:!0,asyncVisitorState:!0,consentDomain:window.location.host}:{isHeadless:!0,storefrontAccessToken:a.token,checkoutRootDomain:a.domain}};let s=Q(e.shop.id);return r.analytics=s,L(i==="default-banner"?S["default-banner"]:S.other),L(z),_("shopify analytics ready",e.shop.id),s}var nt="Default Title",D=100,et=200,rt=t=>t?parseFloat(t.amount):0,M=t=>(t??"").split("/").pop()??"";function T(t,n,e=1,r){let o={item_id:n?.sku||M(n?.id)||M(t.id),item_name:t.title,item_variant:n?.title===nt?void 0:n?.title,item_brand:t.vendor||void 0,item_category:t.productType||void 0,price:rt(n?.price??t.priceRange?.minVariantPrice),quantity:e};return r!=null&&(o.index=r),o}var h=(t,n=t.quantity)=>T(t.merchandise.product,t.merchandise,n);function f(t){let n=t.reduce((e,r)=>e+r.price*(r.quantity||1),0);return Math.round(n*D)/D}var ot=(t,n,e=1)=>({id:t.id,title:t.title,price:n.price,vendor:t.vendor||"",variantId:n.id,variantTitle:n.title,quantity:e,sku:n.sku||void 0,productType:t.productType||void 0}),q=t=>({id:t.id,quantity:t.quantity,merchandise:{id:t.merchandise.id,title:t.merchandise.title,price:t.merchandise.price,sku:t.merchandise.sku,product:{id:t.merchandise.product.id,title:t.merchandise.product.title,vendor:t.merchandise.product.vendor||"",handle:t.merchandise.product.handle}}});function it(){let{dataLayer:t}=a.analytics??{},n=typeof t=="string"?t:"dataLayer",e=Reflect.get(window,n);if(Array.isArray(e))return e;let r=[];return Reflect.set(window,n,r),r}function st(t,n){let e=it();if(!n){e.push({event:t});return}e.push({ecommerce:null}),e.push({event:t,ecommerce:n})}var m=null,v=null,O=null,w=new WeakSet;function d(t,n,e,r){a.analytics?.dataLayer&&st(t,n),m&&e&&m.publish(e,r);try{a.analytics?.onEvent?.(t,n)}catch(o){l(o,"analytics onEvent")}}function F(){let t=document.querySelector(p("product"));return!t||t.closest(`${p("collection")},${p("products")},${p("recommendations")}`)?null:x.get(t)??null}function at({product:t,scope:n}){if(w.has(n.root)||F()!==n)return;w.add(n.root);let e=n.variant??t.variants.nodes[0],r=[T(t,e)],o=e?[ot(t,e)]:[];d("view_item",{currency:e?.price.currencyCode,value:f(r),items:r},"product_viewed",{products:o})}function ct({products:t,collection:n}){let e=t.slice(0,et).map((o,c)=>T(o,o.variants.nodes[0],1,c)),r={item_list_id:n?.handle||"products",item_list_name:n?.title||"Products"};if(!n){d("view_item_list",{...r,items:e});return}d("view_item_list",{...r,items:e},"collection_viewed",{collection:{id:n.id,handle:n.handle}})}function ut(t,n,e){let r=t?.cost.totalAmount.currencyCode;n.forEach((o,c)=>{let i=e.get(c),s=o.quantity-(i?.quantity??0);if(s<=0)return;let u=[h(o,s)];d("add_to_cart",{currency:r,value:f(u),items:u},"product_added_to_cart",{cart:t,prevCart:O,currentLine:q(o),prevLine:i?q(i):void 0})}),e.forEach((o,c)=>{let i=o.quantity-(n.get(c)?.quantity??0);if(i<=0)return;let s=[h(o,i)];d("remove_from_cart",{currency:r,value:f(s),items:s})})}function dt({cart:t,reason:n}){let e=new Map((t?.lines.nodes??[]).map(r=>[r.merchandise.id,r]));v&&n!=="load"&&n!=="pending"&&ut(t,e,v),v=e,O=t}function lt(){let t=b.lines.map(n=>h(n));d("view_cart",{currency:b.state?.cost.totalAmount.currencyCode,value:f(t),items:t})}function pt({cart:t}){if(!t)return;let n=t.lines.nodes.map(r=>h(r)),e=t.discountCodes.filter(r=>r.applicable).map(r=>r.code);d("begin_checkout",{currency:t.cost.totalAmount.currencyCode,value:f(n),coupon:e.join(",")||void 0,items:n})}var ft={"product-ready":at,"list-ready":ct,"cart-updated":dt,"cart-toggled":({open:t})=>{t&&lt()},checkout:pt,search:({term:t})=>{t&&d("search",{search_term:t},"search_viewed",{searchTerm:t})}};function mt(t,n){ft[n](t.detail)}function B(t){if(t.type==="astro:page-load"){w=new WeakSet,m?.publish("page_viewed",{});return}C.forEach(n=>{E(t,n)&&mt(t,n)})}async function yt(t){a.analytics?.shopify&&(m=await V(()=>F()!=null).catch(n=>(l(n,"shopify analytics"),null))),m?.publish("page_viewed",{}),t.splice(0).forEach(B),t.push=(...n)=>(n.forEach(B),t.length)}function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ht(t){return g(t)&&g(t.__core)&&g(t.__parts)}function j(t,n){let e=Reflect.get(window,"Tether");if(!ht(e))throw new Error(`tether.${t}.js runs after the Tether script, which loads it, and needs its window.Tether`);e.__parts[t]=n}j("analytics",k);})();
1
+ (()=>{var U=Object.defineProperty;var $=(t,n)=>{for(var e in n)U(t,e,{get:n[e],enumerable:!0})};var k={};$(k,{startAnalytics:()=>yt});var G=window.Tether.__core["config.ts"],[a,bt,_,vt,wt,l,Tt]=G;var H=window.Tether.__core["dom.ts"],[C,_t,Ct,Et,xt,At,St,Pt,Lt,Nt,E,It,Rt,Vt,Dt,Mt,qt,p,Bt,Ot,Ft,jt]=H;var W=window.Tether.__core["cart.ts"],[b]=W;var Y=window.Tether.__core["product.ts"],[x]=Y;var J=window.Tether.__core["client.ts"],[Ht,A,Wt,Yt,S,Jt]=J;var Z=500,P={"default-banner":"https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js",other:"https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.2/consent-tracking-api.js"},z="https://cdn.shopify.com/storefront/analytics/shopify.js",N=()=>window,y=()=>N().Shopify;function I(){let t=a.analytics?.shopify;return typeof t=="object"?t:{}}function R(){try{let t=y()?.customerPrivacy;return t?.consentStatus==="loaded"&&t.currentVisitorConsent?.()?.analytics!=="no"&&!!t.analyticsProcessingAllowed?.()}catch{return!1}}function K(t){let n=`hydrogen:${t}`;return{getTrackingValues:()=>{let e=R()?y()?.customerPrivacy?.__internal:void 0;return{uniqueToken:e?.uniqueToken?.({generateFallback:!0,tag:n})??"",visitToken:e?.visitToken?.({generateFallback:!0,tag:n})??""}}}}var X=t=>(n,e)=>{let o=t.subscribers.get(n)??new Set;return t.subscribers.set(n,o),o.add(e),()=>t.subscribers.get(n)?.delete(e)};function Q(t){let n=[],e=[],o={shop:{shopId:t,channel:"headless"},consent:{mode:I().consent||"no-banner"}},r=()=>{if(R())for(let i of n)for(;i.next<e.length;i.next+=1){let s=e[i.next];s&&tt(i,s)}},c={getConfig:()=>o,publish(i,s={}){if(e.push({event:i,payload:{shop:o.shop,url:window.location.href,...s}}),e.length>Z){e.shift();for(let u of n)u.next=Math.max(0,u.next-1)}r()},addDestination(i){let s={name:i.name,next:0,subscribers:new Map,context:K(i.name)};return Promise.resolve(i.setup?.({subscribe:X(s),getConfig:c.getConfig})).then(()=>{n.push(s),r()}).catch(u=>{l(u,`analytics ${i.name}`)}),()=>{let u=n.indexOf(s);u>=0&&n.splice(u,1)}}};return document.addEventListener("consentTrackingApiLoaded",r),document.addEventListener("visitorConsentCollected",r),c}function tt(t,{event:n,payload:e}){t.subscribers.get(n)?.forEach(o=>{try{o(e,t.context)}catch(r){l(r,`analytics ${t.name}`)}})}function L(t){let n=document.createElement("script");n.src=t,n.async=!0,document.head.appendChild(n)}async function V(t){let n=y();if(n?.analytics)return n.analytics;let e=await A("query TetherShopId { shop { id } }",{},S({shop:{id:"string"}}),{context:!1}),o=y()??{};N().Shopify=o,o.country=a.country??"US";let[r="en"]=(a.locale||"en").split("-");o.locale=r.toLowerCase(),o.shop=a.domain,o.routes={root:"/",match:()=>({pageTemplateName:t()?"product":"page"}),...o.routes};let{proxy:c,consent:i}=I();o.customerPrivacy={...o.customerPrivacy,config:c?{isHeadless:!0,asyncConsent:!0,asyncVisitorState:!0,consentDomain:window.location.host}:{isHeadless:!0,storefrontAccessToken:a.token,checkoutRootDomain:a.domain}};let s=Q(e.shop.id);return o.analytics=s,L(i==="default-banner"?P["default-banner"]:P.other),L(z),_("shopify analytics ready",e.shop.id),s}var nt="Default Title",D=100,et=200,ot=t=>t?parseFloat(t.amount):0,M=t=>(t??"").split("/").pop()??"";function T(t,n,e=1,o){let r={item_id:n?.sku||M(n?.id)||M(t.id),item_name:t.title,item_variant:n?.title===nt?void 0:n?.title,item_brand:t.vendor||void 0,item_category:t.productType||void 0,price:ot(n?.price??t.priceRange?.minVariantPrice),quantity:e};return o!=null&&(r.index=o),r}var h=(t,n=t.quantity)=>T(t.merchandise.product,t.merchandise,n);function f(t){let n=t.reduce((e,o)=>e+o.price*(o.quantity||1),0);return Math.round(n*D)/D}var rt=(t,n,e=1)=>({id:t.id,title:t.title,price:n.price,vendor:t.vendor||"",variantId:n.id,variantTitle:n.title,quantity:e,sku:n.sku||void 0,productType:t.productType||void 0}),q=t=>({id:t.id,quantity:t.quantity,merchandise:{id:t.merchandise.id,title:t.merchandise.title,price:t.merchandise.price,sku:t.merchandise.sku,product:{id:t.merchandise.product.id,title:t.merchandise.product.title,vendor:t.merchandise.product.vendor||"",handle:t.merchandise.product.handle}}});function it(){let{dataLayer:t}=a.analytics??{},n=typeof t=="string"?t:"dataLayer",e=Reflect.get(window,n);if(Array.isArray(e))return e;let o=[];return Reflect.set(window,n,o),o}function st(t,n){let e=it();if(!n){e.push({event:t});return}e.push({ecommerce:null}),e.push({event:t,ecommerce:n})}var m=null,v=null,O=null,w=new WeakSet;function d(t,n,e,o){a.analytics?.dataLayer&&st(t,n),m&&e&&m.publish(e,o);try{a.analytics?.onEvent?.(t,n)}catch(r){l(r,"analytics onEvent")}}function F(){let t=document.querySelector(p("product"));return!t||t.closest(`${p("collection")},${p("products")},${p("recommendations")}`)?null:x.get(t)??null}function at({product:t,scope:n}){if(w.has(n.root)||F()!==n)return;w.add(n.root);let e=n.variant??t.variants.nodes[0],o=[T(t,e)],r=e?[rt(t,e)]:[];d("view_item",{currency:e?.price.currencyCode,value:f(o),items:o},"product_viewed",{products:r})}function ct({products:t,collection:n}){let e=t.slice(0,et).map((r,c)=>T(r,r.variants.nodes[0],1,c)),o={item_list_id:n?.handle||"products",item_list_name:n?.title||"Products"};if(!n){d("view_item_list",{...o,items:e});return}d("view_item_list",{...o,items:e},"collection_viewed",{collection:{id:n.id,handle:n.handle}})}function ut(t,n,e){let o=t?.cost.totalAmount.currencyCode;n.forEach((r,c)=>{let i=e.get(c),s=r.quantity-(i?.quantity??0);if(s<=0)return;let u=[h(r,s)];d("add_to_cart",{currency:o,value:f(u),items:u},"product_added_to_cart",{cart:t,prevCart:O,currentLine:q(r),prevLine:i?q(i):void 0})}),e.forEach((r,c)=>{let i=r.quantity-(n.get(c)?.quantity??0);if(i<=0)return;let s=[h(r,i)];d("remove_from_cart",{currency:o,value:f(s),items:s})})}function dt({cart:t,reason:n}){let e=new Map((t?.lines.nodes??[]).map(o=>[o.merchandise.id,o]));v&&n!=="load"&&n!=="pending"&&ut(t,e,v),v=e,O=t}function lt(){let t=b.lines.map(n=>h(n));d("view_cart",{currency:b.state?.cost.totalAmount.currencyCode,value:f(t),items:t})}function pt({cart:t}){if(!t)return;let n=t.lines.nodes.map(o=>h(o)),e=t.discountCodes.filter(o=>o.applicable).map(o=>o.code);d("begin_checkout",{currency:t.cost.totalAmount.currencyCode,value:f(n),coupon:e.join(",")||void 0,items:n})}var ft={"product-ready":at,"list-ready":ct,"cart-updated":dt,"cart-toggled":({open:t})=>{t&&lt()},checkout:pt,search:({term:t})=>{t&&d("search",{search_term:t},"search_viewed",{searchTerm:t})}};function mt(t,n){ft[n](t.detail)}function B(t){if(t.type==="astro:page-load"){w=new WeakSet,m?.publish("page_viewed",{});return}C.forEach(n=>{E(t,n)&&mt(t,n)})}async function yt(t){a.analytics?.shopify&&(m=await V(()=>F()!=null).catch(n=>(l(n,"shopify analytics"),null))),m?.publish("page_viewed",{}),t.splice(0).forEach(B),t.push=(...n)=>(n.forEach(B),t.length)}function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ht(t){return g(t)&&g(t.__core)&&g(t.__parts)}function j(t,n){let e=Reflect.get(window,"Tether");if(!ht(e))throw new Error(`tether.${t}.js runs after the Tether script, which loads it, and needs its window.Tether`);e.__parts[t]=n}j("analytics",k);})();
@@ -20,15 +20,15 @@
20
20
 
21
21
  // tether-core:client.ts
22
22
  var m2 = window.Tether.__core["client.ts"];
23
- var [endpoint, gql, orNull, shaped, TetherError] = m2;
23
+ var [endpoint, gql, matches, orNull, shaped, TetherError] = m2;
24
24
 
25
25
  // tether-core:dom.ts
26
26
  var m3 = window.Tether.__core["dom.ts"];
27
- var [ANALYTICS_EVENTS, attr, attributesFromJson, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, parseJSONAttr, productUrl, qsa, repeat, sel, setImage, setText, show] = m3;
27
+ var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m3;
28
28
 
29
29
  // tether-core:loader.ts
30
30
  var m4 = window.Tether.__core["loader.ts"];
31
- var [clearProductCache, getProduct] = m4;
31
+ var [clearProductCache, getProduct, normalizeProductKey, primeProduct, withProductFragment] = m4;
32
32
 
33
33
  // tether-core:selling-plans.ts
34
34
  var m5 = window.Tether.__core["selling-plans.ts"];
@@ -36,7 +36,7 @@
36
36
 
37
37
  // tether-core:status.ts
38
38
  var m6 = window.Tether.__core["status.ts"];
39
- var [boundary, resolveProductKey] = m6;
39
+ var [boundary, isNotFound, resolveProductKey, setScopeStatus] = m6;
40
40
 
41
41
  // src/api-version.ts
42
42
  var QUARTERLY_VERSION = /^(\d{4})-(01|04|07|10)$/;
@@ -1,4 +1,4 @@
1
- (()=>{var L=Object.defineProperty;var Y=(e,n)=>{for(var t in n)L(e,t,{get:n[t],enumerable:!0})};var P={};Y(P,{apiVersionStatus:()=>y,checkMarkup:()=>k,diagnose:()=>ke,didYouMean:()=>f});var G=window.Tether.__core["config.ts"],[a,E,$e,Re,Te,Ae,_e]=G;var B=window.Tether.__core["client.ts"],[$,R,Ne,T,xe]=B;var Q=window.Tether.__core["dom.ts"],[De,p,Oe,Ve,Ue,Ie,m,Ce,A,qe,He,Le,d,Ye,l,Ge,Be,Qe]=Q;var j=window.Tether.__core["loader.ts"],[Ke,_]=j;var K=window.Tether.__core["selling-plans.ts"],[v]=K;var W=window.Tether.__core["status.ts"],[N,h]=W;var F=/^(\d{4})-(01|04|07|10)$/;function M(e){let n=F.exec(typeof e=="string"?e:"");return n?{year:Number(n[1]),month:Number(n[2])}:null}var z=(e,n)=>`${e}-${String(n).padStart(2,"0")}`;function x(e,n=1){let t=M(e);if(!t)throw new Error(`not a quarterly Shopify API version: ${e}`);let r=t.year*4+(t.month-1)/3+n;return z(Math.floor(r/4),r%4*3+1)}function y(e,n=new Date){if(e==="unstable")return{version:e,ok:!1,note:'"unstable" changes without notice: pin a dated version such as 2026-07'};let t=M(e);if(!t)return{version:e,ok:!1,note:"not a quarterly version (YYYY-01, -04, -07 or -10)"};let r=new Date(Date.UTC(t.year,t.month-1,1)),s=new Date(Date.UTC(t.year,t.month-1+12,1)),o=(s.getTime()-n.getTime())/2630016e3,i=r<=n,c=`supported until about ${s.toISOString().slice(0,7)}`;return i?o<=0?c="no longer supported: Shopify falls back to the oldest supported version. Upgrade (see docs/reference.md)":o<3&&(c=`${c}: plan the upgrade to ${x(e)} or later (see docs/reference.md)`):c="not released yet (release candidate at best)",{version:e,ok:i&&o>0,monthsLeft:Math.round(o),next:x(e),note:c}}var J=window.Tether.__core["lazy.ts"],[D]=J;var O=new Set(["in-stock","out-of-stock","backorder","low-stock","plenty-in-stock","on-sale","not-on-sale","has-variants","single-variant","subscription-available","subscription-unavailable","subscription-only","one-time-available","subscription-selected","one-time-selected","has-savings","loading","ready","error","not-found","cart-empty","cart-filled","cart-has-subscription","cart-no-subscription","cart-has-discount","cart-error","cart-warning","list-empty","list-filled","search-empty","search-results","logged-in","logged-out","orders-empty","orders-loading","addresses-loading","addresses-empty","addresses-error","subscriptions-loading","subscriptions-empty","subscriptions-error"]),V=new Set(["title","description","description-text","vendor","type","handle","published-at","price","total-price","compare-at-price","unit-price","min-price","max-price","discount-percentage","discount-amount","variant-title","variant-id","sku","barcode","stock","quantity","featured-image","variant-image","images","tags","link","url","one-time-price","subscription-price","subscription-savings","subscription-savings-amount","checkout-charge","plan-name","plan-description","plan-group","option-value","swatch","image"]),U=new Set(`account account-bind account-link account-login account-logout add-label add-to-cart adding-text
1
+ (()=>{var L=Object.defineProperty;var Y=(e,n)=>{for(var t in n)L(e,t,{get:n[t],enumerable:!0})};var P={};Y(P,{apiVersionStatus:()=>y,checkMarkup:()=>k,diagnose:()=>ke,didYouMean:()=>f});var G=window.Tether.__core["config.ts"],[a,E,$e,Re,Te,Ae,_e]=G;var B=window.Tether.__core["client.ts"],[$,R,Ne,xe,T,Me]=B;var K=window.Tether.__core["dom.ts"],[Oe,p,Ve,Ue,Ce,Ie,qe,m,He,A,Le,Ye,Ge,Be,d,Ke,Qe,l,je,We,Fe,ze]=K;var Q=window.Tether.__core["loader.ts"],[Xe,_,Ze,et,tt]=Q;var j=window.Tether.__core["selling-plans.ts"],[v]=j;var W=window.Tether.__core["status.ts"],[N,ot,h,st]=W;var F=/^(\d{4})-(01|04|07|10)$/;function M(e){let n=F.exec(typeof e=="string"?e:"");return n?{year:Number(n[1]),month:Number(n[2])}:null}var z=(e,n)=>`${e}-${String(n).padStart(2,"0")}`;function x(e,n=1){let t=M(e);if(!t)throw new Error(`not a quarterly Shopify API version: ${e}`);let r=t.year*4+(t.month-1)/3+n;return z(Math.floor(r/4),r%4*3+1)}function y(e,n=new Date){if(e==="unstable")return{version:e,ok:!1,note:'"unstable" changes without notice: pin a dated version such as 2026-07'};let t=M(e);if(!t)return{version:e,ok:!1,note:"not a quarterly version (YYYY-01, -04, -07 or -10)"};let r=new Date(Date.UTC(t.year,t.month-1,1)),s=new Date(Date.UTC(t.year,t.month-1+12,1)),o=(s.getTime()-n.getTime())/2630016e3,i=r<=n,c=`supported until about ${s.toISOString().slice(0,7)}`;return i?o<=0?c="no longer supported: Shopify falls back to the oldest supported version. Upgrade (see docs/reference.md)":o<3&&(c=`${c}: plan the upgrade to ${x(e)} or later (see docs/reference.md)`):c="not released yet (release candidate at best)",{version:e,ok:i&&o>0,monthsLeft:Math.round(o),next:x(e),note:c}}var J=window.Tether.__core["lazy.ts"],[D]=J;var O=new Set(["in-stock","out-of-stock","backorder","low-stock","plenty-in-stock","on-sale","not-on-sale","has-variants","single-variant","subscription-available","subscription-unavailable","subscription-only","one-time-available","subscription-selected","one-time-selected","has-savings","loading","ready","error","not-found","cart-empty","cart-filled","cart-has-subscription","cart-no-subscription","cart-has-discount","cart-error","cart-warning","list-empty","list-filled","search-empty","search-results","logged-in","logged-out","orders-empty","orders-loading","addresses-loading","addresses-empty","addresses-error","subscriptions-loading","subscriptions-empty","subscriptions-error"]),V=new Set(["title","description","description-text","vendor","type","handle","published-at","price","total-price","compare-at-price","unit-price","min-price","max-price","discount-percentage","discount-amount","variant-title","variant-id","sku","barcode","stock","quantity","featured-image","variant-image","images","tags","link","url","one-time-price","subscription-price","subscription-savings","subscription-savings-amount","checkout-charge","plan-name","plan-description","plan-group","option-value","swatch","image"]),U=new Set(`account account-bind account-link account-login account-logout add-label add-to-cart adding-text
2
2
  always-enabled bind cart-checkout-charge cart-clear cart-close cart-count cart-discounts cart-drawer cart-label cart-lines
3
3
  cart-note cart-open cart-subtotal cart-total cart-warning checkout code collection collection-bind countries country
4
4
  country-bind country-label country-select default-plan default-purchase discount discount-code discount-form discount-input
@@ -11,4 +11,4 @@
11
11
  plan-value product products purchase purchase-mode qty qty-minus qty-plus quantity recommendations reverse search
12
12
  search-bind search-collections search-input search-limit search-min search-products search-queries search-results
13
13
  search-state show soldout-text sort state subscribe-text variant variant-select variant-url max-width max-height crop
14
- sig label hydrated busy`.split(/\s+/).filter(Boolean)),X=["bind","option-list","option","variant-select","add-to-cart","purchase","plan-list","plan","qty","line-attribute"],Z=["option-list","plan-list","cart-lines","list"],w="metafield:",ee=/^image:\d+$/,te=2;function ne(e,n){let t=Array.from({length:n.length+1},(r,s)=>s);for(let r=1;r<=e.length;r++){let s=[r];for(let o=1;o<=n.length;o++){let i=(t[o-1]??0)+(e[r-1]===n[o-1]?0:1);s.push(Math.min((t[o]??0)+1,(s[o-1]??0)+1,i))}t=s}return t[n.length]??0}function f(e,n,t=""){let r=null,s=1/0;for(let i of n){let c=ne(e,i);c<s&&(s=c,r=i)}let o=Math.max(2,Math.floor(e.length/4));return r!==null&&s<=o?` Did you mean "${t}${r}"?`:""}function re(e){let n=e.id?`#${e.id}`:"",t=e.className&&typeof e.className=="string"?e.className.trim().split(/\s+/):[],r=t.length?`.${t.slice(0,te).join(".")}`:"";return`<${e.tagName.toLowerCase()}${n}${r}>`}var I=()=>`${l("collection")},${l("products")},${l("recommendations")}`;function oe(e,n){d(e,l("product")).forEach(t=>{if(t.closest(I())&&t.closest(l("list")))return;let{key:r,fromUrl:s,raw:o}=h(t);o?s&&!r&&n("warn",`${p("product")}="${o}" but this URL has no value for it (e.g. ?handle=my-product).`,t):n("error",`${p("product")} has no value. Bind it to the Shopify handle (CMS field), or use "url:handle".`,t)})}function se(e,n){for(let t of X)d(e,l(t)).forEach(r=>{r.closest(l("product"))||t==="line-attribute"&&r.closest(l("group"))||n("warn",`${p(t)} outside any ${p("product")}: it does nothing here.`,r)});d(e,l("group-add")).forEach(t=>{t.closest(l("group"))||n("warn",`${p("group-add")} outside a ${p("group")}.`,t)});for(let t of Z)d(e,l(t)).forEach(r=>{!r.firstElementChild&&!A(r)&&n("warn",`${p(t)} without a template child: put one example element inside it.`,r)});d(e,I()).forEach(t=>{d(t,l("list")).length||n("error",`List without a ${p("list")} child: products have nowhere to render.`,t)})}function ie(e,n){d(e,l("show")).forEach(t=>{let r=m(t,"show")??"";O.has(r)||n("warn",`Unknown ${p("show")}="${r}".${f(r,O)}`,t)}),d(e,l("bind")).forEach(t=>{let r=m(t,"bind")||"";!r||V.has(r)||ee.test(r)||r.startsWith(w)||n("warn",`Unknown ${p("bind")}="${r}": it stays empty.${f(r,V)}`,t)})}function ae(e,n){d(e,l("bind")).forEach(t=>{let r=m(t,"bind")||"";if(!r.startsWith(w))return;let s=r.slice(w.length);a.metafields.some(i=>(typeof i=="string"?i:`${i.namespace}.${i.key}`)===s)||n("error",`${p("bind")}="${r}" but "${s}" is not in config.metafields, so it stays empty.`,t)})}function ce(e,n){let t=`${a.prefix}-`,r=new Set;d(e,"*").forEach(s=>{for(let{name:o}of s.attributes){if(!o.startsWith(t))continue;let i=o.slice(t.length);U.has(i)||r.has(i)||(r.add(i),n("warn",`Unknown attribute ${o}: Tether ignores it.${f(i,U,t)}`,s))}})}function le(e,n){let t=d(e,l("cart-drawer")).length;d(e,l("cart-open")).length&&!t&&n("warn",`${p("cart-open")} exists but there is no ${p("cart-drawer")} on this page.`),t>1&&n("warn",`More than one ${p("cart-drawer")}.`),d(e,`[${p("state")}="error"]`).forEach(r=>{r.matches(N())&&n("error",`Scope failed to load (${m(r,"error")||"error"}).`,r)})}function k(e=document){let n=[],t=(r,s,o)=>{n.push(o?{level:r,message:s,element:re(o),el:o}:{level:r,message:s})};return oe(e,t),se(e,t),ie(e,t),ce(e,t),ae(e,t),le(e,t),n}var ue=20,de=3,C=4;function pe(e){return e?`${e.slice(0,C)}\u2026${e.slice(-C)} (${e.length} chars)`:"(missing)"}function q(e,n){if(e instanceof Error&&e.message)return e.message;let t=typeof e=="object"&&e!==null?Reflect.get(e,"code"):void 0;return typeof t=="string"&&t?t:n}function me(){return{domain:a.domain||"(missing)",token:pe(a.token),apiVersion:a.apiVersion,endpoint:a.domain?$():null,country:a.country,language:a.language,locale:a.locale,markets:a.markets,prefix:a.prefix,productPath:a.productPath,metafields:a.metafields,autoMount:a.autoMount,observe:a.observe,onError:typeof a.onError=="function"}}async function fe(){return{country:a.country||null,language:a.language||null,locale:a.locale||null,detected:a.markets?.detect?(await D("markets")).detectMarket(a.markets):null}}function ge({ok:e,monthsLeft:n,note:t}){return e&&(n===void 0||n>=de)?null:{level:e?"warn":"error",message:`apiVersion ${a.apiVersion}: ${t}`}}var he=T({shop:{name:"string",primaryDomain:{url:"string"},paymentSettings:{currencyCode:"string"}}});async function be(){if(!E())return{kind:"not-configured"};let e=Date.now();try{let n=await R("query TetherDiagnose { shop { name primaryDomain { url } paymentSettings { currencyCode } } }",{},he,{context:!1});return{kind:"reachable",shop:{name:n.shop.name,url:n.shop.primaryDomain.url,currency:n.shop.paymentSettings.currencyCode},latencyMs:Date.now()-e}}catch(n){return{kind:"unreachable",error:n,latencyMs:Date.now()-e}}}function ye(e,n,t){let r=[],s=t.options.map(i=>i.name),o=d(e,l("product")).filter(i=>h(i).key===n&&i.querySelector(l("add-to-cart")));for(let i of o){let c=new Set(d(i,`${l("option-list")},select${l("option")}`).map(u=>m(u,"option-list")||m(u,"option")));if(!(!c.size&&d(i,`select${l("variant-select")}`).length)){if(!a.language)for(let u of c)!u||s.includes(u)||r.push({level:"warn",message:`Product "${t.handle}" has no option "${u}" (its options: ${s.join(", ")||"none"}).${f(u,s)}`});for(let u of t.options)u.optionValues.length<=1||c.has(u.name)||r.push({level:"warn",message:`Product "${t.handle}": option "${u.name}" (${u.optionValues.length} values) has no tether-option-list, so visitors can't choose it.`})}}return r}async function we(e,n){let t=d(e,l("product")).map(o=>h(o).key),r=[...new Set(t.filter(o=>o!==null&&o!==""))].slice(0,ue);(await Promise.allSettled(r.map(o=>_(o)))).forEach((o,i)=>{let c=r[i]??"";if(o.status==="rejected"){let g=q(o.reason,"not loaded");n.products.push({key:c,error:o.reason instanceof Error?o.reason.message:void 0}),n.problems.push({level:"error",message:`Product "${c}": ${g}. Is it published to the Headless channel?`});return}let u=o.value,S=v(u);n.products.push({key:c,handle:u.handle,title:u.title,plans:S.length,requiresSellingPlan:u.requiresSellingPlan});for(let g of S)n.sellingPlans.push({product:u.handle,group:g.group.name,plan:g.name,id:g.id});n.problems.push(...ye(e,c,u))})}async function ke({root:e=document,silent:n=!1,version:t="",now:r=new Date}={}){let s=await be(),o={version:t,config:me(),apiVersion:y(a.apiVersion,r),market:await fe(),reachable:s.kind==="reachable",shop:s.kind==="reachable"?s.shop:null,latencyMs:s.kind==="not-configured"?null:s.latencyMs,products:[],sellingPlans:[],problems:[]};switch(s.kind){case"not-configured":o.problems.push({level:"error",message:"TETHER_CONFIG needs domain and token."});break;case"unreachable":o.problems.push({level:"error",message:`Storefront API not reachable: ${q(s.error,"unknown error")}`});break;case"reachable":await we(e,o);break}let i=ge(o.apiVersion);return i&&o.problems.push(i),typeof document<"u"&&o.problems.push(...k(e)),n||Pe(o),o}function Pe(e){let n=e.problems.filter(c=>c.level==="error").length,t=e.problems.length-n;console.group(`[${a.prefix}] diagnose: ${n?`${n} error(s)`:"no errors"}, ${t} warning(s)`),console.log("version",e.version,"| API",e.apiVersion.version,`(${e.apiVersion.note})`),console.log("config",e.config);let{country:r,language:s,detected:o}=e.market,i=[r,s].filter(Boolean).join(" / ")||"the store default";console.log("market",`in use: ${i}`,o?`(detection picks ${JSON.stringify(o)})`:""),console.log(e.shop?`Storefront API reachable: ${e.shop.name} (${e.latencyMs??0} ms)`:"Storefront API NOT reachable"),e.products.length&&console.table(e.products),e.sellingPlans.length?console.table(e.sellingPlans):e.reachable&&console.log("No selling plans on the products of this page.");for(let c of e.problems)c.level==="error"?console.error(c.message,c.el??""):console.warn(c.message,c.el??"");console.groupEnd()}function b(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Se(e){return b(e)&&b(e.__core)&&b(e.__parts)}function H(e,n){let t=Reflect.get(window,"Tether");if(!Se(t))throw new Error(`tether.${e}.js runs after the Tether script, which loads it, and needs its window.Tether`);t.__parts[e]=n}H("diagnose",P);})();
14
+ sig label hydrated busy`.split(/\s+/).filter(Boolean)),X=["bind","option-list","option","variant-select","add-to-cart","purchase","plan-list","plan","qty","line-attribute"],Z=["option-list","plan-list","cart-lines","list"],w="metafield:",ee=/^image:\d+$/,te=2;function ne(e,n){let t=Array.from({length:n.length+1},(r,s)=>s);for(let r=1;r<=e.length;r++){let s=[r];for(let o=1;o<=n.length;o++){let i=(t[o-1]??0)+(e[r-1]===n[o-1]?0:1);s.push(Math.min((t[o]??0)+1,(s[o-1]??0)+1,i))}t=s}return t[n.length]??0}function f(e,n,t=""){let r=null,s=1/0;for(let i of n){let c=ne(e,i);c<s&&(s=c,r=i)}let o=Math.max(2,Math.floor(e.length/4));return r!==null&&s<=o?` Did you mean "${t}${r}"?`:""}function re(e){let n=e.id?`#${e.id}`:"",t=e.className&&typeof e.className=="string"?e.className.trim().split(/\s+/):[],r=t.length?`.${t.slice(0,te).join(".")}`:"";return`<${e.tagName.toLowerCase()}${n}${r}>`}var C=()=>`${l("collection")},${l("products")},${l("recommendations")}`;function oe(e,n){d(e,l("product")).forEach(t=>{if(t.closest(C())&&t.closest(l("list")))return;let{key:r,fromUrl:s,raw:o}=h(t);o?s&&!r&&n("warn",`${p("product")}="${o}" but this URL has no value for it (e.g. ?handle=my-product).`,t):n("error",`${p("product")} has no value. Bind it to the Shopify handle (CMS field), or use "url:handle".`,t)})}function se(e,n){for(let t of X)d(e,l(t)).forEach(r=>{r.closest(l("product"))||t==="line-attribute"&&r.closest(l("group"))||n("warn",`${p(t)} outside any ${p("product")}: it does nothing here.`,r)});d(e,l("group-add")).forEach(t=>{t.closest(l("group"))||n("warn",`${p("group-add")} outside a ${p("group")}.`,t)});for(let t of Z)d(e,l(t)).forEach(r=>{!r.firstElementChild&&!A(r)&&n("warn",`${p(t)} without a template child: put one example element inside it.`,r)});d(e,C()).forEach(t=>{d(t,l("list")).length||n("error",`List without a ${p("list")} child: products have nowhere to render.`,t)})}function ie(e,n){d(e,l("show")).forEach(t=>{let r=m(t,"show")??"";O.has(r)||n("warn",`Unknown ${p("show")}="${r}".${f(r,O)}`,t)}),d(e,l("bind")).forEach(t=>{let r=m(t,"bind")||"";!r||V.has(r)||ee.test(r)||r.startsWith(w)||n("warn",`Unknown ${p("bind")}="${r}": it stays empty.${f(r,V)}`,t)})}function ae(e,n){d(e,l("bind")).forEach(t=>{let r=m(t,"bind")||"";if(!r.startsWith(w))return;let s=r.slice(w.length);a.metafields.some(i=>(typeof i=="string"?i:`${i.namespace}.${i.key}`)===s)||n("error",`${p("bind")}="${r}" but "${s}" is not in config.metafields, so it stays empty.`,t)})}function ce(e,n){let t=`${a.prefix}-`,r=new Set;d(e,"*").forEach(s=>{for(let{name:o}of s.attributes){if(!o.startsWith(t))continue;let i=o.slice(t.length);U.has(i)||r.has(i)||(r.add(i),n("warn",`Unknown attribute ${o}: Tether ignores it.${f(i,U,t)}`,s))}})}function le(e,n){let t=d(e,l("cart-drawer")).length;d(e,l("cart-open")).length&&!t&&n("warn",`${p("cart-open")} exists but there is no ${p("cart-drawer")} on this page.`),t>1&&n("warn",`More than one ${p("cart-drawer")}.`),d(e,`[${p("state")}="error"]`).forEach(r=>{r.matches(N())&&n("error",`Scope failed to load (${m(r,"error")||"error"}).`,r)})}function k(e=document){let n=[],t=(r,s,o)=>{n.push(o?{level:r,message:s,element:re(o),el:o}:{level:r,message:s})};return oe(e,t),se(e,t),ie(e,t),ce(e,t),ae(e,t),le(e,t),n}var ue=20,de=3,I=4;function pe(e){return e?`${e.slice(0,I)}\u2026${e.slice(-I)} (${e.length} chars)`:"(missing)"}function q(e,n){if(e instanceof Error&&e.message)return e.message;let t=typeof e=="object"&&e!==null?Reflect.get(e,"code"):void 0;return typeof t=="string"&&t?t:n}function me(){return{domain:a.domain||"(missing)",token:pe(a.token),apiVersion:a.apiVersion,endpoint:a.domain?$():null,country:a.country,language:a.language,locale:a.locale,markets:a.markets,prefix:a.prefix,productPath:a.productPath,metafields:a.metafields,autoMount:a.autoMount,observe:a.observe,onError:typeof a.onError=="function"}}async function fe(){return{country:a.country||null,language:a.language||null,locale:a.locale||null,detected:a.markets?.detect?(await D("markets")).detectMarket(a.markets):null}}function ge({ok:e,monthsLeft:n,note:t}){return e&&(n===void 0||n>=de)?null:{level:e?"warn":"error",message:`apiVersion ${a.apiVersion}: ${t}`}}var he=T({shop:{name:"string",primaryDomain:{url:"string"},paymentSettings:{currencyCode:"string"}}});async function be(){if(!E())return{kind:"not-configured"};let e=Date.now();try{let n=await R("query TetherDiagnose { shop { name primaryDomain { url } paymentSettings { currencyCode } } }",{},he,{context:!1});return{kind:"reachable",shop:{name:n.shop.name,url:n.shop.primaryDomain.url,currency:n.shop.paymentSettings.currencyCode},latencyMs:Date.now()-e}}catch(n){return{kind:"unreachable",error:n,latencyMs:Date.now()-e}}}function ye(e,n,t){let r=[],s=t.options.map(i=>i.name),o=d(e,l("product")).filter(i=>h(i).key===n&&i.querySelector(l("add-to-cart")));for(let i of o){let c=new Set(d(i,`${l("option-list")},select${l("option")}`).map(u=>m(u,"option-list")||m(u,"option")));if(!(!c.size&&d(i,`select${l("variant-select")}`).length)){if(!a.language)for(let u of c)!u||s.includes(u)||r.push({level:"warn",message:`Product "${t.handle}" has no option "${u}" (its options: ${s.join(", ")||"none"}).${f(u,s)}`});for(let u of t.options)u.optionValues.length<=1||c.has(u.name)||r.push({level:"warn",message:`Product "${t.handle}": option "${u.name}" (${u.optionValues.length} values) has no tether-option-list, so visitors can't choose it.`})}}return r}async function we(e,n){let t=d(e,l("product")).map(o=>h(o).key),r=[...new Set(t.filter(o=>o!==null&&o!==""))].slice(0,ue);(await Promise.allSettled(r.map(o=>_(o)))).forEach((o,i)=>{let c=r[i]??"";if(o.status==="rejected"){let g=q(o.reason,"not loaded");n.products.push({key:c,error:o.reason instanceof Error?o.reason.message:void 0}),n.problems.push({level:"error",message:`Product "${c}": ${g}. Is it published to the Headless channel?`});return}let u=o.value,S=v(u);n.products.push({key:c,handle:u.handle,title:u.title,plans:S.length,requiresSellingPlan:u.requiresSellingPlan});for(let g of S)n.sellingPlans.push({product:u.handle,group:g.group.name,plan:g.name,id:g.id});n.problems.push(...ye(e,c,u))})}async function ke({root:e=document,silent:n=!1,version:t="",now:r=new Date}={}){let s=await be(),o={version:t,config:me(),apiVersion:y(a.apiVersion,r),market:await fe(),reachable:s.kind==="reachable",shop:s.kind==="reachable"?s.shop:null,latencyMs:s.kind==="not-configured"?null:s.latencyMs,products:[],sellingPlans:[],problems:[]};switch(s.kind){case"not-configured":o.problems.push({level:"error",message:"TETHER_CONFIG needs domain and token."});break;case"unreachable":o.problems.push({level:"error",message:`Storefront API not reachable: ${q(s.error,"unknown error")}`});break;case"reachable":await we(e,o);break}let i=ge(o.apiVersion);return i&&o.problems.push(i),typeof document<"u"&&o.problems.push(...k(e)),n||Pe(o),o}function Pe(e){let n=e.problems.filter(c=>c.level==="error").length,t=e.problems.length-n;console.group(`[${a.prefix}] diagnose: ${n?`${n} error(s)`:"no errors"}, ${t} warning(s)`),console.log("version",e.version,"| API",e.apiVersion.version,`(${e.apiVersion.note})`),console.log("config",e.config);let{country:r,language:s,detected:o}=e.market,i=[r,s].filter(Boolean).join(" / ")||"the store default";console.log("market",`in use: ${i}`,o?`(detection picks ${JSON.stringify(o)})`:""),console.log(e.shop?`Storefront API reachable: ${e.shop.name} (${e.latencyMs??0} ms)`:"Storefront API NOT reachable"),e.products.length&&console.table(e.products),e.sellingPlans.length?console.table(e.sellingPlans):e.reachable&&console.log("No selling plans on the products of this page.");for(let c of e.problems)c.level==="error"?console.error(c.message,c.el??""):console.warn(c.message,c.el??"");console.groupEnd()}function b(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Se(e){return b(e)&&b(e.__core)&&b(e.__parts)}function H(e,n){let t=Reflect.get(window,"Tether");if(!Se(t))throw new Error(`tether.${e}.js runs after the Tether script, which loads it, and needs its window.Tether`);t.__parts[e]=n}H("diagnose",P);})();
@@ -19,7 +19,7 @@
19
19
 
20
20
  // tether-core:dom.ts
21
21
  var m2 = window.Tether.__core["dom.ts"];
22
- var [ANALYTICS_EVENTS, attr, attributesFromJson, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, parseJSONAttr, productUrl, qsa, repeat, sel, setImage, setText, show] = m2;
22
+ var [ANALYTICS_EVENTS, attr, attributesFromJson, busy, emit, formatDate, formatMoney, get, has, hasTemplate, isOwnEvent, notifyLayoutChanged, parseJSONAttr, productUrl, qsa, repeat, scoped, sel, setImage, setStoreHtml, setText, show] = m2;
23
23
 
24
24
  // tether-core:product.ts
25
25
  var m3 = window.Tether.__core["product.ts"];
@@ -1 +1 @@
1
- (()=>{var N=Object.defineProperty;var R=(e,t)=>{for(var n in t)N(e,n,{get:t[n],enumerable:!0})};var f={};R(f,{addGroup:()=>q,onStorage:()=>j,writeVariantUrl:()=>V});var O=window.Tether.__core["config.ts"],[c,Y,Z,P,I,i,p]=O;var v=window.Tether.__core["dom.ts"],[Q,X,m,y,ee,te,k,w,ne,re,h,oe,S,ae,s,ce,ue,ie]=v;var U=window.Tether.__core["product.ts"],[C]=U;var K=window.Tether.__core["cart.ts"],[d]=K;var F=window.Tether.__core["page-market.ts"],[M]=F;var H=window.Tether.__core["market-codes.ts"],[x,b]=H;var E=()=>`${c.prefix}:market:${c.domain}`;function $(e){try{return JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return null;throw t}}function D(e){if(typeof e!="object"||e===null)return null;let t=x(Reflect.get(e,"country"));if(!t)return null;let n=Reflect.get(e,"locale");return{country:t,language:b(Reflect.get(e,"language"))??void 0,locale:typeof n=="string"&&n?n:void 0}}var T=e=>D($(e));function J(e,t){let n=m(h(e,"line-attributes"));return t?[{key:"_group",value:t},...n]:n}async function q(e){let t=e.closest(s("group"));if(!t)return null;let n=k(t,"group"),r=J(t,n),u=S(t,s("product")).flatMap(a=>{let o=C.get(a);if(!o?.variant?.availableForSale||o.quantity<=0)return[];let g=o.getLine();return g?[{...g,attributes:[...g.attributes??[],...r]}]:[]});if(!u.length)return p("group-add: nothing selected"),null;try{let a=await d.add(u);return y("group-added",{group:n,lines:u},t),a}catch(a){return i(a,"group add"),null}}function j(e){if(e.key===c.storageKey||e.key===`${c.storageKey}:seen`){d.init().catch(r=>{i(r,"cart from another tab")});return}if(e.key!==E()||!e.newValue)return;let t=T(e.newValue);if(!t)return;let n={language:t.language??null,locale:t.locale,remember:!1};M(t.country,n).catch(r=>{i(r,"market from another tab")})}var _=new WeakMap,L=e=>e.split("/").pop()??e;function z(e){try{window.history.replaceState(window.history.state,"",e)}catch{}}function V(e,{variant:t,sellingPlanId:n}){let r=`${t.id}|${n??""}`,u=_.get(e);if(_.set(e,r),!u||u===r)return;let a=c.variantUrl&&document.querySelector(s("product"))===e;if(!w(e,"variant-url")&&!a)return;let o=new URL(window.location.href);o.searchParams.set("variant",L(t.id)),n?o.searchParams.set("selling_plan",L(n)):o.searchParams.delete("selling_plan"),z(o)}function l(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function W(e){return l(e)&&l(e.__core)&&l(e.__parts)}function A(e,t){let n=Reflect.get(window,"Tether");if(!W(n))throw new Error(`tether.${e}.js runs after the Tether script, which loads it, and needs its window.Tether`);n.__parts[e]=t}A("extras",f);})();
1
+ (()=>{var N=Object.defineProperty;var R=(e,t)=>{for(var n in t)N(e,n,{get:t[n],enumerable:!0})};var f={};R(f,{addGroup:()=>q,onStorage:()=>j,writeVariantUrl:()=>V});var O=window.Tether.__core["config.ts"],[c,Y,Z,P,I,i,p]=O;var v=window.Tether.__core["dom.ts"],[Q,X,m,ee,y,te,ne,k,w,re,oe,ae,h,ce,S,ue,ie,s,se,le,ge,de]=v;var U=window.Tether.__core["product.ts"],[C]=U;var K=window.Tether.__core["cart.ts"],[d]=K;var H=window.Tether.__core["page-market.ts"],[M]=H;var F=window.Tether.__core["market-codes.ts"],[x,b]=F;var E=()=>`${c.prefix}:market:${c.domain}`;function $(e){try{return JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return null;throw t}}function D(e){if(typeof e!="object"||e===null)return null;let t=x(Reflect.get(e,"country"));if(!t)return null;let n=Reflect.get(e,"locale");return{country:t,language:b(Reflect.get(e,"language"))??void 0,locale:typeof n=="string"&&n?n:void 0}}var T=e=>D($(e));function J(e,t){let n=m(h(e,"line-attributes"));return t?[{key:"_group",value:t},...n]:n}async function q(e){let t=e.closest(s("group"));if(!t)return null;let n=k(t,"group"),r=J(t,n),u=S(t,s("product")).flatMap(a=>{let o=C.get(a);if(!o?.variant?.availableForSale||o.quantity<=0)return[];let g=o.getLine();return g?[{...g,attributes:[...g.attributes??[],...r]}]:[]});if(!u.length)return p("group-add: nothing selected"),null;try{let a=await d.add(u);return y("group-added",{group:n,lines:u},t),a}catch(a){return i(a,"group add"),null}}function j(e){if(e.key===c.storageKey||e.key===`${c.storageKey}:seen`){d.init().catch(r=>{i(r,"cart from another tab")});return}if(e.key!==E()||!e.newValue)return;let t=T(e.newValue);if(!t)return;let n={language:t.language??null,locale:t.locale,remember:!1};M(t.country,n).catch(r=>{i(r,"market from another tab")})}var _=new WeakMap,L=e=>e.split("/").pop()??e;function z(e){try{window.history.replaceState(window.history.state,"",e)}catch{}}function V(e,{variant:t,sellingPlanId:n}){let r=`${t.id}|${n??""}`,u=_.get(e);if(_.set(e,r),!u||u===r)return;let a=c.variantUrl&&document.querySelector(s("product"))===e;if(!w(e,"variant-url")&&!a)return;let o=new URL(window.location.href);o.searchParams.set("variant",L(t.id)),n?o.searchParams.set("selling_plan",L(n)):o.searchParams.delete("selling_plan"),z(o)}function l(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function W(e){return l(e)&&l(e.__core)&&l(e.__parts)}function A(e,t){let n=Reflect.get(window,"Tether");if(!W(n))throw new Error(`tether.${e}.js runs after the Tether script, which loads it, and needs its window.Tether`);n.__parts[e]=t}A("extras",f);})();