@moonbase.sh/storefront 0.3.26 → 0.3.29
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.
- package/dist/moonbase.js +6 -3
- package/dist/moonbase.umd.cjs +2 -2
- package/package.json +2 -2
package/dist/moonbase.js
CHANGED
|
@@ -9820,7 +9820,7 @@ function ja(e) {
|
|
|
9820
9820
|
}
|
|
9821
9821
|
var pi = class it {
|
|
9822
9822
|
constructor(t, n, r) {
|
|
9823
|
-
this.configuration = t, this.client = n, this.stateFactory = r, this.currentUser = V(null), this.loadedUser = V(!1), this.refreshOrderAbortController = new AbortController(), this.debouncedPushOrderContent = gy((l) => this.client.orders.pushContent(l, void 0, this.
|
|
9823
|
+
this.configuration = t, this.client = n, this.stateFactory = r, this.currentUser = V(null), this.loadedUser = V(!1), this.refreshOrderAbortController = new AbortController(), this.debouncedPushOrderContent = gy((l) => this.client.orders.pushContent(l, void 0, this.hasUtmOrReferrer ? this.utm.value : void 0), 500);
|
|
9824
9824
|
var o;
|
|
9825
9825
|
if (typeof window > "u") {
|
|
9826
9826
|
this.currentOrder = V({
|
|
@@ -9862,7 +9862,7 @@ var pi = class it {
|
|
|
9862
9862
|
currency: "",
|
|
9863
9863
|
items: [],
|
|
9864
9864
|
couponsApplied: []
|
|
9865
|
-
}), this.
|
|
9865
|
+
}), this.hasUtmOrReferrer && this.pushOrderContent());
|
|
9866
9866
|
const a = localStorage.getItem(it.storefrontKey);
|
|
9867
9867
|
if (a ? (this.storefront = r(it.storefrontKey, JSON.parse(a)), this.loadedStorefront = r(`${it.storefrontKey}_loaded`, !0)) : (this.storefront = r(it.storefrontKey, {
|
|
9868
9868
|
suggestedCurrency: "",
|
|
@@ -9889,6 +9889,9 @@ var pi = class it {
|
|
|
9889
9889
|
});
|
|
9890
9890
|
}
|
|
9891
9891
|
get hasUtm() {
|
|
9892
|
+
return !!this.utm.value && !!(this.utm.value.source || this.utm.value.medium || this.utm.value.campaign || this.utm.value.term || this.utm.value.content);
|
|
9893
|
+
}
|
|
9894
|
+
get hasUtmOrReferrer() {
|
|
9892
9895
|
return !!this.utm.value && Object.values(this.utm.value).some((t) => !!t);
|
|
9893
9896
|
}
|
|
9894
9897
|
get loadedUserPromise() {
|
|
@@ -17119,7 +17122,7 @@ function eE(e, t) {
|
|
|
17119
17122
|
const Re = /* @__PURE__ */ ir(J2, [["render", eE]]), tE = { class: "moonbase:about" }, nE = /* @__PURE__ */ pe({
|
|
17120
17123
|
__name: "About",
|
|
17121
17124
|
setup(e) {
|
|
17122
|
-
const t = Te(), n = "0.3.
|
|
17125
|
+
const t = Te(), n = "0.3.29";
|
|
17123
17126
|
return (r, o) => (g(), C("div", tE, [
|
|
17124
17127
|
o[2] || (o[2] = Rh('<svg viewBox="0 0 512 512" height="56px" width="56px"><g><path fill="currentColor" d="m493.17795,174.6135c6.257,75.3 -30.577,150.948 -100.579,190.758c-66.292,37.697 -145.001,33.405 -205.402,-4.415c0.409,-1.248 0.638,-2.577 0.638,-3.96c0,-7.026 -5.717,-12.743 -12.743,-12.743c-2.876,0 -5.524,0.969 -7.659,2.582c-18.813,-15.259 -35.159,-34.207 -47.856,-56.534c-54.663,-96.122 -21.054,-218.358 75.069,-273.021a201.218,201.218 0 0 1 33.302,-15.124c-32.428,3.667 -64.663,13.809 -94.827,30.962c-104.526,59.443 -149.511,183.241 -113.473,293.249c-3.376,3.057 -5.513,7.459 -5.513,12.362c0,9.207 7.491,16.698 16.698,16.698c0.136,0 0.267,-0.017 0.401,-0.02a252.205,252.205 0 0 0 8.683,16.691c67.869,119.344 219.635,161.073 338.98,93.204a250.416,250.416 0 0 0 32.893,-22.333c1.045,0.331 2.157,0.513 3.311,0.513c6.047,0 10.968,-4.921 10.968,-10.968c0,-0.605 -0.063,-1.196 -0.157,-1.775c69.545,-64.988 96.008,-165.054 67.266,-256.126m-446.526,25.112a5.071,5.071 0 0 1 -5.066,-5.066a5.072,5.072 0 0 1 5.066,-5.067a5.073,5.073 0 0 1 5.066,5.067a5.072,5.072 0 0 1 -5.066,5.066m-15.819,153.944c-8.238,0 -14.94,-6.702 -14.94,-14.94c0,-8.239 6.702,-14.941 14.94,-14.941c8.239,0 14.941,6.702 14.941,14.941c-0.001,8.238 -6.703,14.94 -14.941,14.94m144.258,-7.659c6.057,0 10.985,4.928 10.985,10.986c0,6.058 -4.928,10.985 -10.985,10.985c-6.058,0 -10.986,-4.928 -10.986,-10.985c0.001,-6.059 4.928,-10.986 10.986,-10.986m70.829,133.004c-5.079,0 -9.21,-4.132 -9.21,-9.21c0,-5.079 4.131,-9.21 9.21,-9.21c5.078,0 9.209,4.131 9.209,9.21c0,5.078 -4.13,9.21 -9.209,9.21m169.18,-37.289c-5.078,0 -9.209,-4.132 -9.209,-9.21s4.131,-9.209 9.209,-9.209s9.21,4.131 9.21,9.209s-4.132,9.21 -9.21,9.21"></path><path fill="currentColor" d="m144.78195,275.9675c46.746,82.201 151.278,110.943 233.48,64.197c59.864,-34.044 91.363,-98.736 86.013,-163.13a170.094,170.094 0 0 0 -5.515,-31.052c-23.045,0.567 -63.864,10.137 -104.194,61.671c-52.045,66.5 -186.285,49.153 -228.855,17.372c3.503,17.443 9.796,34.632 19.071,50.942m233.513,-65.677a8.663,8.663 0 1 1 -8.663,8.663a8.662,8.662 0 0 1 8.663,-8.663m-37.006,62.618c7.02,0 12.712,5.691 12.712,12.712s-5.692,12.712 -12.712,12.712c-7.021,0 -12.712,-5.691 -12.712,-12.712s5.691,-12.712 12.712,-12.712m-102.544,12.712a6.78,6.78 0 1 1 0,13.56a6.78,6.78 0 0 1 0,-13.56"></path><ellipse fill="currentColor" ry="7.3075" rx="7.3075" cy="152.05851" cx="251.33138"></ellipse><ellipse fill="currentColor" ry="5.35076" rx="5.35076" cy="210.31151" cx="204.89499"></ellipse><ellipse fill="currentColor" ry="12.09273" rx="12.09273" cy="200.15625" cx="302.28597"></ellipse></g></svg>', 1)),
|
|
17125
17128
|
w(b(bp), { as: "h3" }, {
|
package/dist/moonbase.umd.cjs
CHANGED
|
@@ -12,7 +12,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
12
12
|
|
|
13
13
|
For more details, see https://link.vuejs.org/feature-flags.`)}}const Rt=av;function Yg(e){return Gg(e)}function Gg(e,t){Zg();const n=ks();n.__VUE__=!0,S.NODE_ENV!=="production"&&Nd(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:r,remove:o,patchProp:s,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:d,nextSibling:f,setScopeId:h=ht,insertStaticContent:p}=e,_=(y,E,F,G=null,W=null,Z=null,ie=void 0,re=null,ne=S.NODE_ENV!=="production"&&bn?!1:!!E.dynamicChildren)=>{if(y===E)return;y&&!no(y,E)&&(G=Za(y),Be(y,W,Z,!0),y=null),E.patchFlag===-2&&(ne=!1,E.dynamicChildren=null);const{type:K,ref:ke,shapeFlag:ue}=E;switch(K){case Us:x(y,E,F,G);break;case it:N(y,E,F,G);break;case Bs:y==null?q(E,F,G,ie):S.NODE_ENV!=="production"&&z(y,E,F,ie);break;case $e:oe(y,E,F,G,W,Z,ie,re,ne);break;default:ue&1?D(y,E,F,G,W,Z,ie,re,ne):ue&6?xe(y,E,F,G,W,Z,ie,re,ne):ue&64||ue&128?K.process(y,E,F,G,W,Z,ie,re,ne,gi):S.NODE_ENV!=="production"&&X("Invalid VNode type:",K,`(${typeof K})`)}ke!=null&&W&&ra(ke,y&&y.ref,Z,E||y,!E)},x=(y,E,F,G)=>{if(y==null)r(E.el=a(E.children),F,G);else{const W=E.el=y.el;E.children!==y.children&&u(W,E.children)}},N=(y,E,F,G)=>{y==null?r(E.el=l(E.children||""),F,G):E.el=y.el},q=(y,E,F,G)=>{[y.el,y.anchor]=p(y.children,E,F,G,y.el,y.anchor)},z=(y,E,F,G)=>{if(E.children!==y.children){const W=f(y.anchor);L(y),[E.el,E.anchor]=p(E.children,F,W,G)}else E.el=y.el,E.anchor=y.anchor},B=({el:y,anchor:E},F,G)=>{let W;for(;y&&y!==E;)W=f(y),r(y,F,G),y=W;r(E,F,G)},L=({el:y,anchor:E})=>{let F;for(;y&&y!==E;)F=f(y),o(y),y=F;o(E)},D=(y,E,F,G,W,Z,ie,re,ne)=>{E.type==="svg"?ie="svg":E.type==="math"&&(ie="mathml"),y==null?m(E,F,G,W,Z,ie,re,ne):T(y,E,W,Z,ie,re,ne)},m=(y,E,F,G,W,Z,ie,re)=>{let ne,K;const{props:ke,shapeFlag:ue,transition:_e,dirs:Ce}=y;if(ne=y.el=i(y.type,Z,ke&&ke.is,ke),ue&8?c(ne,y.children):ue&16&&I(y.children,ne,null,G,W,Gl(y,Z),ie,re),Ce&&Kr(y,null,G,"created"),P(ne,y,y.scopeId,ie,G),ke){for(const Je in ke)Je!=="value"&&!Es(Je)&&s(ne,Je,null,ke[Je],Z,G);"value"in ke&&s(ne,"value",null,ke.value,Z),(K=ke.onVnodeBeforeMount)&&An(K,G,y)}S.NODE_ENV!=="production"&&(Vi(ne,"__vnode",y,!0),Vi(ne,"__vueParentComponent",G,!0)),Ce&&Kr(y,null,G,"beforeMount");const Fe=Kg(W,_e);Fe&&_e.beforeEnter(ne),r(ne,E,F),((K=ke&&ke.onVnodeMounted)||Fe||Ce)&&Rt(()=>{K&&An(K,G,y),Fe&&_e.enter(ne),Ce&&Kr(y,null,G,"mounted")},W)},P=(y,E,F,G,W)=>{if(F&&h(y,F),G)for(let Z=0;Z<G.length;Z++)h(y,G[Z]);if(W){let Z=W.subTree;if(S.NODE_ENV!=="production"&&Z.patchFlag>0&&Z.patchFlag&2048&&(Z=Jl(Z.children)||Z),E===Z||Sf(Z.type)&&(Z.ssContent===E||Z.ssFallback===E)){const ie=W.vnode;P(y,ie,ie.scopeId,ie.slotScopeIds,W.parent)}}},I=(y,E,F,G,W,Z,ie,re,ne=0)=>{for(let K=ne;K<y.length;K++){const ke=y[K]=re?Or(y[K]):vn(y[K]);_(null,ke,E,F,G,W,Z,ie,re)}},T=(y,E,F,G,W,Z,ie)=>{const re=E.el=y.el;S.NODE_ENV!=="production"&&(re.__vnode=E);let{patchFlag:ne,dynamicChildren:K,dirs:ke}=E;ne|=y.patchFlag&16;const ue=y.props||Ze,_e=E.props||Ze;let Ce;if(F&&eo(F,!1),(Ce=_e.onVnodeBeforeUpdate)&&An(Ce,F,E,y),ke&&Kr(E,y,F,"beforeUpdate"),F&&eo(F,!0),S.NODE_ENV!=="production"&&bn&&(ne=0,ie=!1,K=null),(ue.innerHTML&&_e.innerHTML==null||ue.textContent&&_e.textContent==null)&&c(re,""),K?($(y.dynamicChildren,K,re,F,G,Gl(E,W),Z),S.NODE_ENV!=="production"&&Fs(y,E)):ie||me(y,E,re,null,F,G,Gl(E,W),Z,!1),ne>0){if(ne&16)A(re,ue,_e,F,W);else if(ne&2&&ue.class!==_e.class&&s(re,"class",null,_e.class,W),ne&4&&s(re,"style",ue.style,_e.style,W),ne&8){const Fe=E.dynamicProps;for(let Je=0;Je<Fe.length;Je++){const Ke=Fe[Je],tn=ue[Ke],zt=_e[Ke];(zt!==tn||Ke==="value")&&s(re,Ke,tn,zt,W,F)}}ne&1&&y.children!==E.children&&c(re,E.children)}else!ie&&K==null&&A(re,ue,_e,F,W);((Ce=_e.onVnodeUpdated)||ke)&&Rt(()=>{Ce&&An(Ce,F,E,y),ke&&Kr(E,y,F,"updated")},G)},$=(y,E,F,G,W,Z,ie)=>{for(let re=0;re<E.length;re++){const ne=y[re],K=E[re],ke=ne.el&&(ne.type===$e||!no(ne,K)||ne.shapeFlag&70)?d(ne.el):F;_(ne,K,ke,null,G,W,Z,ie,!0)}},A=(y,E,F,G,W)=>{if(E!==F){if(E!==Ze)for(const Z in E)!Es(Z)&&!(Z in F)&&s(y,Z,E[Z],null,W,G);for(const Z in F){if(Es(Z))continue;const ie=F[Z],re=E[Z];ie!==re&&Z!=="value"&&s(y,Z,re,ie,W,G)}"value"in F&&s(y,"value",E.value,F.value,W)}},oe=(y,E,F,G,W,Z,ie,re,ne)=>{const K=E.el=y?y.el:a(""),ke=E.anchor=y?y.anchor:a("");let{patchFlag:ue,dynamicChildren:_e,slotScopeIds:Ce}=E;S.NODE_ENV!=="production"&&(bn||ue&2048)&&(ue=0,ne=!1,_e=null),Ce&&(re=re?re.concat(Ce):Ce),y==null?(r(K,F,G),r(ke,F,G),I(E.children||[],F,ke,W,Z,ie,re,ne)):ue>0&&ue&64&&_e&&y.dynamicChildren?($(y.dynamicChildren,_e,F,W,Z,ie,re),S.NODE_ENV!=="production"?Fs(y,E):(E.key!=null||W&&E===W.subTree)&&Fs(y,E,!0)):me(y,E,F,ke,W,Z,ie,re,ne)},xe=(y,E,F,G,W,Z,ie,re,ne)=>{E.slotScopeIds=re,y==null?E.shapeFlag&512?W.ctx.activate(E,F,G,ie,ne):k(E,F,G,W,Z,ie,ne):U(y,E,ne)},k=(y,E,F,G,W,Z,ie)=>{const re=y.component=hv(y,G,W);if(S.NODE_ENV!=="production"&&re.type.__hmrId&&Wb(re),S.NODE_ENV!=="production"&&(Wi(y),Mo(re,"mount")),Rs(y)&&(re.ctx.renderer=gi),S.NODE_ENV!=="production"&&Mo(re,"init"),mv(re,!1,ie),S.NODE_ENV!=="production"&&Vo(re,"init"),re.asyncDep){if(S.NODE_ENV!=="production"&&bn&&(y.el=null),W&&W.registerDep(re,R,ie),!y.el){const ne=re.subTree=w(it);N(null,ne,E,F)}}else R(re,y,E,F,W,Z,ie);S.NODE_ENV!=="production"&&(Zi(),Vo(re,"mount"))},U=(y,E,F)=>{const G=E.component=y.component;if(sv(y,E,F))if(G.asyncDep&&!G.asyncResolved){S.NODE_ENV!=="production"&&Wi(E),ee(G,E,F),S.NODE_ENV!=="production"&&Zi();return}else G.next=E,G.update();else E.el=y.el,G.vnode=E},R=(y,E,F,G,W,Z,ie)=>{const re=()=>{if(y.isMounted){let{next:ue,bu:_e,u:Ce,parent:Fe,vnode:Je}=y;{const Ln=vf(y);if(Ln){ue&&(ue.el=Je.el,ee(y,ue,ie)),Ln.asyncDep.then(()=>{y.isUnmounted||re()});return}}let Ke=ue,tn;S.NODE_ENV!=="production"&&Wi(ue||y.vnode),eo(y,!1),ue?(ue.el=Je.el,ee(y,ue,ie)):ue=Je,_e&&xs(_e),(tn=ue.props&&ue.props.onVnodeBeforeUpdate)&&An(tn,Fe,ue,Je),eo(y,!0),S.NODE_ENV!=="production"&&Mo(y,"render");const zt=Ef(y);S.NODE_ENV!=="production"&&Vo(y,"render");const Rn=y.subTree;y.subTree=zt,S.NODE_ENV!=="production"&&Mo(y,"patch"),_(Rn,zt,d(Rn.el),Za(Rn),y,W,Z),S.NODE_ENV!=="production"&&Vo(y,"patch"),ue.el=zt.el,Ke===null&&iv(y,zt.el),Ce&&Rt(Ce,W),(tn=ue.props&&ue.props.onVnodeUpdated)&&Rt(()=>An(tn,Fe,ue,Je),W),S.NODE_ENV!=="production"&&Cd(y),S.NODE_ENV!=="production"&&Zi()}else{let ue;const{el:_e,props:Ce}=E,{bm:Fe,m:Je,parent:Ke,root:tn,type:zt}=y,Rn=Io(E);eo(y,!1),Fe&&xs(Fe),!Rn&&(ue=Ce&&Ce.onVnodeBeforeMount)&&An(ue,Ke,E),eo(y,!0);{tn.ce&&tn.ce._injectChildStyle(zt),S.NODE_ENV!=="production"&&Mo(y,"render");const Ln=y.subTree=Ef(y);S.NODE_ENV!=="production"&&Vo(y,"render"),S.NODE_ENV!=="production"&&Mo(y,"patch"),_(null,Ln,F,G,y,W,Z),S.NODE_ENV!=="production"&&Vo(y,"patch"),E.el=Ln.el}if(Je&&Rt(Je,W),!Rn&&(ue=Ce&&Ce.onVnodeMounted)){const Ln=E;Rt(()=>An(ue,Ke,Ln),W)}(E.shapeFlag&256||Ke&&Io(Ke.vnode)&&Ke.vnode.shapeFlag&256)&&y.a&&Rt(y.a,W),y.isMounted=!0,S.NODE_ENV!=="production"&&Jb(y),E=F=G=null}};y.scope.on();const ne=y.effect=new Yc(re);y.scope.off();const K=y.update=ne.run.bind(ne),ke=y.job=ne.runIfDirty.bind(ne);ke.i=y,ke.id=y.uid,ne.scheduler=()=>Ki(ke),eo(y,!0),S.NODE_ENV!=="production"&&(ne.onTrack=y.rtc?ue=>xs(y.rtc,ue):void 0,ne.onTrigger=y.rtg?ue=>xs(y.rtg,ue):void 0),K()},ee=(y,E,F)=>{E.component=y;const G=y.vnode.props;y.vnode=E,y.next=null,Vg(y,E.props,G,F),Wg(y,E.children,F),zn(),Ed(y),Wn()},me=(y,E,F,G,W,Z,ie,re,ne=!1)=>{const K=y&&y.children,ke=y?y.shapeFlag:0,ue=E.children,{patchFlag:_e,shapeFlag:Ce}=E;if(_e>0){if(_e&128){he(K,ue,F,G,W,Z,ie,re,ne);return}else if(_e&256){ae(K,ue,F,G,W,Z,ie,re,ne);return}}Ce&8?(ke&16&&bi(K,W,Z),ue!==K&&c(F,ue)):ke&16?Ce&16?he(K,ue,F,G,W,Z,ie,re,ne):bi(K,W,Z,!0):(ke&8&&c(F,""),Ce&16&&I(ue,F,G,W,Z,ie,re,ne))},ae=(y,E,F,G,W,Z,ie,re,ne)=>{y=y||Co,E=E||Co;const K=y.length,ke=E.length,ue=Math.min(K,ke);let _e;for(_e=0;_e<ue;_e++){const Ce=E[_e]=ne?Or(E[_e]):vn(E[_e]);_(y[_e],Ce,F,null,W,Z,ie,re,ne)}K>ke?bi(y,W,Z,!0,!1,ue):I(E,F,G,W,Z,ie,re,ne,ue)},he=(y,E,F,G,W,Z,ie,re,ne)=>{let K=0;const ke=E.length;let ue=y.length-1,_e=ke-1;for(;K<=ue&&K<=_e;){const Ce=y[K],Fe=E[K]=ne?Or(E[K]):vn(E[K]);if(no(Ce,Fe))_(Ce,Fe,F,null,W,Z,ie,re,ne);else break;K++}for(;K<=ue&&K<=_e;){const Ce=y[ue],Fe=E[_e]=ne?Or(E[_e]):vn(E[_e]);if(no(Ce,Fe))_(Ce,Fe,F,null,W,Z,ie,re,ne);else break;ue--,_e--}if(K>ue){if(K<=_e){const Ce=_e+1,Fe=Ce<ke?E[Ce].el:G;for(;K<=_e;)_(null,E[K]=ne?Or(E[K]):vn(E[K]),F,Fe,W,Z,ie,re,ne),K++}}else if(K>_e)for(;K<=ue;)Be(y[K],W,Z,!0),K++;else{const Ce=K,Fe=K,Je=new Map;for(K=Fe;K<=_e;K++){const Ft=E[K]=ne?Or(E[K]):vn(E[K]);Ft.key!=null&&(S.NODE_ENV!=="production"&&Je.has(Ft.key)&&X("Duplicate keys found during update:",JSON.stringify(Ft.key),"Make sure keys are unique."),Je.set(Ft.key,K))}let Ke,tn=0;const zt=_e-Fe+1;let Rn=!1,Ln=0;const vi=new Array(zt);for(K=0;K<zt;K++)vi[K]=0;for(K=Ce;K<=ue;K++){const Ft=y[K];if(tn>=zt){Be(Ft,W,Z,!0);continue}let jn;if(Ft.key!=null)jn=Je.get(Ft.key);else for(Ke=Fe;Ke<=_e;Ke++)if(vi[Ke-Fe]===0&&no(Ft,E[Ke])){jn=Ke;break}jn===void 0?Be(Ft,W,Z,!0):(vi[jn-Fe]=K+1,jn>=Ln?Ln=jn:Rn=!0,_(Ft,E[jn],F,null,W,Z,ie,re,ne),tn++)}const cm=Rn?Xg(vi):Co;for(Ke=cm.length-1,K=zt-1;K>=0;K--){const Ft=Fe+K,jn=E[Ft],dm=Ft+1<ke?E[Ft+1].el:G;vi[K]===0?_(null,jn,F,dm,W,Z,ie,re,ne):Rn&&(Ke<0||K!==cm[Ke]?ve(jn,F,dm,2):Ke--)}}},ve=(y,E,F,G,W=null)=>{const{el:Z,type:ie,transition:re,children:ne,shapeFlag:K}=y;if(K&6){ve(y.component.subTree,E,F,G);return}if(K&128){y.suspense.move(E,F,G);return}if(K&64){ie.move(y,E,F,gi);return}if(ie===$e){r(Z,E,F);for(let ue=0;ue<ne.length;ue++)ve(ne[ue],E,F,G);r(y.anchor,E,F);return}if(ie===Bs){B(y,E,F);return}if(G!==2&&K&1&&re)if(G===0)re.beforeEnter(Z),r(Z,E,F),Rt(()=>re.enter(Z),W);else{const{leave:ue,delayLeave:_e,afterLeave:Ce}=re,Fe=()=>r(Z,E,F),Je=()=>{ue(Z,()=>{Fe(),Ce&&Ce()})};_e?_e(Z,Fe,Je):Je()}else r(Z,E,F)},Be=(y,E,F,G=!1,W=!1)=>{const{type:Z,props:ie,ref:re,children:ne,dynamicChildren:K,shapeFlag:ke,patchFlag:ue,dirs:_e,cacheIndex:Ce}=y;if(ue===-2&&(W=!1),re!=null&&ra(re,null,F,y,!0),Ce!=null&&(E.renderCache[Ce]=void 0),ke&256){E.ctx.deactivate(y);return}const Fe=ke&1&&_e,Je=!Io(y);let Ke;if(Je&&(Ke=ie&&ie.onVnodeBeforeUnmount)&&An(Ke,E,y),ke&6)NO(y.component,F,G);else{if(ke&128){y.suspense.unmount(F,G);return}Fe&&Kr(y,null,E,"beforeUnmount"),ke&64?y.type.remove(y,E,F,gi,G):K&&!K.hasOnce&&(Z!==$e||ue>0&&ue&64)?bi(K,E,F,!1,!0):(Z===$e&&ue&384||!W&&ke&16)&&bi(ne,E,F),G&&ze(y)}(Je&&(Ke=ie&&ie.onVnodeUnmounted)||Fe)&&Rt(()=>{Ke&&An(Ke,E,y),Fe&&Kr(y,null,E,"unmounted")},F)},ze=y=>{const{type:E,el:F,anchor:G,transition:W}=y;if(E===$e){S.NODE_ENV!=="production"&&y.patchFlag>0&&y.patchFlag&2048&&W&&!W.persisted?y.children.forEach(ie=>{ie.type===it?o(ie.el):ze(ie)}):Tt(F,G);return}if(E===Bs){L(y);return}const Z=()=>{o(F),W&&!W.persisted&&W.afterLeave&&W.afterLeave()};if(y.shapeFlag&1&&W&&!W.persisted){const{leave:ie,delayLeave:re}=W,ne=()=>ie(F,Z);re?re(y.el,Z,ne):ne()}else Z()},Tt=(y,E)=>{let F;for(;y!==E;)F=f(y),o(y),y=F;o(E)},NO=(y,E,F)=>{S.NODE_ENV!=="production"&&y.type.__hmrId&&Zb(y);const{bum:G,scope:W,job:Z,subTree:ie,um:re,m:ne,a:K}=y;yf(ne),yf(K),G&&xs(G),W.stop(),Z&&(Z.flags|=8,Be(ie,y,E,F)),re&&Rt(re,E),Rt(()=>{y.isUnmounted=!0},E),E&&E.pendingBranch&&!E.isUnmounted&&y.asyncDep&&!y.asyncResolved&&y.suspenseId===E.pendingId&&(E.deps--,E.deps===0&&E.resolve()),S.NODE_ENV!=="production"&&eg(y)},bi=(y,E,F,G=!1,W=!1,Z=0)=>{for(let ie=Z;ie<y.length;ie++)Be(y[ie],E,F,G,W)},Za=y=>{if(y.shapeFlag&6)return Za(y.component.subTree);if(y.shapeFlag&128)return y.suspense.next();const E=f(y.anchor||y.el),F=E&&E[Ad];return F?f(F):E};let oc=!1;const um=(y,E,F)=>{y==null?E._vnode&&Be(E._vnode,null,null,!0):_(E._vnode||null,y,E,null,null,null,F),E._vnode=y,oc||(oc=!0,Ed(),xd(),oc=!1)},gi={p:_,um:Be,m:ve,r:ze,mt:k,mc:I,pc:me,pbc:$,n:Za,o:e};return{render:um,hydrate:void 0,createApp:Ag(um)}}function Gl({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function eo({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Kg(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Fs(e,t,n=!1){const r=e.children,o=t.children;if(ge(r)&&ge(o))for(let s=0;s<r.length;s++){const i=r[s];let a=o[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[s]=Or(o[s]),a.el=i.el),!n&&a.patchFlag!==-2&&Fs(i,a)),a.type===Us&&(a.el=i.el),S.NODE_ENV!=="production"&&a.type===it&&!a.el&&(a.el=i.el)}}function Xg(e){const t=e.slice(),n=[0];let r,o,s,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(o=n[n.length-1],e[o]<u){t[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)a=s+i>>1,e[n[a]]<u?s=a+1:i=a;u<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,i=n[s-1];s-- >0;)n[s]=i,i=t[i];return n}function vf(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:vf(t)}function yf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const Jg=Symbol.for("v-scx"),Qg=()=>{{const e=ye(Jg);return e||S.NODE_ENV!=="production"&&X("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Zt(e,t){return Kl(e,null,t)}function et(e,t,n){return S.NODE_ENV!=="production"&&!we(t)&&X("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Kl(e,t,n)}function Kl(e,t,n=Ze){const{immediate:r,deep:o,flush:s,once:i}=n;S.NODE_ENV!=="production"&&!t&&(r!==void 0&&X('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&X('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&X('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=st({},n);S.NODE_ENV!=="production"&&(a.onWarn=X);const l=t&&r||!t&&s!=="post";let u;if(Ws){if(s==="sync"){const h=Qg();u=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=ht,h.resume=ht,h.pause=ht,h}}const c=ut;a.call=(h,p,_)=>mn(h,c,p,_);let d=!1;s==="post"?a.scheduler=h=>{Rt(h,c&&c.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(h,p)=>{p?h():Ki(h)}),a.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const f=Rb(e,t,a);return Ws&&(u?u.push(f):l&&f()),f}function ev(e,t,n){const r=this.proxy,o=Qe(e)?e.includes(".")?_f(r,e):()=>r[e]:e.bind(r,r);let s;we(t)?s=t:(s=t.handler,n=t);const i=zs(this),a=Kl(o,s.bind(r),n);return i(),a}function _f(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const tv=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${At(t)}Modifiers`]||e[`${gr(t)}Modifiers`];function nv(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Ze;if(S.NODE_ENV!=="production"){const{emitsOptions:c,propsOptions:[d]}=e;if(c)if(!(t in c))(!d||!(zr(At(t))in d))&&X(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${zr(At(t))}" prop.`);else{const f=c[t];we(f)&&(f(...n)||X(`Invalid event arguments: event validation failed for event "${t}".`))}}let o=n;const s=t.startsWith("update:"),i=s&&tv(r,t.slice(7));if(i&&(i.trim&&(o=n.map(c=>Qe(c)?c.trim():c)),i.number&&(o=n.map(G0))),S.NODE_ENV!=="production"&&rg(e,t,o),S.NODE_ENV!=="production"){const c=t.toLowerCase();c!==t&&r[zr(c)]&&X(`Event "${c}" is emitted in component ${fa(e,e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${gr(t)}" instead of "${t}".`)}let a,l=r[a=zr(t)]||r[a=zr(At(t))];!l&&s&&(l=r[a=zr(gr(t))]),l&&mn(l,e,6,o);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,mn(u,e,6,o)}}function wf(e,t,n=!1){const r=t.emitsCache,o=r.get(e);if(o!==void 0)return o;const s=e.emits;let i={},a=!1;if(!we(e)){const l=u=>{const c=wf(u,t,!0);c&&(a=!0,st(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(He(e)&&r.set(e,null),null):(ge(s)?s.forEach(l=>i[l]=null):st(i,s),He(e)&&r.set(e,i),i)}function aa(e,t){return!e||!ws(t)?!1:(t=t.slice(2).replace(/Once$/,""),Ue(e,t[0].toLowerCase()+t.slice(1))||Ue(e,gr(t))||Ue(e,t))}let Xl=!1;function la(){Xl=!0}function Ef(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:d,data:f,setupState:h,ctx:p,inheritAttrs:_}=e,x=Qi(e);let N,q;S.NODE_ENV!=="production"&&(Xl=!1);try{if(n.shapeFlag&4){const L=o||r,D=S.NODE_ENV!=="production"&&h.__isScriptSetup?new Proxy(L,{get(m,P,I){return X(`Property '${String(P)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(m,P,I)}}):L;N=vn(u.call(D,L,c,S.NODE_ENV!=="production"?Tn(d):d,h,f,p)),q=a}else{const L=t;S.NODE_ENV!=="production"&&a===d&&la(),N=vn(L.length>1?L(S.NODE_ENV!=="production"?Tn(d):d,S.NODE_ENV!=="production"?{get attrs(){return la(),Tn(a)},slots:i,emit:l}:{attrs:a,slots:i,emit:l}):L(S.NODE_ENV!=="production"?Tn(d):d,null)),q=t.props?a:rv(a)}}catch(L){Hs.length=0,As(L,e,1),N=w(it)}let z=N,B;if(S.NODE_ENV!=="production"&&N.patchFlag>0&&N.patchFlag&2048&&([z,B]=xf(N)),q&&_!==!1){const L=Object.keys(q),{shapeFlag:D}=z;if(L.length){if(D&7)s&&L.some(Di)&&(q=ov(q,s)),z=gn(z,q,!1,!0);else if(S.NODE_ENV!=="production"&&!Xl&&z.type!==it){const m=Object.keys(a),P=[],I=[];for(let T=0,$=m.length;T<$;T++){const A=m[T];ws(A)?Di(A)||P.push(A[2].toLowerCase()+A.slice(3)):I.push(A)}I.length&&X(`Extraneous non-props attributes (${I.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),P.length&&X(`Extraneous non-emits event listeners (${P.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return n.dirs&&(S.NODE_ENV!=="production"&&!kf(z)&&X("Runtime directive used on component with non-element root node. The directives will not function as intended."),z=gn(z,null,!1,!0),z.dirs=z.dirs?z.dirs.concat(n.dirs):n.dirs),n.transition&&(S.NODE_ENV!=="production"&&!kf(z)&&X("Component inside <Transition> renders non-element root node that cannot be animated."),Vs(z,n.transition)),S.NODE_ENV!=="production"&&B?B(z):N=z,Qi(x),N}const xf=e=>{const t=e.children,n=e.dynamicChildren,r=Jl(t,!1);if(r){if(S.NODE_ENV!=="production"&&r.patchFlag>0&&r.patchFlag&2048)return xf(r)}else return[e,void 0];const o=t.indexOf(r),s=n?n.indexOf(r):-1,i=a=>{t[o]=a,n&&(s>-1?n[s]=a:a.patchFlag>0&&(e.dynamicChildren=[...n,a]))};return[vn(r),i]};function Jl(e,t=!0){let n;for(let r=0;r<e.length;r++){const o=e[r];if(to(o)){if(o.type!==it||o.children==="v-if"){if(n)return;if(n=o,S.NODE_ENV!=="production"&&t&&n.patchFlag>0&&n.patchFlag&2048)return Jl(n.children)}}else return}return n}const rv=e=>{let t;for(const n in e)(n==="class"||n==="style"||ws(n))&&((t||(t={}))[n]=e[n]);return t},ov=(e,t)=>{const n={};for(const r in e)(!Di(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n},kf=e=>e.shapeFlag&7||e.type===it;function sv(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:a,patchFlag:l}=t,u=s.emitsOptions;if(S.NODE_ENV!=="production"&&(o||a)&&bn||t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Of(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let d=0;d<c.length;d++){const f=c[d];if(i[f]!==r[f]&&!aa(u,f))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Of(r,i,u):!0:!!i;return!1}function Of(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const s=r[o];if(t[s]!==e[s]&&!aa(n,s))return!0}return!1}function iv({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const Sf=e=>e.__isSuspense;function av(e,t){t&&t.pendingBranch?ge(e)?t.effects.push(...e):t.effects.push(e):wd(e)}const $e=Symbol.for("v-fgt"),Us=Symbol.for("v-txt"),it=Symbol.for("v-cmt"),Bs=Symbol.for("v-stc"),Hs=[];let Yt=null;function g(e=!1){Hs.push(Yt=e?null:[])}function lv(){Hs.pop(),Yt=Hs[Hs.length-1]||null}let qs=1;function Nf(e,t=!1){qs+=e,e<0&&Yt&&t&&(Yt.hasOnce=!0)}function Cf(e){return e.dynamicChildren=qs>0?Yt||Co:null,lv(),qs>0&&Yt&&Yt.push(e),e}function C(e,t,n,r,o,s){return Cf(H(e,t,n,r,o,s,!0))}function J(e,t,n,r,o){return Cf(w(e,t,n,r,o,!0))}function to(e){return e?e.__v_isVNode===!0:!1}function no(e,t){if(S.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const n=Xi.get(t.type);if(n&&n.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}const uv=(...e)=>Pf(...e),Tf=({key:e})=>e??null,ua=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Qe(e)||Xe(e)||we(e)?{i:mt,r:e,k:t,f:!!n}:e:null);function H(e,t=null,n=null,r=0,o=null,s=e===$e?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Tf(t),ref:t&&ua(t),scopeId:Pd,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:mt};return a?(Ql(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=Qe(n)?8:16),S.NODE_ENV!=="production"&&l.key!==l.key&&X("VNode created with invalid key (NaN). VNode type:",l.type),qs>0&&!i&&Yt&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Yt.push(l),l}const w=S.NODE_ENV!=="production"?uv:Pf;function Pf(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===Zd)&&(S.NODE_ENV!=="production"&&!e&&X(`Invalid vnode type when creating vnode: ${e}.`),e=it),to(e)){const a=gn(e,t,!0);return n&&Ql(a,n),qs>0&&!s&&Yt&&(a.shapeFlag&6?Yt[Yt.indexOf(e)]=a:Yt.push(a)),a.patchFlag=-2,a}if(Lf(e)&&(e=e.__vccOpts),t){t=cv(t);let{class:a,style:l}=t;a&&!Qe(a)&&(t.class=Os(a)),He(l)&&(Po(l)&&!ge(l)&&(l=st({},l)),t.style=Ri(l))}const i=Qe(e)?1:Sf(e)?128:Dd(e)?64:He(e)?4:we(e)?2:0;return S.NODE_ENV!=="production"&&i&4&&Po(e)&&(e=Se(e),X("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
14
14
|
Component that was made reactive: `,e)),H(e,t,n,r,o,i,s,!0)}function cv(e){return e?Po(e)||lf(e)?st({},e):e:null}function gn(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:a,transition:l}=e,u=t?eu(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Tf(u),ref:t&&t.ref?n&&s?ge(s)?s.concat(ua(t)):[s,ua(t)]:ua(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:S.NODE_ENV!=="production"&&i===-1&&ge(a)?a.map($f):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==$e?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&gn(e.ssContent),ssFallback:e.ssFallback&&gn(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Vs(c,l.clone(c)),c}function $f(e){const t=gn(e);return ge(e.children)&&(t.children=e.children.map($f)),t}function M(e=" ",t=0){return w(Us,null,e,t)}function Af(e,t){const n=w(Bs,null,e);return n.staticCount=t,n}function fe(e="",t=!1){return t?(g(),J(it,null,e)):w(it,null,e)}function vn(e){return e==null||typeof e=="boolean"?w(it):ge(e)?w($e,null,e.slice()):to(e)?Or(e):w(Us,null,String(e))}function Or(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:gn(e)}function Ql(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ge(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Ql(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!lf(t)?t._ctx=mt:o===3&&mt&&(mt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else we(t)?(t={default:t,_ctx:mt},n=32):(t=String(t),r&64?(n=16,t=[M(t)]):n=8);e.children=t,e.shapeFlag|=n}function eu(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=Os([t.class,r.class]));else if(o==="style")t.style=Ri([t.style,r.style]);else if(ws(o)){const s=t[o],i=r[o];i&&s!==i&&!(ge(s)&&s.includes(i))&&(t[o]=s?[].concat(s,i):i)}else o!==""&&(t[o]=r[o])}return t}function An(e,t,n,r=null){mn(e,t,7,[n,r])}const dv=of();let fv=0;function hv(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||dv,s={uid:fv++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new zc(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:cf(r,o),emitsOptions:wf(r,o),emit:null,emitted:null,propsDefaults:Ze,inheritAttrs:r.inheritAttrs,ctx:Ze,data:Ze,props:Ze,attrs:Ze,slots:Ze,refs:Ze,setupState:Ze,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return S.NODE_ENV!=="production"?s.ctx=Eg(s):s.ctx={_:s},s.root=t?t.root:s,s.emit=nv.bind(null,s),e.ce&&e.ce(s),s}let ut=null;const ca=()=>ut||mt;let da,tu;{const e=ks(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(i=>i(s)):o[0](s)}};da=t("__VUE_INSTANCE_SETTERS__",n=>ut=n),tu=t("__VUE_SSR_SETTERS__",n=>Ws=n)}const zs=e=>{const t=ut;return da(e),e.scope.on(),()=>{e.scope.off(),da(t)}},Df=()=>{ut&&ut.scope.off(),da(null)},pv=Hn("slot,component");function nu(e,{isNativeTag:t}){(pv(e)||t(e))&&X("Do not use built-in or reserved HTML elements as component id: "+e)}function If(e){return e.vnode.shapeFlag&4}let Ws=!1;function mv(e,t=!1,n=!1){t&&tu(t);const{props:r,children:o}=e.vnode,s=If(e);Ig(e,r,s,t),zg(e,o,n);const i=s?bv(e,t):void 0;return t&&tu(!1),i}function bv(e,t){var n;const r=e.type;if(S.NODE_ENV!=="production"){if(r.name&&nu(r.name,e.appContext.config),r.components){const s=Object.keys(r.components);for(let i=0;i<s.length;i++)nu(s[i],e.appContext.config)}if(r.directives){const s=Object.keys(r.directives);for(let i=0;i<s.length;i++)$d(s[i])}r.compilerOptions&&gv()&&X('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Xd),S.NODE_ENV!=="production"&&xg(e);const{setup:o}=r;if(o){zn();const s=e.setupContext=o.length>1?yv(e):null,i=zs(e),a=$o(o,e,0,[S.NODE_ENV!=="production"?Tn(e.props):e.props,s]),l=pl(a);if(Wn(),i(),(l||e.sp)&&!Io(e)&&zd(e),l){if(a.then(Df,Df),t)return a.then(u=>{Mf(e,u,t)}).catch(u=>{As(u,e,0)});if(e.asyncDep=a,S.NODE_ENV!=="production"&&!e.suspense){const u=(n=r.name)!=null?n:"Anonymous";X(`Component <${u}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}}else Mf(e,a,t)}else Vf(e,t)}function Mf(e,t,n){we(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:He(t)?(S.NODE_ENV!=="production"&&to(t)&&X("setup() should not return VNodes directly - return a render function instead."),S.NODE_ENV!=="production"&&(e.devtoolsRawSetupState=t),e.setupState=md(t),S.NODE_ENV!=="production"&&kg(e)):S.NODE_ENV!=="production"&&t!==void 0&&X(`setup() should return an object. Received: ${t===null?"null":typeof t}`),Vf(e,n)}const gv=()=>!0;function Vf(e,t,n){const r=e.type;e.render||(e.render=r.render||ht);{const o=zs(e);zn();try{Sg(e)}finally{Wn(),o()}}S.NODE_ENV!=="production"&&!r.render&&e.render===ht&&!t&&(r.template?X('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):X("Component is missing template or render function: ",r))}const Rf=S.NODE_ENV!=="production"?{get(e,t){return la(),pt(e,"get",""),e[t]},set(){return X("setupContext.attrs is readonly."),!1},deleteProperty(){return X("setupContext.attrs is readonly."),!1}}:{get(e,t){return pt(e,"get",""),e[t]}};function vv(e){return new Proxy(e.slots,{get(t,n){return pt(e,"get","$slots"),t[n]}})}function yv(e){const t=n=>{if(S.NODE_ENV!=="production"&&(e.exposed&&X("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(ge(n)?r="array":Xe(n)&&(r="ref")),r!=="object"&&X(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(S.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,Rf))},get slots(){return r||(r=vv(e))},get emit(){return(o,...s)=>e.emit(o,...s)},expose:t})}else return{attrs:new Proxy(e.attrs,Rf),slots:e.slots,emit:e.emit,expose:t}}function ru(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(md(yr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Jr)return Jr[n](e)},has(t,n){return n in t||n in Jr}})):e.proxy}const _v=/(?:^|[-_])(\w)/g,wv=e=>e.replace(_v,t=>t.toUpperCase()).replace(/[-_]/g,"");function ou(e,t=!0){return we(e)?e.displayName||e.name:e.name||t&&e.__name}function fa(e,t,n=!1){let r=ou(t);if(!r&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(r=o[1])}if(!r&&e&&e.parent){const o=s=>{for(const i in s)if(s[i]===t)return i};r=o(e.components||e.parent.type.components)||o(e.appContext.components)}return r?wv(r):n?"App":"Anonymous"}function Lf(e){return we(e)&&"__vccOpts"in e}const se=(e,t)=>{const n=Mb(e,t,Ws);if(S.NODE_ENV!=="production"){const r=ca();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function ct(e,t,n){const r=arguments.length;return r===2?He(t)&&!ge(t)?to(t)?w(e,null,[t]):w(e,t):w(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&to(n)&&(n=[n]),w(e,t,n))}function Ev(){if(S.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},o={__vue_custom_formatter:!0,header(d){return He(d)?d.__isVue?["div",e,"VueInstance"]:Xe(d)?["div",{},["span",e,c(d)],"<",a("_value"in d?d._value:d),">"]:pn(d)?["div",{},["span",e,It(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${Yn(d)?" (readonly)":""}`]:Yn(d)?["div",{},["span",e,It(d)?"ShallowReadonly":"Readonly"],"<",a(d),">"]:null:null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...s(d.$)]}};function s(d){const f=[];d.type.props&&d.props&&f.push(i("props",Se(d.props))),d.setupState!==Ze&&f.push(i("setup",d.setupState)),d.data!==Ze&&f.push(i("data",Se(d.data)));const h=l(d,"computed");h&&f.push(i("computed",h));const p=l(d,"inject");return p&&f.push(i("injected",p)),f.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),f}function i(d,f){return f=st({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},d],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(h=>["div",{},["span",r,h+": "],a(f[h],!1)])]]:["span",{}]}function a(d,f=!0){return typeof d=="number"?["span",t,d]:typeof d=="string"?["span",n,JSON.stringify(d)]:typeof d=="boolean"?["span",r,d]:He(d)?["object",{object:f?Se(d):d}]:["span",n,String(d)]}function l(d,f){const h=d.type;if(we(h))return;const p={};for(const _ in d.ctx)u(h,_,f)&&(p[_]=d.ctx[_]);return p}function u(d,f,h){const p=d[h];if(ge(p)&&p.includes(f)||He(p)&&f in p||d.extends&&u(d.extends,f,h)||d.mixins&&d.mixins.some(_=>u(_,f,h)))return!0}function c(d){return It(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const jf="3.5.13",Kn=S.NODE_ENV!=="production"?X:ht;var Dn={};let su;const Ff=typeof window<"u"&&window.trustedTypes;if(Ff)try{su=Ff.createPolicy("vue",{createHTML:e=>e})}catch(e){Dn.NODE_ENV!=="production"&&Kn(`Error creating trusted types policy: ${e}`)}const Uf=su?e=>su.createHTML(e):e=>e,xv="http://www.w3.org/2000/svg",kv="http://www.w3.org/1998/Math/MathML",Xn=typeof document<"u"?document:null,Bf=Xn&&Xn.createElement("template"),Ov={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?Xn.createElementNS(xv,e):t==="mathml"?Xn.createElementNS(kv,e):n?Xn.createElement(e,{is:n}):Xn.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>Xn.createTextNode(e),createComment:e=>Xn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Xn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const i=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{Bf.innerHTML=Uf(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Bf.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Sr="transition",Zs="animation",Ys=Symbol("_vtc"),Hf={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Sv=st({},jd,Hf),Gs=(e=>(e.displayName="Transition",e.props=Sv,e))((e,{slots:t})=>ct(lg,Nv(e),t)),ro=(e,t=[])=>{ge(e)?e.forEach(n=>n(...t)):e&&e(...t)},qf=e=>e?ge(e)?e.some(t=>t.length>1):e.length>1:!1;function Nv(e){const t={};for(const A in e)A in Hf||(t[A]=e[A]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:u=i,appearToClass:c=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=Cv(o),_=p&&p[0],x=p&&p[1],{onBeforeEnter:N,onEnter:q,onEnterCancelled:z,onLeave:B,onLeaveCancelled:L,onBeforeAppear:D=N,onAppear:m=q,onAppearCancelled:P=z}=t,I=(A,oe,xe,k)=>{A._enterCancelled=k,oo(A,oe?c:a),oo(A,oe?u:i),xe&&xe()},T=(A,oe)=>{A._isLeaving=!1,oo(A,d),oo(A,h),oo(A,f),oe&&oe()},$=A=>(oe,xe)=>{const k=A?m:q,U=()=>I(oe,A,xe);ro(k,[oe,U]),zf(()=>{oo(oe,A?l:s),Jn(oe,A?c:a),qf(k)||Wf(oe,r,_,U)})};return st(t,{onBeforeEnter(A){ro(N,[A]),Jn(A,s),Jn(A,i)},onBeforeAppear(A){ro(D,[A]),Jn(A,l),Jn(A,u)},onEnter:$(!1),onAppear:$(!0),onLeave(A,oe){A._isLeaving=!0;const xe=()=>T(A,oe);Jn(A,d),A._enterCancelled?(Jn(A,f),Gf()):(Gf(),Jn(A,f)),zf(()=>{A._isLeaving&&(oo(A,d),Jn(A,h),qf(B)||Wf(A,r,x,xe))}),ro(B,[A,xe])},onEnterCancelled(A){I(A,!1,void 0,!0),ro(z,[A])},onAppearCancelled(A){I(A,!0,void 0,!0),ro(P,[A])},onLeaveCancelled(A){T(A),ro(L,[A])}})}function Cv(e){if(e==null)return null;if(He(e))return[iu(e.enter),iu(e.leave)];{const t=iu(e);return[t,t]}}function iu(e){const t=K0(e);return Dn.NODE_ENV!=="production"&&Bb(t,"<transition> explicit duration"),t}function Jn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Ys]||(e[Ys]=new Set)).add(t)}function oo(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Ys];n&&(n.delete(t),n.size||(e[Ys]=void 0))}function zf(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Tv=0;function Wf(e,t,n,r){const o=e._endId=++Tv,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:a,propCount:l}=Pv(e,t);if(!i)return r();const u=i+"end";let c=0;const d=()=>{e.removeEventListener(u,f),s()},f=h=>{h.target===e&&++c>=l&&d()};setTimeout(()=>{c<l&&d()},a+1),e.addEventListener(u,f)}function Pv(e,t){const n=window.getComputedStyle(e),r=p=>(n[p]||"").split(", "),o=r(`${Sr}Delay`),s=r(`${Sr}Duration`),i=Zf(o,s),a=r(`${Zs}Delay`),l=r(`${Zs}Duration`),u=Zf(a,l);let c=null,d=0,f=0;t===Sr?i>0&&(c=Sr,d=i,f=s.length):t===Zs?u>0&&(c=Zs,d=u,f=l.length):(d=Math.max(i,u),c=d>0?i>u?Sr:Zs:null,f=c?c===Sr?s.length:l.length:0);const h=c===Sr&&/\b(transform|all)(,|$)/.test(r(`${Sr}Property`).toString());return{type:c,timeout:d,propCount:f,hasTransform:h}}function Zf(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Yf(n)+Yf(e[r])))}function Yf(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Gf(){return document.body.offsetHeight}function $v(e,t,n){const r=e[Ys];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Kf=Symbol("_vod"),Av=Symbol("_vsh"),Dv=Symbol(Dn.NODE_ENV!=="production"?"CSS_VAR_TEXT":""),Iv=/(^|;)\s*display\s*:/;function Mv(e,t,n){const r=e.style,o=Qe(n);let s=!1;if(n&&!o){if(t)if(Qe(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&ha(r,a,"")}else for(const i in t)n[i]==null&&ha(r,i,"");for(const i in n)i==="display"&&(s=!0),ha(r,i,n[i])}else if(o){if(t!==n){const i=r[Dv];i&&(n+=";"+i),r.cssText=n,s=Iv.test(n)}}else t&&e.removeAttribute("style");Kf in e&&(e[Kf]=s?r.display:"",e[Av]&&(r.display="none"))}const Vv=/[^\\];\s*$/,Xf=/\s*!important$/;function ha(e,t,n){if(ge(n))n.forEach(r=>ha(e,t,r));else if(n==null&&(n=""),Dn.NODE_ENV!=="production"&&Vv.test(n)&&Kn(`Unexpected semicolon at the end of '${t}' style value: '${n}'`),t.startsWith("--"))e.setProperty(t,n);else{const r=Rv(e,t);Xf.test(n)?e.setProperty(gr(r),n.replace(Xf,""),"important"):e[r]=n}}const Jf=["Webkit","Moz","ms"],au={};function Rv(e,t){const n=au[t];if(n)return n;let r=At(t);if(r!=="filter"&&r in e)return au[t]=r;r=qr(r);for(let o=0;o<Jf.length;o++){const s=Jf[o]+r;if(s in e)return au[t]=s}return t}const Qf="http://www.w3.org/1999/xlink";function eh(e,t,n,r,o,s=ab(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Qf,t.slice(6,t.length)):e.setAttributeNS(Qf,t,n):n==null||s&&!Bc(n)?e.removeAttribute(t):e.setAttribute(t,s?"":qn(n)?String(n):n)}function th(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Uf(n):n);return}const s=e.tagName;if(t==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=Bc(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch(a){Dn.NODE_ENV!=="production"&&!i&&Kn(`Failed setting prop "${t}" on <${s.toLowerCase()}>: value ${n} is invalid.`,a)}i&&e.removeAttribute(o||t)}function Lv(e,t,n,r){e.addEventListener(t,n,r)}function jv(e,t,n,r){e.removeEventListener(t,n,r)}const nh=Symbol("_vei");function Fv(e,t,n,r,o=null){const s=e[nh]||(e[nh]={}),i=s[t];if(r&&i)i.value=Dn.NODE_ENV!=="production"?oh(r,t):r;else{const[a,l]=Uv(t);if(r){const u=s[t]=qv(Dn.NODE_ENV!=="production"?oh(r,t):r,o);Lv(e,a,u,l)}else i&&(jv(e,a,i,l),s[t]=void 0)}}const rh=/(?:Once|Passive|Capture)$/;function Uv(e){let t;if(rh.test(e)){t={};let r;for(;r=e.match(rh);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):gr(e.slice(2)),t]}let lu=0;const Bv=Promise.resolve(),Hv=()=>lu||(Bv.then(()=>lu=0),lu=Date.now());function qv(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;mn(zv(r,n.value),t,5,[r])};return n.value=e,n.attached=Hv(),n}function oh(e,t){return we(e)||ge(e)?e:(Kn(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
|
|
15
|
-
Expected function or array of functions, received type ${typeof e}.`),ht)}function zv(e,t){if(ge(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const sh=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Wv=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?$v(e,r,i):t==="style"?Mv(e,n,r):ws(t)?Di(t)||Fv(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Zv(e,t,r,i))?(th(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&eh(e,t,r,i,s,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Qe(r))?th(e,At(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),eh(e,t,r,i))};function Zv(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&sh(t)&&we(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return sh(t)&&Qe(n)?!1:t in e}const Yv=["ctrl","shift","alt","meta"],Gv={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Yv.some(n=>e[`${n}Key`]&&!t.includes(n))},Nr=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...s)=>{for(let i=0;i<t.length;i++){const a=Gv[t[i]];if(a&&a(o,t))return}return e(o,...s)})},Kv=st({patchProp:Wv},Ov);let ih;function Xv(){return ih||(ih=Yg(Kv))}const Jv=(...e)=>{const t=Xv().createApp(...e);Dn.NODE_ENV!=="production"&&(ey(t),ty(t));const{mount:n}=t;return t.mount=r=>{const o=ny(r);if(!o)return;const s=t._component;!we(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,Qv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t};function Qv(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ey(e){Object.defineProperty(e.config,"isNativeTag",{value:t=>ob(t)||sb(t)||ib(t),writable:!1})}function ty(e){{const t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){Kn("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});const n=e.config.compilerOptions,r='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(e.config,"compilerOptions",{get(){return Kn(r),n},set(){Kn(r)}})}}function ny(e){if(Qe(e)){const t=document.querySelector(e);return Dn.NODE_ENV!=="production"&&!t&&Kn(`Failed to mount app: mount target selector "${e}" returned null.`),t}return Dn.NODE_ENV!=="production"&&window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode==="closed"&&Kn('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}var ry={};function oy(){Ev()}ry.NODE_ENV!=="production"&&oy();let pa;const sy=new Uint8Array(16);function iy(){if(!pa&&(pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pa(sy)}const _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function ay(e,t=0){return _t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]}const ah={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ks(e,t,n){if(ah.randomUUID&&!e)return ah.randomUUID();e=e||{};const r=e.random||(e.rng||iy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ay(r)}var Gt=Symbol("storefront");function ly(e,t=100){let n=0;return async(...o)=>{clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}var uy=v.object({source:v.literal("moonbase-checkout"),event:v.literal("close"),intent:v.string().optional(),completed:v.boolean()}),cy=v.object({source:v.literal("moonbase-checkout"),event:v.literal("completed"),order:fl.orders.completedOrderSchema}),dy=v.discriminatedUnion("event",[uy,cy]);function fy(){var e;const t=document.getElementById("moonbase-checkout");!t||!(t instanceof HTMLIFrameElement)||(e=t.contentWindow)==null||e.postMessage("close","*")}function ma(e){if(typeof window>"u"){console.warn("Can not mount checkout server side");return}if(document.getElementById("moonbase-checkout"))return;const t=document.createElement("iframe");t.id="moonbase-checkout",t.src=e,t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.right="0px",t.style.border="none",t.style.colorScheme="normal",t.style.backgroundColor="transparent",t.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),t.setAttribute("background","transparent"),t.setAttribute("frameborder","0"),t.setAttribute("allowtransparency","true"),t.setAttribute("allow","payment"),t.height="100%",t.width="100%",document.body.append(t),document.documentElement.style.overflow="hidden",window.onmessage=function(n){var r;try{const o=dy.parse(n.data);o.event==="close"&&(document.body.contains(t)&&(document.documentElement.style.removeProperty("overflow"),document.body.removeChild(t)),window.dispatchEvent(new CustomEvent("moonbase-checkout-closed",{detail:o}))),o.event==="completed"&&window.dispatchEvent(new CustomEvent("moonbase-checkout-completed",{detail:o}))}catch(o){((r=n.data)==null?void 0:r.source)==="moonbase-checkout"&&console.error("Could not parse event:",n.data,o)}}}var Xs=class lt{constructor(t,n,r){this.configuration=t,this.client=n,this.stateFactory=r,this.currentUser=V(null),this.loadedUser=V(!1),this.refreshOrderAbortController=new AbortController,this.debouncedPushOrderContent=ly(l=>this.client.orders.pushContent(l,void 0,this.hasUtm?this.utm.value:void 0),500);var o;if(typeof window>"u"){this.currentOrder=V({id:Ks(),status:No.Open,currency:"",items:[],couponsApplied:[]}),this.storefront=r(lt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!1),this.utm=r(lt.utmKey,void 0);return}window.addEventListener("storage",l=>this.handleStorageUpdate(l));const s=new URLSearchParams(window.location.search);if(this.utm=r(lt.utmKey,{referrer:((o=window.document.referrer)==null?void 0:o.replace(/https?:\/\//g,"").split("/")[0])||void 0,source:s.get("utm_source")||void 0,medium:s.get("utm_medium")||void 0,campaign:s.get("utm_campaign")||void 0,term:s.get("utm_term")||void 0,content:s.get("utm_content")||void 0}),this.hasUtm&&t.persistUtm)localStorage.setItem(lt.utmKey,JSON.stringify(this.utm.value));else if(t.persistUtm){const l=localStorage.getItem(lt.utmKey);if(l)try{this.utm=r(lt.utmKey,JSON.parse(l))}catch{}}const i=localStorage.getItem(lt.sessionKey);i?(this.currentOrder=V(JSON.parse(i)),this.refreshOrder()):(this.currentOrder=V({id:Ks(),status:No.Open,currency:"",items:[],couponsApplied:[]}),this.hasUtm&&this.pushOrderContent());const a=localStorage.getItem(lt.storefrontKey);if(a?(this.storefront=r(lt.storefrontKey,JSON.parse(a)),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!0)):(this.storefront=r(lt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!1)),this.client.tokenStore.user&&(this.currentUser.value=fl.identity.userSchema.parse(this.client.tokenStore.user)),this.updateStorefront(),this.updateUser(),window.location){const l=new URLSearchParams(window.location.search),u=l.get("mb_intent"),c=l.get("mb_endpoint");if(u==="checkout"&&l.get("mb_complete")&&c){const d=Object.fromEntries([...l.entries()].filter(([h])=>!h.startsWith("mb_"))),f=new URL(decodeURIComponent(c));for(const h of Object.keys(d))f.searchParams.append(h,d[h]);ma(f.toString()),window.history.replaceState(null,"",window.location.href.split("?")[0])}}window.addEventListener("moonbase-checkout-completed",l=>{l.detail.order.id===this.currentOrder.value.id&&this.resetOrder(),this.updateUser()})}get loadedStorefrontPromise(){return new Promise(t=>{et(this.loadedStorefront,n=>{n&&t()},{immediate:!0})})}get hasUtm(){return!!this.utm.value&&Object.values(this.utm.value).some(t=>!!t)}get loadedUserPromise(){return new Promise(t=>{et(this.loadedUser,n=>{n&&t()},{immediate:!0})})}closeCheckout(){fy()}onCheckoutInitiated(t){window.addEventListener("moonbase-checkout-initiated",n=>t(n.detail.order,n.detail.total))}onCheckoutCompleted(t){window.addEventListener("moonbase-checkout-completed",n=>t(n.detail.order))}onCheckoutClosed(t){window.addEventListener("moonbase-checkout-closed",n=>t(n.detail.intent))}install(t){t.provide(Gt,this),console.log("Moonbase.sh storefront installed, learn more at https://moonbase.sh/docs")}async updateUser(){try{this.currentUser.value=await this.client.identity.get()}catch(t){t instanceof Pi||console.error("Could not load user",t),this.currentUser.value=null}finally{this.loadedUser.value=!0}return this.currentUser.value}async updateStorefront(){const t=await this.client.storefront.get(this.hasUtm?this.utm.value:void 0);return t&&(typeof window<"u"&&localStorage.setItem(lt.storefrontKey,JSON.stringify(t)),this.storefront.value=t,this.loadedStorefront.value=!0,this.currentOrder.value.currency||(this.currentOrder.value.currency=t.suggestedCurrency),this.currentOrder.value.items=this.enrichLineItems(this.currentOrder.value.items)),t}async pushOrderContent(){typeof window<"u"&&localStorage.setItem(lt.sessionKey,JSON.stringify(this.currentOrder.value)),this.refreshOrderAbortController.abort(),this.refreshOrderAbortController=new AbortController,this.debouncedPushOrderContent(this.currentOrder.value)}handleStorageUpdate(t){var n;switch(t.key){case lt.sessionKey:this.currentOrder.value=t.newValue?JSON.parse(t.newValue):{id:Ks(),currency:((n=this.storefront.value)==null?void 0:n.suggestedCurrency)||"",status:No.Open,items:[],couponsApplied:[]};break;case lt.storefrontKey:this.storefront.value=JSON.parse(t.newValue);break;case lt.utmKey:this.utm.value=JSON.parse(t.newValue);break;case Mc.storageKey:t.newValue?console.warn("User was updated",t.newValue):(this.currentUser.value=null,console.warn("User was removed"))}}async refreshOrder(){try{const t=await this.client.orders.get(this.currentOrder.value.id,this.refreshOrderAbortController.signal);t&&(t.status!==No.Open?this.resetOrder():(t.items=this.enrichLineItems(t.items),typeof window<"u"&&localStorage.setItem(lt.sessionKey,JSON.stringify(t)),this.currentOrder.value=t))}catch(t){t instanceof wc&&this.resetOrder()}}resetOrder(){var t;this.currentOrder.value={id:Ks(),currency:((t=this.storefront.value)==null?void 0:t.suggestedCurrency)||"",status:No.Open,items:[],couponsApplied:[]},typeof window<"u"&&localStorage.removeItem(lt.sessionKey)}async surrenderOrder(){try{await this.client.orders.removeBillingDetails(this.currentOrder.value.id)}catch(t){if(t instanceof mr)return;console.warn("Could not surrender order:",t)}}enrichLineItems(t){return this.storefront?t.map(n=>{var r,o;if(n.type==="Product"){const s=this.storefront.value.products.find(l=>l.id===n.productId),a=((s==null?void 0:s.variations)||[]).find(l=>l.id===n.variationId);return{...n,product:s,variation:a,price:a==null?void 0:a.price,appliedDiscount:(r=a==null?void 0:a.discount)!=null?r:n.appliedDiscount}}else{const s=this.storefront.value.bundles.find(l=>l.id===n.bundleId),a=((s==null?void 0:s.variations)||[]).find(l=>l.id===n.variationId);return{...n,bundle:s,variation:a,price:a==null?void 0:a.price,appliedDiscount:(o=a==null?void 0:a.discount)!=null?o:n.appliedDiscount}}}):t}};Xs.userKey="moonbase_user",Xs.sessionKey="moonbase_session",Xs.storefrontKey="moonbase_storefront",Xs.utmKey="moonbase_utm";var hy=Xs;function py(e,t){const n=ye(Gt);if(!n)throw new Error("No storefront configured");const r=n.stateFactory(`activation-request-${_r(e)}`,null),o=n.stateFactory(`activation-request-${_r(e)}-error`,null),s=n.stateFactory(`activation-request-${_r(e)}-loading`,!0),i=n.stateFactory(`activation-request-${_r(e)}-fulfilling`,!1),a=n.stateFactory(`activation-request-${_r(e)}-completing`,!1),l=n.stateFactory(`activation-request-${_r(e)}-completion-timeout`,null),u=async()=>{if(!r.value)return;await n.client.activationRequests.isCompleted(r.value.id)&&r.value?(r.value.status=fn.Completed,a.value=!1):l.value=setTimeout(u,1500)};return et(()=>_r(e),async c=>{try{c&&c.length>0?(r.value=await n.client.activationRequests.get(c),r.value.status===fn.Fulfilled&&(a.value=!0,u()),s.value=!1):console.warn("No token given to `useActivationRequest`")}catch(d){o.value=d.message,s.value=!1}},{immediate:!0}),jl(()=>{l.value&&clearTimeout(l.value)}),et(n.currentUser,async()=>{var c,d;const f=_r(e);if(!(!f||(d=(c=r.value)==null?void 0:c.licenseEligibility)!=null&&d.eligible)){s.value=!0;try{r.value=await n.client.activationRequests.get(f),r.value.status===fn.Fulfilled&&(a.value=!0,u())}catch(h){o.value=h.message}s.value=!1}}),{activationRequest:r,loading:s,fulfilling:i,completing:a,error:o,isInstalled:se(()=>{var c;return r&&((c=r.value)==null?void 0:c.status)===fn.Completed}),fulfillLicense:async()=>{i.value=!0,r.value=await n.client.activationRequests.fulfillLicense(r.value.id),i.value=!1,a.value=!0,u()},fulfillTrial:async()=>{i.value=!0;try{r.value=await n.client.activationRequests.fulfillTrial(r.value.id),i.value=!1,a.value=!0;const c=u()}catch(c){console.warn("Could not fulfill trial: ",c),c instanceof Pi?o.value="You need to be signed in to do this":o.value=c.message,i.value=!1}},cancel:async()=>{!r.value||r.value.status===fn.Cancelled||(r.value=await n.client.activationRequests.cancel(r.value.id))}}}function tt(e){const t=e??ye(Gt);if(!t)throw new Error("No storefront configured");return{user:t.currentUser,loaded:t.loadedUser,loadedPromise:t.loadedUserPromise,signIn:async(n,r)=>{const o=await t.client.identity.signIn(n,r);return t.currentUser.value=o,t.updateStorefront(),o},signUp:async(n,r,o,s,i,a,l)=>{const u=await t.client.identity.signUp(n,r,o,s,i,a,l);return t.currentUser.value=u,t.updateStorefront(),u},signOut:async()=>{t.client.tokenStore.clear(),await Promise.all([t.updateStorefront(),t.surrenderOrder()]),t.currentUser.value=null},update:async(n,r,o,s)=>{const i=await t.client.identity.update(n,r,o,s);return t.currentUser.value&&(t.currentUser.value=i.user),i},setPassword:async(n,r)=>{await t.client.identity.setPassword(n,r)},forgotPassword:async n=>{await t.client.identity.forgotPassword(n)},resetPassword:async(n,r,o)=>{await t.client.identity.resetPassword(n,r,o)},confirmAccount:async(n,r)=>await t.client.identity.confirmAccount(n,r),confirmEmail:async(n,r)=>await t.client.identity.confirmEmail(n,r),confirmEmailChange:async(n,r)=>(await t.client.identity.confirmEmailChange(n,r),await t.updateUser())}}function ba(e,t){const n=t??ye(Gt);if(!n)throw new Error("No storefront configured");return se(()=>n.storefront.value.bundles.find(r=>r.id===e)||null)}function my(e){const t=ye(Gt);if(!t)throw new Error("No storefront configured");return se(()=>t.storefront.value.bundles)}function Cr(e){const t=e??ye(Gt);if(!t)throw new Error("No storefront configured");const n=se(()=>{const r=t.currentOrder.value.currency||t.storefront.value.suggestedCurrency;return{amount:t.currentOrder.value.items.reduce((s,i)=>{var a,l,u,c,d,f,h,p,_;let x;if(i.type==="Product"){const N=t.storefront.value.products.find(D=>D.id===i.productId),z=((N==null?void 0:N.variations)||[]).find(D=>D.id===i.variationId),B=(l=(a=z==null?void 0:z.pricingTiers)==null?void 0:a.filter(D=>i.quantity>=D.minQuantity))!=null?l:[],L=B.length>0?B[B.length-1]:null;x=(f=(d=(u=L==null?void 0:L.price[r])!=null?u:z==null?void 0:z.price[r])!=null?d:(c=N==null?void 0:N.defaultVariation)==null?void 0:c.price[r])!=null?f:0}else{const N=t.storefront.value.bundles.find(B=>B.id===i.bundleId),z=((N==null?void 0:N.variations)||[]).find(B=>B.id===i.variationId);x=(_=(p=z==null?void 0:z.price[r])!=null?p:(h=N==null?void 0:N.defaultVariation)==null?void 0:h.price[r])!=null?_:0}return s+x*i.quantity},0),currency:r}});return{items:se(()=>t.enrichLineItems(t.currentOrder.value.items)),currency:se(()=>t.currentOrder.value.currency||t.storefront.value.suggestedCurrency),total:n,addToCart:(r,o)=>{var s,i;if(r=b(r),o??(o=r.defaultVariation),!o)throw new Error("Added item does not have a default variation, and none have been specified");const a=`${r.type==="bundle"?"b":"p"}/${r.id}/${o.id}`;let l=t.currentOrder.value.items.find(u=>u.id===a);if(l)l.quantity+=1,!l.variation&&o&&(l.variation=o),!l.price&&o&&(l.price=o.price),!l.appliedDiscount&&o.discount&&(l.appliedDiscount=o.discount),l.type==="Product"&&r.type==="product"&&!l.product&&(l.product=r),l.type==="Bundle"&&r.type==="bundle"&&!l.bundle&&(l.bundle=r);else if(r.type==="bundle")l={id:a,type:"Bundle",bundleId:r.id,bundle:r,quantity:1,variation:o,variationId:o.id,price:o.price,appliedDiscount:o.discount,isDefaultVariation:o.id===((s=r.defaultVariation)==null?void 0:s.id)},t.currentOrder.value.items.push(l);else if(r.type==="product")l={id:a,type:"Product",productId:r.id,product:r,quantity:1,variation:o,variationId:o.id,price:o.price,appliedDiscount:o.discount,isDefaultVariation:o.id===((i=r.defaultVariation)==null?void 0:i.id)},t.currentOrder.value.items.push(l);else throw new Nn("Invalid input",`Could not handle item of type '${r.type}'`);return t.pushOrderContent(),l},setQuantity:(r,o)=>{const s=t.currentOrder.value.items.find(i=>i.id===r.id);if(!s)throw new Error("Cart item not found");if(s.quantity=o,s.quantity<=0){const i=t.currentOrder.value.items.findIndex(a=>a.id===s.id);t.currentOrder.value.items.splice(i,1)}return t.pushOrderContent(),r},removeFromCart:r=>{const o=t.currentOrder.value.items.findIndex(s=>s.id===r.id);t.currentOrder.value.items.splice(o,1),t.pushOrderContent()},checkout:async r=>{var o;const s=typeof window<"u"?window.location.pathname:"",i=new URL((o=r.returnUrl)!=null?o:s,document.baseURI).href,a=await t.client.orders.pushContent(t.currentOrder.value,{returnUrl:i},t.hasUtm?t.utm.value:void 0);if(a.items=t.enrichLineItems(a.items),window.dispatchEvent(new CustomEvent("moonbase-checkout-initiated",{detail:{order:a,total:n.value}})),!r.redirect&&a.embeddedCheckoutUrl&&typeof window<"u"){const l=a.embeddedCheckoutUrl;return new Promise(u=>{ma(l.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",c=>{const d=c;u({next:d.detail.intent,completed:d.detail.completed})},{once:!0})})}else{if(r.redirect&&a.checkoutUrl&&typeof window<"u")return window.location.href=a.checkoutUrl,{next:void 0,completed:!1};throw new Error("No checkout URL found")}}}}async function by(e,t,n){var r,o;const s=n??ye(Gt);if(!s)throw new Error("No storefront configured");const i=[];for(const c of e){const d=b(c.item),f=(r=c.variation)!=null?r:d.defaultVariation;if(!f)throw new Error("Added item does not have a default variation, and none have been specified");const h=`${d.type==="bundle"?"b":"p"}/${d.id}/${f.id}`;if(d.type==="bundle")i.push({id:h,type:"Bundle",bundleId:d.id,bundle:d,quantity:1,variation:f,variationId:f.id,price:f.price,appliedDiscount:f.discount});else if(d.type==="product")i.push({id:h,type:"Product",productId:d.id,product:d,quantity:1,variation:f,variationId:f.id,price:f.price,appliedDiscount:f.discount});else throw new Nn("Invalid input",`Could not handle item of type '${c.type}'`)}const a=typeof window<"u"?window.location.pathname:"",l=new URL((o=t.returnUrl)!=null?o:a,document.baseURI).href,u=await s.client.orders.pushContent({id:Ks(),currency:s.storefront.value.suggestedCurrency,items:i},{returnUrl:l},s.hasUtm?s.utm.value:void 0);if(u.items=s.enrichLineItems(u.items),window.dispatchEvent(new CustomEvent("moonbase-checkout-initiated",{detail:{order:u,total:{amount:e.reduce((c,d)=>{var f,h;return c+((h=(f=d.variation)==null?void 0:f.price[u.currency])!=null?h:0)},0),currency:u.currency}}})),!t.redirect&&u.embeddedCheckoutUrl&&typeof window<"u"){const c=u.embeddedCheckoutUrl;return new Promise(d=>{ma(c.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",f=>{const h=f;d({next:h.detail.intent,completed:h.detail.completed})},{once:!0})})}else{if(t.redirect&&u.checkoutUrl&&typeof window<"u")return window.location.href=u.checkoutUrl,Promise.resolve({next:void 0,completed:!1});throw new Error("No checkout URL found")}}function so(e){const t=ye(Gt);if(!t)throw new Error("No storefront configured");return{getLicenses:async n=>t.client.inventory.licenses.get(n),getLicenseActivations:async(n,r)=>t.client.inventory.licenses.getActivations(n,r),getProduct:async(n,r)=>t.client.inventory.products.get(n,r),getProducts:async n=>t.client.inventory.products.getOwned(n),getProductLicenses:async(n,r)=>t.client.inventory.products.getLicenses(n,r),getProductActivations:async(n,r)=>t.client.inventory.products.getActivations(n,r),revokeActivation:async n=>t.client.inventory.licenses.revokeActivation(n.licenseId,n.id),activateProduct:async(n,r)=>t.client.inventory.activation.activate(n,r),downloadProduct:async n=>{if(!n.path)throw new Error("Product is not downloadable");window.location.href=await t.client.inventory.products.getDownloadUrl(n.path)},getSubscriptions:async n=>t.client.inventory.subscriptions.get(n),getSubscription:async n=>t.client.inventory.subscriptions.getById(n),cancelSubscription:async n=>t.client.inventory.subscriptions.cancel(n),renewSubscription:async(n,r)=>{var o;const s=typeof window<"u"?window.location.pathname:"",i=new URL((o=r.returnUrl)!=null?o:s,document.baseURI).href,{location:a}=await t.client.inventory.subscriptions.renew(n,i,!r.redirect);return r.redirect?(window.location.href=a,Promise.resolve({next:void 0,completed:!1})):new Promise(l=>{ma(a.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",u=>{const c=u;l({next:c.detail.intent,completed:c.detail.completed})},{once:!0})})}}}function Js(e,t){const n=t??ye(Gt);if(!n)throw new Error("No storefront configured");return se(()=>n.storefront.value.products.find(r=>r.id===e)||null)}function gy(e){const t=ye(Gt);if(!t)throw new Error("No storefront configured");return se(()=>t.storefront.value.products)}function lh(e){const t=ye(Gt);if(!t)throw new Error("No storefront configured");return{peek:async n=>{try{return await t.client.vouchers.peek(n)}catch(r){throw r instanceof mr?new Error("Voucher code invalid"):r}},redeem:async n=>{try{return await t.client.vouchers.redeem(n)}catch(r){throw r instanceof mr?new Error("Voucher code invalid"):r}}}}function vy(e,t,n){const r={endpoint:e};return new hy(r,new H0(r),(o,s)=>V(s))}function ga(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function uu(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function yy(){return uh().__VUE_DEVTOOLS_GLOBAL_HOOK__}function uh(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const _y=typeof Proxy=="function",wy="devtools-plugin:setup",Ey="plugin:settings:set";let Ro,cu;function xy(){var e;return Ro!==void 0||(typeof window<"u"&&window.performance?(Ro=!0,cu=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(Ro=!0,cu=globalThis.perf_hooks.performance):Ro=!1),Ro}function ky(){return xy()?cu.now():Date.now()}class Oy{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const r={};if(t.settings)for(const i in t.settings){const a=t.settings[i];r[i]=a.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let s=Object.assign({},r);try{const i=localStorage.getItem(o),a=JSON.parse(i);Object.assign(s,a)}catch{}this.fallbacks={getSettings(){return s},setSettings(i){try{localStorage.setItem(o,JSON.stringify(i))}catch{}s=i},now(){return ky()}},n&&n.on(Ey,(i,a)=>{i===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(i,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(i,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(u=>{this.targetQueue.push({method:a,args:l,resolve:u})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function ch(e,t){const n=e,r=uh(),o=yy(),s=_y&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(wy,e,t);else{const i=s?new Oy(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}var je={};let Qs;const ei=e=>Qs=e,dh=je.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function io(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var In;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(In||(In={}));const Tr=typeof window<"u",fh=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function Sy(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function du(e,t,n){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){mh(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function hh(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function va(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}const ya=typeof navigator=="object"?navigator:{userAgent:""},ph=/Macintosh/.test(ya.userAgent)&&/AppleWebKit/.test(ya.userAgent)&&!/Safari/.test(ya.userAgent),mh=Tr?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!ph?Ny:"msSaveOrOpenBlob"in ya?Cy:Ty:()=>{};function Ny(e,t="download",n){const r=document.createElement("a");r.download=t,r.rel="noopener",typeof e=="string"?(r.href=e,r.origin!==location.origin?hh(r.href)?du(e,t,n):(r.target="_blank",va(r)):va(r)):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){va(r)},0))}function Cy(e,t="download",n){if(typeof e=="string")if(hh(e))du(e,t,n);else{const r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){va(r)})}else navigator.msSaveOrOpenBlob(Sy(e,n),t)}function Ty(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return du(e,t,n);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(fh.HTMLElement))||"safari"in fh,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||o&&s||ph)&&typeof FileReader<"u"){const a=new FileReader;a.onloadend=function(){let l=a.result;if(typeof l!="string")throw r=null,new Error("Wrong reader.result type");l=i?l:l.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=l:location.assign(l),r=null},a.readAsDataURL(e)}else{const a=URL.createObjectURL(e);r?r.location.assign(a):location.href=a,r=null,setTimeout(function(){URL.revokeObjectURL(a)},4e4)}}function bt(e,t){const n="🍍 "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,t):t==="error"?console.error(n):t==="warn"?console.warn(n):console.log(n)}function fu(e){return"_a"in e&&"install"in e}function bh(){if(!("clipboard"in navigator))return bt("Your browser doesn't support the Clipboard API","error"),!0}function gh(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(bt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function Py(e){if(!bh())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),bt("Global state copied to clipboard.")}catch(t){if(gh(t))return;bt("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function $y(e){if(!bh())try{vh(e,JSON.parse(await navigator.clipboard.readText())),bt("Global state pasted from clipboard.")}catch(t){if(gh(t))return;bt("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function Ay(e){try{mh(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){bt("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let Qn;function Dy(){Qn||(Qn=document.createElement("input"),Qn.type="file",Qn.accept=".json");function e(){return new Promise((t,n)=>{Qn.onchange=async()=>{const r=Qn.files;if(!r)return t(null);const o=r.item(0);return t(o?{text:await o.text(),file:o}:null)},Qn.oncancel=()=>t(null),Qn.onerror=n,Qn.click()})}return e}async function Iy(e){try{const n=await Dy()();if(!n)return;const{text:r,file:o}=n;vh(e,JSON.parse(r)),bt(`Global state imported from "${o.name}".`)}catch(t){bt("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function vh(e,t){for(const n in t){const r=e.state.value[n];r?Object.assign(r,t[n]):e.state.value[n]=t[n]}}function yn(e){return{_custom:{display:e}}}const yh="🍍 Pinia (root)",_a="_root";function My(e){return fu(e)?{id:_a,label:yh}:{id:e.$id,label:e.$id}}function Vy(e){if(fu(e)){const n=Array.from(e._s.keys()),r=e._s;return{state:n.map(s=>({editable:!0,key:s,value:e.state.value[s]})),getters:n.filter(s=>r.get(s)._getters).map(s=>{const i=r.get(s);return{editable:!1,key:s,value:i._getters.reduce((a,l)=>(a[l]=i[l],a),{})}})}}const t={state:Object.keys(e.$state).map(n=>({editable:!0,key:n,value:e.$state[n]}))};return e._getters&&e._getters.length&&(t.getters=e._getters.map(n=>({editable:!1,key:n,value:e[n]}))),e._customProperties.size&&(t.customProperties=Array.from(e._customProperties).map(n=>({editable:!0,key:n,value:e[n]}))),t}function Ry(e){return e?Array.isArray(e)?e.reduce((t,n)=>(t.keys.push(n.key),t.operations.push(n.type),t.oldValue[n.key]=n.oldValue,t.newValue[n.key]=n.newValue,t),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:yn(e.type),key:yn(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function Ly(e){switch(e){case In.direct:return"mutation";case In.patchFunction:return"$patch";case In.patchObject:return"$patch";default:return"unknown"}}let Lo=!0;const wa=[],ao="pinia:mutations",kt="pinia",{assign:jy}=Object,Ea=e=>"🍍 "+e;function Fy(e,t){ch({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:wa,app:e},n=>{typeof n.now!="function"&&bt("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),n.addTimelineLayer({id:ao,label:"Pinia 🍍",color:15064968}),n.addInspector({id:kt,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{Py(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await $y(t),n.sendInspectorTree(kt),n.sendInspectorState(kt)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{Ay(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Iy(t),n.sendInspectorTree(kt),n.sendInspectorState(kt)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:r=>{const o=t._s.get(r);o?typeof o.$reset!="function"?bt(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(o.$reset(),bt(`Store "${r}" reset.`)):bt(`Cannot reset "${r}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((r,o)=>{const s=r.componentInstance&&r.componentInstance.proxy;if(s&&s._pStores){const i=r.componentInstance.proxy._pStores;Object.values(i).forEach(a=>{r.instanceData.state.push({type:Ea(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:Se(a.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>a.$reset()}]}}:Object.keys(a.$state).reduce((l,u)=>(l[u]=a.$state[u],l),{})}),a._getters&&a._getters.length&&r.instanceData.state.push({type:Ea(a.$id),key:"getters",editable:!1,value:a._getters.reduce((l,u)=>{try{l[u]=a[u]}catch(c){l[u]=c}return l},{})})})}}),n.on.getInspectorTree(r=>{if(r.app===e&&r.inspectorId===kt){let o=[t];o=o.concat(Array.from(t._s.values())),r.rootNodes=(r.filter?o.filter(s=>"$id"in s?s.$id.toLowerCase().includes(r.filter.toLowerCase()):yh.toLowerCase().includes(r.filter.toLowerCase())):o).map(My)}}),globalThis.$pinia=t,n.on.getInspectorState(r=>{if(r.app===e&&r.inspectorId===kt){const o=r.nodeId===_a?t:t._s.get(r.nodeId);if(!o)return;o&&(r.nodeId!==_a&&(globalThis.$store=Se(o)),r.state=Vy(o))}}),n.on.editInspectorState((r,o)=>{if(r.app===e&&r.inspectorId===kt){const s=r.nodeId===_a?t:t._s.get(r.nodeId);if(!s)return bt(`store "${r.nodeId}" not found`,"error");const{path:i}=r;fu(s)?i.unshift("state"):(i.length!==1||!s._customProperties.has(i[0])||i[0]in s.$state)&&i.unshift("$state"),Lo=!1,r.set(s,i,r.state.value),Lo=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const o=r.type.replace(/^🍍\s*/,""),s=t._s.get(o);if(!s)return bt(`store "${o}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return bt(`Invalid path for store "${o}":
|
|
15
|
+
Expected function or array of functions, received type ${typeof e}.`),ht)}function zv(e,t){if(ge(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const sh=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Wv=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?$v(e,r,i):t==="style"?Mv(e,n,r):ws(t)?Di(t)||Fv(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Zv(e,t,r,i))?(th(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&eh(e,t,r,i,s,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Qe(r))?th(e,At(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),eh(e,t,r,i))};function Zv(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&sh(t)&&we(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return sh(t)&&Qe(n)?!1:t in e}const Yv=["ctrl","shift","alt","meta"],Gv={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Yv.some(n=>e[`${n}Key`]&&!t.includes(n))},Nr=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...s)=>{for(let i=0;i<t.length;i++){const a=Gv[t[i]];if(a&&a(o,t))return}return e(o,...s)})},Kv=st({patchProp:Wv},Ov);let ih;function Xv(){return ih||(ih=Yg(Kv))}const Jv=(...e)=>{const t=Xv().createApp(...e);Dn.NODE_ENV!=="production"&&(ey(t),ty(t));const{mount:n}=t;return t.mount=r=>{const o=ny(r);if(!o)return;const s=t._component;!we(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,Qv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t};function Qv(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ey(e){Object.defineProperty(e.config,"isNativeTag",{value:t=>ob(t)||sb(t)||ib(t),writable:!1})}function ty(e){{const t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){Kn("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});const n=e.config.compilerOptions,r='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(e.config,"compilerOptions",{get(){return Kn(r),n},set(){Kn(r)}})}}function ny(e){if(Qe(e)){const t=document.querySelector(e);return Dn.NODE_ENV!=="production"&&!t&&Kn(`Failed to mount app: mount target selector "${e}" returned null.`),t}return Dn.NODE_ENV!=="production"&&window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode==="closed"&&Kn('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}var ry={};function oy(){Ev()}ry.NODE_ENV!=="production"&&oy();let pa;const sy=new Uint8Array(16);function iy(){if(!pa&&(pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pa(sy)}const _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function ay(e,t=0){return _t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]}const ah={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ks(e,t,n){if(ah.randomUUID&&!e)return ah.randomUUID();e=e||{};const r=e.random||(e.rng||iy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ay(r)}var Gt=Symbol("storefront");function ly(e,t=100){let n=0;return async(...o)=>{clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}var uy=v.object({source:v.literal("moonbase-checkout"),event:v.literal("close"),intent:v.string().optional(),completed:v.boolean()}),cy=v.object({source:v.literal("moonbase-checkout"),event:v.literal("completed"),order:fl.orders.completedOrderSchema}),dy=v.discriminatedUnion("event",[uy,cy]);function fy(){var e;const t=document.getElementById("moonbase-checkout");!t||!(t instanceof HTMLIFrameElement)||(e=t.contentWindow)==null||e.postMessage("close","*")}function ma(e){if(typeof window>"u"){console.warn("Can not mount checkout server side");return}if(document.getElementById("moonbase-checkout"))return;const t=document.createElement("iframe");t.id="moonbase-checkout",t.src=e,t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.right="0px",t.style.border="none",t.style.colorScheme="normal",t.style.backgroundColor="transparent",t.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),t.setAttribute("background","transparent"),t.setAttribute("frameborder","0"),t.setAttribute("allowtransparency","true"),t.setAttribute("allow","payment"),t.height="100%",t.width="100%",document.body.append(t),document.documentElement.style.overflow="hidden",window.onmessage=function(n){var r;try{const o=dy.parse(n.data);o.event==="close"&&(document.body.contains(t)&&(document.documentElement.style.removeProperty("overflow"),document.body.removeChild(t)),window.dispatchEvent(new CustomEvent("moonbase-checkout-closed",{detail:o}))),o.event==="completed"&&window.dispatchEvent(new CustomEvent("moonbase-checkout-completed",{detail:o}))}catch(o){((r=n.data)==null?void 0:r.source)==="moonbase-checkout"&&console.error("Could not parse event:",n.data,o)}}}var Xs=class lt{constructor(t,n,r){this.configuration=t,this.client=n,this.stateFactory=r,this.currentUser=V(null),this.loadedUser=V(!1),this.refreshOrderAbortController=new AbortController,this.debouncedPushOrderContent=ly(l=>this.client.orders.pushContent(l,void 0,this.hasUtmOrReferrer?this.utm.value:void 0),500);var o;if(typeof window>"u"){this.currentOrder=V({id:Ks(),status:No.Open,currency:"",items:[],couponsApplied:[]}),this.storefront=r(lt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!1),this.utm=r(lt.utmKey,void 0);return}window.addEventListener("storage",l=>this.handleStorageUpdate(l));const s=new URLSearchParams(window.location.search);if(this.utm=r(lt.utmKey,{referrer:((o=window.document.referrer)==null?void 0:o.replace(/https?:\/\//g,"").split("/")[0])||void 0,source:s.get("utm_source")||void 0,medium:s.get("utm_medium")||void 0,campaign:s.get("utm_campaign")||void 0,term:s.get("utm_term")||void 0,content:s.get("utm_content")||void 0}),this.hasUtm&&t.persistUtm)localStorage.setItem(lt.utmKey,JSON.stringify(this.utm.value));else if(t.persistUtm){const l=localStorage.getItem(lt.utmKey);if(l)try{this.utm=r(lt.utmKey,JSON.parse(l))}catch{}}const i=localStorage.getItem(lt.sessionKey);i?(this.currentOrder=V(JSON.parse(i)),this.refreshOrder()):(this.currentOrder=V({id:Ks(),status:No.Open,currency:"",items:[],couponsApplied:[]}),this.hasUtmOrReferrer&&this.pushOrderContent());const a=localStorage.getItem(lt.storefrontKey);if(a?(this.storefront=r(lt.storefrontKey,JSON.parse(a)),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!0)):(this.storefront=r(lt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!1)),this.client.tokenStore.user&&(this.currentUser.value=fl.identity.userSchema.parse(this.client.tokenStore.user)),this.updateStorefront(),this.updateUser(),window.location){const l=new URLSearchParams(window.location.search),u=l.get("mb_intent"),c=l.get("mb_endpoint");if(u==="checkout"&&l.get("mb_complete")&&c){const d=Object.fromEntries([...l.entries()].filter(([h])=>!h.startsWith("mb_"))),f=new URL(decodeURIComponent(c));for(const h of Object.keys(d))f.searchParams.append(h,d[h]);ma(f.toString()),window.history.replaceState(null,"",window.location.href.split("?")[0])}}window.addEventListener("moonbase-checkout-completed",l=>{l.detail.order.id===this.currentOrder.value.id&&this.resetOrder(),this.updateUser()})}get loadedStorefrontPromise(){return new Promise(t=>{et(this.loadedStorefront,n=>{n&&t()},{immediate:!0})})}get hasUtm(){return!!this.utm.value&&!!(this.utm.value.source||this.utm.value.medium||this.utm.value.campaign||this.utm.value.term||this.utm.value.content)}get hasUtmOrReferrer(){return!!this.utm.value&&Object.values(this.utm.value).some(t=>!!t)}get loadedUserPromise(){return new Promise(t=>{et(this.loadedUser,n=>{n&&t()},{immediate:!0})})}closeCheckout(){fy()}onCheckoutInitiated(t){window.addEventListener("moonbase-checkout-initiated",n=>t(n.detail.order,n.detail.total))}onCheckoutCompleted(t){window.addEventListener("moonbase-checkout-completed",n=>t(n.detail.order))}onCheckoutClosed(t){window.addEventListener("moonbase-checkout-closed",n=>t(n.detail.intent))}install(t){t.provide(Gt,this),console.log("Moonbase.sh storefront installed, learn more at https://moonbase.sh/docs")}async updateUser(){try{this.currentUser.value=await this.client.identity.get()}catch(t){t instanceof Pi||console.error("Could not load user",t),this.currentUser.value=null}finally{this.loadedUser.value=!0}return this.currentUser.value}async updateStorefront(){const t=await this.client.storefront.get(this.hasUtm?this.utm.value:void 0);return t&&(typeof window<"u"&&localStorage.setItem(lt.storefrontKey,JSON.stringify(t)),this.storefront.value=t,this.loadedStorefront.value=!0,this.currentOrder.value.currency||(this.currentOrder.value.currency=t.suggestedCurrency),this.currentOrder.value.items=this.enrichLineItems(this.currentOrder.value.items)),t}async pushOrderContent(){typeof window<"u"&&localStorage.setItem(lt.sessionKey,JSON.stringify(this.currentOrder.value)),this.refreshOrderAbortController.abort(),this.refreshOrderAbortController=new AbortController,this.debouncedPushOrderContent(this.currentOrder.value)}handleStorageUpdate(t){var n;switch(t.key){case lt.sessionKey:this.currentOrder.value=t.newValue?JSON.parse(t.newValue):{id:Ks(),currency:((n=this.storefront.value)==null?void 0:n.suggestedCurrency)||"",status:No.Open,items:[],couponsApplied:[]};break;case lt.storefrontKey:this.storefront.value=JSON.parse(t.newValue);break;case lt.utmKey:this.utm.value=JSON.parse(t.newValue);break;case Mc.storageKey:t.newValue?console.warn("User was updated",t.newValue):(this.currentUser.value=null,console.warn("User was removed"))}}async refreshOrder(){try{const t=await this.client.orders.get(this.currentOrder.value.id,this.refreshOrderAbortController.signal);t&&(t.status!==No.Open?this.resetOrder():(t.items=this.enrichLineItems(t.items),typeof window<"u"&&localStorage.setItem(lt.sessionKey,JSON.stringify(t)),this.currentOrder.value=t))}catch(t){t instanceof wc&&this.resetOrder()}}resetOrder(){var t;this.currentOrder.value={id:Ks(),currency:((t=this.storefront.value)==null?void 0:t.suggestedCurrency)||"",status:No.Open,items:[],couponsApplied:[]},typeof window<"u"&&localStorage.removeItem(lt.sessionKey)}async surrenderOrder(){try{await this.client.orders.removeBillingDetails(this.currentOrder.value.id)}catch(t){if(t instanceof mr)return;console.warn("Could not surrender order:",t)}}enrichLineItems(t){return this.storefront?t.map(n=>{var r,o;if(n.type==="Product"){const s=this.storefront.value.products.find(l=>l.id===n.productId),a=((s==null?void 0:s.variations)||[]).find(l=>l.id===n.variationId);return{...n,product:s,variation:a,price:a==null?void 0:a.price,appliedDiscount:(r=a==null?void 0:a.discount)!=null?r:n.appliedDiscount}}else{const s=this.storefront.value.bundles.find(l=>l.id===n.bundleId),a=((s==null?void 0:s.variations)||[]).find(l=>l.id===n.variationId);return{...n,bundle:s,variation:a,price:a==null?void 0:a.price,appliedDiscount:(o=a==null?void 0:a.discount)!=null?o:n.appliedDiscount}}}):t}};Xs.userKey="moonbase_user",Xs.sessionKey="moonbase_session",Xs.storefrontKey="moonbase_storefront",Xs.utmKey="moonbase_utm";var hy=Xs;function py(e,t){const n=ye(Gt);if(!n)throw new Error("No storefront configured");const r=n.stateFactory(`activation-request-${_r(e)}`,null),o=n.stateFactory(`activation-request-${_r(e)}-error`,null),s=n.stateFactory(`activation-request-${_r(e)}-loading`,!0),i=n.stateFactory(`activation-request-${_r(e)}-fulfilling`,!1),a=n.stateFactory(`activation-request-${_r(e)}-completing`,!1),l=n.stateFactory(`activation-request-${_r(e)}-completion-timeout`,null),u=async()=>{if(!r.value)return;await n.client.activationRequests.isCompleted(r.value.id)&&r.value?(r.value.status=fn.Completed,a.value=!1):l.value=setTimeout(u,1500)};return et(()=>_r(e),async c=>{try{c&&c.length>0?(r.value=await n.client.activationRequests.get(c),r.value.status===fn.Fulfilled&&(a.value=!0,u()),s.value=!1):console.warn("No token given to `useActivationRequest`")}catch(d){o.value=d.message,s.value=!1}},{immediate:!0}),jl(()=>{l.value&&clearTimeout(l.value)}),et(n.currentUser,async()=>{var c,d;const f=_r(e);if(!(!f||(d=(c=r.value)==null?void 0:c.licenseEligibility)!=null&&d.eligible)){s.value=!0;try{r.value=await n.client.activationRequests.get(f),r.value.status===fn.Fulfilled&&(a.value=!0,u())}catch(h){o.value=h.message}s.value=!1}}),{activationRequest:r,loading:s,fulfilling:i,completing:a,error:o,isInstalled:se(()=>{var c;return r&&((c=r.value)==null?void 0:c.status)===fn.Completed}),fulfillLicense:async()=>{i.value=!0,r.value=await n.client.activationRequests.fulfillLicense(r.value.id),i.value=!1,a.value=!0,u()},fulfillTrial:async()=>{i.value=!0;try{r.value=await n.client.activationRequests.fulfillTrial(r.value.id),i.value=!1,a.value=!0;const c=u()}catch(c){console.warn("Could not fulfill trial: ",c),c instanceof Pi?o.value="You need to be signed in to do this":o.value=c.message,i.value=!1}},cancel:async()=>{!r.value||r.value.status===fn.Cancelled||(r.value=await n.client.activationRequests.cancel(r.value.id))}}}function tt(e){const t=e??ye(Gt);if(!t)throw new Error("No storefront configured");return{user:t.currentUser,loaded:t.loadedUser,loadedPromise:t.loadedUserPromise,signIn:async(n,r)=>{const o=await t.client.identity.signIn(n,r);return t.currentUser.value=o,t.updateStorefront(),o},signUp:async(n,r,o,s,i,a,l)=>{const u=await t.client.identity.signUp(n,r,o,s,i,a,l);return t.currentUser.value=u,t.updateStorefront(),u},signOut:async()=>{t.client.tokenStore.clear(),await Promise.all([t.updateStorefront(),t.surrenderOrder()]),t.currentUser.value=null},update:async(n,r,o,s)=>{const i=await t.client.identity.update(n,r,o,s);return t.currentUser.value&&(t.currentUser.value=i.user),i},setPassword:async(n,r)=>{await t.client.identity.setPassword(n,r)},forgotPassword:async n=>{await t.client.identity.forgotPassword(n)},resetPassword:async(n,r,o)=>{await t.client.identity.resetPassword(n,r,o)},confirmAccount:async(n,r)=>await t.client.identity.confirmAccount(n,r),confirmEmail:async(n,r)=>await t.client.identity.confirmEmail(n,r),confirmEmailChange:async(n,r)=>(await t.client.identity.confirmEmailChange(n,r),await t.updateUser())}}function ba(e,t){const n=t??ye(Gt);if(!n)throw new Error("No storefront configured");return se(()=>n.storefront.value.bundles.find(r=>r.id===e)||null)}function my(e){const t=ye(Gt);if(!t)throw new Error("No storefront configured");return se(()=>t.storefront.value.bundles)}function Cr(e){const t=e??ye(Gt);if(!t)throw new Error("No storefront configured");const n=se(()=>{const r=t.currentOrder.value.currency||t.storefront.value.suggestedCurrency;return{amount:t.currentOrder.value.items.reduce((s,i)=>{var a,l,u,c,d,f,h,p,_;let x;if(i.type==="Product"){const N=t.storefront.value.products.find(D=>D.id===i.productId),z=((N==null?void 0:N.variations)||[]).find(D=>D.id===i.variationId),B=(l=(a=z==null?void 0:z.pricingTiers)==null?void 0:a.filter(D=>i.quantity>=D.minQuantity))!=null?l:[],L=B.length>0?B[B.length-1]:null;x=(f=(d=(u=L==null?void 0:L.price[r])!=null?u:z==null?void 0:z.price[r])!=null?d:(c=N==null?void 0:N.defaultVariation)==null?void 0:c.price[r])!=null?f:0}else{const N=t.storefront.value.bundles.find(B=>B.id===i.bundleId),z=((N==null?void 0:N.variations)||[]).find(B=>B.id===i.variationId);x=(_=(p=z==null?void 0:z.price[r])!=null?p:(h=N==null?void 0:N.defaultVariation)==null?void 0:h.price[r])!=null?_:0}return s+x*i.quantity},0),currency:r}});return{items:se(()=>t.enrichLineItems(t.currentOrder.value.items)),currency:se(()=>t.currentOrder.value.currency||t.storefront.value.suggestedCurrency),total:n,addToCart:(r,o)=>{var s,i;if(r=b(r),o??(o=r.defaultVariation),!o)throw new Error("Added item does not have a default variation, and none have been specified");const a=`${r.type==="bundle"?"b":"p"}/${r.id}/${o.id}`;let l=t.currentOrder.value.items.find(u=>u.id===a);if(l)l.quantity+=1,!l.variation&&o&&(l.variation=o),!l.price&&o&&(l.price=o.price),!l.appliedDiscount&&o.discount&&(l.appliedDiscount=o.discount),l.type==="Product"&&r.type==="product"&&!l.product&&(l.product=r),l.type==="Bundle"&&r.type==="bundle"&&!l.bundle&&(l.bundle=r);else if(r.type==="bundle")l={id:a,type:"Bundle",bundleId:r.id,bundle:r,quantity:1,variation:o,variationId:o.id,price:o.price,appliedDiscount:o.discount,isDefaultVariation:o.id===((s=r.defaultVariation)==null?void 0:s.id)},t.currentOrder.value.items.push(l);else if(r.type==="product")l={id:a,type:"Product",productId:r.id,product:r,quantity:1,variation:o,variationId:o.id,price:o.price,appliedDiscount:o.discount,isDefaultVariation:o.id===((i=r.defaultVariation)==null?void 0:i.id)},t.currentOrder.value.items.push(l);else throw new Nn("Invalid input",`Could not handle item of type '${r.type}'`);return t.pushOrderContent(),l},setQuantity:(r,o)=>{const s=t.currentOrder.value.items.find(i=>i.id===r.id);if(!s)throw new Error("Cart item not found");if(s.quantity=o,s.quantity<=0){const i=t.currentOrder.value.items.findIndex(a=>a.id===s.id);t.currentOrder.value.items.splice(i,1)}return t.pushOrderContent(),r},removeFromCart:r=>{const o=t.currentOrder.value.items.findIndex(s=>s.id===r.id);t.currentOrder.value.items.splice(o,1),t.pushOrderContent()},checkout:async r=>{var o;const s=typeof window<"u"?window.location.pathname:"",i=new URL((o=r.returnUrl)!=null?o:s,document.baseURI).href,a=await t.client.orders.pushContent(t.currentOrder.value,{returnUrl:i},t.hasUtm?t.utm.value:void 0);if(a.items=t.enrichLineItems(a.items),window.dispatchEvent(new CustomEvent("moonbase-checkout-initiated",{detail:{order:a,total:n.value}})),!r.redirect&&a.embeddedCheckoutUrl&&typeof window<"u"){const l=a.embeddedCheckoutUrl;return new Promise(u=>{ma(l.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",c=>{const d=c;u({next:d.detail.intent,completed:d.detail.completed})},{once:!0})})}else{if(r.redirect&&a.checkoutUrl&&typeof window<"u")return window.location.href=a.checkoutUrl,{next:void 0,completed:!1};throw new Error("No checkout URL found")}}}}async function by(e,t,n){var r,o;const s=n??ye(Gt);if(!s)throw new Error("No storefront configured");const i=[];for(const c of e){const d=b(c.item),f=(r=c.variation)!=null?r:d.defaultVariation;if(!f)throw new Error("Added item does not have a default variation, and none have been specified");const h=`${d.type==="bundle"?"b":"p"}/${d.id}/${f.id}`;if(d.type==="bundle")i.push({id:h,type:"Bundle",bundleId:d.id,bundle:d,quantity:1,variation:f,variationId:f.id,price:f.price,appliedDiscount:f.discount});else if(d.type==="product")i.push({id:h,type:"Product",productId:d.id,product:d,quantity:1,variation:f,variationId:f.id,price:f.price,appliedDiscount:f.discount});else throw new Nn("Invalid input",`Could not handle item of type '${c.type}'`)}const a=typeof window<"u"?window.location.pathname:"",l=new URL((o=t.returnUrl)!=null?o:a,document.baseURI).href,u=await s.client.orders.pushContent({id:Ks(),currency:s.storefront.value.suggestedCurrency,items:i},{returnUrl:l},s.hasUtm?s.utm.value:void 0);if(u.items=s.enrichLineItems(u.items),window.dispatchEvent(new CustomEvent("moonbase-checkout-initiated",{detail:{order:u,total:{amount:e.reduce((c,d)=>{var f,h;return c+((h=(f=d.variation)==null?void 0:f.price[u.currency])!=null?h:0)},0),currency:u.currency}}})),!t.redirect&&u.embeddedCheckoutUrl&&typeof window<"u"){const c=u.embeddedCheckoutUrl;return new Promise(d=>{ma(c.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",f=>{const h=f;d({next:h.detail.intent,completed:h.detail.completed})},{once:!0})})}else{if(t.redirect&&u.checkoutUrl&&typeof window<"u")return window.location.href=u.checkoutUrl,Promise.resolve({next:void 0,completed:!1});throw new Error("No checkout URL found")}}function so(e){const t=ye(Gt);if(!t)throw new Error("No storefront configured");return{getLicenses:async n=>t.client.inventory.licenses.get(n),getLicenseActivations:async(n,r)=>t.client.inventory.licenses.getActivations(n,r),getProduct:async(n,r)=>t.client.inventory.products.get(n,r),getProducts:async n=>t.client.inventory.products.getOwned(n),getProductLicenses:async(n,r)=>t.client.inventory.products.getLicenses(n,r),getProductActivations:async(n,r)=>t.client.inventory.products.getActivations(n,r),revokeActivation:async n=>t.client.inventory.licenses.revokeActivation(n.licenseId,n.id),activateProduct:async(n,r)=>t.client.inventory.activation.activate(n,r),downloadProduct:async n=>{if(!n.path)throw new Error("Product is not downloadable");window.location.href=await t.client.inventory.products.getDownloadUrl(n.path)},getSubscriptions:async n=>t.client.inventory.subscriptions.get(n),getSubscription:async n=>t.client.inventory.subscriptions.getById(n),cancelSubscription:async n=>t.client.inventory.subscriptions.cancel(n),renewSubscription:async(n,r)=>{var o;const s=typeof window<"u"?window.location.pathname:"",i=new URL((o=r.returnUrl)!=null?o:s,document.baseURI).href,{location:a}=await t.client.inventory.subscriptions.renew(n,i,!r.redirect);return r.redirect?(window.location.href=a,Promise.resolve({next:void 0,completed:!1})):new Promise(l=>{ma(a.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",u=>{const c=u;l({next:c.detail.intent,completed:c.detail.completed})},{once:!0})})}}}function Js(e,t){const n=t??ye(Gt);if(!n)throw new Error("No storefront configured");return se(()=>n.storefront.value.products.find(r=>r.id===e)||null)}function gy(e){const t=ye(Gt);if(!t)throw new Error("No storefront configured");return se(()=>t.storefront.value.products)}function lh(e){const t=ye(Gt);if(!t)throw new Error("No storefront configured");return{peek:async n=>{try{return await t.client.vouchers.peek(n)}catch(r){throw r instanceof mr?new Error("Voucher code invalid"):r}},redeem:async n=>{try{return await t.client.vouchers.redeem(n)}catch(r){throw r instanceof mr?new Error("Voucher code invalid"):r}}}}function vy(e,t,n){const r={endpoint:e};return new hy(r,new H0(r),(o,s)=>V(s))}function ga(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function uu(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function yy(){return uh().__VUE_DEVTOOLS_GLOBAL_HOOK__}function uh(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const _y=typeof Proxy=="function",wy="devtools-plugin:setup",Ey="plugin:settings:set";let Ro,cu;function xy(){var e;return Ro!==void 0||(typeof window<"u"&&window.performance?(Ro=!0,cu=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(Ro=!0,cu=globalThis.perf_hooks.performance):Ro=!1),Ro}function ky(){return xy()?cu.now():Date.now()}class Oy{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const r={};if(t.settings)for(const i in t.settings){const a=t.settings[i];r[i]=a.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let s=Object.assign({},r);try{const i=localStorage.getItem(o),a=JSON.parse(i);Object.assign(s,a)}catch{}this.fallbacks={getSettings(){return s},setSettings(i){try{localStorage.setItem(o,JSON.stringify(i))}catch{}s=i},now(){return ky()}},n&&n.on(Ey,(i,a)=>{i===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(i,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(i,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(u=>{this.targetQueue.push({method:a,args:l,resolve:u})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function ch(e,t){const n=e,r=uh(),o=yy(),s=_y&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(wy,e,t);else{const i=s?new Oy(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}var je={};let Qs;const ei=e=>Qs=e,dh=je.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function io(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var In;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(In||(In={}));const Tr=typeof window<"u",fh=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function Sy(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function du(e,t,n){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){mh(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function hh(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function va(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}const ya=typeof navigator=="object"?navigator:{userAgent:""},ph=/Macintosh/.test(ya.userAgent)&&/AppleWebKit/.test(ya.userAgent)&&!/Safari/.test(ya.userAgent),mh=Tr?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!ph?Ny:"msSaveOrOpenBlob"in ya?Cy:Ty:()=>{};function Ny(e,t="download",n){const r=document.createElement("a");r.download=t,r.rel="noopener",typeof e=="string"?(r.href=e,r.origin!==location.origin?hh(r.href)?du(e,t,n):(r.target="_blank",va(r)):va(r)):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){va(r)},0))}function Cy(e,t="download",n){if(typeof e=="string")if(hh(e))du(e,t,n);else{const r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){va(r)})}else navigator.msSaveOrOpenBlob(Sy(e,n),t)}function Ty(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return du(e,t,n);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(fh.HTMLElement))||"safari"in fh,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||o&&s||ph)&&typeof FileReader<"u"){const a=new FileReader;a.onloadend=function(){let l=a.result;if(typeof l!="string")throw r=null,new Error("Wrong reader.result type");l=i?l:l.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=l:location.assign(l),r=null},a.readAsDataURL(e)}else{const a=URL.createObjectURL(e);r?r.location.assign(a):location.href=a,r=null,setTimeout(function(){URL.revokeObjectURL(a)},4e4)}}function bt(e,t){const n="🍍 "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,t):t==="error"?console.error(n):t==="warn"?console.warn(n):console.log(n)}function fu(e){return"_a"in e&&"install"in e}function bh(){if(!("clipboard"in navigator))return bt("Your browser doesn't support the Clipboard API","error"),!0}function gh(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(bt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function Py(e){if(!bh())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),bt("Global state copied to clipboard.")}catch(t){if(gh(t))return;bt("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function $y(e){if(!bh())try{vh(e,JSON.parse(await navigator.clipboard.readText())),bt("Global state pasted from clipboard.")}catch(t){if(gh(t))return;bt("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function Ay(e){try{mh(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){bt("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let Qn;function Dy(){Qn||(Qn=document.createElement("input"),Qn.type="file",Qn.accept=".json");function e(){return new Promise((t,n)=>{Qn.onchange=async()=>{const r=Qn.files;if(!r)return t(null);const o=r.item(0);return t(o?{text:await o.text(),file:o}:null)},Qn.oncancel=()=>t(null),Qn.onerror=n,Qn.click()})}return e}async function Iy(e){try{const n=await Dy()();if(!n)return;const{text:r,file:o}=n;vh(e,JSON.parse(r)),bt(`Global state imported from "${o.name}".`)}catch(t){bt("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function vh(e,t){for(const n in t){const r=e.state.value[n];r?Object.assign(r,t[n]):e.state.value[n]=t[n]}}function yn(e){return{_custom:{display:e}}}const yh="🍍 Pinia (root)",_a="_root";function My(e){return fu(e)?{id:_a,label:yh}:{id:e.$id,label:e.$id}}function Vy(e){if(fu(e)){const n=Array.from(e._s.keys()),r=e._s;return{state:n.map(s=>({editable:!0,key:s,value:e.state.value[s]})),getters:n.filter(s=>r.get(s)._getters).map(s=>{const i=r.get(s);return{editable:!1,key:s,value:i._getters.reduce((a,l)=>(a[l]=i[l],a),{})}})}}const t={state:Object.keys(e.$state).map(n=>({editable:!0,key:n,value:e.$state[n]}))};return e._getters&&e._getters.length&&(t.getters=e._getters.map(n=>({editable:!1,key:n,value:e[n]}))),e._customProperties.size&&(t.customProperties=Array.from(e._customProperties).map(n=>({editable:!0,key:n,value:e[n]}))),t}function Ry(e){return e?Array.isArray(e)?e.reduce((t,n)=>(t.keys.push(n.key),t.operations.push(n.type),t.oldValue[n.key]=n.oldValue,t.newValue[n.key]=n.newValue,t),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:yn(e.type),key:yn(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function Ly(e){switch(e){case In.direct:return"mutation";case In.patchFunction:return"$patch";case In.patchObject:return"$patch";default:return"unknown"}}let Lo=!0;const wa=[],ao="pinia:mutations",kt="pinia",{assign:jy}=Object,Ea=e=>"🍍 "+e;function Fy(e,t){ch({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:wa,app:e},n=>{typeof n.now!="function"&&bt("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),n.addTimelineLayer({id:ao,label:"Pinia 🍍",color:15064968}),n.addInspector({id:kt,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{Py(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await $y(t),n.sendInspectorTree(kt),n.sendInspectorState(kt)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{Ay(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Iy(t),n.sendInspectorTree(kt),n.sendInspectorState(kt)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:r=>{const o=t._s.get(r);o?typeof o.$reset!="function"?bt(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(o.$reset(),bt(`Store "${r}" reset.`)):bt(`Cannot reset "${r}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((r,o)=>{const s=r.componentInstance&&r.componentInstance.proxy;if(s&&s._pStores){const i=r.componentInstance.proxy._pStores;Object.values(i).forEach(a=>{r.instanceData.state.push({type:Ea(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:Se(a.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>a.$reset()}]}}:Object.keys(a.$state).reduce((l,u)=>(l[u]=a.$state[u],l),{})}),a._getters&&a._getters.length&&r.instanceData.state.push({type:Ea(a.$id),key:"getters",editable:!1,value:a._getters.reduce((l,u)=>{try{l[u]=a[u]}catch(c){l[u]=c}return l},{})})})}}),n.on.getInspectorTree(r=>{if(r.app===e&&r.inspectorId===kt){let o=[t];o=o.concat(Array.from(t._s.values())),r.rootNodes=(r.filter?o.filter(s=>"$id"in s?s.$id.toLowerCase().includes(r.filter.toLowerCase()):yh.toLowerCase().includes(r.filter.toLowerCase())):o).map(My)}}),globalThis.$pinia=t,n.on.getInspectorState(r=>{if(r.app===e&&r.inspectorId===kt){const o=r.nodeId===_a?t:t._s.get(r.nodeId);if(!o)return;o&&(r.nodeId!==_a&&(globalThis.$store=Se(o)),r.state=Vy(o))}}),n.on.editInspectorState((r,o)=>{if(r.app===e&&r.inspectorId===kt){const s=r.nodeId===_a?t:t._s.get(r.nodeId);if(!s)return bt(`store "${r.nodeId}" not found`,"error");const{path:i}=r;fu(s)?i.unshift("state"):(i.length!==1||!s._customProperties.has(i[0])||i[0]in s.$state)&&i.unshift("$state"),Lo=!1,r.set(s,i,r.state.value),Lo=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const o=r.type.replace(/^🍍\s*/,""),s=t._s.get(o);if(!s)return bt(`store "${o}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return bt(`Invalid path for store "${o}":
|
|
16
16
|
${i}
|
|
17
17
|
Only state can be modified.`);i[0]="$state",Lo=!1,r.set(s,i,r.state.value),Lo=!0}})})}function Uy(e,t){wa.includes(Ea(t.$id))||wa.push(Ea(t.$id)),ch({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:wa,app:e,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},n=>{const r=typeof n.now=="function"?n.now.bind(n):Date.now;t.$onAction(({after:i,onError:a,name:l,args:u})=>{const c=_h++;n.addTimelineEvent({layerId:ao,event:{time:r(),title:"🛫 "+l,subtitle:"start",data:{store:yn(t.$id),action:yn(l),args:u},groupId:c}}),i(d=>{Pr=void 0,n.addTimelineEvent({layerId:ao,event:{time:r(),title:"🛬 "+l,subtitle:"end",data:{store:yn(t.$id),action:yn(l),args:u,result:d},groupId:c}})}),a(d=>{Pr=void 0,n.addTimelineEvent({layerId:ao,event:{time:r(),logType:"error",title:"💥 "+l,subtitle:"end",data:{store:yn(t.$id),action:yn(l),args:u,error:d},groupId:c}})})},!0),t._customProperties.forEach(i=>{et(()=>b(t[i]),(a,l)=>{n.notifyComponentUpdate(),n.sendInspectorState(kt),Lo&&n.addTimelineEvent({layerId:ao,event:{time:r(),title:"Change",subtitle:i,data:{newValue:a,oldValue:l},groupId:Pr}})},{deep:!0})}),t.$subscribe(({events:i,type:a},l)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(kt),!Lo)return;const u={time:r(),title:Ly(a),data:jy({store:yn(t.$id)},Ry(i)),groupId:Pr};a===In.patchFunction?u.subtitle="⤵️":a===In.patchObject?u.subtitle="🧩":i&&!Array.isArray(i)&&(u.subtitle=i.type),i&&(u.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:ao,event:u})},{detached:!0,flush:"sync"});const o=t._hotUpdate;t._hotUpdate=yr(i=>{o(i),n.addTimelineEvent({layerId:ao,event:{time:r(),title:"🔥 "+t.$id,subtitle:"HMR update",data:{store:yn(t.$id),info:yn("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(kt),n.sendInspectorState(kt)});const{$dispose:s}=t;t.$dispose=()=>{s(),n.notifyComponentUpdate(),n.sendInspectorTree(kt),n.sendInspectorState(kt),n.getSettings().logStoreChanges&&bt(`Disposed "${t.$id}" store 🗑`)},n.notifyComponentUpdate(),n.sendInspectorTree(kt),n.sendInspectorState(kt),n.getSettings().logStoreChanges&&bt(`"${t.$id}" store installed 🆕`)})}let _h=0,Pr;function wh(e,t,n){const r=t.reduce((o,s)=>(o[s]=Se(e)[s],o),{});for(const o in r)e[o]=function(){const s=_h,i=n?new Proxy(e,{get(...l){return Pr=s,Reflect.get(...l)},set(...l){return Pr=s,Reflect.set(...l)}}):e;Pr=s;const a=r[o].apply(i,arguments);return Pr=void 0,a}}function By({app:e,store:t,options:n}){if(!t.$id.startsWith("__hot:")){if(t._isOptionsAPI=!!n.state,!t._p._testing){wh(t,Object.keys(n.actions),t._isOptionsAPI);const r=t._hotUpdate;Se(t)._hotUpdate=function(o){r.apply(this,arguments),wh(t,Object.keys(o._hmrPayload.actions),!!t._isOptionsAPI)}}Uy(e,t)}}function Hy(){const e=Wc(!0),t=e.run(()=>V({}));let n=[],r=[];const o=yr({install(s){ei(o),o._a=s,s.provide(dh,o),s.config.globalProperties.$pinia=o,je.NODE_ENV!=="production"&&je.NODE_ENV!=="test"&&Tr&&Fy(s,o),r.forEach(i=>n.push(i)),r=[]},use(s){return this._a?n.push(s):r.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return je.NODE_ENV!=="production"&&je.NODE_ENV!=="test"&&Tr&&typeof Proxy<"u"&&o.use(By),o}function Eh(e,t){for(const n in t){const r=t[n];if(!(n in e))continue;const o=e[n];io(o)&&io(r)&&!Xe(r)&&!pn(r)?e[n]=Eh(o,r):e[n]=r}return e}const xh=()=>{};function kh(e,t,n,r=xh){e.push(t);const o=()=>{const s=e.indexOf(t);s>-1&&(e.splice(s,1),r())};return!n&&Zc()&&lb(o),o}function jo(e,...t){e.slice().forEach(n=>{n(...t)})}const qy=e=>e(),Oh=Symbol(),hu=Symbol();function pu(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,r)=>e.set(r,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],o=e[n];io(o)&&io(r)&&e.hasOwnProperty(n)&&!Xe(r)&&!pn(r)?e[n]=pu(o,r):e[n]=r}return e}const zy=je.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Wy(e){return!io(e)||!e.hasOwnProperty(zy)}const{assign:on}=Object;function Sh(e){return!!(Xe(e)&&e.effect)}function Nh(e,t,n,r){const{state:o,actions:s,getters:i}=t,a=n.state.value[e];let l;function u(){!a&&(je.NODE_ENV==="production"||!r)&&(n.state.value[e]=o?o():{});const c=je.NODE_ENV!=="production"&&r?bd(V(o?o():{}).value):bd(n.state.value[e]);return on(c,s,Object.keys(i||{}).reduce((d,f)=>(je.NODE_ENV!=="production"&&f in c&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${f}" in store "${e}".`),d[f]=yr(se(()=>{ei(n);const h=n._s.get(e);return i[f].call(h,h)})),d),{}))}return l=mu(e,u,t,n,r,!0),l}function mu(e,t,n={},r,o,s){let i;const a=on({actions:{}},n);if(je.NODE_ENV!=="production"&&!r._e.active)throw new Error("Pinia destroyed");const l={deep:!0};je.NODE_ENV!=="production"&&(l.onTrigger=T=>{u?h=T:u==!1&&!m._hotUpdating&&(Array.isArray(h)?h.push(T):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let u,c,d=[],f=[],h;const p=r.state.value[e];!s&&!p&&(je.NODE_ENV==="production"||!o)&&(r.state.value[e]={});const _=V({});let x;function N(T){let $;u=c=!1,je.NODE_ENV!=="production"&&(h=[]),typeof T=="function"?(T(r.state.value[e]),$={type:In.patchFunction,storeId:e,events:h}):(pu(r.state.value[e],T),$={type:In.patchObject,payload:T,storeId:e,events:h});const A=x=Symbol();Gi().then(()=>{x===A&&(u=!0)}),c=!0,jo(d,$,r.state.value[e])}const q=s?function(){const{state:$}=n,A=$?$():{};this.$patch(oe=>{on(oe,A)})}:je.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:xh;function z(){i.stop(),d=[],f=[],r._s.delete(e)}const B=(T,$="")=>{if(Oh in T)return T[hu]=$,T;const A=function(){ei(r);const oe=Array.from(arguments),xe=[],k=[];function U(me){xe.push(me)}function R(me){k.push(me)}jo(f,{args:oe,name:A[hu],store:m,after:U,onError:R});let ee;try{ee=T.apply(this&&this.$id===e?this:m,oe)}catch(me){throw jo(k,me),me}return ee instanceof Promise?ee.then(me=>(jo(xe,me),me)).catch(me=>(jo(k,me),Promise.reject(me))):(jo(xe,ee),ee)};return A[Oh]=!0,A[hu]=$,A},L=yr({actions:{},getters:{},state:[],hotState:_}),D={_p:r,$id:e,$onAction:kh.bind(null,f),$patch:N,$reset:q,$subscribe(T,$={}){const A=kh(d,T,$.detached,()=>oe()),oe=i.run(()=>et(()=>r.state.value[e],xe=>{($.flush==="sync"?c:u)&&T({storeId:e,type:In.direct,events:h},xe)},on({},l,$)));return A},$dispose:z},m=$s(je.NODE_ENV!=="production"||je.NODE_ENV!=="production"&&je.NODE_ENV!=="test"&&Tr?on({_hmrPayload:L,_customProperties:yr(new Set)},D):D);r._s.set(e,m);const I=(r._a&&r._a.runWithContext||qy)(()=>r._e.run(()=>(i=Wc()).run(()=>t({action:B}))));for(const T in I){const $=I[T];if(Xe($)&&!Sh($)||pn($))je.NODE_ENV!=="production"&&o?ga(_.value,T,Tl(I,T)):s||(p&&Wy($)&&(Xe($)?$.value=p[T]:pu($,p[T])),r.state.value[e][T]=$),je.NODE_ENV!=="production"&&L.state.push(T);else if(typeof $=="function"){const A=je.NODE_ENV!=="production"&&o?$:B($,T);I[T]=A,je.NODE_ENV!=="production"&&(L.actions[T]=$),a.actions[T]=$}else je.NODE_ENV!=="production"&&Sh($)&&(L.getters[T]=s?n.getters[T]:$,Tr&&(I._getters||(I._getters=yr([]))).push(T))}if(on(m,I),on(Se(m),I),Object.defineProperty(m,"$state",{get:()=>je.NODE_ENV!=="production"&&o?_.value:r.state.value[e],set:T=>{if(je.NODE_ENV!=="production"&&o)throw new Error("cannot set hotState");N($=>{on($,T)})}}),je.NODE_ENV!=="production"&&(m._hotUpdate=yr(T=>{m._hotUpdating=!0,T._hmrPayload.state.forEach($=>{if($ in m.$state){const A=T.$state[$],oe=m.$state[$];typeof A=="object"&&io(A)&&io(oe)?Eh(A,oe):T.$state[$]=oe}ga(m,$,Tl(T.$state,$))}),Object.keys(m.$state).forEach($=>{$ in T.$state||uu(m,$)}),u=!1,c=!1,r.state.value[e]=Tl(T._hmrPayload,"hotState"),c=!0,Gi().then(()=>{u=!0});for(const $ in T._hmrPayload.actions){const A=T[$];ga(m,$,B(A,$))}for(const $ in T._hmrPayload.getters){const A=T._hmrPayload.getters[$],oe=s?se(()=>(ei(r),A.call(m,m))):A;ga(m,$,oe)}Object.keys(m._hmrPayload.getters).forEach($=>{$ in T._hmrPayload.getters||uu(m,$)}),Object.keys(m._hmrPayload.actions).forEach($=>{$ in T._hmrPayload.actions||uu(m,$)}),m._hmrPayload=T._hmrPayload,m._getters=T._getters,m._hotUpdating=!1})),je.NODE_ENV!=="production"&&je.NODE_ENV!=="test"&&Tr){const T={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach($=>{Object.defineProperty(m,$,on({value:m[$]},T))})}return r._p.forEach(T=>{if(je.NODE_ENV!=="production"&&je.NODE_ENV!=="test"&&Tr){const $=i.run(()=>T({store:m,app:r._a,pinia:r,options:a}));Object.keys($||{}).forEach(A=>m._customProperties.add(A)),on(m,$)}else on(m,i.run(()=>T({store:m,app:r._a,pinia:r,options:a})))}),je.NODE_ENV!=="production"&&m.$state&&typeof m.$state=="object"&&typeof m.$state.constructor=="function"&&!m.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
18
18
|
state: () => new MyClass()
|
|
@@ -33,4 +33,4 @@ This will fail in production.`);a=Qs,a._s.has(r)||(s?mu(r,t,o,a):Nh(r,o,a),je.NO
|
|
|
33
33
|
*
|
|
34
34
|
* You can read more about the APCA Readability Criterion at
|
|
35
35
|
* https://readtech.org/ARC/
|
|
36
|
-
*/const yp=.027,t2=5e-4,n2=.1,_p=1.14,Ia=.022,wp=1.414,r2=(e,t)=>{e=new Q(e),t=new Q(t),e.alpha()<1&&(e=Zo(t,e,e.alpha(),"rgb"));const n=Ep(...e.rgb()),r=Ep(...t.rgb()),o=n>=Ia?n:n+Math.pow(Ia-n,wp),s=r>=Ia?r:r+Math.pow(Ia-r,wp),i=Math.pow(s,.56)-Math.pow(o,.57),a=Math.pow(s,.65)-Math.pow(o,.62),l=Math.abs(s-o)<t2?0:o<s?i*_p:a*_p;return(Math.abs(l)<n2?0:l>0?l-yp:l+yp)*100};function Ep(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:rr,pow:dt,min:o2,max:s2,atan2:xp,abs:kp,cos:Ma,sin:Op,exp:i2,PI:Sp}=Math;function a2(e,t,n=1,r=1,o=1){var s=function(Be){return 360*Be/(2*Sp)},i=function(Be){return 2*Sp*Be/360};e=new Q(e),t=new Q(t);const[a,l,u]=Array.from(e.lab()),[c,d,f]=Array.from(t.lab()),h=(a+c)/2,p=rr(dt(l,2)+dt(u,2)),_=rr(dt(d,2)+dt(f,2)),x=(p+_)/2,N=.5*(1-rr(dt(x,7)/(dt(x,7)+dt(25,7)))),q=l*(1+N),z=d*(1+N),B=rr(dt(q,2)+dt(u,2)),L=rr(dt(z,2)+dt(f,2)),D=(B+L)/2,m=s(xp(u,q)),P=s(xp(f,z)),I=m>=0?m:m+360,T=P>=0?P:P+360,$=kp(I-T)>180?(I+T+360)/2:(I+T)/2,A=1-.17*Ma(i($-30))+.24*Ma(i(2*$))+.32*Ma(i(3*$+6))-.2*Ma(i(4*$-63));let oe=T-I;oe=kp(oe)<=180?oe:T<=I?oe+360:oe-360,oe=2*rr(B*L)*Op(i(oe)/2);const xe=c-a,k=L-B,U=1+.015*dt(h-50,2)/rr(20+dt(h-50,2)),R=1+.045*D,ee=1+.015*D*A,me=30*i2(-dt(($-275)/25,2)),he=-(2*rr(dt(D,7)/(dt(D,7)+dt(25,7))))*Op(2*i(me)),ve=rr(dt(xe/(n*U),2)+dt(k/(r*R),2)+dt(oe/(o*ee),2)+he*(k/(r*R))*(oe/(o*ee)));return s2(0,o2(100,ve))}function l2(e,t,n="lab"){e=new Q(e),t=new Q(t);const r=e.get(n),o=t.get(n);let s=0;for(let i in r){const a=(r[i]||0)-(o[i]||0);s+=a*a}return Math.sqrt(s)}const u2=(...e)=>{try{return new Q(...e),!0}catch{return!1}},c2={cool(){return Da([Ie.hsl(180,1,.9),Ie.hsl(250,.7,.4)])},hot(){return Da(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Yu={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Np=Object.keys(Yu),Cp=new Map(Np.map(e=>[e.toLowerCase(),e])),d2=typeof Proxy=="function"?new Proxy(Yu,{get(e,t){const n=t.toLowerCase();if(Cp.has(n))return e[Cp.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(Np)}}):Yu,f2=(...e)=>{e=De(e,"cmyk");const[t,n,r,o]=e,s=e.length>4?e[4]:1;return o===1?[0,0,0,s]:[t>=1?0:255*(1-t)*(1-o),n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),s]},{max:Tp}=Math,h2=(...e)=>{let[t,n,r]=De(e,"rgb");t=t/255,n=n/255,r=r/255;const o=1-Tp(t,Tp(n,r)),s=o<1?1/(1-o):0,i=(1-t-o)*s,a=(1-n-o)*s,l=(1-r-o)*s;return[i,a,l,o]};Q.prototype.cmyk=function(){return h2(this._rgb)},Object.assign(Ie,{cmyk:(...e)=>new Q(...e,"cmyk")}),Te.format.cmyk=f2,Te.autodetect.push({p:2,test:(...e)=>{if(e=De(e,"cmyk"),Re(e)==="array"&&e.length===4)return"cmyk"}});const p2=(...e)=>{const t=De(e,"hsla");let n=zo(e)||"lsa";return t[0]=an(t[0]||0)+"deg",t[1]=an(t[1]*100)+"%",t[2]=an(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},m2=(...e)=>{const t=De(e,"lab");let n=zo(e)||"lab";return t[0]=an(t[0])+"%",t[1]=an(t[1]),t[2]=an(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},b2=(...e)=>{const t=De(e,"lch");let n=zo(e)||"lab";return t[0]=an(t[0])+"%",t[1]=an(t[1]),t[2]=isNaN(t[2])?"none":an(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},g2=(...e)=>{const t=De(e,"lab");return t[0]=an(t[0]*100)+"%",t[1]=Au(t[1]),t[2]=Au(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},Pp=(...e)=>{const[t,n,r,...o]=De(e,"rgb"),[s,i,a]=qu(t,n,r),[l,u,c]=cp(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},v2=(...e)=>{const t=De(e,"lch");return t[0]=an(t[0]*100)+"%",t[1]=Au(t[1]),t[2]=isNaN(t[2])?"none":an(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:Gu}=Math,y2=(...e)=>{const t=De(e,"rgba");let n=zo(e)||"rgb";if(n.substr(0,3)==="hsl")return p2(fp(t),n);if(n.substr(0,3)==="lab"){const r=ci();nr("d50");const o=m2(Vu(t),n);return nr(r),o}if(n.substr(0,3)==="lch"){const r=ci();nr("d50");const o=b2(Fu(t),n);return nr(r),o}return n.substr(0,5)==="oklab"?g2(qu(t)):n.substr(0,5)==="oklch"?v2(Pp(t)):(t[0]=Gu(t[0]),t[1]=Gu(t[1]),t[2]=Gu(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},$p=(...e)=>{e=De(e,"lch");const[t,n,r,...o]=e,[s,i,a]=up(t,n,r),[l,u,c]=Hu(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},or=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,wn=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Va=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,ln=/\s*/.source,Xo=/\s+/.source,Ku=/\s*,\s*/.source,Ra=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Jo=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,Ap=new RegExp("^rgba?\\("+ln+[or,or,or].join(Xo)+Jo+"\\)$"),Dp=new RegExp("^rgb\\("+ln+[or,or,or].join(Ku)+ln+"\\)$"),Ip=new RegExp("^rgba\\("+ln+[or,or,or,wn].join(Ku)+ln+"\\)$"),Mp=new RegExp("^hsla?\\("+ln+[Ra,Va,Va].join(Xo)+Jo+"\\)$"),Vp=new RegExp("^hsl?\\("+ln+[Ra,Va,Va].join(Ku)+ln+"\\)$"),Rp=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Lp=new RegExp("^lab\\("+ln+[wn,wn,wn].join(Xo)+Jo+"\\)$"),jp=new RegExp("^lch\\("+ln+[wn,wn,Ra].join(Xo)+Jo+"\\)$"),Fp=new RegExp("^oklab\\("+ln+[wn,wn,wn].join(Xo)+Jo+"\\)$"),Up=new RegExp("^oklch\\("+ln+[wn,wn,Ra].join(Xo)+Jo+"\\)$"),{round:Bp}=Math,Qo=e=>e.map((t,n)=>n<=2?po(Bp(t),0,255):t),ft=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),jt=(e,t)=>e==="none"?t:e,Xu=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(Te.format.named)try{return Te.format.named(e)}catch{}if((t=e.match(Ap))||(t=e.match(Dp))){let n=t.slice(1,4);for(let o=0;o<3;o++)n[o]=+ft(jt(n[o],0),0,255);n=Qo(n);const r=t[4]!==void 0?+ft(t[4],0,1):1;return n[3]=r,n}if(t=e.match(Ip)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+ft(n[r],0,255);return n}if((t=e.match(Mp))||(t=e.match(Vp))){const n=t.slice(1,4);n[0]=+jt(n[0].replace("deg",""),0),n[1]=+ft(jt(n[1],0),0,100)*.01,n[2]=+ft(jt(n[2],0),0,100)*.01;const r=Qo(Bu(n)),o=t[4]!==void 0?+ft(t[4],0,1):1;return r[3]=o,r}if(t=e.match(Rp)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Bu(n);for(let o=0;o<3;o++)r[o]=Bp(r[o]);return r[3]=+t[4],r}if(t=e.match(Lp)){const n=t.slice(1,4);n[0]=ft(jt(n[0],0),0,100),n[1]=ft(jt(n[1],0),-125,125,!0),n[2]=ft(jt(n[2],0),-125,125,!0);const r=ci();nr("d50");const o=Qo(Iu(n));nr(r);const s=t[4]!==void 0?+ft(t[4],0,1):1;return o[3]=s,o}if(t=e.match(jp)){const n=t.slice(1,4);n[0]=ft(n[0],0,100),n[1]=ft(jt(n[1],0),0,150,!1),n[2]=+jt(n[2].replace("deg",""),0);const r=ci();nr("d50");const o=Qo(ju(n));nr(r);const s=t[4]!==void 0?+ft(t[4],0,1):1;return o[3]=s,o}if(t=e.match(Fp)){const n=t.slice(1,4);n[0]=ft(jt(n[0],0),0,1),n[1]=ft(jt(n[1],0),-.4,.4,!0),n[2]=ft(jt(n[2],0),-.4,.4,!0);const r=Qo(Hu(n)),o=t[4]!==void 0?+ft(t[4],0,1):1;return r[3]=o,r}if(t=e.match(Up)){const n=t.slice(1,4);n[0]=ft(jt(n[0],0),0,1),n[1]=ft(jt(n[1],0),0,.4,!1),n[2]=+jt(n[2].replace("deg",""),0);const r=Qo($p(n)),o=t[4]!==void 0?+ft(t[4],0,1):1;return r[3]=o,r}};Xu.test=e=>Ap.test(e)||Mp.test(e)||Lp.test(e)||jp.test(e)||Fp.test(e)||Up.test(e)||Dp.test(e)||Ip.test(e)||Vp.test(e)||Rp.test(e)||e==="transparent",Q.prototype.css=function(e){return y2(this._rgb,e)};const _2=(...e)=>new Q(...e,"css");Ie.css=_2,Te.format.css=Xu,Te.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Re(e)==="string"&&Xu.test(e))return"css"}}),Te.format.gl=(...e)=>{const t=De(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const w2=(...e)=>new Q(...e,"gl");Ie.gl=w2,Q.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},Q.prototype.hex=function(e){return ip(this._rgb,e)};const E2=(...e)=>new Q(...e,"hex");Ie.hex=E2,Te.format.hex=sp,Te.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&Re(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:La}=Math,Hp=e=>{const t=e/100;let n,r,o;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*La(r),o=t<20?0:-254.76935184120902+.8274096064007395*(o=t-10)+115.67994401066147*La(o)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*La(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*La(r),o=255),[n,r,o,1]},{round:x2}=Math,k2=(...e)=>{const t=De(e,"rgb"),n=t[0],r=t[2];let o=1e3,s=4e4;const i=.4;let a;for(;s-o>i;){a=(s+o)*.5;const l=Hp(a);l[2]/l[0]>=r/n?s=a:o=a}return x2(a)};Q.prototype.temp=Q.prototype.kelvin=Q.prototype.temperature=function(){return k2(this._rgb)};const Ju=(...e)=>new Q(...e,"temp");Object.assign(Ie,{temp:Ju,kelvin:Ju,temperature:Ju}),Te.format.temp=Te.format.kelvin=Te.format.temperature=Hp,Q.prototype.oklch=function(){return Pp(this._rgb)},Object.assign(Ie,{oklch:(...e)=>new Q(...e,"oklch")}),Te.format.oklch=$p,Te.autodetect.push({p:2,test:(...e)=>{if(e=De(e,"oklch"),Re(e)==="array"&&e.length===3)return"oklch"}}),Object.assign(Ie,{analyze:gp,average:Cw,bezier:Iw,blend:_n,brewer:d2,Color:Q,colors:Wo,contrast:e2,contrastAPCA:r2,cubehelix:Ww,deltaE:a2,distance:l2,input:Te,interpolate:Zo,limits:vp,mix:Zo,random:Kw,scale:Da,scales:c2,valid:u2});const O2=[{name:"Slate",id:"slate",reference:!1,shades:[{number:50,hexcode:"#f8fafc"},{number:100,hexcode:"#f1f5f9"},{number:200,hexcode:"#e2e8f0"},{number:300,hexcode:"#cbd5e1"},{number:400,hexcode:"#94a3b8"},{number:500,hexcode:"#64748b"},{number:600,hexcode:"#475569"},{number:700,hexcode:"#334155"},{number:800,hexcode:"#1e293b"},{number:900,hexcode:"#0f172a"},{number:950,hexcode:"#020617"}]},{name:"Gray",id:"gray",reference:!1,shades:[{number:50,hexcode:"#f9fafb"},{number:100,hexcode:"#f3f4f6"},{number:200,hexcode:"#e5e7eb"},{number:300,hexcode:"#d1d5db"},{number:400,hexcode:"#9ca3af"},{number:500,hexcode:"#6b7280"},{number:600,hexcode:"#4b5563"},{number:700,hexcode:"#374151"},{number:800,hexcode:"#1f2937"},{number:900,hexcode:"#111827"},{number:950,hexcode:"#030712"}]},{name:"Zinc",id:"zinc",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f4f4f5"},{number:200,hexcode:"#e4e4e7"},{number:300,hexcode:"#d4d4d8"},{number:400,hexcode:"#a1a1aa"},{number:500,hexcode:"#71717a"},{number:600,hexcode:"#52525b"},{number:700,hexcode:"#3f3f46"},{number:800,hexcode:"#27272a"},{number:900,hexcode:"#18181b"},{number:950,hexcode:"#09090b"}]},{name:"Neutral",id:"neutral",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f5f5f5"},{number:200,hexcode:"#e5e5e5"},{number:300,hexcode:"#d4d4d4"},{number:400,hexcode:"#a3a3a3"},{number:500,hexcode:"#737373"},{number:600,hexcode:"#525252"},{number:700,hexcode:"#404040"},{number:800,hexcode:"#262626"},{number:900,hexcode:"#171717"},{number:950,hexcode:"#0a0a0a"}]},{name:"Stone",id:"stone",reference:!1,shades:[{number:50,hexcode:"#fafaf9"},{number:100,hexcode:"#f5f5f4"},{number:200,hexcode:"#e7e5e4"},{number:300,hexcode:"#d6d3d1"},{number:400,hexcode:"#a8a29e"},{number:500,hexcode:"#78716c"},{number:600,hexcode:"#57534e"},{number:700,hexcode:"#44403c"},{number:800,hexcode:"#292524"},{number:900,hexcode:"#1c1917"},{number:950,hexcode:"#0c0a09"}]},{name:"Red",id:"red",reference:!0,shades:[{number:50,hexcode:"#fef2f2"},{number:100,hexcode:"#fee2e2"},{number:200,hexcode:"#fecaca"},{number:300,hexcode:"#fca5a5"},{number:400,hexcode:"#f87171"},{number:500,hexcode:"#ef4444"},{number:600,hexcode:"#dc2626"},{number:700,hexcode:"#b91c1c"},{number:800,hexcode:"#991b1b"},{number:900,hexcode:"#7f1d1d"},{number:950,hexcode:"#450a0a"}]},{name:"Orange",id:"orange",reference:!0,shades:[{number:50,hexcode:"#fff7ed"},{number:100,hexcode:"#ffedd5"},{number:200,hexcode:"#fed7aa"},{number:300,hexcode:"#fdba74"},{number:400,hexcode:"#fb923c"},{number:500,hexcode:"#f97316"},{number:600,hexcode:"#ea580c"},{number:700,hexcode:"#c2410c"},{number:800,hexcode:"#9a3412"},{number:900,hexcode:"#7c2d12"},{number:950,hexcode:"#431407"}]},{name:"Amber",id:"amber",reference:!0,shades:[{number:50,hexcode:"#fffbeb"},{number:100,hexcode:"#fef3c7"},{number:200,hexcode:"#fde68a"},{number:300,hexcode:"#fcd34d"},{number:400,hexcode:"#fbbf24"},{number:500,hexcode:"#f59e0b"},{number:600,hexcode:"#d97706"},{number:700,hexcode:"#b45309"},{number:800,hexcode:"#92400e"},{number:900,hexcode:"#78350f"},{number:950,hexcode:"#451a03"}]},{name:"Yellow",id:"yellow",reference:!0,shades:[{number:50,hexcode:"#fefce8"},{number:100,hexcode:"#fef9c3"},{number:200,hexcode:"#fef08a"},{number:300,hexcode:"#fde047"},{number:400,hexcode:"#facc15"},{number:500,hexcode:"#eab308"},{number:600,hexcode:"#ca8a04"},{number:700,hexcode:"#a16207"},{number:800,hexcode:"#854d0e"},{number:900,hexcode:"#713f12"},{number:950,hexcode:"#422006"}]},{name:"Lime",id:"lime",reference:!0,shades:[{number:50,hexcode:"#f7fee7"},{number:100,hexcode:"#ecfccb"},{number:200,hexcode:"#d9f99d"},{number:300,hexcode:"#bef264"},{number:400,hexcode:"#a3e635"},{number:500,hexcode:"#84cc16"},{number:600,hexcode:"#65a30d"},{number:700,hexcode:"#4d7c0f"},{number:800,hexcode:"#3f6212"},{number:900,hexcode:"#365314"},{number:950,hexcode:"#1a2e05"}]},{name:"Green",id:"green",reference:!0,shades:[{number:50,hexcode:"#f0fdf4"},{number:100,hexcode:"#dcfce7"},{number:200,hexcode:"#bbf7d0"},{number:300,hexcode:"#86efac"},{number:400,hexcode:"#4ade80"},{number:500,hexcode:"#22c55e"},{number:600,hexcode:"#16a34a"},{number:700,hexcode:"#15803d"},{number:800,hexcode:"#166534"},{number:900,hexcode:"#14532d"},{number:950,hexcode:"#052e16"}]},{name:"Emerald",id:"emerald",reference:!0,shades:[{number:50,hexcode:"#ecfdf5"},{number:100,hexcode:"#d1fae5"},{number:200,hexcode:"#a7f3d0"},{number:300,hexcode:"#6ee7b7"},{number:400,hexcode:"#34d399"},{number:500,hexcode:"#10b981"},{number:600,hexcode:"#059669"},{number:700,hexcode:"#047857"},{number:800,hexcode:"#065f46"},{number:900,hexcode:"#064e3b"},{number:950,hexcode:"#022c22"}]},{name:"Teal",id:"teal",reference:!0,shades:[{number:50,hexcode:"#f0fdfa"},{number:100,hexcode:"#ccfbf1"},{number:200,hexcode:"#99f6e4"},{number:300,hexcode:"#5eead4"},{number:400,hexcode:"#2dd4bf"},{number:500,hexcode:"#14b8a6"},{number:600,hexcode:"#0d9488"},{number:700,hexcode:"#0f766e"},{number:800,hexcode:"#115e59"},{number:900,hexcode:"#134e4a"},{number:950,hexcode:"#042f2e"}]},{name:"Cyan",id:"cyan",reference:!0,shades:[{number:50,hexcode:"#ecfeff"},{number:100,hexcode:"#cffafe"},{number:200,hexcode:"#a5f3fc"},{number:300,hexcode:"#67e8f9"},{number:400,hexcode:"#22d3ee"},{number:500,hexcode:"#06b6d4"},{number:600,hexcode:"#0891b2"},{number:700,hexcode:"#0e7490"},{number:800,hexcode:"#155e75"},{number:900,hexcode:"#164e63"},{number:950,hexcode:"#083344"}]},{name:"Sky",id:"sky",reference:!0,shades:[{number:50,hexcode:"#f0f9ff"},{number:100,hexcode:"#e0f2fe"},{number:200,hexcode:"#bae6fd"},{number:300,hexcode:"#7dd3fc"},{number:400,hexcode:"#38bdf8"},{number:500,hexcode:"#0ea5e9"},{number:600,hexcode:"#0284c7"},{number:700,hexcode:"#0369a1"},{number:800,hexcode:"#075985"},{number:900,hexcode:"#0c4a6e"},{number:950,hexcode:"#082f49"}]},{name:"Blue",id:"blue",reference:!0,shades:[{number:50,hexcode:"#eff6ff"},{number:100,hexcode:"#dbeafe"},{number:200,hexcode:"#bfdbfe"},{number:300,hexcode:"#93c5fd"},{number:400,hexcode:"#60a5fa"},{number:500,hexcode:"#3b82f6"},{number:600,hexcode:"#2563eb"},{number:700,hexcode:"#1d4ed8"},{number:800,hexcode:"#1e40af"},{number:900,hexcode:"#1e3a8a"},{number:950,hexcode:"#172554"}]},{name:"Indigo",id:"indigo",reference:!0,shades:[{number:50,hexcode:"#eef2ff"},{number:100,hexcode:"#e0e7ff"},{number:200,hexcode:"#c7d2fe"},{number:300,hexcode:"#a5b4fc"},{number:400,hexcode:"#818cf8"},{number:500,hexcode:"#6366f1"},{number:600,hexcode:"#4f46e5"},{number:700,hexcode:"#4338ca"},{number:800,hexcode:"#3730a3"},{number:900,hexcode:"#312e81"},{number:950,hexcode:"#1e1b4b"}]},{name:"Violet",id:"violet",reference:!0,shades:[{number:50,hexcode:"#f5f3ff"},{number:100,hexcode:"#ede9fe"},{number:200,hexcode:"#ddd6fe"},{number:300,hexcode:"#c4b5fd"},{number:400,hexcode:"#a78bfa"},{number:500,hexcode:"#8b5cf6"},{number:600,hexcode:"#7c3aed"},{number:700,hexcode:"#6d28d9"},{number:800,hexcode:"#5b21b6"},{number:900,hexcode:"#4c1d95"},{number:950,hexcode:"#2e1065"}]},{name:"Purple",id:"purple",reference:!0,shades:[{number:50,hexcode:"#faf5ff"},{number:100,hexcode:"#f3e8ff"},{number:200,hexcode:"#e9d5ff"},{number:300,hexcode:"#d8b4fe"},{number:400,hexcode:"#c084fc"},{number:500,hexcode:"#a855f7"},{number:600,hexcode:"#9333ea"},{number:700,hexcode:"#7e22ce"},{number:800,hexcode:"#6b21a8"},{number:900,hexcode:"#581c87"},{number:950,hexcode:"#3b0764"}]},{name:"Fuchsia",id:"fuchsia",reference:!0,shades:[{number:50,hexcode:"#fdf4ff"},{number:100,hexcode:"#fae8ff"},{number:200,hexcode:"#f5d0fe"},{number:300,hexcode:"#f0abfc"},{number:400,hexcode:"#e879f9"},{number:500,hexcode:"#d946ef"},{number:600,hexcode:"#c026d3"},{number:700,hexcode:"#a21caf"},{number:800,hexcode:"#86198f"},{number:900,hexcode:"#701a75"},{number:950,hexcode:"#4a044e"}]},{name:"Pink",id:"pink",reference:!0,shades:[{number:50,hexcode:"#fdf2f8"},{number:100,hexcode:"#fce7f3"},{number:200,hexcode:"#fbcfe8"},{number:300,hexcode:"#f9a8d4"},{number:400,hexcode:"#f472b6"},{number:500,hexcode:"#ec4899"},{number:600,hexcode:"#db2777"},{number:700,hexcode:"#be185d"},{number:800,hexcode:"#9d174d"},{number:900,hexcode:"#831843"},{number:950,hexcode:"#500724"}]},{name:"Rose",id:"rose",reference:!0,shades:[{number:50,hexcode:"#fff1f2"},{number:100,hexcode:"#ffe4e6"},{number:200,hexcode:"#fecdd3"},{number:300,hexcode:"#fda4af"},{number:400,hexcode:"#fb7185"},{number:500,hexcode:"#f43f5e"},{number:600,hexcode:"#e11d48"},{number:700,hexcode:"#be123c"},{number:800,hexcode:"#9f1239"},{number:900,hexcode:"#881337"},{number:950,hexcode:"#4c0519"}]}];function S2(e){const r=O2.filter(i=>i.reference).map(i=>({...i,shades:i.shades.map(a=>({...a,delta:Ie.deltaE(e,a.hexcode)}))})).map(i=>({...i,closestShade:i.shades.reduce((a,l)=>a.delta<l.delta?a:l)})).reduce((i,a)=>i.closestShade.delta<a.closestShade.delta?i:a),o=r.shades.map(i=>({...i,lightnessDifference:Math.abs(Ie(i.hexcode).get("hsl.l")-e.get("hsl.l"))})),s=o.reduce((i,a)=>i.lightnessDifference<a.lightnessDifference?i:a);return{...r,shades:o,closestShade:s}}function N2(e){const t=Ie(e),n=S2(t),r=t.get("hsl.h"),o=Ie(n.closestShade.hexcode).get("hsl.h"),s=r-o,i=s===0?o.toString():s>0?`+${s}`:s.toString(),a=t.get("hsl.s")/Ie(n.closestShade.hexcode).get("hsl.s");return n.shades.map(u=>{if(u.number===n.closestShade.number)return{number:u.number,hexcode:t.hex()};let c=Ie(u.hexcode);const d=c.get("hsl.s")*a;return c=c.set("hsl.s",d),c=c.set("hsl.h",i),{number:u.number,hexcode:c.hex()}})}class ja extends Error{constructor(){super(),this.name="IndiscriminateError"}}const C2={},T2={fill:"none",viewBox:"0 0 24 24"};function P2(e,t){return g(),C("svg",T2,t[0]||(t[0]=[H("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),H("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))}const Qt=er(C2,[["render",P2],["__scopeId","data-v-687bcaf0"]]),$2={"aria-hidden":"true"},Qu=pe({__name:"MoonButtonBase",props:{label:{},successLabel:{},errorLabel:{},icon:{},variant:{},size:{},working:{type:Boolean},success:{type:Boolean},error:{type:Boolean},disabled:{type:Boolean},type:{}},emits:["click"],setup(e){const t=e,n=ye(Lt),r=se(()=>t.success?t.successLabel??t.label:t.error?t.errorLabel??t.label:t.label),o=se(()=>t.variant?t.variant==="secondary"?`secondary-${(n==null?void 0:n.value.theme.buttons)??"light"}`:t.variant:"primary");return(s,i)=>{var a,l;return g(),J(Fl(s.type==="anchor"?"a":"button"),{class:"moonbase:button",type:s.type||"button",disabled:s.success||s.error||s.working||s.disabled,"data-success":s.success||void 0,"data-error":s.error||void 0,"data-working":s.working||void 0,"data-variant":o.value,"data-size":s.size||"large","data-corners":(a=b(n))==null?void 0:a.theme.corners,"data-background":(l=b(n))==null?void 0:l.theme.colors.background,"data-icon-visible":s.working||s.success||s.error||!!s.icon||void 0,onClick:i[0]||(i[0]=u=>s.$emit("click",u))},{default:O(()=>[H("div",$2,[s.working?(g(),J(Qt,{key:0})):s.success?(g(),J(b(X1),{key:1})):s.error?(g(),J(b(t_),{key:2})):s.icon?(g(),J(Fl(s.icon),{key:3})):fe("",!0)]),M(" "+j(r.value),1)]),_:1},8,["type","disabled","data-success","data-error","data-working","data-variant","data-size","data-corners","data-background","data-icon-visible"])}}}),at=pe({__name:"MoonButton",props:{handler:{type:Function},label:{},success:{},error:{},icon:{},variant:{},size:{},noReset:{type:Boolean},disabled:{type:Boolean}},setup(e){const t=e,n=V(!1),r=V(!1),o=V(!1);async function s(){try{const i=t.handler();i instanceof Promise&&(n.value=!0,await i,n.value=!1,r.value=!0,await Ht(2500),t.noReset||(r.value=!1))}catch(i){if(n.value=!1,i instanceof ja)return;o.value=!0,await Ht(2500),o.value=!1}}return(i,a)=>(g(),J(Qu,{label:i.label,working:n.value,"success-label":i.success,success:r.value,"error-label":i.error,error:o.value,icon:i.icon,disabled:i.disabled,variant:i.variant,size:i.size,onClick:s},null,8,["label","working","success-label","success","error-label","error","icon","disabled","variant","size"]))}}),A2={},D2={class:"moonbase:text-body"};function I2(e,t){return g(),C("span",D2,[xt(e.$slots,"default")])}const rt=er(A2,[["render",I2]]),M2={},V2={class:"moonbase:text-subtext"};function R2(e,t){return g(),C("span",V2,[xt(e.$slots,"default")])}const Le=er(M2,[["render",R2]]),L2={class:"moonbase:about"},j2=pe({__name:"About",setup(e){const t=Ae(),n="0.3.26";return(r,o)=>(g(),C("div",L2,[o[2]||(o[2]=Af('<svg viewBox="0 0 512 512" height="56px" width="56px"><g><path fill="currentColor" d="m493.17795,174.6135c6.257,75.3 -30.577,150.948 -100.579,190.758c-66.292,37.697 -145.001,33.405 -205.402,-4.415c0.409,-1.248 0.638,-2.577 0.638,-3.96c0,-7.026 -5.717,-12.743 -12.743,-12.743c-2.876,0 -5.524,0.969 -7.659,2.582c-18.813,-15.259 -35.159,-34.207 -47.856,-56.534c-54.663,-96.122 -21.054,-218.358 75.069,-273.021a201.218,201.218 0 0 1 33.302,-15.124c-32.428,3.667 -64.663,13.809 -94.827,30.962c-104.526,59.443 -149.511,183.241 -113.473,293.249c-3.376,3.057 -5.513,7.459 -5.513,12.362c0,9.207 7.491,16.698 16.698,16.698c0.136,0 0.267,-0.017 0.401,-0.02a252.205,252.205 0 0 0 8.683,16.691c67.869,119.344 219.635,161.073 338.98,93.204a250.416,250.416 0 0 0 32.893,-22.333c1.045,0.331 2.157,0.513 3.311,0.513c6.047,0 10.968,-4.921 10.968,-10.968c0,-0.605 -0.063,-1.196 -0.157,-1.775c69.545,-64.988 96.008,-165.054 67.266,-256.126m-446.526,25.112a5.071,5.071 0 0 1 -5.066,-5.066a5.072,5.072 0 0 1 5.066,-5.067a5.073,5.073 0 0 1 5.066,5.067a5.072,5.072 0 0 1 -5.066,5.066m-15.819,153.944c-8.238,0 -14.94,-6.702 -14.94,-14.94c0,-8.239 6.702,-14.941 14.94,-14.941c8.239,0 14.941,6.702 14.941,14.941c-0.001,8.238 -6.703,14.94 -14.941,14.94m144.258,-7.659c6.057,0 10.985,4.928 10.985,10.986c0,6.058 -4.928,10.985 -10.985,10.985c-6.058,0 -10.986,-4.928 -10.986,-10.985c0.001,-6.059 4.928,-10.986 10.986,-10.986m70.829,133.004c-5.079,0 -9.21,-4.132 -9.21,-9.21c0,-5.079 4.131,-9.21 9.21,-9.21c5.078,0 9.209,4.131 9.209,9.21c0,5.078 -4.13,9.21 -9.209,9.21m169.18,-37.289c-5.078,0 -9.209,-4.132 -9.209,-9.21s4.131,-9.209 9.209,-9.209s9.21,4.131 9.21,9.209s-4.132,9.21 -9.21,9.21"></path><path fill="currentColor" d="m144.78195,275.9675c46.746,82.201 151.278,110.943 233.48,64.197c59.864,-34.044 91.363,-98.736 86.013,-163.13a170.094,170.094 0 0 0 -5.515,-31.052c-23.045,0.567 -63.864,10.137 -104.194,61.671c-52.045,66.5 -186.285,49.153 -228.855,17.372c3.503,17.443 9.796,34.632 19.071,50.942m233.513,-65.677a8.663,8.663 0 1 1 -8.663,8.663a8.662,8.662 0 0 1 8.663,-8.663m-37.006,62.618c7.02,0 12.712,5.691 12.712,12.712s-5.692,12.712 -12.712,12.712c-7.021,0 -12.712,-5.691 -12.712,-12.712s5.691,-12.712 12.712,-12.712m-102.544,12.712a6.78,6.78 0 1 1 0,13.56a6.78,6.78 0 0 1 0,-13.56"></path><ellipse fill="currentColor" ry="7.3075" rx="7.3075" cy="152.05851" cx="251.33138"></ellipse><ellipse fill="currentColor" ry="5.35076" rx="5.35076" cy="210.31151" cx="204.89499"></ellipse><ellipse fill="currentColor" ry="12.09273" rx="12.09273" cy="200.15625" cx="302.28597"></ellipse></g></svg>',1)),w(b(Wh),{as:"h3"},{default:O(()=>o[0]||(o[0]=[M(" Moonbase Embedded Storefront ")])),_:1}),w(Le,null,{default:O(()=>[M(" Version "+j(b(n)),1)]),_:1}),w(rt,null,{default:O(()=>o[1]||(o[1]=[M(" This store is using the "),H("a",{href:"https://moonbase.sh/solutions/payments",target:"_blank"},"Moonbase Embedded Storefront",-1),M(" module to accept payments, provide authentication and power software licensing. ")])),_:1}),w(at,{label:"Close",variant:"primary",handler:()=>b(t).reset()},null,8,["handler"])]))}});var qt=(e=>(e.SignedIn="signed-in",e.SignedUp="signed-up",e.SignedOut="signed-out",e.RedeemedVoucher="redeemed-voucher",e.DownloadedProduct="downloaded-product",e.ActivatedProduct="activated-product",e.AddedToCart="added-to-cart",e.CheckoutInitiated="checkout-initiated",e.CheckoutClosed="checkout-closed",e.CheckoutCompleted="checkout-completed",e))(qt||{});const F2=["data-corners","data-variant"],U2={class:"moonbase:card-content"},En=pe({__name:"MoonCard",setup(e){const t=ye(Lt);return(n,r)=>{var o,s;return g(),C("div",{class:"moonbase:card","data-corners":(o=b(t))==null?void 0:o.theme.corners,"data-variant":(s=b(t))==null?void 0:s.theme.cards},[H("div",U2,[xt(n.$slots,"default")]),xt(n.$slots,"addon")],8,F2)}}}),B2=["data-corners"],H2=["src"],q2={key:1,class:"moonbase:image-placeholder"},en=pe({__name:"ProductIcon",props:{url:{},size:{}},setup(e){const t=ye(Lt);return(n,r)=>{var o;return g(),C("div",{class:"moonbase:product-icon",style:Ri({width:`${n.size}px`,height:`${n.size}px`}),"data-corners":(o=b(t))==null?void 0:o.theme.corners},[n.url?(g(),C("img",{key:0,src:n.url,alt:""},null,8,H2)):(g(),C("div",q2,[w(b(J1))]))],12,B2)}}}),z2={},W2={class:"moonbase:text-title"};function Z2(e,t){return g(),C("h4",W2,[xt(e.$slots,"default")])}const es=er(z2,[["render",Z2]]),Y2={class:"moonbase:product-card-content"},qp=pe({__name:"ProductCard",props:{product:{}},setup(e){return(t,n)=>(g(),J(En,{class:"moonbase:product-card"},{default:O(()=>[w(en,{url:t.product.iconUrl,size:72},null,8,["url"]),H("div",Y2,[w(es,null,{default:O(()=>{var r;return[M(j((r=t.product)==null?void 0:r.name),1)]}),_:1}),w(Le,null,{default:O(()=>{var r;return[M(j((r=t.product)==null?void 0:r.tagline),1)]}),_:1}),xt(t.$slots,"description")]),xt(t.$slots,"default")]),_:3}))}}),G2={class:"moonbase:auto-activation"},K2={key:0,class:"moonbase:loader"},X2={key:1,class:"moonbase:loader"},J2={key:2,class:"moonbase:loader"},Q2={key:3},eE={key:1,class:"moonbase:loader"},tE={key:2,class:"moonbase:loader"},nE={key:3,class:"moonbase:loader"},rE={key:4,class:"moonbase:auto-activation-content"},oE={key:0,class:"moonbase:auto-activation-option"},sE={class:"moonbase:auto-activation-cta"},iE={key:1,class:"moonbase:auto-activation-option"},aE={class:"moonbase:auto-activation-cta"},lE={key:2,class:"moonbase:auto-activation-option"},uE={key:3,class:"moonbase:auto-activation-option"},cE={class:"moonbase:auto-activation-cta"},dE={key:4,class:"moonbase:auto-activation-option"},fE={key:4,class:"moonbase:auto-activation-cta"},hE={key:5,class:"moonbase:auto-activation-cta"},pE=pe({__name:"AutoActivation",setup(e){const t=Ae(),{user:n,loaded:r}=tt(),o=ye(Rr),s=t.getParameter("token"),{activationRequest:i,loading:a,fulfilling:l,completing:u,error:c,fulfillLicense:d,fulfillTrial:f}=py(s),h=ye(Gt);et(i,m=>{var P;!l.value&&!u.value&&(m==null?void 0:m.status)===fn.Requested&&((P=m==null?void 0:m.licenseEligibility)!=null&&P.eligible)&&d(),(m==null?void 0:m.status)===fn.Completed&&(o==null||o(qt.ActivatedProduct,{product:m.product,fulfillmentType:m.fulfillmentType,user:n.value}))},{deep:!0});const p=se(()=>{if(i.value)return b(Js(i.value.product.id))}),_=se(()=>p.value&&p.value.defaultVariation),{currency:x,addToCart:N,setQuantity:q}=Cr();function z(){t.show(le.Product,te.ViewProduct,{product_id:i.value.product.id})}function B(){t.enqueue(le.Activation,te.ActivateProduct,t.parameters??void 0),t.show(le.Authentication,te.SignIn)}function L(){if(!p.value)return;const m=N(p.value);q(m,1),t.enqueue(le.Activation,te.ActivateProduct,t.parameters),t.show(le.Cart,te.ViewCart)}function D(){var m;t.enqueue(le.Activation,te.ActivateProduct,{...t.parameters,product_id:((m=i.value)==null?void 0:m.product.id)??""}),n.value?t.show(le.Customer,te.RedeemVoucher):t.show(le.Redeem,te.RedeemVoucher)}return(m,P)=>{var I,T,$,A,oe,xe,k;return g(),C("div",G2,[b(a)||!b(r)||!((I=b(h))!=null&&I.loadedStorefront)?(g(),C("div",K2,[w(Qt)])):b(c)?(g(),C("div",X2,[w(nt,null,{default:O(()=>P[0]||(P[0]=[M(" Uh oh ")])),_:1}),w(rt,null,{default:O(()=>[M(j(b(c)),1)]),_:1})])):b(i)?(g(),C("div",Q2,[b(i).product?(g(),J(qp,{key:0,product:b(i).product},null,8,["product"])):fe("",!0),((T=b(i))==null?void 0:T.status)===b(fn).Cancelled?(g(),C("div",eE,[w(nt,null,{default:O(()=>P[3]||(P[3]=[M(" Uh oh ")])),_:1}),w(rt,null,{default:O(()=>P[4]||(P[4]=[M(" This activation request was cancelled, open your app to try again. ")])),_:1})])):b(l)||b(u)?(g(),C("div",tE,[w(Qt),w(rt,null,{default:O(()=>[M(" Activating "+j(b(i).product.name)+"... ",1)]),_:1})])):(($=b(i))==null?void 0:$.status)===b(fn).Completed?(g(),C("div",nE,[w(nt,null,{default:O(()=>P[5]||(P[5]=[M(" Done! ")])),_:1}),w(rt,null,{default:O(()=>P[6]||(P[6]=[M(" Your product is activated. "),H("br",null,null,-1),M(" You may close this window and return to the app. ")])),_:1})])):(g(),C("div",rE,[_.value?(g(),C("div",oE,[w(nt,null,{default:O(()=>P[7]||(P[7]=[M(" Option 1: Purchase product ")])),_:1}),w(rt,null,{default:O(()=>[M(" Buy a copy of "+j(p.value.name)+" for ",1),H("strong",null,j(b(Jt)(p.value.defaultVariation.price[b(x)],b(x))),1),P[8]||(P[8]=M(". "))]),_:1}),H("span",sE,[w(at,{label:"Purchase",variant:"primary",handler:()=>L()},null,8,["handler"])])])):fe("",!0),b(n)?!b(n).ownedProducts||!((A=b(n).ownedProducts)!=null&&A.includes(b(i).product.id))&&!b(n).subscribedProducts||!((oe=b(n).subscribedProducts)!=null&&oe.includes(b(i).product.id))?(g(),C("div",lE,[w(nt,null,{default:O(()=>[M(" Option "+j(_.value?"2":"1")+": Use license ",1)]),_:1}),w(rt,null,{default:O(()=>P[10]||(P[10]=[M(" You don't own any licenses for this product. ")])),_:1})])):(xe=b(n).ownedProducts)!=null&&xe.includes(b(i).product.id)||(k=b(n).subscribedProducts)!=null&&k.includes(b(i).product.id)?(g(),C("div",uE,[w(nt,null,{default:O(()=>[M(" Option "+j(_.value?"2":"1")+": Use license ",1)]),_:1}),w(rt,null,{default:O(()=>P[11]||(P[11]=[M(" You don't have enough free seats on your licenses to activate this device. Either free up a seat or purchase additional licenses. ")])),_:1}),H("span",cE,[w(at,{label:"Licenses",variant:"secondary",handler:()=>z()},null,8,["handler"])])])):fe("",!0):(g(),C("div",iE,[w(nt,null,{default:O(()=>[M(" Option "+j(_.value?"2":"1")+": Use license ",1)]),_:1}),w(rt,null,{default:O(()=>P[9]||(P[9]=[M(" Please sign in to use a license for this product. ")])),_:1}),H("span",aE,[w(at,{label:"Sign in",variant:"secondary",handler:()=>B()},null,8,["handler"])])])),b(i).trialEligibility?(g(),C("div",dE,[w(nt,null,{default:O(()=>[M(" Option "+j(_.value?"3":"2")+": Start trial ",1)]),_:1}),b(i).trialEligibility.eligible&&b(i).trialEligibility.requiresAccount&&!b(n)?(g(),J(rt,{key:0},{default:O(()=>P[12]||(P[12]=[M(" You need to be signed in to start a trial for this product. ")])),_:1})):b(i).trialEligibility.eligible&&b(i).trialEligibility.existing?(g(),J(rt,{key:1},{default:O(()=>[M(" You are eligible for a "+j(b(i).trialEligibility.numberOfDaysPerProduct)+" day trial of which you have "+j(b(i).trialEligibility.numberOfDaysRemaining)+" days remaining. ",1)]),_:1})):b(i).trialEligibility.eligible?(g(),J(rt,{key:2},{default:O(()=>[M(" You are eligible for a "+j(b(i).trialEligibility.numberOfDaysPerProduct)+" day trial. ",1)]),_:1})):(g(),J(rt,{key:3},{default:O(()=>P[13]||(P[13]=[M(" This device or product is not eligible for a trial. ")])),_:1})),b(i).trialEligibility.eligible&&b(i).trialEligibility.requiresAccount&&!b(n)?(g(),C("span",fE,[w(at,{label:"Sign in",variant:"secondary",handler:()=>B()},null,8,["handler"])])):b(i).trialEligibility.eligible?(g(),C("span",hE,[w(at,{label:"Start trial",variant:"secondary",handler:b(f)},null,8,["handler"])])):fe("",!0)])):fe("",!0),P[15]||(P[15]=H("div",{class:"moonbase:grow"},null,-1)),w(Le,{class:"moonbase:auto-activation-redeem"},{default:O(()=>[P[14]||(P[14]=M(" Have a voucher code? ")),H("button",{type:"button",onClick:D}," Redeem now ")]),_:1})]))])):(g(),C("div",J2,[w(nt,null,{default:O(()=>P[1]||(P[1]=[M(" Uh oh ")])),_:1}),w(rt,null,{default:O(()=>P[2]||(P[2]=[M(" Could not find activation request ")])),_:1})]))])}}}),mE={},bE={class:"moonbase:text-caption"};function gE(e,t){return g(),C("span",bE,[xt(e.$slots,"default")])}const Ir=er(mE,[["render",gE]]),vE=["data-corners"],yE=["accept"],_E={"data-error":""},wE=pe({__name:"DeviceTokenInput",props:{error:{}},emits:["input","error"],setup(e,{emit:t}){const n=t,r=ye(Lt),o=V(!1),s=se(()=>{let u=".dt";return r!=null&&r.value&&(u=r.value.activation.deviceTokenFileExtension),u.startsWith(".")?u:`.${u}`});function i(u){const c=new FileReader;c.onload=d=>{var f;n("input",(f=d.target)==null?void 0:f.result)},c.readAsText(u)}function a(u){var d;o.value=!1;const c=(d=u.dataTransfer)==null?void 0:d.files;if(!c||c.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(c[0])}function l(u){const c=u.target,d=c==null?void 0:c.files;if(!d||d.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(d[0])}return(u,c)=>{var d,f;return g(),C("div",{class:Os(["moonbase:device-token-input",{"moonbase:device-token-input--hovering":o.value}]),"data-corners":(d=b(r))==null?void 0:d.theme.corners,onDrag:c[0]||(c[0]=Nr(()=>{},["prevent","stop"])),onDragstart:c[1]||(c[1]=Nr(()=>{},["prevent","stop"])),onDragend:c[2]||(c[2]=Nr(h=>o.value=!1,["prevent","stop"])),onDragover:c[3]||(c[3]=Nr(h=>o.value=!0,["prevent","stop"])),onDragenter:c[4]||(c[4]=Nr(h=>o.value=!0,["prevent","stop"])),onDragleave:c[5]||(c[5]=Nr(h=>o.value=!1,["prevent","stop"])),onDrop:Nr(a,["prevent","stop"])},[w(b(e_)),c[6]||(c[6]=H("label",{for:"fallback-input"},[H("span",{class:"moonbase:underline"},"Choose a machine file"),M(" or drag here to upload ")],-1)),H("input",{id:"fallback-input",type:"file",accept:s.value,class:"moonbase:sr-only",onChange:l},null,40,yE),H("p",_E,j((f=u.error)==null?void 0:f.message),1)],42,vE)}}}),EE={class:"moonbase:manual-activation"},xE={key:1,class:"moonbase:loader"},kE={key:2,class:"moonbase:manual-activation-content"},OE=pe({__name:"ManualActivation",setup(e){const t=ye(Lt),{activateProduct:n}=so(),r=Ai.Offline,o=V(0),s=V(null),i=V(null);async function a(l){o.value=1;try{i.value=await n(l,r),o.value=2}catch(u){s.value=u,o.value=0}}return(l,u)=>(g(),C("div",EE,[w(rt,null,{default:O(()=>u[2]||(u[2]=[M(" Upload your machine file here to get a license file for activating offline devices. The machine file can be generated in the installed app. ")])),_:1}),w(Gs,{mode:"out-in",name:"moonbase:slide-left"},{default:O(()=>[o.value===0?(g(),J(wE,{key:0,error:s.value,onInput:u[0]||(u[0]=c=>a(c)),onError:u[1]||(u[1]=c=>s.value=c)},null,8,["error"])):o.value===1?(g(),C("div",xE,[w(Qt)])):o.value===2&&i.value?(g(),C("div",kE,[w(nt,null,{default:O(()=>u[3]||(u[3]=[M(" Success! ")])),_:1}),w(rt,null,{default:O(()=>u[4]||(u[4]=[M(" Your license can be downloaded below: ")])),_:1}),i.value.license.product?(g(),J(qp,{key:0,product:i.value.license.product},{description:O(()=>[w(Ir,null,{default:O(()=>[M(j(i.value.license.activeNumberOfActivations)+" of "+j(i.value.license.maxNumberOfActivations)+" devices activated ",1)]),_:1})]),default:O(()=>{var c;return[w(qo,{href:i.value.url,target:"_blank",download:((c=b(t))==null?void 0:c.activation.licenseTokenFileName)??"license-file.mb",class:"moonbase:manual-activation-download-button"},{default:O(()=>[w(b(Q1))]),_:1},8,["href","download"])]}),_:1},8,["product"])):fe("",!0),u[5]||(u[5]=H("div",null,null,-1)),u[6]||(u[6]=H("div",null,null,-1))])):fe("",!0)]),_:1})]))}}),SE={class:"moonbase:activation"},NE=pe({__name:"Activation",setup(e){const t=Ae();return(n,r)=>(g(),C("div",SE,[b(t).getParameter("token")?(g(),J(pE,{key:0})):(g(),J(OE,{key:1}))]))}}),CE=["disabled"],zp=Symbol("form-state"),sr=pe({__name:"MoonForm",props:{handler:{type:Function},disabled:{type:Boolean},noReset:{type:Boolean}},setup(e){const t=e,n=V(!1),r=V(!1),o=V(!1),s=se(()=>t.disabled||n.value||r.value||!1);Bt(zp,{working:n,isSuccess:r,isError:o,disabled:s});async function i(){n.value=!0;try{await t.handler(),n.value=!1,r.value=!0,await Ht(2500),t.noReset||(r.value=!1)}catch{n.value=!1,o.value=!0,await Ht(2500),o.value=!1}}return(a,l)=>(g(),C("form",{disabled:s.value,onSubmit:Nr(i,["prevent"])},[xt(a.$slots,"default",{working:n.value,isSuccess:r.value,isError:o.value,disabled:n.value||r.value})],40,CE))}}),TE=["hidden"],PE=["for"],$E=["id","type","name","placeholder","value","disabled","aria-invalid","aria-describedby","data-corners"],AE=["id"],DE=["id"],Nt=pe({inheritAttrs:!1,__name:"MoonInput",props:{name:{},label:{},placeholder:{},type:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{},hidden:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=ye(Lt);return(n,r)=>{var o;return g(),C("div",{class:"moonbase:input",hidden:n.hidden||void 0},[H("label",{for:`mb-${n.name}`},j(n.label),9,PE),H("input",eu({id:`mb-${n.name}`,type:n.type??"text",name:`mb-${n.name}`,placeholder:n.placeholder,value:n.modelValue,disabled:n.disabled,"aria-invalid":!!n.error,"aria-describedby":n.error?`mb-${n.name}-error`:n.hint?`mb-${n.name}-hint`:void 0,"data-corners":(o=b(t))==null?void 0:o.theme.corners},n.$attrs,{onInput:r[0]||(r[0]=s=>{var i;return n.$emit("update:modelValue",(i=s.target)==null?void 0:i.value)})}),null,16,$E),n.error?(g(),C("p",{key:0,id:`mb-${n.name}-error`,class:"moonbase:input-hint","data-type":"error"},j(n.error),9,AE)):n.hint?(g(),C("p",{key:1,id:`mb-${n.name}-hint`,class:"moonbase:input-hint"},j(n.hint),9,DE)):fe("",!0)],8,TE)}}}),ir=pe({__name:"MoonSubmitButton",props:{label:{},success:{},error:{},variant:{},size:{}},setup(e){const{working:t,isSuccess:n,isError:r,disabled:o}=ye(zp);return(s,i)=>(g(),J(Qu,{label:s.label,working:b(t),"success-label":s.success,success:b(n),"error-label":s.error,error:b(r),type:"submit",disabled:b(o),variant:s.variant,size:s.size},null,8,["label","working","success-label","success","error-label","error","disabled","variant","size"]))}}),IE=["data-visible"],ME={class:"moonbase:sign-in-actions"},VE=["data-corners"],RE=pe({__name:"SignIn",emits:["signedIn"],setup(e,{emit:t}){const n=t,r=Ae(),o=tt(),s=ye(Lt),i=ye(Rr),a=V(r.getParameter("email")??""),l=V(""),u=V(null);async function c(){u.value=null;try{const d=await o.signIn(a.value,l.value);i==null||i(qt.SignedIn,{user:d}),Ht(1500).then(()=>n("signedIn",d))}catch(d){throw d instanceof mr?u.value="User not found":u.value=d.message,d}}return(d,f)=>(g(),J(sr,{handler:c,class:"moonbase:sign-in"},{default:O(()=>{var h,p,_;return[w(Nt,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=x=>a.value=x),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=x=>l.value=x),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),H("span",{class:"moonbase:error","data-visible":!!u.value||void 0},j(u.value),9,IE),w(ir,{success:"Signed in",label:"Sign in",error:"Error"}),H("div",ME,[(h=b(s))!=null&&h.auth.signUp.enabled?(g(),J(at,{key:0,label:"Create account",variant:"subtle",handler:()=>b(r).show(b(le).Authentication,b(te).SignUp,{email:a.value})},null,8,["handler"])):fe("",!0),w(at,{label:"Forgot password",variant:"subtle",handler:()=>b(r).show(b(le).Authentication,b(te).ForgotPassword,{email:a.value})},null,8,["handler"])]),(p=b(s))!=null&&p.auth.signIn.hint?(g(),C("div",{key:0,class:"moonbase:sign-in-hint","data-corners":(_=b(s))==null?void 0:_.theme.corners},[w(b(n_)),w(Le,null,{default:O(()=>[M(j(b(s).auth.signIn.hint),1)]),_:1})],8,VE)):fe("",!0)]}),_:1}))}}),ts=[{title:"Password must be at least 6 characters long",test:e=>e.length>=6},{title:"Password must contain uppercase letters",test:e=>/[A-Z]/.test(e)},{title:"Password must contain lowercase letters",test:e=>/[a-z]/.test(e)},{title:"Password must contain at least one number",test:e=>/\d/.test(e)},{title:"Password must contain at least one special character",test:e=>/[=+\-^$*.[\\\]{}()?!@#%&/,><':;|_~`]/.test(e)}],LE={key:0,class:"moonbase:loader"},jE={key:1,class:"moonbase:error","data-visible":""},FE={key:0,class:"moonbase:password-validation"},UE=["data-visible"],BE=pe({__name:"ConfirmAccount",emits:["confirmedAccount"],setup(e,{emit:t}){const n=t,r=Ae(),o=tt(),s=V(!0),i=V(null),a=V(""),l=V(!1),u=V(null),c=se(()=>ts.some(f=>!f.test(a.value)));qe(async()=>{try{const f=r.getParameter("email"),h=r.getParameter("code");if(!f||!h)throw new Error("Link is broken");i.value=await o.confirmAccount(f,h)}catch(f){f instanceof mr?u.value="Could not find a user to confirm":u.value=f.message}s.value=!1});async function d(){var f,h;if(u.value=null,!!((f=i.value)!=null&&f.resetPasswordToken))try{const p=r.getParameter("email");await o.resetPassword(p,a.value,(h=i.value)==null?void 0:h.resetPasswordToken);const _=await o.signIn(p,a.value);Ht(1500).then(()=>n("confirmedAccount",_))}catch(p){throw u.value=p.message,p}}return(f,h)=>(g(),J(sr,{handler:d,disabled:c.value,class:"moonbase:confirm-account"},{default:O(()=>[s.value?(g(),C("div",LE,[w(Qt)])):i.value?(g(),C($e,{key:2},[H("h3",null," Hi "+j(i.value.name)+", ",1),h[2]||(h[2]=H("p",null," Please create a new password for your account: ",-1)),w(Nt,{"model-value":b(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),w(Nt,{modelValue:a.value,"onUpdate:modelValue":h[0]||(h[0]=p=>a.value=p),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:h[1]||(h[1]=p=>l.value=!0)},null,8,["modelValue"]),l.value&&c.value?(g(),C("div",FE,[(g(!0),C($e,null,yt(b(ts).filter(p=>!p.test(a.value)),p=>(g(),J(Le,{key:p.title,"data-error":""},{default:O(()=>[M(j(p.title),1)]),_:2},1024))),128))])):fe("",!0),w(ir,{success:"Password saved",label:"Save password",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!u.value||void 0},j(u.value),9,UE)],64)):(g(),C("div",jE,j(u.value),1))]),_:1},8,["disabled"]))}}),HE={class:"moonbase:confirm-email-change"},qE={key:0,class:"moonbase:loader"},zE={key:1,class:"moonbase:error","data-visible":""},WE=pe({__name:"ConfirmEmail",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=Ae(),{user:o,confirmEmail:s}=tt(),i=V(!0),a=V(null);return qe(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Ht(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>(g(),C("div",HE,[i.value?(g(),C("div",qE,[w(Qt)])):a.value?(g(),C("div",zE,j(a.value),1)):(g(),C($e,{key:2},[w(nt,null,{default:O(()=>u[0]||(u[0]=[M(" Success! ")])),_:1}),u[1]||(u[1]=H("p",null," Thanks for confirming your new email. ",-1)),b(o)?(g(),J(at,{key:0,handler:()=>b(r).show(b(le).Customer,b(te).ViewAccount,void 0,!0),label:"Continue"},null,8,["handler"])):fe("",!0)],64))]))}}),ZE={class:"moonbase:confirm-email-change"},YE={key:0,class:"moonbase:loader"},GE={key:1,class:"moonbase:error","data-visible":""},KE=pe({__name:"ConfirmEmailChange",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=Ae(),{user:o,confirmEmailChange:s}=tt(),i=V(!0),a=V(null);return qe(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Ht(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>{var c;return g(),C("div",ZE,[i.value?(g(),C("div",YE,[w(Qt)])):a.value?(g(),C("div",GE,j(a.value),1)):(g(),C($e,{key:2},[H("h3",null," Hi "+j((c=b(o))==null?void 0:c.name)+", ",1),u[0]||(u[0]=H("p",null," Thanks for confirming your new email. You can now sign in using this new address. ",-1))],64))])}}}),XE=["data-visible"],JE=pe({__name:"ForgotPassword",setup(e){const t=Ae(),n=tt(),r=V(t.getParameter("email")??""),o=V(null),s=V(!1);async function i(){o.value=null;try{await n.forgotPassword(r.value),Ht(1500).then(()=>{s.value=!0})}catch(a){throw a instanceof mr?o.value="User not found":o.value=a.message,a}}return(a,l)=>(g(),J(sr,{handler:i,class:"moonbase:sign-in","no-reset":""},{default:O(({disabled:u})=>[l[1]||(l[1]=H("p",null," Please enter your email address below. You will receive an email message with instructions on how to reset your password. ",-1)),w(Nt,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:"",disabled:u},null,8,["modelValue","disabled"]),w(ir,{success:"Email sent",label:"Reset password",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!o.value||void 0},j(o.value),9,XE)]),_:1}))}}),QE={key:0,class:"moonbase:password-validation"},e5=["data-visible"],t5=pe({__name:"ResetPassword",emits:["passwordReset"],setup(e,{emit:t}){const n=t,r=Ae(),o=tt(),s=se(()=>r.getParameter("email")),i=V(""),a=V(!1),l=V(null),u=se(()=>ts.some(d=>!d.test(i.value)));qe(()=>{(!r.getParameter("email")||!r.getParameter("code"))&&(l.value="Link broken, please try again")});async function c(){l.value=null;const d=r.getParameter("code");if(d)try{await o.resetPassword(s.value,i.value,d);const f=await o.signIn(s.value,i.value);Ht(1500).then(()=>n("passwordReset",f))}catch(f){throw l.value=f.message,f}}return(d,f)=>(g(),J(sr,{handler:c,disabled:u.value,class:"moonbase:reset-password"},{default:O(()=>[H("h3",null," Hi "+j(s.value)+", ",1),f[2]||(f[2]=H("p",null," Please create a new password for your account: ",-1)),w(Nt,{"model-value":b(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),w(Nt,{modelValue:i.value,"onUpdate:modelValue":f[0]||(f[0]=h=>i.value=h),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:f[1]||(f[1]=h=>a.value=!0)},null,8,["modelValue"]),a.value&&u.value?(g(),C("div",QE,[(g(!0),C($e,null,yt(b(ts).filter(h=>!h.test(i.value)),h=>(g(),J(Le,{key:h.title,"data-error":""},{default:O(()=>[M(j(h.title),1)]),_:2},1024))),128))])):fe("",!0),w(ir,{success:"Password saved",label:"Save password",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!l.value||void 0},j(l.value),9,e5)]),_:1},8,["disabled"]))}}),n5={class:"moonbase:checkbox"},r5={class:"moonbase:checkbox-container"},o5=["id","name","checked","disabled","aria-invalid","aria-describedby"],s5={class:"moonbase:checkbox-description"},i5=["for"],a5=["id"],l5=["id"],Wp=pe({inheritAttrs:!1,__name:"MoonCheckbox",props:{name:{},label:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,n)=>(g(),C("div",n5,[H("div",r5,[H("input",eu({id:`mb-${t.name}`,type:"checkbox",name:`mb-${t.name}`,checked:t.modelValue,disabled:t.disabled,"aria-invalid":!!t.error,"aria-describedby":t.error?`mb-${t.name}-error`:t.hint?`mb-${t.name}-hint`:void 0},t.$attrs,{onChange:n[0]||(n[0]=r=>{var o;return t.$emit("update:modelValue",(o=r.target)==null?void 0:o.checked)})}),null,16,o5)]),H("div",s5,[H("label",{for:`mb-${t.name}`},j(t.label),9,i5),t.error?(g(),C("p",{key:0,id:`mb-${t.name}-error`,"data-type":"error"},j(t.error),9,a5)):t.hint?(g(),C("p",{key:1,id:`mb-${t.name}-hint`},j(t.hint),9,l5)):fe("",!0)])]))}}),u5={key:0,class:"moonbase:password-validation"},c5=["href"],d5=["href"],f5=["data-visible"],h5=pe({__name:"SignUp",emits:["signedUp"],setup(e,{emit:t}){const n=t,r=Ae(),o=tt(),s=ye(rc),i=ye(Rr),a=V(""),l=V(r.getParameter("email")??""),u=V(""),c=V(!1),d=V(!1),f=V(null),h=se(()=>ts.some(_=>!_.test(u.value)));async function p(){f.value=null;try{const _=await o.signUp(a.value,l.value,u.value,null,!0,!0,d.value);i==null||i(qt.SignedUp,{user:_}),Ht(1500).then(()=>n("signedUp",_))}catch(_){throw f.value=_.message,_}}return(_,x)=>(g(),J(sr,{handler:p,disabled:h.value,class:"moonbase:sign-up"},{default:O(()=>[w(Nt,{modelValue:a.value,"onUpdate:modelValue":x[0]||(x[0]=N=>a.value=N),label:"Full name",name:"name",type:"text",placeholder:"Full name",autocomplete:"name",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":x[1]||(x[1]=N=>l.value=N),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),w(Nt,{modelValue:u.value,"onUpdate:modelValue":x[2]||(x[2]=N=>u.value=N),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:"",onBlur:x[3]||(x[3]=N=>c.value=!0)},null,8,["modelValue"]),c.value&&h.value?(g(),C("div",u5,[(g(!0),C($e,null,yt(b(ts).filter(N=>!N.test(u.value)),N=>(g(),J(Le,{key:N.title,"data-error":""},{default:O(()=>[M(j(N.title),1)]),_:2},1024))),128))])):fe("",!0),w(Wp,{modelValue:d.value,"onUpdate:modelValue":x[4]||(x[4]=N=>d.value=N),label:"Receive updates and offers by email",name:"newsletter-opt-in"},null,8,["modelValue"]),w(Le,null,{default:O(()=>[x[5]||(x[5]=M(" By signing up, you accept our ")),H("a",{href:`${b(s)}/terms-of-use`,target:"_blank",rel:"noopener"},"terms",8,c5),x[6]||(x[6]=M(" and ")),H("a",{href:`${b(s)}/privacy-policy`,target:"_blank",rel:"noopener"},"privacy policy",8,d5),x[7]||(x[7]=M(". "))]),_:1}),w(ir,{success:"Signed up",label:"Sign up",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!f.value||void 0},j(f.value),9,f5),w(at,{label:"I already have an account",variant:"subtle",handler:()=>b(r).show(b(le).Authentication,b(te).SignIn,{email:l.value})},null,8,["handler"])]),_:1},8,["disabled"]))}}),p5={class:"moonbase:authentication"},m5={key:0,class:"moonbase:loader"},b5=pe({__name:"Authentication",setup(e){const t=Ae(),{loaded:n}=tt();return(r,o)=>(g(),C("div",p5,[w(Gs,{name:b(t).direction===b(gu).Forward?"moonbase:slide-left":"moonbase:slide-right",mode:"out-in"},{default:O(()=>[b(n)?b(t).intent===b(te).SignIn?(g(),J(RE,{key:1,onSignedIn:o[0]||(o[0]=s=>b(t).dequeue())})):b(t).intent===b(te).SignUp?(g(),J(h5,{key:2,onSignedUp:o[1]||(o[1]=s=>b(t).next?b(t).dequeue():b(t).show(b(le).Customer,b(te).ViewAccount,void 0,!0))})):b(t).intent===b(te).ConfirmAccount?(g(),J(BE,{key:3,onConfirmedAccount:o[2]||(o[2]=s=>b(t).show(b(le).Customer,b(te).ViewAccount,void 0,!0))})):b(t).intent===b(te).ConfirmEmail?(g(),J(WE,{key:4})):b(t).intent===b(te).ConfirmEmailChange?(g(),J(KE,{key:5})):b(t).intent===b(te).ForgotPassword?(g(),J(JE,{key:6})):b(t).intent===b(te).ResetPassword?(g(),J(t5,{key:7,onPasswordReset:o[3]||(o[3]=s=>b(t).show(b(le).Customer,b(te).ViewAccount,void 0))})):fe("",!0):(g(),C("div",m5,[w(Qt)]))]),_:1},8,["name"])]))}}),g5={},v5={class:"moonbase:text-subtext-bold"};function y5(e,t){return g(),C("span",v5,[xt(e.$slots,"default")])}const Ct=er(g5,[["render",y5]]);function ec(){const e=ye(Gt);return e||console.warn("No storefront injectable"),{reportProblem:async(t,n)=>{try{await(e==null?void 0:e.client.api.fetch(`/api/customer/insights/${t}`,null,{method:"POST",body:{origin:window==null?void 0:window.location.href,...n}}))}catch{}}}}const _5=["data-corners","data-cards"],Zp=pe({__name:"Counter",props:{modelValue:{}},emits:["update:modelValue"],setup(e){const t=ye(Lt);return(n,r)=>{var o,s;return g(),C("div",{class:"moonbase:counter","data-corners":(o=b(t))==null?void 0:o.theme.corners,"data-cards":(s=b(t))==null?void 0:s.theme.cards},[H("button",{onClick:r[0]||(r[0]=i=>n.$emit("update:modelValue",n.modelValue-1))},[w(b(r_))]),w(Le,null,{default:O(()=>[M(j(n.modelValue.toString().padStart(2,"0")),1)]),_:1}),H("button",{onClick:r[1]||(r[1]=i=>n.$emit("update:modelValue",n.modelValue+1))},[w(b(o_))])],8,_5)}}});function tc(e){switch(e){case hr.Daily:return"day";case hr.Weekly:return"week";case hr.Monthly:return"month";case hr.Quarterly:return"quarter";case hr.Yearly:return"year"}throw new Error("Unknown cycle length")}const w5={class:"moonbase:bundle-cart-item-content"},E5={key:0,class:"moonbase:bundle-cart-item-total"},x5={key:0,class:"moonbase:discount"},k5={class:"moonbase:bundle-cart-item-summary"},O5=["data-open"],S5=["data-open"],N5={class:"moonbase:bundle-cart-item-product-list-item-content"},C5={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},T5=pe({__name:"BundleCartItem",props:{lineItem:{},currency:{}},setup(e){const n=ba(e.lineItem.bundleId),r=Cr(),o=V(!1),s=V(null);return et(o,i=>{s.value&&(s.value.style.height=i?`${s.value.scrollHeight}px`:"0px")}),(i,a)=>(g(),J(En,{class:"moonbase:bundle-cart-item"},{addon:O(()=>{var l;return[H("div",k5,[i.lineItem.bundle?(g(),C("button",{key:0,onClick:a[1]||(a[1]=u=>o.value=!o.value)},[w(Ct,null,{default:O(()=>{var u,c,d;return[M(j((u=i.lineItem.bundle)==null?void 0:u.products.filter(f=>f.included).length)+" ",1),(c=i.lineItem.bundle)!=null&&c.products.some(f=>!f.included)?(g(),C($e,{key:0},[M(" of "+j((d=i.lineItem.bundle)==null?void 0:d.products.length),1)],64)):fe("",!0),a[2]||(a[2]=M(" products "))]}),_:1}),w(Le,null,{default:O(()=>[M(j(o.value?"Hide":"Show")+" ",1),(g(),C("svg",{"data-open":o.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},a[3]||(a[3]=[H("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,O5))]),_:1})])):fe("",!0)]),H("div",{ref_key:"productListRef",ref:s,class:"moonbase:bundle-cart-item-product-list",style:{height:"0px"},"data-open":o.value||void 0},[(g(!0),C($e,null,yt(((l=i.lineItem.bundle)==null?void 0:l.products)||[],u=>(g(),C("div",{key:u.id,class:"moonbase:bundle-cart-item-product-list-item"},[w(en,{url:u==null?void 0:u.iconUrl,size:48},null,8,["url"]),H("div",N5,[w(Ct,{"data-included":u.included||void 0},{default:O(()=>[u.included?(g(),C("svg",C5,a[4]||(a[4]=[H("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):fe("",!0),M(" "+j(u==null?void 0:u.name),1)]),_:2},1032,["data-included"]),u.included?u!=null&&u.tagline?(g(),J(Le,{key:1},{default:O(()=>[M(j(u.tagline),1)]),_:2},1024)):fe("",!0):(g(),J(Le,{key:0},{default:O(()=>a[5]||(a[5]=[M(" You already own this ")])),_:1}))])]))),128))],8,S5)]}),default:O(()=>{var l,u,c,d,f;return[w(en,{url:(l=i.lineItem.bundle)==null?void 0:l.iconUrl,size:72},null,8,["url"]),H("div",w5,[w(Ct,null,{default:O(()=>{var h;return[M(j((h=i.lineItem.bundle)==null?void 0:h.name),1)]}),_:1}),w(Le,{class:"moonbase:bundle-cart-item-tagline","data-truncate":i.lineItem.variation&&i.lineItem.variation.id!==((c=(u=b(n))==null?void 0:u.defaultVariation)==null?void 0:c.id)||void 0},{default:O(()=>{var h;return[M(j((h=i.lineItem.bundle)==null?void 0:h.tagline),1)]}),_:1},8,["data-truncate"]),i.lineItem.variation&&i.lineItem.variation.id!==((f=(d=b(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)?(g(),J(Le,{key:0,class:"moonbase:bundle-cart-item-variation"},{default:O(()=>[M(j(i.lineItem.variation.name),1)]),_:1})):fe("",!0)]),i.lineItem.variation?(g(),C("div",E5,[w(ui,null,{default:O(()=>{var h;return[i.lineItem.variation.hasDiscount?(g(),C("span",x5,j(b(Jt)(i.lineItem.variation.originalPrice[i.currency]*i.lineItem.quantity,i.currency)),1)):fe("",!0),M(" "+j(b(Jt)(i.lineItem.variation.price[i.currency]*i.lineItem.quantity,i.currency))+" ",1),((h=i.lineItem.variation)==null?void 0:h.recurrence.type)==="Recurring"?(g(),J(rt,{key:1},{default:O(()=>[M(" / "+j(b(tc)(i.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):fe("",!0)]}),_:1}),w(Zp,{"model-value":i.lineItem.quantity,"onUpdate:modelValue":a[0]||(a[0]=h=>b(r).setQuantity(i.lineItem,h))},null,8,["model-value"])])):fe("",!0)]}),_:1}))}}),P5={class:"moonbase:product-cart-item-content"},$5={class:"moonbase:product-cart-item-total"},A5={key:0,class:"moonbase:discount"},D5=pe({__name:"ProductCartItem",props:{lineItem:{},currency:{}},setup(e){const t=e,n=Js(t.lineItem.productId);function r(a){var u;if(!a.variation)throw new Error("No variation found");const l=s(a);return(l==null?void 0:l.price[t.currency])??((u=a.variation)==null?void 0:u.price[t.currency])}function o(a){return!!s(a)}function s(a){var u,c;const l=((c=(u=a.variation)==null?void 0:u.pricingTiers)==null?void 0:c.filter(d=>a.quantity>=d.minQuantity))??[];return l.length>0?l[l.length-1]:null}const i=Cr();return(a,l)=>(g(),J(En,{class:"moonbase:product-cart-item"},{default:O(()=>{var u,c,d,f,h;return[w(en,{url:(u=a.lineItem.product)==null?void 0:u.iconUrl,size:72},null,8,["url"]),H("div",P5,[w(Ct,null,{default:O(()=>{var p;return[M(j((p=a.lineItem.product)==null?void 0:p.name),1)]}),_:1}),w(Le,{class:"moonbase:product-cart-item-tagline","data-truncate":a.lineItem.variation&&a.lineItem.variation.id!==((d=(c=b(n))==null?void 0:c.defaultVariation)==null?void 0:d.id)||void 0},{default:O(()=>{var p;return[M(j((p=a.lineItem.product)==null?void 0:p.tagline),1)]}),_:1},8,["data-truncate"]),a.lineItem.variation&&a.lineItem.variation.id!==((h=(f=b(n))==null?void 0:f.defaultVariation)==null?void 0:h.id)?(g(),J(Le,{key:0,class:"moonbase:product-cart-item-variation"},{default:O(()=>[M(j(a.lineItem.variation.name),1)]),_:1})):fe("",!0)]),H("div",$5,[a.lineItem.variation?(g(),J(ui,{key:0},{default:O(()=>{var p;return[a.lineItem.variation.hasDiscount||o(a.lineItem)?(g(),C("span",A5,j(b(Jt)(a.lineItem.variation.originalPrice[a.currency]*a.lineItem.quantity,a.currency)),1)):fe("",!0),M(" "+j(b(Jt)(r(a.lineItem)*a.lineItem.quantity,a.currency))+" ",1),((p=a.lineItem.variation)==null?void 0:p.recurrence.type)==="Recurring"?(g(),J(rt,{key:1},{default:O(()=>[M(" / "+j(b(tc)(a.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):fe("",!0)]}),_:1})):fe("",!0),w(Zp,{"model-value":a.lineItem.quantity,"onUpdate:modelValue":l[0]||(l[0]=p=>b(i).setQuantity(a.lineItem,p))},null,8,["model-value"])])]}),_:1}))}}),I5={class:"moonbase:cart"},M5=["data-background"],V5=["data-corners"],R5={class:"moonbase:cart-total"},L5={"data-error":""},j5=pe({__name:"Cart",setup(e){const t=ec(),{items:n,total:r,currency:o,checkout:s}=Cr(),i=ye(Lt),a=V(null);async function l(){a.value=null;try{const u=await s({redirect:(i==null?void 0:i.value.checkout.redirect)??!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(!(u!=null&&u.completed))throw new ja}catch(u){if(a.value=u.message,!(u instanceof ja))if(u instanceof Nn)t.reportProblem("error",{type:u.name,title:u.title,detail:u.detail,status:u.status,errors:u.errors?Object.fromEntries(Object.entries(u.errors).map(([c,d])=>[c,[d]])):void 0,instance:"Cart.vue:startCheckout"});else{const c=u;t.reportProblem("error",{type:c.name,title:c.message,instance:"Cart.vue:startCheckout"})}throw u}}return(u,c)=>{var d,f;return g(),C("div",I5,[b(n).length>0?(g(),C("ul",{key:0,role:"list",class:"moonbase:cart-items","data-background":(d=b(i))==null?void 0:d.theme.colors.background},[(g(!0),C($e,null,yt(b(n),h=>(g(),C("li",{key:h.id},[h.type==="Product"?(g(),J(D5,{key:0,"line-item":h,currency:b(o)},null,8,["line-item","currency"])):h.type==="Bundle"?(g(),J(T5,{key:1,"line-item":h,currency:b(o)},null,8,["line-item","currency"])):fe("",!0)]))),128))],8,M5)):(g(),C("div",{key:1,class:"moonbase:cart-empty","data-corners":(f=b(i))==null?void 0:f.theme.corners},[w(b(s_)),w(Ct,null,{default:O(()=>c[0]||(c[0]=[M(" Your cart is empty ")])),_:1})],8,V5)),H("div",R5,[c[1]||(c[1]=H("label",null," Total ",-1)),H("span",null,j(b(Jt)(b(r).amount,b(r).currency)),1),c[2]||(c[2]=H("p",null," Sales tax to be calculated at checkout ",-1)),H("p",L5,j(a.value),1)]),w(at,{handler:l,disabled:b(n).length===0,label:"Checkout",error:a.value?"Error":"Cancelled",variant:"primary"},null,8,["disabled","error"])])}}}),F5={class:"moonbase:account"},U5={key:0,class:"moonbase:error"},B5={key:1,class:"moonbase:notification"},H5={key:0,class:"moonbase:error"},q5=pe({__name:"Account",setup(e){var q,z,B;const t=Ae(),{user:n,update:r,setPassword:o,signOut:s}=tt(),i=ye(Rr),a=V(((q=n.value)==null?void 0:q.name)??""),l=V(((z=n.value)==null?void 0:z.email)??""),u=V(((B=n.value)==null?void 0:B.communicationPreferences)??{newsletterOptIn:!1}),c=V(null),d=V(!1),f=V(""),h=V(""),p=V(null);async function _(){c.value=null,d.value=!1;try{(await r(a.value,l.value,void 0,u.value)).needsEmailConfirmationToken&&(d.value=!0)}catch(L){throw c.value=L,L}}async function x(){p.value=null;try{await o(f.value,h.value),f.value="",h.value=""}catch(L){throw p.value=L,L}}async function N(){const L={...n.value};await s(),i==null||i(qt.SignedOut,{user:L}),t.reset()}return(L,D)=>(g(),C("div",F5,[w(sr,{handler:_},{default:O(()=>[w(Nt,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=m=>a.value=m),label:"Full name",name:"name",autocomplete:"name",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":D[1]||(D[1]=m=>l.value=m),label:"Email address",name:"email",type:"email",autocomplete:"email",required:""},null,8,["modelValue"]),w(Wp,{modelValue:u.value.newsletterOptIn,"onUpdate:modelValue":D[2]||(D[2]=m=>u.value.newsletterOptIn=m),label:"Newsletter subscription",name:"newsletter-opt-in",hint:"Receive updates and offers by email"},null,8,["modelValue"]),w(ir,{label:"Update",error:"Error",success:"Updated"}),c.value?(g(),C("p",U5,j(c.value.message),1)):d.value?(g(),C("p",B5," You need to confirm your new email address, please check your inbox ")):fe("",!0)]),_:1}),w(sr,{handler:x},{default:O(()=>[w(Nt,{modelValue:f.value,"onUpdate:modelValue":D[3]||(D[3]=m=>f.value=m),label:"Current password",name:"old-password",type:"password",autocomplete:"current-password",required:""},null,8,["modelValue"]),w(Nt,{modelValue:h.value,"onUpdate:modelValue":D[4]||(D[4]=m=>h.value=m),label:"New password",name:"new-password",type:"password",autocomplete:"new-password",required:""},null,8,["modelValue"]),w(ir,{label:"Change password",error:"Error",success:"Password changed"}),p.value?(g(),C("p",H5,j(p.value.message),1)):fe("",!0)]),_:1}),w(at,{label:"Log out",success:"Logged out",error:"Error",variant:"subtle",handler:N})]))}}),z5={class:"moonbase:products"},W5={key:0,class:"moonbase:loader"},Z5={key:1,class:"moonbase:loader"},Y5={class:"moonbase:products-item-content"},G5=pe({__name:"Products",setup(e){const t=Ae(),{getProducts:n}=so(),r=V(null);return qe(async()=>{let o=await n();for(r.value=o.items;o.hasMore&&o.next;)o=await n(o.next),r.value.push(...o.items)}),(o,s)=>(g(),C("div",z5,[r.value?r.value.length===0?(g(),C("div",Z5," No products found ")):fe("",!0):(g(),C("div",W5,[w(Qt),s[0]||(s[0]=M(" Loading products.. "))])),(g(!0),C($e,null,yt(r.value||[],i=>(g(),C("div",{key:i.id,class:"moonbase:products-item"},[w(en,{url:i.iconUrl,size:48},null,8,["url"]),H("div",Y5,[w(Ct,null,{default:O(()=>[M(j(i.name),1)]),_:2},1024),i.numberOfLicenses||i.subscriptionLicenses?(g(),J(Le,{key:0},{default:O(()=>[M(j((i.numberOfLicenses??0)+(i.subscriptionLicenses??0))+" licenses ",1)]),_:2},1024)):fe("",!0)]),H("div",null,[w(qo,{variant:"subtle",onClick:a=>b(t).show(b(le).Product,b(te).ViewProduct,{product_id:i.id})},{default:O(()=>[w(b(Qh)),s[1]||(s[1]=H("span",{class:"moonbase:clickable"},null,-1))]),_:2},1032,["onClick"])])]))),128))]))}}),K5={class:"moonbase:bundle-redemption-item-content"},X5={class:"moonbase:bundle-redemption-item-summary"},J5=["data-open"],Q5=["data-open"],Yp=pe({__name:"BundleRedemptionItem",props:{bundle:{},quantity:{}},setup(e){const t=V(!1),n=V(null);return et(t,r=>{n.value&&(n.value.style.height=r?`${n.value.scrollHeight}px`:"0px")}),(r,o)=>(g(),J(En,{class:"moonbase:bundle-redemption-item"},{addon:O(()=>{var s;return[H("div",X5,[r.bundle?(g(),C("button",{key:0,onClick:o[0]||(o[0]=i=>t.value=!t.value)},[w(Ct,null,{default:O(()=>{var i;return[M(j((i=r.bundle)==null?void 0:i.products.length)+" products ",1)]}),_:1}),w(Le,null,{default:O(()=>[M(j(t.value?"Hide":"Show")+" ",1),(g(),C("svg",{"data-open":t.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},o[1]||(o[1]=[H("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,J5))]),_:1})])):fe("",!0)]),H("div",{ref_key:"productListRef",ref:n,class:"moonbase:bundle-redemption-item-product-list",style:{height:"0px"},"data-open":t.value||void 0},[(g(!0),C($e,null,yt(((s=r.bundle)==null?void 0:s.products)||[],i=>(g(),C("div",{key:i.id},[w(en,{url:i.iconUrl,size:48},null,8,["url"]),H("div",null,[w(Ct,null,{default:O(()=>[M(j(i.name),1)]),_:2},1024),i.tagline?(g(),J(Le,{key:0},{default:O(()=>[M(j(i.tagline),1)]),_:2},1024)):fe("",!0)])]))),128))],8,Q5)]}),default:O(()=>[w(en,{url:r.bundle.iconUrl,size:72},null,8,["url"]),H("div",K5,[w(Ct,null,{default:O(()=>{var s;return[M(j((s=r.bundle)==null?void 0:s.name),1)]}),_:1}),w(Le,{class:"moonbase:bundle-redemption-item-tagline"},{default:O(()=>{var s;return[M(j((s=r.bundle)==null?void 0:s.tagline),1)]}),_:1})])]),_:1}))}}),ex={class:"moonbase:product-redemption-item-content"},Gp=pe({__name:"ProductRedemptionItem",props:{product:{},quantity:{}},setup(e){return(t,n)=>(g(),J(En,{class:"moonbase:product-redemption-item"},{default:O(()=>[w(en,{url:t.product.iconUrl,size:72},null,8,["url"]),H("div",ex,[w(Ct,null,{default:O(()=>{var r;return[M(j((r=t.product)==null?void 0:r.name),1)]}),_:1}),w(Le,{class:"moonbase:product-redemption-item-tagline"},{default:O(()=>{var r;return[M(j((r=t.product)==null?void 0:r.tagline),1)]}),_:1})])]),_:1}))}}),tx={class:"moonbase:redeem"},nx=["data-visible"],rx={key:1,class:"moonbase:redeem-voucher"},ox={key:0,class:"moonbase:redeem-voucher-content"},sx={key:1,class:"moonbase:redeem-voucher-return"},ix=pe({__name:"Redeem",setup(e){const{redeem:t}=lh(),n=Ae(),r=tt(),o=ye(Rr),s=V(null),i=V(null),a=V(n.getParameter("code")||"");async function l(){i.value=null;try{const u=await t(a.value);s.value=u,o==null||o(qt.RedeemedVoucher,{voucher:u,user:r.user.value})}catch(u){throw i.value=u,u}}return(u,c)=>(g(),C("div",tx,[w(Gs,{mode:"out-in",name:"moonbase:slide-left"},{default:O(()=>[s.value?(g(),C("div",rx,[H("div",null,[w(es,null,{default:O(()=>[M(j(s.value.name),1)]),_:1}),s.value.description?(g(),J(nt,{key:0},{default:O(()=>[M(' "'+j(s.value.description)+'" ',1)]),_:1})):fe("",!0),w(Le,null,{default:O(()=>[w(b(K1)),c[2]||(c[2]=M(" Licenses have been added to your account. "))]),_:1}),w(Le,null,{default:O(()=>[c[3]||(c[3]=M(" Code: ")),H("strong",null,j(s.value.code),1)]),_:1})]),w(nt,null,{default:O(()=>c[4]||(c[4]=[M(" Voucher summary ")])),_:1}),s.value.redeemsProducts.length>0||s.value.redeemsBundles.length>0?(g(),C("div",ox,[(g(!0),C($e,null,yt(s.value.redeemsProducts,({value:d,quantity:f})=>(g(),J(Gp,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(g(!0),C($e,null,yt(s.value.redeemsBundles,({value:d,quantity:f})=>(g(),J(Yp,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):fe("",!0),b(n).next&&b(n).next[0]===b(le).Activation&&(s.value.redeemsProducts.some(d=>{var f,h;return d.value.id===((h=(f=b(n).next)==null?void 0:f[2])==null?void 0:h.product_id)})||s.value.redeemsBundles.some(d=>d.value.products.some(f=>{var h,p;return f.id===((p=(h=b(n).next)==null?void 0:h[2])==null?void 0:p.product_id)})))?(g(),C("div",sx,[w(at,{label:"Return to activation",variant:"primary",icon:b(G1),handler:()=>b(n).dequeue()},null,8,["icon","handler"])])):fe("",!0)])):(g(),J(sr,{key:0,handler:l},{default:O(()=>{var d;return[w(rt,null,{default:O(()=>c[1]||(c[1]=[M(" Do you have a voucher you want to redeem? "),H("br",null,null,-1),M(" Please enter the code below: ")])),_:1}),w(Nt,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=f=>a.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),w(ir,{label:"Redeem voucher",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!i.value||void 0},j((d=i.value)==null?void 0:d.message),9,nx)]}),_:1}))]),_:1})]))}}),Kp=6048e5,ax=864e5,Fa=43200,Xp=1440,Jp=Symbol.for("constructDateFrom");function ar(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Jp in e?e[Jp](t):e instanceof Date?new e.constructor(t):new Date(t)}function vt(e,t){return ar(t||e,e)}let lx={};function di(){return lx}function fi(e,t){var a,l,u,c;const n=di(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=vt(e,t==null?void 0:t.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Ua(e,t){return fi(e,{...t,weekStartsOn:1})}function Qp(e,t){const n=vt(e,t==null?void 0:t.in),r=n.getFullYear(),o=ar(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Ua(o),i=ar(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Ua(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Ba(e){const t=vt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ha(e,...t){const n=ar.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function em(e,t){const n=vt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function ux(e,t,n){const[r,o]=Ha(n==null?void 0:n.in,e,t),s=em(r),i=em(o),a=+s-Ba(s),l=+i-Ba(i);return Math.round((a-l)/ax)}function cx(e,t){const n=Qp(e,t),r=ar(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ua(r)}function qa(e,t){const n=+vt(e)-+vt(t);return n<0?-1:n>0?1:n}function dx(e){return ar(e,Date.now())}function fx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function hx(e){return!(!fx(e)&&typeof e!="number"||isNaN(+vt(e)))}function px(e,t,n){const[r,o]=Ha(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function mx(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function bx(e,t){return+vt(e)-+vt(t)}function gx(e,t){const n=vt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function vx(e,t){const n=vt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function yx(e,t){const n=vt(e,t==null?void 0:t.in);return+gx(n,t)==+vx(n,t)}function _x(e,t,n){const[r,o,s]=Ha(n==null?void 0:n.in,e,e,t),i=qa(o,s),a=Math.abs(px(o,s));if(a<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-i*a);let l=qa(o,s)===-i;yx(r)&&a===1&&qa(r,s)===1&&(l=!1);const u=i*(a-+l);return u===0?0:u}function wx(e,t,n){const r=bx(e,t)/1e3;return mx(n==null?void 0:n.roundingMethod)(r)}function Ex(e,t){const n=vt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const xx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},kx=(e,t,n)=>{let r;const o=xx[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function nc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Ox={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Nx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cx={date:nc({formats:Ox,defaultWidth:"full"}),time:nc({formats:Sx,defaultWidth:"full"}),dateTime:nc({formats:Nx,defaultWidth:"full"})},Tx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Px=(e,t,n,r)=>Tx[e];function hi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const $x={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ax={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Dx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ix={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Mx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Vx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Rx={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:hi({values:$x,defaultWidth:"wide"}),quarter:hi({values:Ax,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hi({values:Dx,defaultWidth:"wide"}),day:hi({values:Ix,defaultWidth:"wide"}),dayPeriod:hi({values:Mx,defaultWidth:"wide",formattingValues:Vx,defaultFormattingWidth:"wide"})};function pi(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?jx(a,d=>d.test(i)):Lx(a,d=>d.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(i.length);return{value:u,rest:c}}}function Lx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function jx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Fx(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const Ux=/^(\d+)(th|st|nd|rd)?/i,Bx=/\d+/i,Hx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},qx={any:[/^b/i,/^(a|c)/i]},zx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wx={any:[/1/i,/2/i,/3/i,/4/i]},Zx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Yx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Gx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Kx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Jx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Qx={ordinalNumber:Fx({matchPattern:Ux,parsePattern:Bx,valueCallback:e=>parseInt(e,10)}),era:pi({matchPatterns:Hx,defaultMatchWidth:"wide",parsePatterns:qx,defaultParseWidth:"any"}),quarter:pi({matchPatterns:zx,defaultMatchWidth:"wide",parsePatterns:Wx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:pi({matchPatterns:Zx,defaultMatchWidth:"wide",parsePatterns:Yx,defaultParseWidth:"any"}),day:pi({matchPatterns:Gx,defaultMatchWidth:"wide",parsePatterns:Kx,defaultParseWidth:"any"}),dayPeriod:pi({matchPatterns:Xx,defaultMatchWidth:"any",parsePatterns:Jx,defaultParseWidth:"any"})},tm={code:"en-US",formatDistance:kx,formatLong:Cx,formatRelative:Px,localize:Rx,match:Qx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ek(e,t){const n=vt(e,t==null?void 0:t.in);return ux(n,Ex(n))+1}function tk(e,t){const n=vt(e,t==null?void 0:t.in),r=+Ua(n)-+cx(n);return Math.round(r/Kp)+1}function nm(e,t){var c,d,f,h;const n=vt(e,t==null?void 0:t.in),r=n.getFullYear(),o=di(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=ar((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=fi(i,t),l=ar((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=fi(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function nk(e,t){var a,l,u,c;const n=di(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=nm(e,t),s=ar((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),fi(s,t)}function rk(e,t){const n=vt(e,t==null?void 0:t.in),r=+fi(n,t)-+nk(n,t);return Math.round(r/Kp)+1}function Ge(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Mr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ge(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ge(n+1,2)},d(e,t){return Ge(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ge(e.getHours()%12||12,t.length)},H(e,t){return Ge(e.getHours(),t.length)},m(e,t){return Ge(e.getMinutes(),t.length)},s(e,t){return Ge(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Ge(o,t.length)}},ns={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},rm={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Mr.y(e,t)},Y:function(e,t,n,r){const o=nm(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return Ge(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ge(s,t.length)},R:function(e,t){const n=Qp(e);return Ge(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ge(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ge(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ge(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Mr.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ge(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=rk(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Ge(o,t.length)},I:function(e,t,n){const r=tk(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ge(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Mr.d(e,t)},D:function(e,t,n){const r=ek(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ge(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ge(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ge(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Ge(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=ns.noon:r===0?o=ns.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=ns.evening:r>=12?o=ns.afternoon:r>=4?o=ns.morning:o=ns.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Mr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Mr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Mr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Mr.s(e,t)},S:function(e,t){return Mr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return sm(r);case"XXXX":case"XX":return mo(r);case"XXXXX":case"XXX":default:return mo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return sm(r);case"xxxx":case"xx":return mo(r);case"xxxxx":case"xxx":default:return mo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+om(r,":");case"OOOO":default:return"GMT"+mo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+om(r,":");case"zzzz":default:return"GMT"+mo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ge(r,t.length)},T:function(e,t,n){return Ge(+e,t.length)}};function om(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+Ge(s,2)}function sm(e,t){return e%60===0?(e>0?"-":"+")+Ge(Math.abs(e)/60,2):mo(e,t)}function mo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ge(Math.trunc(r/60),2),s=Ge(r%60,2);return n+o+t+s}const im=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},am=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ok={p:am,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return im(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",im(r,t)).replace("{{time}}",am(o,t))}},sk=/^D+$/,ik=/^Y+$/,ak=["D","DD","YY","YYYY"];function lk(e){return sk.test(e)}function uk(e){return ik.test(e)}function ck(e,t,n){const r=dk(e,t,n);if(console.warn(r),ak.includes(e))throw new RangeError(r)}function dk(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const fk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,hk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pk=/^'([^]*?)'?$/,mk=/''/g,bk=/[a-zA-Z]/;function gk(e,t,n){var c,d,f,h;const r=di(),o=r.locale??tm,s=r.firstWeekContainsDate??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=vt(e,n==null?void 0:n.in);if(!hx(a))throw new RangeError("Invalid time value");let l=t.match(hk).map(p=>{const _=p[0];if(_==="p"||_==="P"){const x=ok[_];return x(p,o.formatLong)}return p}).join("").match(fk).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const _=p[0];if(_==="'")return{isToken:!1,value:vk(p)};if(rm[_])return{isToken:!0,value:p};if(_.match(bk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:p}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return l.map(p=>{if(!p.isToken)return p.value;const _=p.value;(uk(_)||lk(_))&&ck(_,t,String(e));const x=rm[_[0]];return x(a,_,o.localize,u)}).join("")}function vk(e){const t=e.match(pk);return t?t[1].replace(mk,"'"):e}function yk(e,t,n){const r=di(),o=(n==null?void 0:n.locale)??r.locale??tm,s=2520,i=qa(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i}),[l,u]=Ha(n==null?void 0:n.in,...i>0?[t,e]:[e,t]),c=wx(u,l),d=(Ba(u)-Ba(l))/1e3,f=Math.round((c-d)/60);let h;if(f<2)return n!=null&&n.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,a):c<10?o.formatDistance("lessThanXSeconds",10,a):c<20?o.formatDistance("lessThanXSeconds",20,a):c<40?o.formatDistance("halfAMinute",0,a):c<60?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",1,a):f===0?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",f,a);if(f<45)return o.formatDistance("xMinutes",f,a);if(f<90)return o.formatDistance("aboutXHours",1,a);if(f<Xp){const p=Math.round(f/60);return o.formatDistance("aboutXHours",p,a)}else{if(f<s)return o.formatDistance("xDays",1,a);if(f<Fa){const p=Math.round(f/Xp);return o.formatDistance("xDays",p,a)}else if(f<Fa*2)return h=Math.round(f/Fa),o.formatDistance("aboutXMonths",h,a)}if(h=_x(u,l),h<12){const p=Math.round(f/Fa);return o.formatDistance("xMonths",p,a)}else{const p=h%12,_=Math.trunc(h/12);return p<3?o.formatDistance("aboutXYears",_,a):p<9?o.formatDistance("overXYears",_,a):o.formatDistance("almostXYears",_+1,a)}}function _k(e,t){return yk(e,dx(e),t)}function wk(e){return _k(e,{addSuffix:!0})}function mi(e,t){return gk(e,t||"PPP")}const Ek={class:"moonbase:subscriptions"},xk={key:0,class:"moonbase:loader"},kk={key:1,class:"moonbase:loader"},Ok=["data-subscription-status"],Sk={class:"moonbase:subscriptions-item-content"},Nk={class:"moonbase:subscriptions-item-content"},Ck=pe({__name:"Subscriptions",setup(e){const t=Ae(),{getSubscriptions:n}=so(),r=V(new Date),o=V(null);return qe(async()=>{let s=await n();for(o.value=s.items;s.hasMore&&s.next;)s=await n(s.next),o.value.push(...s.items)}),(s,i)=>(g(),C("div",Ek,[o.value?o.value.length===0?(g(),C("div",kk," No subscriptions found ")):fe("",!0):(g(),C("div",xk,[w(Qt),i[0]||(i[0]=M(" Loading subscriptions.. "))])),(g(!0),C($e,null,yt(o.value||[],a=>(g(),C("div",{key:a.id,"data-subscription-status":a.status,class:"moonbase:subscriptions-item"},[a.content.type==="Product"?(g(),C($e,{key:0},[w(en,{url:a.content.product.iconUrl,size:48},null,8,["url"]),H("div",Sk,[w(Ct,null,{default:O(()=>[M(j(a.content.quantity)+" x "+j(a.content.product.name),1)]),_:2},1024),w(Le,null,{default:O(()=>[M(j(a.status===b(br).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+j(b(mi)(a.expiresAt)),1)]),_:2},1024)])],64)):(g(),C($e,{key:1},[w(en,{url:a.content.bundle.iconUrl,size:48},null,8,["url"]),H("div",Nk,[w(Ct,null,{default:O(()=>[M(j(a.content.quantity)+" x "+j(a.content.bundle.name),1)]),_:2},1024),w(Le,null,{default:O(()=>[M(j(a.status===b(br).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+j(b(mi)(a.expiresAt)),1)]),_:2},1024)])],64)),H("div",null,[w(qo,{variant:"subtle",onClick:l=>b(t).show(b(le).Subscription,b(te).ManageSubscription,{subscription_id:a.id})},{default:O(()=>[w(b(Qh)),i[1]||(i[1]=H("span",{class:"moonbase:clickable"},null,-1))]),_:2},1032,["onClick"])])],8,Ok))),128))]))}}),Tk={class:"moonbase:customer"},Pk=pe({__name:"Customer",setup(e){const t=Ae(),{user:n}=tt(),r=ye(Lt),o=se(()=>[{intent:te.ViewProducts,title:"Products",content:G5},{intent:te.ViewSubscriptions,title:"Subscriptions",content:Ck,predicate:()=>{var a;return((a=n.value)==null?void 0:a.hasSubscriptions)??!1}},{intent:te.ViewAccount,title:"Account",content:q5},{intent:te.RedeemVoucher,title:"Redeem",content:ix}].filter(a=>a.predicate===void 0||a.predicate())),s=se(()=>o.value.findIndex(a=>a.intent===t.intent));function i(a){t.intent=o.value[a].intent}return(a,l)=>(g(),C("div",Tk,[w(b(M1),{"selected-index":s.value,onChange:i},{default:O(()=>{var u,c;return[w(b(V1),{"data-corners":(u=b(r))==null?void 0:u.theme.corners,"data-background":(c=b(r))==null?void 0:c.theme.colors.background},{default:O(()=>[(g(!0),C($e,null,yt(o.value,d=>(g(),J(b(R1),{key:d.intent},{default:O(()=>[M(j(d.title),1)]),_:2},1024))),128))]),_:1},8,["data-corners","data-background"]),w(b(L1),null,{default:O(()=>[(g(!0),C($e,null,yt(o.value,d=>(g(),J(b(j1),{key:d.intent},{default:O(()=>[(g(),J(Fl(d.content)))]),_:2},1024))),128))]),_:1})]}),_:1},8,["selected-index"])]))}}),$k={class:"moonbase:product-card-content"},Ak=["data-open"],Dk=pe({__name:"ProductCard",props:{product:{}},setup(e){const t=V(!1),n=V(null),r=se(()=>n.value&&n.value.$el&&n.value.$el.scrollHeight>n.value.$el.clientHeight);return(o,s)=>(g(),J(En,{class:"moonbase:product-card"},{addon:O(()=>[H("div",{class:"moonbase:product-card-description","data-open":t.value||void 0},[w(Le,{ref_key:"descriptionRef",ref:n},{default:O(()=>[M(j(o.product.description),1)]),_:1},512),!t.value&&r.value?(g(),C("button",{key:0,onClick:s[0]||(s[0]=i=>t.value=!0)},[w(Ct,null,{default:O(()=>s[1]||(s[1]=[M(" read more ")])),_:1})])):fe("",!0)],8,Ak)]),default:O(()=>[w(en,{url:o.product.iconUrl,size:72},null,8,["url"]),H("div",$k,[w(es,null,{default:O(()=>{var i;return[M(j((i=o.product)==null?void 0:i.name),1)]}),_:1}),w(Le,{class:"moonbase:product-card-tagline"},{default:O(()=>{var i;return[M(j((i=o.product)==null?void 0:i.tagline),1)]}),_:1})])]),_:1}))}});function Ik(e){const t=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e<1)return`${e} B`;const n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);e=Number(e/1024**n);const r=t[n];return e>=10||e%1===0?`${e.toFixed(0)} ${r}`:`${e.toFixed(1)} ${r}`}const Mk={class:"moonbase:product-downloads"},Vk=["data-open"],Rk={key:1,class:"moonbase:product-downloads-content"},Lk={key:2,class:"moonbase:product-downloads-content"},jk={key:3,class:"moonbase:product-downloads-content"},Fk={key:4,class:"moonbase:product-downloads-content"},Uk={class:"moonbase:product-downloads-list"},Bk={class:"moonbase:product-downloads-download-actions"},Hk=pe({__name:"ProductDownloads",props:{product:{}},setup(e){const t=e,n=Ae(),r=tt(),o=ec(),s=ye(Rr),{downloadProduct:i}=so(),a=V(!1),l=V(null),u=se(()=>l.value&&l.value.$el&&l.value.$el.scrollHeight>l.value.$el.clientHeight);function c(){n.enqueue(le.Product,te.DownloadProduct,n.parameters??void 0),n.show(le.Authentication,te.SignIn)}const d=[Sn.Windows,Sn.Mac,Sn.Linux,Sn.Universal];function f(){var q;const N=(((q=navigator.userAgentData)==null?void 0:q.platform)??navigator.platform??"Unknown").toLowerCase();return/mac/.test(N)?Sn.Mac:/win/.test(N)?Sn.Windows:/linux/.test(N)?Sn.Linux:Sn.Universal}const h=f(),p=[h,...d.filter(N=>N!==h)],_=se(()=>p.flatMap(N=>[...(t.product.downloads??[]).filter(q=>q.platform===N)]));async function x(N){try{await i(N),s==null||s(qt.DownloadedProduct,{product:t.product,download:N,user:r.user.value})}catch(q){if(q instanceof Nn)o.reportProblem("error",{type:q.name,title:q.title,detail:q.detail,status:q.status,errors:q.errors?Object.fromEntries(Object.entries(q.errors).map(([z,B])=>[z,[B]])):void 0,instance:"ProductDownloads.vue:startDownload"});else{const z=q;o.reportProblem("error",{type:z.name,title:z.message,instance:"ProductDownloads.vue:startDownload"})}throw q}}return(N,q)=>(g(),C("div",Mk,[w(nt,null,{default:O(()=>[q[1]||(q[1]=M(" Downloads ")),w(Le,null,{default:O(()=>[M(" Version "+j(N.product.version),1)]),_:1})]),_:1}),N.product.releaseDescription?(g(),C("div",{key:0,class:"moonbase:product-downloads-description","data-open":a.value||void 0},[w(Le,{ref_key:"descriptionRef",ref:l},{default:O(()=>[M(j(N.product.releaseDescription),1)]),_:1},512),!a.value&&u.value?(g(),C("button",{key:0,onClick:q[0]||(q[0]=z=>a.value=!0)},[w(Ct,null,{default:O(()=>q[2]||(q[2]=[M(" read more ")])),_:1})])):fe("",!0)],8,Vk)):fe("",!0),N.product.downloadsNeedsUser&&N.product.downloadsNeedsOwnership&&!N.product.numberOfLicenses&&!N.product.subscriptionLicenses?(g(),C("div",Rk,[w(rt,{"data-center":""},{default:O(()=>q[3]||(q[3]=[M(" This product requires ownership to download ")])),_:1}),w(at,{label:"Sign in",handler:c})])):N.product.downloadsNeedsUser&&!b(r).user?(g(),C("div",Lk,[w(rt,{"data-center":""},{default:O(()=>q[4]||(q[4]=[M(" This product requires an account to download ")])),_:1}),w(at,{label:"Sign in",handler:c})])):N.product.downloadsNeedsOwnership&&!N.product.numberOfLicenses&&!N.product.subscriptionLicenses?(g(),C("div",jk,[w(rt,{"data-center":""},{default:O(()=>q[5]||(q[5]=[M(" This product requires ownership to download ")])),_:1})])):(g(),C("div",Fk,[H("div",Uk,[(g(!0),C($e,null,yt(_.value,z=>(g(),J(En,{key:z.key,class:"moonbase:product-downloads-download"},{addon:O(()=>[H("div",Bk,[w(at,{label:`Download for ${z.platform}`,variant:z.platform===b(h)?"primary":"secondary","no-reset":!0,handler:()=>x(z),icon:b(W1)},null,8,["label","variant","handler","icon"])])]),default:O(()=>[H("div",null,[w(nt,null,{default:O(()=>[M(j(z.platform),1)]),_:2},1024),w(Ir,null,{default:O(()=>[M(j(z.name)+" - "+j(b(Ik)(z.size)),1)]),_:2},1024)])]),_:2},1024))),128))]),_.value.length===0?(g(),J(rt,{key:0,"data-center":""},{default:O(()=>q[6]||(q[6]=[M(" No downloadable files found ")])),_:1})):fe("",!0)]))]))}}),qk={class:"moonbase:product-licenses"},zk={key:0,class:"moonbase:loader"},Wk={key:1,class:"moonbase:empty"},Zk={key:0,class:"moonbase:loader"},Yk={key:1,class:"moonbase:product-licenses-activations"},Gk={key:0},Kk={class:"moonbase:product-licenses-activation-actions"},Xk={key:2,class:"moonbase:loader"},Jk={key:3,class:"moonbase:product-licenses-licenses"},Qk=pe({__name:"ProductLicenses",props:{product:{}},emits:["revoked"],setup(e,{emit:t}){const n=e,r=t,{getProductActivations:o,getProductLicenses:s,revokeActivation:i}=so(),a=ec(),l=V(null),u=V(null),c=V(!0);qe(async()=>{if(n.product.maxActivations){let f=await o(n.product.id);for(l.value=f.items.map(h=>({...h,revoking:!1}));f.hasMore&&f.next;)f=await o(n.product.id,f.next),l.value.push(...f.items.map(h=>({...h,revoking:!1})))}if(n.product.externalLicenses){let f=await s(n.product.id);for(u.value=f.items;f.hasMore&&f.next;)f=await s(n.product.id,f.next),u.value.push(...f.items)}c.value=!1});async function d(f){try{await i(f),r("revoked",f),l.value&&Ht(1e3).then(()=>{var h,p;return(p=l.value)==null?void 0:p.splice((h=l.value)==null?void 0:h.indexOf(f),1)})}catch(h){if(h instanceof Nn)a.reportProblem("error",{type:h.name,title:h.title,detail:h.detail,status:h.status,errors:h.errors?Object.fromEntries(Object.entries(h.errors).map(([p,_])=>[p,[_]])):void 0,instance:"ProductLicenses.vue:revoke"});else{const p=h;a.reportProblem("error",{type:p.name,title:p.message,instance:"ProductLicenses.vue:revoke"})}throw h}}return(f,h)=>(g(),C("div",qk,[w(nt,null,{default:O(()=>[h[0]||(h[0]=M(" Licenses ")),f.product.maxActivations&&f.product.maxActivations>0?(g(),J(Le,{key:0},{default:O(()=>[M(j(f.product.currentActivations??0)+" of "+j(f.product.maxActivations)+" seats used ",1)]),_:1})):fe("",!0)]),_:1}),c.value?(g(),C("div",zk,[w(Qt)])):!f.product.numberOfLicenses&&!f.product.subscriptionLicenses?(g(),C("div",Wk,[w(rt,null,{default:O(()=>h[1]||(h[1]=[M(" You don't own any licenses for this product yet ")])),_:1}),f.product&&f.product.website?(g(),J(Qu,{key:0,type:"anchor",href:f.product.website,label:"Purchase",icon:b(Y1)},null,8,["href","icon"])):fe("",!0)])):fe("",!0),c.value?fe("",!0):(g(),C($e,{key:2},[f.product.maxActivations&&f.product.maxActivations>0&&!f.product.currentActivations?(g(),C("div",Zk,[w(b(ep)),w(nt,null,{default:O(()=>h[2]||(h[2]=[M(" No activations yet ")])),_:1})])):fe("",!0),f.product.maxActivations&&l.value?(g(),C("div",Yk,[(g(!0),C($e,null,yt(l.value??[],p=>(g(),J(En,{key:p.id,class:"moonbase:product-licenses-activation"},Gd({default:O(()=>[H("div",null,[w(Ir,null,{default:O(()=>h[3]||(h[3]=[M(" Device ")])),_:1}),w(nt,null,{default:O(()=>[M(j(p.name),1)]),_:2},1024)]),H("div",null,[w(Ir,null,{default:O(()=>h[4]||(h[4]=[M(" Activation ")])),_:1}),w(nt,null,{default:O(()=>[M(j(p.activationMethod),1)]),_:2},1024)]),p.lastValidatedAt?(g(),C("div",Gk,[w(Ir,null,{default:O(()=>h[5]||(h[5]=[M(" First activated ")])),_:1}),w(nt,null,{default:O(()=>[M(j(b(wk)(p.firstValidatedAt)),1)]),_:2},1024)])):fe("",!0)]),_:2},[p.activationMethod===b(Ai).Online?{name:"addon",fn:O(()=>[H("div",Kk,[w(at,{label:"Revoke",variant:"secondary","no-reset":!0,handler:()=>d(p)},null,8,["handler"])])]),key:"0"}:void 0]),1024))),128))])):fe("",!0),(!u.value||u.value.length===0)&&!f.product.maxActivations&&(f.product.numberOfLicenses||f.product.subscriptionLicenses)?(g(),C("div",Xk,[w(b(ep)),f.product.numberOfLicenses?(g(),J(nt,{key:0},{default:O(()=>[M(" You own "+j(f.product.numberOfLicenses)+" license"+j(f.product.numberOfLicenses!==1?"s":"")+" for this product ",1)]),_:1})):fe("",!0),f.product.subscriptionLicenses?(g(),J(nt,{key:1},{default:O(()=>[M(" You have "+j(f.product.subscriptionLicenses)+" subscription license"+j(f.product.subscriptionLicenses!==1?"s":"")+" for this product ",1)]),_:1})):fe("",!0)])):f.product.externalLicenses&&u.value?(g(),C("div",Jk,[(g(!0),C($e,null,yt((u.value??[]).filter(p=>p.externalFulfillment),p=>(g(),J(En,{key:p.id,class:"moonbase:product-licenses-license"},Gd({default:O(()=>[H("div",null,[w(Ir,null,{default:O(()=>[M(j(f.product.name)+" license ",1)]),_:1}),w(nt,null,{default:O(()=>[M(j(p.id),1)]),_:2},1024)])]),_:2},[p.externalFulfillment?{name:"addon",fn:O(()=>[H("code",null,j(p.externalFulfillment),1)]),key:"0"}:void 0]),1024))),128))])):fe("",!0)],64))]))}}),eO={class:"moonbase:download-product"},tO={key:0,class:"moonbase:loader"},nO={key:1,class:"moonbase:loader"},rO={key:2,class:"moonbase:loader"},oO={key:3},sO=pe({__name:"Product",setup(e){const t=Ae(),n=tt(),{loaded:r}=tt(),{getProduct:o}=so(),s=V(null),i=V(null),a=V(!0);return qe(async()=>{const l=t.getParameter("product_id"),u=t.getParameter("version");if(!l){i.value="Link is broken";return}try{s.value=await o(l,u||void 0)}catch(c){i.value=c.message}a.value=!1}),(l,u)=>(g(),C("div",eO,[a.value||!b(r)?(g(),C("div",tO,[w(Qt)])):i.value?(g(),C("div",nO,j(i.value),1)):s.value?(g(),C("div",oO,[w(Dk,{product:s.value},null,8,["product"]),s.value.downloads?(g(),J(Hk,{key:0,product:s.value},null,8,["product"])):fe("",!0),b(n).user.value?(g(),J(Qk,{key:1,product:s.value,onRevoked:u[0]||(u[0]=c=>s.value.currentActivations=(s.value.currentActivations??1)-1)},null,8,["product"])):fe("",!0)])):(g(),C("div",rO," Could not find product "))]))}}),iO={class:"moonbase:peek"},aO=["data-visible"],lO={key:1,class:"moonbase:peek-voucher"},uO={key:0,class:"moonbase:peek-voucher-content"},cO={class:"moonbase:peek-voucher-auth"},dO=pe({__name:"Redeem",setup(e){const{peek:t}=lh(),n=Ae(),r=V(null),o=V(null),s=V(n.getParameter("code")||"");async function i(){o.value=null;try{r.value=await t(s.value),n.parameters={code:r.value.code}}catch(u){throw o.value=u,u}}function a(){n.enqueue(le.Customer,te.RedeemVoucher,{code:s.value}),n.show(le.Authentication,te.SignIn)}function l(){n.enqueue(le.Customer,te.RedeemVoucher,{code:s.value}),n.show(le.Authentication,te.SignUp)}return(u,c)=>(g(),C("div",iO,[w(Gs,{mode:"out-in",name:"moonbase:slide-left"},{default:O(()=>[r.value?(g(),C("div",lO,[H("div",null,[w(es,null,{default:O(()=>[M(j(r.value.name),1)]),_:1}),r.value.description?(g(),J(nt,{key:0},{default:O(()=>[M(' "'+j(r.value.description)+'" ',1)]),_:1})):fe("",!0),w(Le,null,{default:O(()=>[c[2]||(c[2]=M(" Code: ")),H("strong",null,j(r.value.code),1)]),_:1})]),w(nt,null,{default:O(()=>c[3]||(c[3]=[M(" Voucher summary ")])),_:1}),r.value.redeemsProducts.length>0||r.value.redeemsBundles.length>0?(g(),C("div",uO,[(g(!0),C($e,null,yt(r.value.redeemsProducts,({value:d,quantity:f})=>(g(),J(Gp,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(g(!0),C($e,null,yt(r.value.redeemsBundles,({value:d,quantity:f})=>(g(),J(Yp,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):fe("",!0),H("div",cO,[w(rt,null,{default:O(()=>c[4]||(c[4]=[M(" Sign in or create an account to redeem products ")])),_:1}),w(at,{label:"Sign in",variant:"primary",handler:a}),w(at,{label:"Create account",variant:"subtle",handler:l})])])):(g(),J(sr,{key:0,handler:i},{default:O(()=>{var d;return[w(rt,null,{default:O(()=>c[1]||(c[1]=[M(" Do you have a voucher you want to redeem? "),H("br",null,null,-1),M(" Please enter the code below: ")])),_:1}),w(Nt,{modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=f=>s.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),w(ir,{label:"Redeem voucher",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!o.value||void 0},j((d=o.value)==null?void 0:d.message),9,aO)]}),_:1}))]),_:1})]))}}),fO={class:"moonbase:subscription-content-card-content"},hO=["data-open"],pO={class:"moonbase:subscription-content-card-content"},mO=["data-open"],bO=pe({__name:"ContentCard",props:{subscription:{}},setup(e){const t=V(new Date),n=V(!1),r=V(null),o=se(()=>r.value&&r.value.$el&&r.value.$el.scrollHeight>r.value.$el.clientHeight);return(s,i)=>s.subscription.content.type==="Product"?(g(),J(En,{key:0,class:"moonbase:subscription-content-card"},{addon:O(()=>[H("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[w(Le,{ref_key:"descriptionRef",ref:r},{default:O(()=>[M(j(s.subscription.content.product.description),1)]),_:1},512),!n.value&&o.value?(g(),C("button",{key:0,onClick:i[0]||(i[0]=a=>n.value=!0)},[w(Ct,null,{default:O(()=>i[2]||(i[2]=[M(" read more ")])),_:1})])):fe("",!0)],8,hO)]),default:O(()=>[w(en,{url:s.subscription.content.product.iconUrl,size:72},null,8,["url"]),H("div",fO,[w(es,null,{default:O(()=>{var a;return[M(j((a=s.subscription.content.product)==null?void 0:a.name),1)]}),_:1}),w(Le,{class:"moonbase:subscription-content-card-tagline"},{default:O(()=>{var a;return[M(j((a=s.subscription.content.product)==null?void 0:a.tagline),1)]}),_:1}),w(Le,{class:"moonbase:subscription-content-card-expiry"},{default:O(()=>[M(j(s.subscription.status===b(br).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),H("strong",null,j(b(mi)(s.subscription.expiresAt)),1)]),_:1})])]),_:1})):(g(),J(En,{key:1,class:"moonbase:subscription-content-card"},{addon:O(()=>[H("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[w(Le,{ref_key:"descriptionRef",ref:r},{default:O(()=>[M(j(s.subscription.content.bundle.description),1)]),_:1},512),!n.value&&o.value?(g(),C("button",{key:0,onClick:i[1]||(i[1]=a=>n.value=!0)},[w(Ct,null,{default:O(()=>i[3]||(i[3]=[M(" read more ")])),_:1})])):fe("",!0)],8,mO)]),default:O(()=>[w(en,{url:s.subscription.content.bundle.iconUrl,size:72},null,8,["url"]),H("div",pO,[w(es,null,{default:O(()=>{var a;return[M(j((a=s.subscription.content.bundle)==null?void 0:a.name),1)]}),_:1}),w(Le,{class:"moonbase:subscription-content-card-tagline"},{default:O(()=>{var a;return[M(j((a=s.subscription.content.bundle)==null?void 0:a.tagline),1)]}),_:1}),w(Le,{class:"moonbase:subscription-content-card-expiry"},{default:O(()=>[M(j(s.subscription.status===b(br).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),H("strong",null,j(b(mi)(s.subscription.expiresAt)),1)]),_:1})])]),_:1}))}}),gO={class:"moonbase:subscription"},vO={key:0,class:"moonbase:loader"},yO={key:1,class:"moonbase:loader"},_O={key:2,class:"moonbase:loader"},wO={key:3},EO={class:"moonbase:subscription-actions"},xO=pe({__name:"Subscription",setup(e){const t=Ae(),{loaded:n}=tt(),{getSubscription:r,renewSubscription:o,cancelSubscription:s}=so(),i=V(null),a=V(new Date),l=V(null),u=V(!0);qe(async()=>{const f=t.getParameter("subscription_id");if(!f){l.value="Link is broken";return}try{i.value=await r(f)}catch(h){l.value=h.message}u.value=!1});async function c(){if(!i.value)return;if((await o(i.value.id,{redirect:!1})).completed){const h=await r(i.value.id);Ht(1500).then(()=>i.value=h)}else throw new ja}async function d(){i.value&&(i.value=await s(i.value.id))}return(f,h)=>(g(),C("div",gO,[u.value||!b(n)?(g(),C("div",vO,[w(Qt)])):l.value?(g(),C("div",yO,j(l.value),1)):i.value?(g(),C("div",wO,[w(bO,{subscription:i.value},null,8,["subscription"]),H("div",EO,[i.value.status===b(br).Active?(g(),J(at,{key:0,label:"Cancel subscription",variant:"danger",handler:d})):(g(),J(at,{key:1,label:"Continue subscription",variant:"primary",handler:c})),i.value.status===b(br).Active?(g(),J(Ir,{key:2},{default:O(()=>[h[0]||(h[0]=M(" Cancelling a subscription will let you use the products to the end of the current period, after which you will lose access. If you want to continue using the products later, you may simply renew this subscription whenever you wish. You are currently paying ")),H("strong",null,j(b(Jt)(i.value.total.due)),1),M(" per "+j(b(tc)(i.value.cycleLength))+" for this subscription. ",1)]),_:1})):(g(),J(Ir,{key:3},{default:O(()=>[M(" This subscription has been stopped, and "+j(i.value.expiresAt>a.value?"expires":"expired")+" "+j(b(mi)(i.value.expiresAt))+". If you want to continue using the products after this date, you may continue the subscription to regain access. ",1)]),_:1}))])])):(g(),C("div",_O," Could not find subscription "))]))}}),kO=pe({__name:"App",setup(e){const t=ye(Lt),n=Ae();et(()=>[n.active,n.intent],([o,s])=>{});const r={Inter:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",Roboto:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap","EB Garamond":"https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap",Merriweather:"https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap",Poppins:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap","PT Serif":"https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap",Montserrat:"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap",Aleo:"https://fonts.googleapis.com/css2?family=Aleo:ital,wght@0,100..900;1,100..900&display=swap"};if(t){const o=document.createElement("link");o.rel="stylesheet",o.href=r[t.value.theme.fonts.body],document.head.appendChild(o),document.documentElement.style.setProperty("--moonbase-font-body",t.value.theme.fonts.body??"");const s=document.createElement("link");s.rel="stylesheet",s.href=r[t.value.theme.fonts.heading],document.head.appendChild(s),document.documentElement.style.setProperty("--moonbase-font-heading",t.value.theme.fonts.heading??"");let i=t.value.theme.colors.primary;typeof i=="string"&&(i=Object.fromEntries(N2(i).map(a=>[a.number<=100||a.number===950?a.number-50:a.number-100,a.hexcode]))),document.documentElement.style.setProperty("--moonbase-brand-50",i[50]??""),document.documentElement.style.setProperty("--moonbase-brand-100",i[100]??""),document.documentElement.style.setProperty("--moonbase-brand-200",i[200]??""),document.documentElement.style.setProperty("--moonbase-brand-300",i[300]??""),document.documentElement.style.setProperty("--moonbase-brand-400",i[400]??""),document.documentElement.style.setProperty("--moonbase-brand-500",i[500]??""),document.documentElement.style.setProperty("--moonbase-brand-600",i[600]??""),document.documentElement.style.setProperty("--moonbase-brand-700",i[700]??""),document.documentElement.style.setProperty("--moonbase-brand-800",i[800]??""),document.documentElement.style.setProperty("--moonbase-brand-900",i[900]??"")}return et(()=>t==null?void 0:t.value.theme.dark,o=>{o?document.documentElement.classList.add("moonbase:dark"):document.documentElement.classList.remove("moonbase:dark")},{immediate:!0}),T_(),(o,s)=>{var i;return g(),C($e,null,[(i=b(t))!=null&&i.toolbar.enabled?(g(),J(C_,{key:0})):fe("",!0),w(__,null,{default:O(()=>[b(n).active===b(le).Cart?(g(),J(j5,{key:0})):b(n).active===b(le).Authentication?(g(),J(b5,{key:1})):b(n).active===b(le).Activation?(g(),J(NE,{key:2})):b(n).active===b(le).Product?(g(),J(sO,{key:3})):b(n).active===b(le).Subscription?(g(),J(xO,{key:4})):b(n).active===b(le).Customer?(g(),J(Pk,{key:5})):b(n).active===b(le).Redeem?(g(),J(dO,{key:6})):b(n).active===b(le).About?(g(),J(j2,{key:7})):fe("",!0)]),_:1})],64)}}});function za(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof HTMLElement)}function Wa(e,...t){if(t.length===0)return e;const n=t.shift();if(!n)return e;if(za(e)&&za(n)){for(const r in e)if(Object.prototype.hasOwnProperty.call(n,r)){const o=n[r];za(o)&&za(e[r])?e[r]=Wa(e[r],o):o!==void 0&&(e[r]=o)}}return Wa(e,...t)}function OO(e){const t=n=>Array.isArray(n)?n.map(r=>t(r)):Xe(n)||pn(n)||Po(n)?t(Se(n)):n&&typeof n=="object"?Object.keys(n).reduce((r,o)=>(r[o]=t(n[o]),r),{}):n;return t(e)}const rc=Symbol("url"),Vr=(e,t)=>window.dispatchEvent(new CustomEvent(`moonbase-storefront-${e}`,{detail:OO(t)})),Rr=Symbol("event-emitter");class SO{constructor(){bo(this,"initialized",!1);bo(this,"pinia");bo(this,"storefront");bo(this,"options")}async setup(t,n){var l,u;if(typeof window>"u")throw console.error("Moonbase setup must be done client-side"),new Error("Moonbase setup must be done client-side");if(document.getElementById("moonbase")){console.warn("Moonbase has already been initialized!");return}this.options=V(Wa(((l=this.options)==null?void 0:l.value)??Ch,n??{})),bu("Merged options:",this.options.value);const r=document.createElement("div");r.id="moonbase",r.classList.add("moonbase"),(this.options.value.target??document.body).append(r),this.storefront=vy(t),this.pinia=Hy(),Jv(kO).use(this.storefront).use(this.pinia).provide(Lt,this.options).provide(rc,t.replace(/\/$/,"")).provide(Rr,Vr).mount("#moonbase"),this.initialized=!0,window&&window.location&&this.handleLocationIntent(window.location);const i=Ae(this.pinia),a=tt(this.storefront);(u=this.storefront)==null||u.onCheckoutInitiated((c,d)=>{Vr(qt.CheckoutInitiated,{order:c,total:d,user:a.user.value})}),this.storefront.onCheckoutClosed(c=>{Vr(qt.CheckoutClosed,{order:this.storefront.currentOrder.value,user:a.user.value}),c===te.ViewProducts&&(a.user?i.show(le.Customer,te.ViewProducts):i.show(le.Cart,te.ViewCart))}),this.storefront.onCheckoutCompleted(c=>{Vr(qt.CheckoutCompleted,{order:c,user:a.user.value})})}configure(t){var r;const n=Wa(((r=this.options)==null?void 0:r.value)??Ch,t??{});this.options?this.options.value=n:this.options=V(n)}on(t,n){window.addEventListener(`moonbase-storefront-${t}`,r=>n(r.detail))}handleLocationIntent(t){const n=new URLSearchParams(t.search),r=n.get("mb_intent");if(r&&Object.values(te).includes(r)){const o=Object.fromEntries([...n.entries()].filter(([i])=>i.startsWith("mb_")).map(([i,a])=>[i.substring(3),a]));if(r===te.Checkout&&o.complete)return;this[r](o);for(const i of Object.keys(o))n.delete(`mb_${i}`);const s=n.toString();window.history.replaceState(null,"",t.href.split("?")[0]+(s?`?${s}`:""))}}sign_in(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Authentication,te.SignIn,t)}sign_up(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!((r=this.options)!=null&&r.value.auth.signUp.enabled))throw new Error("Sign ups are not enabled");Ae(this.pinia).show(le.Authentication,te.SignUp,t)}forgot_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Authentication,te.ForgotPassword,t)}reset_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Authentication,te.ResetPassword,t)}confirm_account(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Authentication,te.ConfirmAccount,t)}confirm_email(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Authentication,te.ConfirmEmail,t)}confirm_email_change(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Ae(this.pinia);tt(this.storefront).user.value?n.show(le.Authentication,te.ConfirmEmailChange,t):(n.enqueue(le.Authentication,te.ConfirmEmailChange,t),n.show(le.Authentication,te.SignIn))}view_account(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const t=Ae(this.pinia);tt(this.storefront).user.value?t.show(le.Customer,te.ViewAccount):(t.enqueue(le.Customer,te.ViewAccount),t.show(le.Authentication,te.SignIn))}view_products(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Customer,te.ViewProducts)}view_subscriptions(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Customer,te.ViewSubscriptions)}redeem_voucher(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Ae(this.pinia);tt(this.storefront).user.value?n.show(le.Customer,te.RedeemVoucher,t):n.show(le.Redeem,te.RedeemVoucher,t)}view_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Product,te.ViewProduct,t)}download_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Product,te.DownloadProduct,t)}activate_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Ae(this.pinia),r=tt(this.storefront);!(t!=null&&t.token)&&!r.user.value?(n.enqueue(le.Activation,te.ActivateProduct,t),n.show(le.Authentication,te.SignIn)):n.show(le.Activation,te.ActivateProduct,t)}manage_subscription(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Ae(this.pinia);tt(this.storefront).user.value?n.show(le.Subscription,te.ManageSubscription,t):(n.enqueue(le.Subscription,te.ManageSubscription,t),n.show(le.Authentication,te.SignIn))}view_cart(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Cart,te.ViewCart)}async add_to_cart(t){var o,s,i,a;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!(t!=null&&t.product_id)&&!(t!=null&&t.bundle_id))throw new Error("You need to provide a product or bundle ID when adding to cart");const n=Cr(this.storefront),r=tt(this.storefront);if(t!=null&&t.product_id){const l=Js(t.product_id,this.storefront);if(l.value){let u=n.addToCart(l.value,(o=l.value.variations)==null?void 0:o.find(c=>c.id===t.variation_id));t!=null&&t.quantity&&(u=n.setQuantity(u,u.quantity+t.quantity-1)),Vr(qt.AddedToCart,{item:u,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const u=Js(t.product_id,this.storefront);if(u.value){let c=n.addToCart(u.value,(s=u.value.variations)==null?void 0:s.find(d=>d.id===t.variation_id));t!=null&&t.quantity&&(c=n.setQuantity(c,c.quantity+t.quantity-1)),Vr(qt.AddedToCart,{item:c,currency:n.currency.value,user:r.user.value})}else throw new Error(`Product '${t.product_id}' not found`)}}if(t!=null&&t.bundle_id){const l=ba(t.bundle_id,this.storefront);if(l.value){let u=n.addToCart(l.value,(i=l.value.variations)==null?void 0:i.find(c=>c.id===t.variation_id));t!=null&&t.quantity&&(u=n.setQuantity(u,u.quantity+t.quantity-1)),Vr(qt.AddedToCart,{item:u,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const u=ba(t.bundle_id,this.storefront);if(u.value){let c=n.addToCart(u.value,(a=u.value.variations)==null?void 0:a.find(d=>d.id===t.variation_id));t!=null&&t.quantity&&(c=n.setQuantity(c,c.quantity+t.quantity-1)),Vr(qt.AddedToCart,{item:c,currency:n.currency.value,user:r.user.value})}else throw new Error(`Bundle '${t.bundle_id}' not found`)}}(t==null?void 0:t.show_cart)!==!1&&Ae(this.pinia).show(le.Cart,te.AddToCart)}async purchase(t){var o,s,i,a,l;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(o=this.storefront)!=null&&o.loadedStorefront||await((s=this.storefront)==null?void 0:s.loadedStorefrontPromise);const n=t?Array.isArray(t)?t:[t]:[];if(n.length===0)throw new Error("No items given to purchase");const r=[];for(const u of n){if(!u.product_id&&!u.bundle_id)throw new Error("You need to provide a product or bundle ID when purchasing");if(u.product_id){const c=Js(u.product_id,this.storefront);if(c.value)r.push({item:c.value,variation:(i=c.value.variations)==null?void 0:i.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Product '${u.product_id}' not found`)}if(u.bundle_id){const c=ba(u.bundle_id,this.storefront);if(c.value)r.push({item:c.value,variation:(a=c.value.variations)==null?void 0:a.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Bundle '${u.bundle_id}' not found`)}}await by(r,{redirect:((l=this.options)==null?void 0:l.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`},this.storefront)}checkout(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(t!=null&&t.complete)return;Cr(this.storefront).checkout({redirect:((r=this.options)==null?void 0:r.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`})}close_checkout(){var t;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(t=this.storefront)==null||t.closeCheckout()}view_about(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.About,te.ViewAbout)}}const lm=new SO;globalThis&&(globalThis.Moonbase?console.warn("Multiple instances of Moonbase detected, only one will be initialized"):globalThis.Moonbase=lm),Pt.MoonbaseIntent=te,Pt.default=lm,Pt.eventEmitterKey=Rr,Pt.urlKey=rc,Object.defineProperties(Pt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
36
|
+
*/const yp=.027,t2=5e-4,n2=.1,_p=1.14,Ia=.022,wp=1.414,r2=(e,t)=>{e=new Q(e),t=new Q(t),e.alpha()<1&&(e=Zo(t,e,e.alpha(),"rgb"));const n=Ep(...e.rgb()),r=Ep(...t.rgb()),o=n>=Ia?n:n+Math.pow(Ia-n,wp),s=r>=Ia?r:r+Math.pow(Ia-r,wp),i=Math.pow(s,.56)-Math.pow(o,.57),a=Math.pow(s,.65)-Math.pow(o,.62),l=Math.abs(s-o)<t2?0:o<s?i*_p:a*_p;return(Math.abs(l)<n2?0:l>0?l-yp:l+yp)*100};function Ep(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:rr,pow:dt,min:o2,max:s2,atan2:xp,abs:kp,cos:Ma,sin:Op,exp:i2,PI:Sp}=Math;function a2(e,t,n=1,r=1,o=1){var s=function(Be){return 360*Be/(2*Sp)},i=function(Be){return 2*Sp*Be/360};e=new Q(e),t=new Q(t);const[a,l,u]=Array.from(e.lab()),[c,d,f]=Array.from(t.lab()),h=(a+c)/2,p=rr(dt(l,2)+dt(u,2)),_=rr(dt(d,2)+dt(f,2)),x=(p+_)/2,N=.5*(1-rr(dt(x,7)/(dt(x,7)+dt(25,7)))),q=l*(1+N),z=d*(1+N),B=rr(dt(q,2)+dt(u,2)),L=rr(dt(z,2)+dt(f,2)),D=(B+L)/2,m=s(xp(u,q)),P=s(xp(f,z)),I=m>=0?m:m+360,T=P>=0?P:P+360,$=kp(I-T)>180?(I+T+360)/2:(I+T)/2,A=1-.17*Ma(i($-30))+.24*Ma(i(2*$))+.32*Ma(i(3*$+6))-.2*Ma(i(4*$-63));let oe=T-I;oe=kp(oe)<=180?oe:T<=I?oe+360:oe-360,oe=2*rr(B*L)*Op(i(oe)/2);const xe=c-a,k=L-B,U=1+.015*dt(h-50,2)/rr(20+dt(h-50,2)),R=1+.045*D,ee=1+.015*D*A,me=30*i2(-dt(($-275)/25,2)),he=-(2*rr(dt(D,7)/(dt(D,7)+dt(25,7))))*Op(2*i(me)),ve=rr(dt(xe/(n*U),2)+dt(k/(r*R),2)+dt(oe/(o*ee),2)+he*(k/(r*R))*(oe/(o*ee)));return s2(0,o2(100,ve))}function l2(e,t,n="lab"){e=new Q(e),t=new Q(t);const r=e.get(n),o=t.get(n);let s=0;for(let i in r){const a=(r[i]||0)-(o[i]||0);s+=a*a}return Math.sqrt(s)}const u2=(...e)=>{try{return new Q(...e),!0}catch{return!1}},c2={cool(){return Da([Ie.hsl(180,1,.9),Ie.hsl(250,.7,.4)])},hot(){return Da(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Yu={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Np=Object.keys(Yu),Cp=new Map(Np.map(e=>[e.toLowerCase(),e])),d2=typeof Proxy=="function"?new Proxy(Yu,{get(e,t){const n=t.toLowerCase();if(Cp.has(n))return e[Cp.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(Np)}}):Yu,f2=(...e)=>{e=De(e,"cmyk");const[t,n,r,o]=e,s=e.length>4?e[4]:1;return o===1?[0,0,0,s]:[t>=1?0:255*(1-t)*(1-o),n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),s]},{max:Tp}=Math,h2=(...e)=>{let[t,n,r]=De(e,"rgb");t=t/255,n=n/255,r=r/255;const o=1-Tp(t,Tp(n,r)),s=o<1?1/(1-o):0,i=(1-t-o)*s,a=(1-n-o)*s,l=(1-r-o)*s;return[i,a,l,o]};Q.prototype.cmyk=function(){return h2(this._rgb)},Object.assign(Ie,{cmyk:(...e)=>new Q(...e,"cmyk")}),Te.format.cmyk=f2,Te.autodetect.push({p:2,test:(...e)=>{if(e=De(e,"cmyk"),Re(e)==="array"&&e.length===4)return"cmyk"}});const p2=(...e)=>{const t=De(e,"hsla");let n=zo(e)||"lsa";return t[0]=an(t[0]||0)+"deg",t[1]=an(t[1]*100)+"%",t[2]=an(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},m2=(...e)=>{const t=De(e,"lab");let n=zo(e)||"lab";return t[0]=an(t[0])+"%",t[1]=an(t[1]),t[2]=an(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},b2=(...e)=>{const t=De(e,"lch");let n=zo(e)||"lab";return t[0]=an(t[0])+"%",t[1]=an(t[1]),t[2]=isNaN(t[2])?"none":an(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},g2=(...e)=>{const t=De(e,"lab");return t[0]=an(t[0]*100)+"%",t[1]=Au(t[1]),t[2]=Au(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},Pp=(...e)=>{const[t,n,r,...o]=De(e,"rgb"),[s,i,a]=qu(t,n,r),[l,u,c]=cp(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},v2=(...e)=>{const t=De(e,"lch");return t[0]=an(t[0]*100)+"%",t[1]=Au(t[1]),t[2]=isNaN(t[2])?"none":an(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:Gu}=Math,y2=(...e)=>{const t=De(e,"rgba");let n=zo(e)||"rgb";if(n.substr(0,3)==="hsl")return p2(fp(t),n);if(n.substr(0,3)==="lab"){const r=ci();nr("d50");const o=m2(Vu(t),n);return nr(r),o}if(n.substr(0,3)==="lch"){const r=ci();nr("d50");const o=b2(Fu(t),n);return nr(r),o}return n.substr(0,5)==="oklab"?g2(qu(t)):n.substr(0,5)==="oklch"?v2(Pp(t)):(t[0]=Gu(t[0]),t[1]=Gu(t[1]),t[2]=Gu(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},$p=(...e)=>{e=De(e,"lch");const[t,n,r,...o]=e,[s,i,a]=up(t,n,r),[l,u,c]=Hu(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},or=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,wn=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Va=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,ln=/\s*/.source,Xo=/\s+/.source,Ku=/\s*,\s*/.source,Ra=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Jo=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,Ap=new RegExp("^rgba?\\("+ln+[or,or,or].join(Xo)+Jo+"\\)$"),Dp=new RegExp("^rgb\\("+ln+[or,or,or].join(Ku)+ln+"\\)$"),Ip=new RegExp("^rgba\\("+ln+[or,or,or,wn].join(Ku)+ln+"\\)$"),Mp=new RegExp("^hsla?\\("+ln+[Ra,Va,Va].join(Xo)+Jo+"\\)$"),Vp=new RegExp("^hsl?\\("+ln+[Ra,Va,Va].join(Ku)+ln+"\\)$"),Rp=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Lp=new RegExp("^lab\\("+ln+[wn,wn,wn].join(Xo)+Jo+"\\)$"),jp=new RegExp("^lch\\("+ln+[wn,wn,Ra].join(Xo)+Jo+"\\)$"),Fp=new RegExp("^oklab\\("+ln+[wn,wn,wn].join(Xo)+Jo+"\\)$"),Up=new RegExp("^oklch\\("+ln+[wn,wn,Ra].join(Xo)+Jo+"\\)$"),{round:Bp}=Math,Qo=e=>e.map((t,n)=>n<=2?po(Bp(t),0,255):t),ft=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),jt=(e,t)=>e==="none"?t:e,Xu=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(Te.format.named)try{return Te.format.named(e)}catch{}if((t=e.match(Ap))||(t=e.match(Dp))){let n=t.slice(1,4);for(let o=0;o<3;o++)n[o]=+ft(jt(n[o],0),0,255);n=Qo(n);const r=t[4]!==void 0?+ft(t[4],0,1):1;return n[3]=r,n}if(t=e.match(Ip)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+ft(n[r],0,255);return n}if((t=e.match(Mp))||(t=e.match(Vp))){const n=t.slice(1,4);n[0]=+jt(n[0].replace("deg",""),0),n[1]=+ft(jt(n[1],0),0,100)*.01,n[2]=+ft(jt(n[2],0),0,100)*.01;const r=Qo(Bu(n)),o=t[4]!==void 0?+ft(t[4],0,1):1;return r[3]=o,r}if(t=e.match(Rp)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Bu(n);for(let o=0;o<3;o++)r[o]=Bp(r[o]);return r[3]=+t[4],r}if(t=e.match(Lp)){const n=t.slice(1,4);n[0]=ft(jt(n[0],0),0,100),n[1]=ft(jt(n[1],0),-125,125,!0),n[2]=ft(jt(n[2],0),-125,125,!0);const r=ci();nr("d50");const o=Qo(Iu(n));nr(r);const s=t[4]!==void 0?+ft(t[4],0,1):1;return o[3]=s,o}if(t=e.match(jp)){const n=t.slice(1,4);n[0]=ft(n[0],0,100),n[1]=ft(jt(n[1],0),0,150,!1),n[2]=+jt(n[2].replace("deg",""),0);const r=ci();nr("d50");const o=Qo(ju(n));nr(r);const s=t[4]!==void 0?+ft(t[4],0,1):1;return o[3]=s,o}if(t=e.match(Fp)){const n=t.slice(1,4);n[0]=ft(jt(n[0],0),0,1),n[1]=ft(jt(n[1],0),-.4,.4,!0),n[2]=ft(jt(n[2],0),-.4,.4,!0);const r=Qo(Hu(n)),o=t[4]!==void 0?+ft(t[4],0,1):1;return r[3]=o,r}if(t=e.match(Up)){const n=t.slice(1,4);n[0]=ft(jt(n[0],0),0,1),n[1]=ft(jt(n[1],0),0,.4,!1),n[2]=+jt(n[2].replace("deg",""),0);const r=Qo($p(n)),o=t[4]!==void 0?+ft(t[4],0,1):1;return r[3]=o,r}};Xu.test=e=>Ap.test(e)||Mp.test(e)||Lp.test(e)||jp.test(e)||Fp.test(e)||Up.test(e)||Dp.test(e)||Ip.test(e)||Vp.test(e)||Rp.test(e)||e==="transparent",Q.prototype.css=function(e){return y2(this._rgb,e)};const _2=(...e)=>new Q(...e,"css");Ie.css=_2,Te.format.css=Xu,Te.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Re(e)==="string"&&Xu.test(e))return"css"}}),Te.format.gl=(...e)=>{const t=De(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const w2=(...e)=>new Q(...e,"gl");Ie.gl=w2,Q.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},Q.prototype.hex=function(e){return ip(this._rgb,e)};const E2=(...e)=>new Q(...e,"hex");Ie.hex=E2,Te.format.hex=sp,Te.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&Re(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:La}=Math,Hp=e=>{const t=e/100;let n,r,o;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*La(r),o=t<20?0:-254.76935184120902+.8274096064007395*(o=t-10)+115.67994401066147*La(o)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*La(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*La(r),o=255),[n,r,o,1]},{round:x2}=Math,k2=(...e)=>{const t=De(e,"rgb"),n=t[0],r=t[2];let o=1e3,s=4e4;const i=.4;let a;for(;s-o>i;){a=(s+o)*.5;const l=Hp(a);l[2]/l[0]>=r/n?s=a:o=a}return x2(a)};Q.prototype.temp=Q.prototype.kelvin=Q.prototype.temperature=function(){return k2(this._rgb)};const Ju=(...e)=>new Q(...e,"temp");Object.assign(Ie,{temp:Ju,kelvin:Ju,temperature:Ju}),Te.format.temp=Te.format.kelvin=Te.format.temperature=Hp,Q.prototype.oklch=function(){return Pp(this._rgb)},Object.assign(Ie,{oklch:(...e)=>new Q(...e,"oklch")}),Te.format.oklch=$p,Te.autodetect.push({p:2,test:(...e)=>{if(e=De(e,"oklch"),Re(e)==="array"&&e.length===3)return"oklch"}}),Object.assign(Ie,{analyze:gp,average:Cw,bezier:Iw,blend:_n,brewer:d2,Color:Q,colors:Wo,contrast:e2,contrastAPCA:r2,cubehelix:Ww,deltaE:a2,distance:l2,input:Te,interpolate:Zo,limits:vp,mix:Zo,random:Kw,scale:Da,scales:c2,valid:u2});const O2=[{name:"Slate",id:"slate",reference:!1,shades:[{number:50,hexcode:"#f8fafc"},{number:100,hexcode:"#f1f5f9"},{number:200,hexcode:"#e2e8f0"},{number:300,hexcode:"#cbd5e1"},{number:400,hexcode:"#94a3b8"},{number:500,hexcode:"#64748b"},{number:600,hexcode:"#475569"},{number:700,hexcode:"#334155"},{number:800,hexcode:"#1e293b"},{number:900,hexcode:"#0f172a"},{number:950,hexcode:"#020617"}]},{name:"Gray",id:"gray",reference:!1,shades:[{number:50,hexcode:"#f9fafb"},{number:100,hexcode:"#f3f4f6"},{number:200,hexcode:"#e5e7eb"},{number:300,hexcode:"#d1d5db"},{number:400,hexcode:"#9ca3af"},{number:500,hexcode:"#6b7280"},{number:600,hexcode:"#4b5563"},{number:700,hexcode:"#374151"},{number:800,hexcode:"#1f2937"},{number:900,hexcode:"#111827"},{number:950,hexcode:"#030712"}]},{name:"Zinc",id:"zinc",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f4f4f5"},{number:200,hexcode:"#e4e4e7"},{number:300,hexcode:"#d4d4d8"},{number:400,hexcode:"#a1a1aa"},{number:500,hexcode:"#71717a"},{number:600,hexcode:"#52525b"},{number:700,hexcode:"#3f3f46"},{number:800,hexcode:"#27272a"},{number:900,hexcode:"#18181b"},{number:950,hexcode:"#09090b"}]},{name:"Neutral",id:"neutral",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f5f5f5"},{number:200,hexcode:"#e5e5e5"},{number:300,hexcode:"#d4d4d4"},{number:400,hexcode:"#a3a3a3"},{number:500,hexcode:"#737373"},{number:600,hexcode:"#525252"},{number:700,hexcode:"#404040"},{number:800,hexcode:"#262626"},{number:900,hexcode:"#171717"},{number:950,hexcode:"#0a0a0a"}]},{name:"Stone",id:"stone",reference:!1,shades:[{number:50,hexcode:"#fafaf9"},{number:100,hexcode:"#f5f5f4"},{number:200,hexcode:"#e7e5e4"},{number:300,hexcode:"#d6d3d1"},{number:400,hexcode:"#a8a29e"},{number:500,hexcode:"#78716c"},{number:600,hexcode:"#57534e"},{number:700,hexcode:"#44403c"},{number:800,hexcode:"#292524"},{number:900,hexcode:"#1c1917"},{number:950,hexcode:"#0c0a09"}]},{name:"Red",id:"red",reference:!0,shades:[{number:50,hexcode:"#fef2f2"},{number:100,hexcode:"#fee2e2"},{number:200,hexcode:"#fecaca"},{number:300,hexcode:"#fca5a5"},{number:400,hexcode:"#f87171"},{number:500,hexcode:"#ef4444"},{number:600,hexcode:"#dc2626"},{number:700,hexcode:"#b91c1c"},{number:800,hexcode:"#991b1b"},{number:900,hexcode:"#7f1d1d"},{number:950,hexcode:"#450a0a"}]},{name:"Orange",id:"orange",reference:!0,shades:[{number:50,hexcode:"#fff7ed"},{number:100,hexcode:"#ffedd5"},{number:200,hexcode:"#fed7aa"},{number:300,hexcode:"#fdba74"},{number:400,hexcode:"#fb923c"},{number:500,hexcode:"#f97316"},{number:600,hexcode:"#ea580c"},{number:700,hexcode:"#c2410c"},{number:800,hexcode:"#9a3412"},{number:900,hexcode:"#7c2d12"},{number:950,hexcode:"#431407"}]},{name:"Amber",id:"amber",reference:!0,shades:[{number:50,hexcode:"#fffbeb"},{number:100,hexcode:"#fef3c7"},{number:200,hexcode:"#fde68a"},{number:300,hexcode:"#fcd34d"},{number:400,hexcode:"#fbbf24"},{number:500,hexcode:"#f59e0b"},{number:600,hexcode:"#d97706"},{number:700,hexcode:"#b45309"},{number:800,hexcode:"#92400e"},{number:900,hexcode:"#78350f"},{number:950,hexcode:"#451a03"}]},{name:"Yellow",id:"yellow",reference:!0,shades:[{number:50,hexcode:"#fefce8"},{number:100,hexcode:"#fef9c3"},{number:200,hexcode:"#fef08a"},{number:300,hexcode:"#fde047"},{number:400,hexcode:"#facc15"},{number:500,hexcode:"#eab308"},{number:600,hexcode:"#ca8a04"},{number:700,hexcode:"#a16207"},{number:800,hexcode:"#854d0e"},{number:900,hexcode:"#713f12"},{number:950,hexcode:"#422006"}]},{name:"Lime",id:"lime",reference:!0,shades:[{number:50,hexcode:"#f7fee7"},{number:100,hexcode:"#ecfccb"},{number:200,hexcode:"#d9f99d"},{number:300,hexcode:"#bef264"},{number:400,hexcode:"#a3e635"},{number:500,hexcode:"#84cc16"},{number:600,hexcode:"#65a30d"},{number:700,hexcode:"#4d7c0f"},{number:800,hexcode:"#3f6212"},{number:900,hexcode:"#365314"},{number:950,hexcode:"#1a2e05"}]},{name:"Green",id:"green",reference:!0,shades:[{number:50,hexcode:"#f0fdf4"},{number:100,hexcode:"#dcfce7"},{number:200,hexcode:"#bbf7d0"},{number:300,hexcode:"#86efac"},{number:400,hexcode:"#4ade80"},{number:500,hexcode:"#22c55e"},{number:600,hexcode:"#16a34a"},{number:700,hexcode:"#15803d"},{number:800,hexcode:"#166534"},{number:900,hexcode:"#14532d"},{number:950,hexcode:"#052e16"}]},{name:"Emerald",id:"emerald",reference:!0,shades:[{number:50,hexcode:"#ecfdf5"},{number:100,hexcode:"#d1fae5"},{number:200,hexcode:"#a7f3d0"},{number:300,hexcode:"#6ee7b7"},{number:400,hexcode:"#34d399"},{number:500,hexcode:"#10b981"},{number:600,hexcode:"#059669"},{number:700,hexcode:"#047857"},{number:800,hexcode:"#065f46"},{number:900,hexcode:"#064e3b"},{number:950,hexcode:"#022c22"}]},{name:"Teal",id:"teal",reference:!0,shades:[{number:50,hexcode:"#f0fdfa"},{number:100,hexcode:"#ccfbf1"},{number:200,hexcode:"#99f6e4"},{number:300,hexcode:"#5eead4"},{number:400,hexcode:"#2dd4bf"},{number:500,hexcode:"#14b8a6"},{number:600,hexcode:"#0d9488"},{number:700,hexcode:"#0f766e"},{number:800,hexcode:"#115e59"},{number:900,hexcode:"#134e4a"},{number:950,hexcode:"#042f2e"}]},{name:"Cyan",id:"cyan",reference:!0,shades:[{number:50,hexcode:"#ecfeff"},{number:100,hexcode:"#cffafe"},{number:200,hexcode:"#a5f3fc"},{number:300,hexcode:"#67e8f9"},{number:400,hexcode:"#22d3ee"},{number:500,hexcode:"#06b6d4"},{number:600,hexcode:"#0891b2"},{number:700,hexcode:"#0e7490"},{number:800,hexcode:"#155e75"},{number:900,hexcode:"#164e63"},{number:950,hexcode:"#083344"}]},{name:"Sky",id:"sky",reference:!0,shades:[{number:50,hexcode:"#f0f9ff"},{number:100,hexcode:"#e0f2fe"},{number:200,hexcode:"#bae6fd"},{number:300,hexcode:"#7dd3fc"},{number:400,hexcode:"#38bdf8"},{number:500,hexcode:"#0ea5e9"},{number:600,hexcode:"#0284c7"},{number:700,hexcode:"#0369a1"},{number:800,hexcode:"#075985"},{number:900,hexcode:"#0c4a6e"},{number:950,hexcode:"#082f49"}]},{name:"Blue",id:"blue",reference:!0,shades:[{number:50,hexcode:"#eff6ff"},{number:100,hexcode:"#dbeafe"},{number:200,hexcode:"#bfdbfe"},{number:300,hexcode:"#93c5fd"},{number:400,hexcode:"#60a5fa"},{number:500,hexcode:"#3b82f6"},{number:600,hexcode:"#2563eb"},{number:700,hexcode:"#1d4ed8"},{number:800,hexcode:"#1e40af"},{number:900,hexcode:"#1e3a8a"},{number:950,hexcode:"#172554"}]},{name:"Indigo",id:"indigo",reference:!0,shades:[{number:50,hexcode:"#eef2ff"},{number:100,hexcode:"#e0e7ff"},{number:200,hexcode:"#c7d2fe"},{number:300,hexcode:"#a5b4fc"},{number:400,hexcode:"#818cf8"},{number:500,hexcode:"#6366f1"},{number:600,hexcode:"#4f46e5"},{number:700,hexcode:"#4338ca"},{number:800,hexcode:"#3730a3"},{number:900,hexcode:"#312e81"},{number:950,hexcode:"#1e1b4b"}]},{name:"Violet",id:"violet",reference:!0,shades:[{number:50,hexcode:"#f5f3ff"},{number:100,hexcode:"#ede9fe"},{number:200,hexcode:"#ddd6fe"},{number:300,hexcode:"#c4b5fd"},{number:400,hexcode:"#a78bfa"},{number:500,hexcode:"#8b5cf6"},{number:600,hexcode:"#7c3aed"},{number:700,hexcode:"#6d28d9"},{number:800,hexcode:"#5b21b6"},{number:900,hexcode:"#4c1d95"},{number:950,hexcode:"#2e1065"}]},{name:"Purple",id:"purple",reference:!0,shades:[{number:50,hexcode:"#faf5ff"},{number:100,hexcode:"#f3e8ff"},{number:200,hexcode:"#e9d5ff"},{number:300,hexcode:"#d8b4fe"},{number:400,hexcode:"#c084fc"},{number:500,hexcode:"#a855f7"},{number:600,hexcode:"#9333ea"},{number:700,hexcode:"#7e22ce"},{number:800,hexcode:"#6b21a8"},{number:900,hexcode:"#581c87"},{number:950,hexcode:"#3b0764"}]},{name:"Fuchsia",id:"fuchsia",reference:!0,shades:[{number:50,hexcode:"#fdf4ff"},{number:100,hexcode:"#fae8ff"},{number:200,hexcode:"#f5d0fe"},{number:300,hexcode:"#f0abfc"},{number:400,hexcode:"#e879f9"},{number:500,hexcode:"#d946ef"},{number:600,hexcode:"#c026d3"},{number:700,hexcode:"#a21caf"},{number:800,hexcode:"#86198f"},{number:900,hexcode:"#701a75"},{number:950,hexcode:"#4a044e"}]},{name:"Pink",id:"pink",reference:!0,shades:[{number:50,hexcode:"#fdf2f8"},{number:100,hexcode:"#fce7f3"},{number:200,hexcode:"#fbcfe8"},{number:300,hexcode:"#f9a8d4"},{number:400,hexcode:"#f472b6"},{number:500,hexcode:"#ec4899"},{number:600,hexcode:"#db2777"},{number:700,hexcode:"#be185d"},{number:800,hexcode:"#9d174d"},{number:900,hexcode:"#831843"},{number:950,hexcode:"#500724"}]},{name:"Rose",id:"rose",reference:!0,shades:[{number:50,hexcode:"#fff1f2"},{number:100,hexcode:"#ffe4e6"},{number:200,hexcode:"#fecdd3"},{number:300,hexcode:"#fda4af"},{number:400,hexcode:"#fb7185"},{number:500,hexcode:"#f43f5e"},{number:600,hexcode:"#e11d48"},{number:700,hexcode:"#be123c"},{number:800,hexcode:"#9f1239"},{number:900,hexcode:"#881337"},{number:950,hexcode:"#4c0519"}]}];function S2(e){const r=O2.filter(i=>i.reference).map(i=>({...i,shades:i.shades.map(a=>({...a,delta:Ie.deltaE(e,a.hexcode)}))})).map(i=>({...i,closestShade:i.shades.reduce((a,l)=>a.delta<l.delta?a:l)})).reduce((i,a)=>i.closestShade.delta<a.closestShade.delta?i:a),o=r.shades.map(i=>({...i,lightnessDifference:Math.abs(Ie(i.hexcode).get("hsl.l")-e.get("hsl.l"))})),s=o.reduce((i,a)=>i.lightnessDifference<a.lightnessDifference?i:a);return{...r,shades:o,closestShade:s}}function N2(e){const t=Ie(e),n=S2(t),r=t.get("hsl.h"),o=Ie(n.closestShade.hexcode).get("hsl.h"),s=r-o,i=s===0?o.toString():s>0?`+${s}`:s.toString(),a=t.get("hsl.s")/Ie(n.closestShade.hexcode).get("hsl.s");return n.shades.map(u=>{if(u.number===n.closestShade.number)return{number:u.number,hexcode:t.hex()};let c=Ie(u.hexcode);const d=c.get("hsl.s")*a;return c=c.set("hsl.s",d),c=c.set("hsl.h",i),{number:u.number,hexcode:c.hex()}})}class ja extends Error{constructor(){super(),this.name="IndiscriminateError"}}const C2={},T2={fill:"none",viewBox:"0 0 24 24"};function P2(e,t){return g(),C("svg",T2,t[0]||(t[0]=[H("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),H("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))}const Qt=er(C2,[["render",P2],["__scopeId","data-v-687bcaf0"]]),$2={"aria-hidden":"true"},Qu=pe({__name:"MoonButtonBase",props:{label:{},successLabel:{},errorLabel:{},icon:{},variant:{},size:{},working:{type:Boolean},success:{type:Boolean},error:{type:Boolean},disabled:{type:Boolean},type:{}},emits:["click"],setup(e){const t=e,n=ye(Lt),r=se(()=>t.success?t.successLabel??t.label:t.error?t.errorLabel??t.label:t.label),o=se(()=>t.variant?t.variant==="secondary"?`secondary-${(n==null?void 0:n.value.theme.buttons)??"light"}`:t.variant:"primary");return(s,i)=>{var a,l;return g(),J(Fl(s.type==="anchor"?"a":"button"),{class:"moonbase:button",type:s.type||"button",disabled:s.success||s.error||s.working||s.disabled,"data-success":s.success||void 0,"data-error":s.error||void 0,"data-working":s.working||void 0,"data-variant":o.value,"data-size":s.size||"large","data-corners":(a=b(n))==null?void 0:a.theme.corners,"data-background":(l=b(n))==null?void 0:l.theme.colors.background,"data-icon-visible":s.working||s.success||s.error||!!s.icon||void 0,onClick:i[0]||(i[0]=u=>s.$emit("click",u))},{default:O(()=>[H("div",$2,[s.working?(g(),J(Qt,{key:0})):s.success?(g(),J(b(X1),{key:1})):s.error?(g(),J(b(t_),{key:2})):s.icon?(g(),J(Fl(s.icon),{key:3})):fe("",!0)]),M(" "+j(r.value),1)]),_:1},8,["type","disabled","data-success","data-error","data-working","data-variant","data-size","data-corners","data-background","data-icon-visible"])}}}),at=pe({__name:"MoonButton",props:{handler:{type:Function},label:{},success:{},error:{},icon:{},variant:{},size:{},noReset:{type:Boolean},disabled:{type:Boolean}},setup(e){const t=e,n=V(!1),r=V(!1),o=V(!1);async function s(){try{const i=t.handler();i instanceof Promise&&(n.value=!0,await i,n.value=!1,r.value=!0,await Ht(2500),t.noReset||(r.value=!1))}catch(i){if(n.value=!1,i instanceof ja)return;o.value=!0,await Ht(2500),o.value=!1}}return(i,a)=>(g(),J(Qu,{label:i.label,working:n.value,"success-label":i.success,success:r.value,"error-label":i.error,error:o.value,icon:i.icon,disabled:i.disabled,variant:i.variant,size:i.size,onClick:s},null,8,["label","working","success-label","success","error-label","error","icon","disabled","variant","size"]))}}),A2={},D2={class:"moonbase:text-body"};function I2(e,t){return g(),C("span",D2,[xt(e.$slots,"default")])}const rt=er(A2,[["render",I2]]),M2={},V2={class:"moonbase:text-subtext"};function R2(e,t){return g(),C("span",V2,[xt(e.$slots,"default")])}const Le=er(M2,[["render",R2]]),L2={class:"moonbase:about"},j2=pe({__name:"About",setup(e){const t=Ae(),n="0.3.29";return(r,o)=>(g(),C("div",L2,[o[2]||(o[2]=Af('<svg viewBox="0 0 512 512" height="56px" width="56px"><g><path fill="currentColor" d="m493.17795,174.6135c6.257,75.3 -30.577,150.948 -100.579,190.758c-66.292,37.697 -145.001,33.405 -205.402,-4.415c0.409,-1.248 0.638,-2.577 0.638,-3.96c0,-7.026 -5.717,-12.743 -12.743,-12.743c-2.876,0 -5.524,0.969 -7.659,2.582c-18.813,-15.259 -35.159,-34.207 -47.856,-56.534c-54.663,-96.122 -21.054,-218.358 75.069,-273.021a201.218,201.218 0 0 1 33.302,-15.124c-32.428,3.667 -64.663,13.809 -94.827,30.962c-104.526,59.443 -149.511,183.241 -113.473,293.249c-3.376,3.057 -5.513,7.459 -5.513,12.362c0,9.207 7.491,16.698 16.698,16.698c0.136,0 0.267,-0.017 0.401,-0.02a252.205,252.205 0 0 0 8.683,16.691c67.869,119.344 219.635,161.073 338.98,93.204a250.416,250.416 0 0 0 32.893,-22.333c1.045,0.331 2.157,0.513 3.311,0.513c6.047,0 10.968,-4.921 10.968,-10.968c0,-0.605 -0.063,-1.196 -0.157,-1.775c69.545,-64.988 96.008,-165.054 67.266,-256.126m-446.526,25.112a5.071,5.071 0 0 1 -5.066,-5.066a5.072,5.072 0 0 1 5.066,-5.067a5.073,5.073 0 0 1 5.066,5.067a5.072,5.072 0 0 1 -5.066,5.066m-15.819,153.944c-8.238,0 -14.94,-6.702 -14.94,-14.94c0,-8.239 6.702,-14.941 14.94,-14.941c8.239,0 14.941,6.702 14.941,14.941c-0.001,8.238 -6.703,14.94 -14.941,14.94m144.258,-7.659c6.057,0 10.985,4.928 10.985,10.986c0,6.058 -4.928,10.985 -10.985,10.985c-6.058,0 -10.986,-4.928 -10.986,-10.985c0.001,-6.059 4.928,-10.986 10.986,-10.986m70.829,133.004c-5.079,0 -9.21,-4.132 -9.21,-9.21c0,-5.079 4.131,-9.21 9.21,-9.21c5.078,0 9.209,4.131 9.209,9.21c0,5.078 -4.13,9.21 -9.209,9.21m169.18,-37.289c-5.078,0 -9.209,-4.132 -9.209,-9.21s4.131,-9.209 9.209,-9.209s9.21,4.131 9.21,9.209s-4.132,9.21 -9.21,9.21"></path><path fill="currentColor" d="m144.78195,275.9675c46.746,82.201 151.278,110.943 233.48,64.197c59.864,-34.044 91.363,-98.736 86.013,-163.13a170.094,170.094 0 0 0 -5.515,-31.052c-23.045,0.567 -63.864,10.137 -104.194,61.671c-52.045,66.5 -186.285,49.153 -228.855,17.372c3.503,17.443 9.796,34.632 19.071,50.942m233.513,-65.677a8.663,8.663 0 1 1 -8.663,8.663a8.662,8.662 0 0 1 8.663,-8.663m-37.006,62.618c7.02,0 12.712,5.691 12.712,12.712s-5.692,12.712 -12.712,12.712c-7.021,0 -12.712,-5.691 -12.712,-12.712s5.691,-12.712 12.712,-12.712m-102.544,12.712a6.78,6.78 0 1 1 0,13.56a6.78,6.78 0 0 1 0,-13.56"></path><ellipse fill="currentColor" ry="7.3075" rx="7.3075" cy="152.05851" cx="251.33138"></ellipse><ellipse fill="currentColor" ry="5.35076" rx="5.35076" cy="210.31151" cx="204.89499"></ellipse><ellipse fill="currentColor" ry="12.09273" rx="12.09273" cy="200.15625" cx="302.28597"></ellipse></g></svg>',1)),w(b(Wh),{as:"h3"},{default:O(()=>o[0]||(o[0]=[M(" Moonbase Embedded Storefront ")])),_:1}),w(Le,null,{default:O(()=>[M(" Version "+j(b(n)),1)]),_:1}),w(rt,null,{default:O(()=>o[1]||(o[1]=[M(" This store is using the "),H("a",{href:"https://moonbase.sh/solutions/payments",target:"_blank"},"Moonbase Embedded Storefront",-1),M(" module to accept payments, provide authentication and power software licensing. ")])),_:1}),w(at,{label:"Close",variant:"primary",handler:()=>b(t).reset()},null,8,["handler"])]))}});var qt=(e=>(e.SignedIn="signed-in",e.SignedUp="signed-up",e.SignedOut="signed-out",e.RedeemedVoucher="redeemed-voucher",e.DownloadedProduct="downloaded-product",e.ActivatedProduct="activated-product",e.AddedToCart="added-to-cart",e.CheckoutInitiated="checkout-initiated",e.CheckoutClosed="checkout-closed",e.CheckoutCompleted="checkout-completed",e))(qt||{});const F2=["data-corners","data-variant"],U2={class:"moonbase:card-content"},En=pe({__name:"MoonCard",setup(e){const t=ye(Lt);return(n,r)=>{var o,s;return g(),C("div",{class:"moonbase:card","data-corners":(o=b(t))==null?void 0:o.theme.corners,"data-variant":(s=b(t))==null?void 0:s.theme.cards},[H("div",U2,[xt(n.$slots,"default")]),xt(n.$slots,"addon")],8,F2)}}}),B2=["data-corners"],H2=["src"],q2={key:1,class:"moonbase:image-placeholder"},en=pe({__name:"ProductIcon",props:{url:{},size:{}},setup(e){const t=ye(Lt);return(n,r)=>{var o;return g(),C("div",{class:"moonbase:product-icon",style:Ri({width:`${n.size}px`,height:`${n.size}px`}),"data-corners":(o=b(t))==null?void 0:o.theme.corners},[n.url?(g(),C("img",{key:0,src:n.url,alt:""},null,8,H2)):(g(),C("div",q2,[w(b(J1))]))],12,B2)}}}),z2={},W2={class:"moonbase:text-title"};function Z2(e,t){return g(),C("h4",W2,[xt(e.$slots,"default")])}const es=er(z2,[["render",Z2]]),Y2={class:"moonbase:product-card-content"},qp=pe({__name:"ProductCard",props:{product:{}},setup(e){return(t,n)=>(g(),J(En,{class:"moonbase:product-card"},{default:O(()=>[w(en,{url:t.product.iconUrl,size:72},null,8,["url"]),H("div",Y2,[w(es,null,{default:O(()=>{var r;return[M(j((r=t.product)==null?void 0:r.name),1)]}),_:1}),w(Le,null,{default:O(()=>{var r;return[M(j((r=t.product)==null?void 0:r.tagline),1)]}),_:1}),xt(t.$slots,"description")]),xt(t.$slots,"default")]),_:3}))}}),G2={class:"moonbase:auto-activation"},K2={key:0,class:"moonbase:loader"},X2={key:1,class:"moonbase:loader"},J2={key:2,class:"moonbase:loader"},Q2={key:3},eE={key:1,class:"moonbase:loader"},tE={key:2,class:"moonbase:loader"},nE={key:3,class:"moonbase:loader"},rE={key:4,class:"moonbase:auto-activation-content"},oE={key:0,class:"moonbase:auto-activation-option"},sE={class:"moonbase:auto-activation-cta"},iE={key:1,class:"moonbase:auto-activation-option"},aE={class:"moonbase:auto-activation-cta"},lE={key:2,class:"moonbase:auto-activation-option"},uE={key:3,class:"moonbase:auto-activation-option"},cE={class:"moonbase:auto-activation-cta"},dE={key:4,class:"moonbase:auto-activation-option"},fE={key:4,class:"moonbase:auto-activation-cta"},hE={key:5,class:"moonbase:auto-activation-cta"},pE=pe({__name:"AutoActivation",setup(e){const t=Ae(),{user:n,loaded:r}=tt(),o=ye(Rr),s=t.getParameter("token"),{activationRequest:i,loading:a,fulfilling:l,completing:u,error:c,fulfillLicense:d,fulfillTrial:f}=py(s),h=ye(Gt);et(i,m=>{var P;!l.value&&!u.value&&(m==null?void 0:m.status)===fn.Requested&&((P=m==null?void 0:m.licenseEligibility)!=null&&P.eligible)&&d(),(m==null?void 0:m.status)===fn.Completed&&(o==null||o(qt.ActivatedProduct,{product:m.product,fulfillmentType:m.fulfillmentType,user:n.value}))},{deep:!0});const p=se(()=>{if(i.value)return b(Js(i.value.product.id))}),_=se(()=>p.value&&p.value.defaultVariation),{currency:x,addToCart:N,setQuantity:q}=Cr();function z(){t.show(le.Product,te.ViewProduct,{product_id:i.value.product.id})}function B(){t.enqueue(le.Activation,te.ActivateProduct,t.parameters??void 0),t.show(le.Authentication,te.SignIn)}function L(){if(!p.value)return;const m=N(p.value);q(m,1),t.enqueue(le.Activation,te.ActivateProduct,t.parameters),t.show(le.Cart,te.ViewCart)}function D(){var m;t.enqueue(le.Activation,te.ActivateProduct,{...t.parameters,product_id:((m=i.value)==null?void 0:m.product.id)??""}),n.value?t.show(le.Customer,te.RedeemVoucher):t.show(le.Redeem,te.RedeemVoucher)}return(m,P)=>{var I,T,$,A,oe,xe,k;return g(),C("div",G2,[b(a)||!b(r)||!((I=b(h))!=null&&I.loadedStorefront)?(g(),C("div",K2,[w(Qt)])):b(c)?(g(),C("div",X2,[w(nt,null,{default:O(()=>P[0]||(P[0]=[M(" Uh oh ")])),_:1}),w(rt,null,{default:O(()=>[M(j(b(c)),1)]),_:1})])):b(i)?(g(),C("div",Q2,[b(i).product?(g(),J(qp,{key:0,product:b(i).product},null,8,["product"])):fe("",!0),((T=b(i))==null?void 0:T.status)===b(fn).Cancelled?(g(),C("div",eE,[w(nt,null,{default:O(()=>P[3]||(P[3]=[M(" Uh oh ")])),_:1}),w(rt,null,{default:O(()=>P[4]||(P[4]=[M(" This activation request was cancelled, open your app to try again. ")])),_:1})])):b(l)||b(u)?(g(),C("div",tE,[w(Qt),w(rt,null,{default:O(()=>[M(" Activating "+j(b(i).product.name)+"... ",1)]),_:1})])):(($=b(i))==null?void 0:$.status)===b(fn).Completed?(g(),C("div",nE,[w(nt,null,{default:O(()=>P[5]||(P[5]=[M(" Done! ")])),_:1}),w(rt,null,{default:O(()=>P[6]||(P[6]=[M(" Your product is activated. "),H("br",null,null,-1),M(" You may close this window and return to the app. ")])),_:1})])):(g(),C("div",rE,[_.value?(g(),C("div",oE,[w(nt,null,{default:O(()=>P[7]||(P[7]=[M(" Option 1: Purchase product ")])),_:1}),w(rt,null,{default:O(()=>[M(" Buy a copy of "+j(p.value.name)+" for ",1),H("strong",null,j(b(Jt)(p.value.defaultVariation.price[b(x)],b(x))),1),P[8]||(P[8]=M(". "))]),_:1}),H("span",sE,[w(at,{label:"Purchase",variant:"primary",handler:()=>L()},null,8,["handler"])])])):fe("",!0),b(n)?!b(n).ownedProducts||!((A=b(n).ownedProducts)!=null&&A.includes(b(i).product.id))&&!b(n).subscribedProducts||!((oe=b(n).subscribedProducts)!=null&&oe.includes(b(i).product.id))?(g(),C("div",lE,[w(nt,null,{default:O(()=>[M(" Option "+j(_.value?"2":"1")+": Use license ",1)]),_:1}),w(rt,null,{default:O(()=>P[10]||(P[10]=[M(" You don't own any licenses for this product. ")])),_:1})])):(xe=b(n).ownedProducts)!=null&&xe.includes(b(i).product.id)||(k=b(n).subscribedProducts)!=null&&k.includes(b(i).product.id)?(g(),C("div",uE,[w(nt,null,{default:O(()=>[M(" Option "+j(_.value?"2":"1")+": Use license ",1)]),_:1}),w(rt,null,{default:O(()=>P[11]||(P[11]=[M(" You don't have enough free seats on your licenses to activate this device. Either free up a seat or purchase additional licenses. ")])),_:1}),H("span",cE,[w(at,{label:"Licenses",variant:"secondary",handler:()=>z()},null,8,["handler"])])])):fe("",!0):(g(),C("div",iE,[w(nt,null,{default:O(()=>[M(" Option "+j(_.value?"2":"1")+": Use license ",1)]),_:1}),w(rt,null,{default:O(()=>P[9]||(P[9]=[M(" Please sign in to use a license for this product. ")])),_:1}),H("span",aE,[w(at,{label:"Sign in",variant:"secondary",handler:()=>B()},null,8,["handler"])])])),b(i).trialEligibility?(g(),C("div",dE,[w(nt,null,{default:O(()=>[M(" Option "+j(_.value?"3":"2")+": Start trial ",1)]),_:1}),b(i).trialEligibility.eligible&&b(i).trialEligibility.requiresAccount&&!b(n)?(g(),J(rt,{key:0},{default:O(()=>P[12]||(P[12]=[M(" You need to be signed in to start a trial for this product. ")])),_:1})):b(i).trialEligibility.eligible&&b(i).trialEligibility.existing?(g(),J(rt,{key:1},{default:O(()=>[M(" You are eligible for a "+j(b(i).trialEligibility.numberOfDaysPerProduct)+" day trial of which you have "+j(b(i).trialEligibility.numberOfDaysRemaining)+" days remaining. ",1)]),_:1})):b(i).trialEligibility.eligible?(g(),J(rt,{key:2},{default:O(()=>[M(" You are eligible for a "+j(b(i).trialEligibility.numberOfDaysPerProduct)+" day trial. ",1)]),_:1})):(g(),J(rt,{key:3},{default:O(()=>P[13]||(P[13]=[M(" This device or product is not eligible for a trial. ")])),_:1})),b(i).trialEligibility.eligible&&b(i).trialEligibility.requiresAccount&&!b(n)?(g(),C("span",fE,[w(at,{label:"Sign in",variant:"secondary",handler:()=>B()},null,8,["handler"])])):b(i).trialEligibility.eligible?(g(),C("span",hE,[w(at,{label:"Start trial",variant:"secondary",handler:b(f)},null,8,["handler"])])):fe("",!0)])):fe("",!0),P[15]||(P[15]=H("div",{class:"moonbase:grow"},null,-1)),w(Le,{class:"moonbase:auto-activation-redeem"},{default:O(()=>[P[14]||(P[14]=M(" Have a voucher code? ")),H("button",{type:"button",onClick:D}," Redeem now ")]),_:1})]))])):(g(),C("div",J2,[w(nt,null,{default:O(()=>P[1]||(P[1]=[M(" Uh oh ")])),_:1}),w(rt,null,{default:O(()=>P[2]||(P[2]=[M(" Could not find activation request ")])),_:1})]))])}}}),mE={},bE={class:"moonbase:text-caption"};function gE(e,t){return g(),C("span",bE,[xt(e.$slots,"default")])}const Ir=er(mE,[["render",gE]]),vE=["data-corners"],yE=["accept"],_E={"data-error":""},wE=pe({__name:"DeviceTokenInput",props:{error:{}},emits:["input","error"],setup(e,{emit:t}){const n=t,r=ye(Lt),o=V(!1),s=se(()=>{let u=".dt";return r!=null&&r.value&&(u=r.value.activation.deviceTokenFileExtension),u.startsWith(".")?u:`.${u}`});function i(u){const c=new FileReader;c.onload=d=>{var f;n("input",(f=d.target)==null?void 0:f.result)},c.readAsText(u)}function a(u){var d;o.value=!1;const c=(d=u.dataTransfer)==null?void 0:d.files;if(!c||c.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(c[0])}function l(u){const c=u.target,d=c==null?void 0:c.files;if(!d||d.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(d[0])}return(u,c)=>{var d,f;return g(),C("div",{class:Os(["moonbase:device-token-input",{"moonbase:device-token-input--hovering":o.value}]),"data-corners":(d=b(r))==null?void 0:d.theme.corners,onDrag:c[0]||(c[0]=Nr(()=>{},["prevent","stop"])),onDragstart:c[1]||(c[1]=Nr(()=>{},["prevent","stop"])),onDragend:c[2]||(c[2]=Nr(h=>o.value=!1,["prevent","stop"])),onDragover:c[3]||(c[3]=Nr(h=>o.value=!0,["prevent","stop"])),onDragenter:c[4]||(c[4]=Nr(h=>o.value=!0,["prevent","stop"])),onDragleave:c[5]||(c[5]=Nr(h=>o.value=!1,["prevent","stop"])),onDrop:Nr(a,["prevent","stop"])},[w(b(e_)),c[6]||(c[6]=H("label",{for:"fallback-input"},[H("span",{class:"moonbase:underline"},"Choose a machine file"),M(" or drag here to upload ")],-1)),H("input",{id:"fallback-input",type:"file",accept:s.value,class:"moonbase:sr-only",onChange:l},null,40,yE),H("p",_E,j((f=u.error)==null?void 0:f.message),1)],42,vE)}}}),EE={class:"moonbase:manual-activation"},xE={key:1,class:"moonbase:loader"},kE={key:2,class:"moonbase:manual-activation-content"},OE=pe({__name:"ManualActivation",setup(e){const t=ye(Lt),{activateProduct:n}=so(),r=Ai.Offline,o=V(0),s=V(null),i=V(null);async function a(l){o.value=1;try{i.value=await n(l,r),o.value=2}catch(u){s.value=u,o.value=0}}return(l,u)=>(g(),C("div",EE,[w(rt,null,{default:O(()=>u[2]||(u[2]=[M(" Upload your machine file here to get a license file for activating offline devices. The machine file can be generated in the installed app. ")])),_:1}),w(Gs,{mode:"out-in",name:"moonbase:slide-left"},{default:O(()=>[o.value===0?(g(),J(wE,{key:0,error:s.value,onInput:u[0]||(u[0]=c=>a(c)),onError:u[1]||(u[1]=c=>s.value=c)},null,8,["error"])):o.value===1?(g(),C("div",xE,[w(Qt)])):o.value===2&&i.value?(g(),C("div",kE,[w(nt,null,{default:O(()=>u[3]||(u[3]=[M(" Success! ")])),_:1}),w(rt,null,{default:O(()=>u[4]||(u[4]=[M(" Your license can be downloaded below: ")])),_:1}),i.value.license.product?(g(),J(qp,{key:0,product:i.value.license.product},{description:O(()=>[w(Ir,null,{default:O(()=>[M(j(i.value.license.activeNumberOfActivations)+" of "+j(i.value.license.maxNumberOfActivations)+" devices activated ",1)]),_:1})]),default:O(()=>{var c;return[w(qo,{href:i.value.url,target:"_blank",download:((c=b(t))==null?void 0:c.activation.licenseTokenFileName)??"license-file.mb",class:"moonbase:manual-activation-download-button"},{default:O(()=>[w(b(Q1))]),_:1},8,["href","download"])]}),_:1},8,["product"])):fe("",!0),u[5]||(u[5]=H("div",null,null,-1)),u[6]||(u[6]=H("div",null,null,-1))])):fe("",!0)]),_:1})]))}}),SE={class:"moonbase:activation"},NE=pe({__name:"Activation",setup(e){const t=Ae();return(n,r)=>(g(),C("div",SE,[b(t).getParameter("token")?(g(),J(pE,{key:0})):(g(),J(OE,{key:1}))]))}}),CE=["disabled"],zp=Symbol("form-state"),sr=pe({__name:"MoonForm",props:{handler:{type:Function},disabled:{type:Boolean},noReset:{type:Boolean}},setup(e){const t=e,n=V(!1),r=V(!1),o=V(!1),s=se(()=>t.disabled||n.value||r.value||!1);Bt(zp,{working:n,isSuccess:r,isError:o,disabled:s});async function i(){n.value=!0;try{await t.handler(),n.value=!1,r.value=!0,await Ht(2500),t.noReset||(r.value=!1)}catch{n.value=!1,o.value=!0,await Ht(2500),o.value=!1}}return(a,l)=>(g(),C("form",{disabled:s.value,onSubmit:Nr(i,["prevent"])},[xt(a.$slots,"default",{working:n.value,isSuccess:r.value,isError:o.value,disabled:n.value||r.value})],40,CE))}}),TE=["hidden"],PE=["for"],$E=["id","type","name","placeholder","value","disabled","aria-invalid","aria-describedby","data-corners"],AE=["id"],DE=["id"],Nt=pe({inheritAttrs:!1,__name:"MoonInput",props:{name:{},label:{},placeholder:{},type:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{},hidden:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=ye(Lt);return(n,r)=>{var o;return g(),C("div",{class:"moonbase:input",hidden:n.hidden||void 0},[H("label",{for:`mb-${n.name}`},j(n.label),9,PE),H("input",eu({id:`mb-${n.name}`,type:n.type??"text",name:`mb-${n.name}`,placeholder:n.placeholder,value:n.modelValue,disabled:n.disabled,"aria-invalid":!!n.error,"aria-describedby":n.error?`mb-${n.name}-error`:n.hint?`mb-${n.name}-hint`:void 0,"data-corners":(o=b(t))==null?void 0:o.theme.corners},n.$attrs,{onInput:r[0]||(r[0]=s=>{var i;return n.$emit("update:modelValue",(i=s.target)==null?void 0:i.value)})}),null,16,$E),n.error?(g(),C("p",{key:0,id:`mb-${n.name}-error`,class:"moonbase:input-hint","data-type":"error"},j(n.error),9,AE)):n.hint?(g(),C("p",{key:1,id:`mb-${n.name}-hint`,class:"moonbase:input-hint"},j(n.hint),9,DE)):fe("",!0)],8,TE)}}}),ir=pe({__name:"MoonSubmitButton",props:{label:{},success:{},error:{},variant:{},size:{}},setup(e){const{working:t,isSuccess:n,isError:r,disabled:o}=ye(zp);return(s,i)=>(g(),J(Qu,{label:s.label,working:b(t),"success-label":s.success,success:b(n),"error-label":s.error,error:b(r),type:"submit",disabled:b(o),variant:s.variant,size:s.size},null,8,["label","working","success-label","success","error-label","error","disabled","variant","size"]))}}),IE=["data-visible"],ME={class:"moonbase:sign-in-actions"},VE=["data-corners"],RE=pe({__name:"SignIn",emits:["signedIn"],setup(e,{emit:t}){const n=t,r=Ae(),o=tt(),s=ye(Lt),i=ye(Rr),a=V(r.getParameter("email")??""),l=V(""),u=V(null);async function c(){u.value=null;try{const d=await o.signIn(a.value,l.value);i==null||i(qt.SignedIn,{user:d}),Ht(1500).then(()=>n("signedIn",d))}catch(d){throw d instanceof mr?u.value="User not found":u.value=d.message,d}}return(d,f)=>(g(),J(sr,{handler:c,class:"moonbase:sign-in"},{default:O(()=>{var h,p,_;return[w(Nt,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=x=>a.value=x),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=x=>l.value=x),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),H("span",{class:"moonbase:error","data-visible":!!u.value||void 0},j(u.value),9,IE),w(ir,{success:"Signed in",label:"Sign in",error:"Error"}),H("div",ME,[(h=b(s))!=null&&h.auth.signUp.enabled?(g(),J(at,{key:0,label:"Create account",variant:"subtle",handler:()=>b(r).show(b(le).Authentication,b(te).SignUp,{email:a.value})},null,8,["handler"])):fe("",!0),w(at,{label:"Forgot password",variant:"subtle",handler:()=>b(r).show(b(le).Authentication,b(te).ForgotPassword,{email:a.value})},null,8,["handler"])]),(p=b(s))!=null&&p.auth.signIn.hint?(g(),C("div",{key:0,class:"moonbase:sign-in-hint","data-corners":(_=b(s))==null?void 0:_.theme.corners},[w(b(n_)),w(Le,null,{default:O(()=>[M(j(b(s).auth.signIn.hint),1)]),_:1})],8,VE)):fe("",!0)]}),_:1}))}}),ts=[{title:"Password must be at least 6 characters long",test:e=>e.length>=6},{title:"Password must contain uppercase letters",test:e=>/[A-Z]/.test(e)},{title:"Password must contain lowercase letters",test:e=>/[a-z]/.test(e)},{title:"Password must contain at least one number",test:e=>/\d/.test(e)},{title:"Password must contain at least one special character",test:e=>/[=+\-^$*.[\\\]{}()?!@#%&/,><':;|_~`]/.test(e)}],LE={key:0,class:"moonbase:loader"},jE={key:1,class:"moonbase:error","data-visible":""},FE={key:0,class:"moonbase:password-validation"},UE=["data-visible"],BE=pe({__name:"ConfirmAccount",emits:["confirmedAccount"],setup(e,{emit:t}){const n=t,r=Ae(),o=tt(),s=V(!0),i=V(null),a=V(""),l=V(!1),u=V(null),c=se(()=>ts.some(f=>!f.test(a.value)));qe(async()=>{try{const f=r.getParameter("email"),h=r.getParameter("code");if(!f||!h)throw new Error("Link is broken");i.value=await o.confirmAccount(f,h)}catch(f){f instanceof mr?u.value="Could not find a user to confirm":u.value=f.message}s.value=!1});async function d(){var f,h;if(u.value=null,!!((f=i.value)!=null&&f.resetPasswordToken))try{const p=r.getParameter("email");await o.resetPassword(p,a.value,(h=i.value)==null?void 0:h.resetPasswordToken);const _=await o.signIn(p,a.value);Ht(1500).then(()=>n("confirmedAccount",_))}catch(p){throw u.value=p.message,p}}return(f,h)=>(g(),J(sr,{handler:d,disabled:c.value,class:"moonbase:confirm-account"},{default:O(()=>[s.value?(g(),C("div",LE,[w(Qt)])):i.value?(g(),C($e,{key:2},[H("h3",null," Hi "+j(i.value.name)+", ",1),h[2]||(h[2]=H("p",null," Please create a new password for your account: ",-1)),w(Nt,{"model-value":b(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),w(Nt,{modelValue:a.value,"onUpdate:modelValue":h[0]||(h[0]=p=>a.value=p),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:h[1]||(h[1]=p=>l.value=!0)},null,8,["modelValue"]),l.value&&c.value?(g(),C("div",FE,[(g(!0),C($e,null,yt(b(ts).filter(p=>!p.test(a.value)),p=>(g(),J(Le,{key:p.title,"data-error":""},{default:O(()=>[M(j(p.title),1)]),_:2},1024))),128))])):fe("",!0),w(ir,{success:"Password saved",label:"Save password",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!u.value||void 0},j(u.value),9,UE)],64)):(g(),C("div",jE,j(u.value),1))]),_:1},8,["disabled"]))}}),HE={class:"moonbase:confirm-email-change"},qE={key:0,class:"moonbase:loader"},zE={key:1,class:"moonbase:error","data-visible":""},WE=pe({__name:"ConfirmEmail",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=Ae(),{user:o,confirmEmail:s}=tt(),i=V(!0),a=V(null);return qe(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Ht(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>(g(),C("div",HE,[i.value?(g(),C("div",qE,[w(Qt)])):a.value?(g(),C("div",zE,j(a.value),1)):(g(),C($e,{key:2},[w(nt,null,{default:O(()=>u[0]||(u[0]=[M(" Success! ")])),_:1}),u[1]||(u[1]=H("p",null," Thanks for confirming your new email. ",-1)),b(o)?(g(),J(at,{key:0,handler:()=>b(r).show(b(le).Customer,b(te).ViewAccount,void 0,!0),label:"Continue"},null,8,["handler"])):fe("",!0)],64))]))}}),ZE={class:"moonbase:confirm-email-change"},YE={key:0,class:"moonbase:loader"},GE={key:1,class:"moonbase:error","data-visible":""},KE=pe({__name:"ConfirmEmailChange",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=Ae(),{user:o,confirmEmailChange:s}=tt(),i=V(!0),a=V(null);return qe(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Ht(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>{var c;return g(),C("div",ZE,[i.value?(g(),C("div",YE,[w(Qt)])):a.value?(g(),C("div",GE,j(a.value),1)):(g(),C($e,{key:2},[H("h3",null," Hi "+j((c=b(o))==null?void 0:c.name)+", ",1),u[0]||(u[0]=H("p",null," Thanks for confirming your new email. You can now sign in using this new address. ",-1))],64))])}}}),XE=["data-visible"],JE=pe({__name:"ForgotPassword",setup(e){const t=Ae(),n=tt(),r=V(t.getParameter("email")??""),o=V(null),s=V(!1);async function i(){o.value=null;try{await n.forgotPassword(r.value),Ht(1500).then(()=>{s.value=!0})}catch(a){throw a instanceof mr?o.value="User not found":o.value=a.message,a}}return(a,l)=>(g(),J(sr,{handler:i,class:"moonbase:sign-in","no-reset":""},{default:O(({disabled:u})=>[l[1]||(l[1]=H("p",null," Please enter your email address below. You will receive an email message with instructions on how to reset your password. ",-1)),w(Nt,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:"",disabled:u},null,8,["modelValue","disabled"]),w(ir,{success:"Email sent",label:"Reset password",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!o.value||void 0},j(o.value),9,XE)]),_:1}))}}),QE={key:0,class:"moonbase:password-validation"},e5=["data-visible"],t5=pe({__name:"ResetPassword",emits:["passwordReset"],setup(e,{emit:t}){const n=t,r=Ae(),o=tt(),s=se(()=>r.getParameter("email")),i=V(""),a=V(!1),l=V(null),u=se(()=>ts.some(d=>!d.test(i.value)));qe(()=>{(!r.getParameter("email")||!r.getParameter("code"))&&(l.value="Link broken, please try again")});async function c(){l.value=null;const d=r.getParameter("code");if(d)try{await o.resetPassword(s.value,i.value,d);const f=await o.signIn(s.value,i.value);Ht(1500).then(()=>n("passwordReset",f))}catch(f){throw l.value=f.message,f}}return(d,f)=>(g(),J(sr,{handler:c,disabled:u.value,class:"moonbase:reset-password"},{default:O(()=>[H("h3",null," Hi "+j(s.value)+", ",1),f[2]||(f[2]=H("p",null," Please create a new password for your account: ",-1)),w(Nt,{"model-value":b(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),w(Nt,{modelValue:i.value,"onUpdate:modelValue":f[0]||(f[0]=h=>i.value=h),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:f[1]||(f[1]=h=>a.value=!0)},null,8,["modelValue"]),a.value&&u.value?(g(),C("div",QE,[(g(!0),C($e,null,yt(b(ts).filter(h=>!h.test(i.value)),h=>(g(),J(Le,{key:h.title,"data-error":""},{default:O(()=>[M(j(h.title),1)]),_:2},1024))),128))])):fe("",!0),w(ir,{success:"Password saved",label:"Save password",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!l.value||void 0},j(l.value),9,e5)]),_:1},8,["disabled"]))}}),n5={class:"moonbase:checkbox"},r5={class:"moonbase:checkbox-container"},o5=["id","name","checked","disabled","aria-invalid","aria-describedby"],s5={class:"moonbase:checkbox-description"},i5=["for"],a5=["id"],l5=["id"],Wp=pe({inheritAttrs:!1,__name:"MoonCheckbox",props:{name:{},label:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,n)=>(g(),C("div",n5,[H("div",r5,[H("input",eu({id:`mb-${t.name}`,type:"checkbox",name:`mb-${t.name}`,checked:t.modelValue,disabled:t.disabled,"aria-invalid":!!t.error,"aria-describedby":t.error?`mb-${t.name}-error`:t.hint?`mb-${t.name}-hint`:void 0},t.$attrs,{onChange:n[0]||(n[0]=r=>{var o;return t.$emit("update:modelValue",(o=r.target)==null?void 0:o.checked)})}),null,16,o5)]),H("div",s5,[H("label",{for:`mb-${t.name}`},j(t.label),9,i5),t.error?(g(),C("p",{key:0,id:`mb-${t.name}-error`,"data-type":"error"},j(t.error),9,a5)):t.hint?(g(),C("p",{key:1,id:`mb-${t.name}-hint`},j(t.hint),9,l5)):fe("",!0)])]))}}),u5={key:0,class:"moonbase:password-validation"},c5=["href"],d5=["href"],f5=["data-visible"],h5=pe({__name:"SignUp",emits:["signedUp"],setup(e,{emit:t}){const n=t,r=Ae(),o=tt(),s=ye(rc),i=ye(Rr),a=V(""),l=V(r.getParameter("email")??""),u=V(""),c=V(!1),d=V(!1),f=V(null),h=se(()=>ts.some(_=>!_.test(u.value)));async function p(){f.value=null;try{const _=await o.signUp(a.value,l.value,u.value,null,!0,!0,d.value);i==null||i(qt.SignedUp,{user:_}),Ht(1500).then(()=>n("signedUp",_))}catch(_){throw f.value=_.message,_}}return(_,x)=>(g(),J(sr,{handler:p,disabled:h.value,class:"moonbase:sign-up"},{default:O(()=>[w(Nt,{modelValue:a.value,"onUpdate:modelValue":x[0]||(x[0]=N=>a.value=N),label:"Full name",name:"name",type:"text",placeholder:"Full name",autocomplete:"name",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":x[1]||(x[1]=N=>l.value=N),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),w(Nt,{modelValue:u.value,"onUpdate:modelValue":x[2]||(x[2]=N=>u.value=N),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:"",onBlur:x[3]||(x[3]=N=>c.value=!0)},null,8,["modelValue"]),c.value&&h.value?(g(),C("div",u5,[(g(!0),C($e,null,yt(b(ts).filter(N=>!N.test(u.value)),N=>(g(),J(Le,{key:N.title,"data-error":""},{default:O(()=>[M(j(N.title),1)]),_:2},1024))),128))])):fe("",!0),w(Wp,{modelValue:d.value,"onUpdate:modelValue":x[4]||(x[4]=N=>d.value=N),label:"Receive updates and offers by email",name:"newsletter-opt-in"},null,8,["modelValue"]),w(Le,null,{default:O(()=>[x[5]||(x[5]=M(" By signing up, you accept our ")),H("a",{href:`${b(s)}/terms-of-use`,target:"_blank",rel:"noopener"},"terms",8,c5),x[6]||(x[6]=M(" and ")),H("a",{href:`${b(s)}/privacy-policy`,target:"_blank",rel:"noopener"},"privacy policy",8,d5),x[7]||(x[7]=M(". "))]),_:1}),w(ir,{success:"Signed up",label:"Sign up",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!f.value||void 0},j(f.value),9,f5),w(at,{label:"I already have an account",variant:"subtle",handler:()=>b(r).show(b(le).Authentication,b(te).SignIn,{email:l.value})},null,8,["handler"])]),_:1},8,["disabled"]))}}),p5={class:"moonbase:authentication"},m5={key:0,class:"moonbase:loader"},b5=pe({__name:"Authentication",setup(e){const t=Ae(),{loaded:n}=tt();return(r,o)=>(g(),C("div",p5,[w(Gs,{name:b(t).direction===b(gu).Forward?"moonbase:slide-left":"moonbase:slide-right",mode:"out-in"},{default:O(()=>[b(n)?b(t).intent===b(te).SignIn?(g(),J(RE,{key:1,onSignedIn:o[0]||(o[0]=s=>b(t).dequeue())})):b(t).intent===b(te).SignUp?(g(),J(h5,{key:2,onSignedUp:o[1]||(o[1]=s=>b(t).next?b(t).dequeue():b(t).show(b(le).Customer,b(te).ViewAccount,void 0,!0))})):b(t).intent===b(te).ConfirmAccount?(g(),J(BE,{key:3,onConfirmedAccount:o[2]||(o[2]=s=>b(t).show(b(le).Customer,b(te).ViewAccount,void 0,!0))})):b(t).intent===b(te).ConfirmEmail?(g(),J(WE,{key:4})):b(t).intent===b(te).ConfirmEmailChange?(g(),J(KE,{key:5})):b(t).intent===b(te).ForgotPassword?(g(),J(JE,{key:6})):b(t).intent===b(te).ResetPassword?(g(),J(t5,{key:7,onPasswordReset:o[3]||(o[3]=s=>b(t).show(b(le).Customer,b(te).ViewAccount,void 0))})):fe("",!0):(g(),C("div",m5,[w(Qt)]))]),_:1},8,["name"])]))}}),g5={},v5={class:"moonbase:text-subtext-bold"};function y5(e,t){return g(),C("span",v5,[xt(e.$slots,"default")])}const Ct=er(g5,[["render",y5]]);function ec(){const e=ye(Gt);return e||console.warn("No storefront injectable"),{reportProblem:async(t,n)=>{try{await(e==null?void 0:e.client.api.fetch(`/api/customer/insights/${t}`,null,{method:"POST",body:{origin:window==null?void 0:window.location.href,...n}}))}catch{}}}}const _5=["data-corners","data-cards"],Zp=pe({__name:"Counter",props:{modelValue:{}},emits:["update:modelValue"],setup(e){const t=ye(Lt);return(n,r)=>{var o,s;return g(),C("div",{class:"moonbase:counter","data-corners":(o=b(t))==null?void 0:o.theme.corners,"data-cards":(s=b(t))==null?void 0:s.theme.cards},[H("button",{onClick:r[0]||(r[0]=i=>n.$emit("update:modelValue",n.modelValue-1))},[w(b(r_))]),w(Le,null,{default:O(()=>[M(j(n.modelValue.toString().padStart(2,"0")),1)]),_:1}),H("button",{onClick:r[1]||(r[1]=i=>n.$emit("update:modelValue",n.modelValue+1))},[w(b(o_))])],8,_5)}}});function tc(e){switch(e){case hr.Daily:return"day";case hr.Weekly:return"week";case hr.Monthly:return"month";case hr.Quarterly:return"quarter";case hr.Yearly:return"year"}throw new Error("Unknown cycle length")}const w5={class:"moonbase:bundle-cart-item-content"},E5={key:0,class:"moonbase:bundle-cart-item-total"},x5={key:0,class:"moonbase:discount"},k5={class:"moonbase:bundle-cart-item-summary"},O5=["data-open"],S5=["data-open"],N5={class:"moonbase:bundle-cart-item-product-list-item-content"},C5={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},T5=pe({__name:"BundleCartItem",props:{lineItem:{},currency:{}},setup(e){const n=ba(e.lineItem.bundleId),r=Cr(),o=V(!1),s=V(null);return et(o,i=>{s.value&&(s.value.style.height=i?`${s.value.scrollHeight}px`:"0px")}),(i,a)=>(g(),J(En,{class:"moonbase:bundle-cart-item"},{addon:O(()=>{var l;return[H("div",k5,[i.lineItem.bundle?(g(),C("button",{key:0,onClick:a[1]||(a[1]=u=>o.value=!o.value)},[w(Ct,null,{default:O(()=>{var u,c,d;return[M(j((u=i.lineItem.bundle)==null?void 0:u.products.filter(f=>f.included).length)+" ",1),(c=i.lineItem.bundle)!=null&&c.products.some(f=>!f.included)?(g(),C($e,{key:0},[M(" of "+j((d=i.lineItem.bundle)==null?void 0:d.products.length),1)],64)):fe("",!0),a[2]||(a[2]=M(" products "))]}),_:1}),w(Le,null,{default:O(()=>[M(j(o.value?"Hide":"Show")+" ",1),(g(),C("svg",{"data-open":o.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},a[3]||(a[3]=[H("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,O5))]),_:1})])):fe("",!0)]),H("div",{ref_key:"productListRef",ref:s,class:"moonbase:bundle-cart-item-product-list",style:{height:"0px"},"data-open":o.value||void 0},[(g(!0),C($e,null,yt(((l=i.lineItem.bundle)==null?void 0:l.products)||[],u=>(g(),C("div",{key:u.id,class:"moonbase:bundle-cart-item-product-list-item"},[w(en,{url:u==null?void 0:u.iconUrl,size:48},null,8,["url"]),H("div",N5,[w(Ct,{"data-included":u.included||void 0},{default:O(()=>[u.included?(g(),C("svg",C5,a[4]||(a[4]=[H("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):fe("",!0),M(" "+j(u==null?void 0:u.name),1)]),_:2},1032,["data-included"]),u.included?u!=null&&u.tagline?(g(),J(Le,{key:1},{default:O(()=>[M(j(u.tagline),1)]),_:2},1024)):fe("",!0):(g(),J(Le,{key:0},{default:O(()=>a[5]||(a[5]=[M(" You already own this ")])),_:1}))])]))),128))],8,S5)]}),default:O(()=>{var l,u,c,d,f;return[w(en,{url:(l=i.lineItem.bundle)==null?void 0:l.iconUrl,size:72},null,8,["url"]),H("div",w5,[w(Ct,null,{default:O(()=>{var h;return[M(j((h=i.lineItem.bundle)==null?void 0:h.name),1)]}),_:1}),w(Le,{class:"moonbase:bundle-cart-item-tagline","data-truncate":i.lineItem.variation&&i.lineItem.variation.id!==((c=(u=b(n))==null?void 0:u.defaultVariation)==null?void 0:c.id)||void 0},{default:O(()=>{var h;return[M(j((h=i.lineItem.bundle)==null?void 0:h.tagline),1)]}),_:1},8,["data-truncate"]),i.lineItem.variation&&i.lineItem.variation.id!==((f=(d=b(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)?(g(),J(Le,{key:0,class:"moonbase:bundle-cart-item-variation"},{default:O(()=>[M(j(i.lineItem.variation.name),1)]),_:1})):fe("",!0)]),i.lineItem.variation?(g(),C("div",E5,[w(ui,null,{default:O(()=>{var h;return[i.lineItem.variation.hasDiscount?(g(),C("span",x5,j(b(Jt)(i.lineItem.variation.originalPrice[i.currency]*i.lineItem.quantity,i.currency)),1)):fe("",!0),M(" "+j(b(Jt)(i.lineItem.variation.price[i.currency]*i.lineItem.quantity,i.currency))+" ",1),((h=i.lineItem.variation)==null?void 0:h.recurrence.type)==="Recurring"?(g(),J(rt,{key:1},{default:O(()=>[M(" / "+j(b(tc)(i.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):fe("",!0)]}),_:1}),w(Zp,{"model-value":i.lineItem.quantity,"onUpdate:modelValue":a[0]||(a[0]=h=>b(r).setQuantity(i.lineItem,h))},null,8,["model-value"])])):fe("",!0)]}),_:1}))}}),P5={class:"moonbase:product-cart-item-content"},$5={class:"moonbase:product-cart-item-total"},A5={key:0,class:"moonbase:discount"},D5=pe({__name:"ProductCartItem",props:{lineItem:{},currency:{}},setup(e){const t=e,n=Js(t.lineItem.productId);function r(a){var u;if(!a.variation)throw new Error("No variation found");const l=s(a);return(l==null?void 0:l.price[t.currency])??((u=a.variation)==null?void 0:u.price[t.currency])}function o(a){return!!s(a)}function s(a){var u,c;const l=((c=(u=a.variation)==null?void 0:u.pricingTiers)==null?void 0:c.filter(d=>a.quantity>=d.minQuantity))??[];return l.length>0?l[l.length-1]:null}const i=Cr();return(a,l)=>(g(),J(En,{class:"moonbase:product-cart-item"},{default:O(()=>{var u,c,d,f,h;return[w(en,{url:(u=a.lineItem.product)==null?void 0:u.iconUrl,size:72},null,8,["url"]),H("div",P5,[w(Ct,null,{default:O(()=>{var p;return[M(j((p=a.lineItem.product)==null?void 0:p.name),1)]}),_:1}),w(Le,{class:"moonbase:product-cart-item-tagline","data-truncate":a.lineItem.variation&&a.lineItem.variation.id!==((d=(c=b(n))==null?void 0:c.defaultVariation)==null?void 0:d.id)||void 0},{default:O(()=>{var p;return[M(j((p=a.lineItem.product)==null?void 0:p.tagline),1)]}),_:1},8,["data-truncate"]),a.lineItem.variation&&a.lineItem.variation.id!==((h=(f=b(n))==null?void 0:f.defaultVariation)==null?void 0:h.id)?(g(),J(Le,{key:0,class:"moonbase:product-cart-item-variation"},{default:O(()=>[M(j(a.lineItem.variation.name),1)]),_:1})):fe("",!0)]),H("div",$5,[a.lineItem.variation?(g(),J(ui,{key:0},{default:O(()=>{var p;return[a.lineItem.variation.hasDiscount||o(a.lineItem)?(g(),C("span",A5,j(b(Jt)(a.lineItem.variation.originalPrice[a.currency]*a.lineItem.quantity,a.currency)),1)):fe("",!0),M(" "+j(b(Jt)(r(a.lineItem)*a.lineItem.quantity,a.currency))+" ",1),((p=a.lineItem.variation)==null?void 0:p.recurrence.type)==="Recurring"?(g(),J(rt,{key:1},{default:O(()=>[M(" / "+j(b(tc)(a.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):fe("",!0)]}),_:1})):fe("",!0),w(Zp,{"model-value":a.lineItem.quantity,"onUpdate:modelValue":l[0]||(l[0]=p=>b(i).setQuantity(a.lineItem,p))},null,8,["model-value"])])]}),_:1}))}}),I5={class:"moonbase:cart"},M5=["data-background"],V5=["data-corners"],R5={class:"moonbase:cart-total"},L5={"data-error":""},j5=pe({__name:"Cart",setup(e){const t=ec(),{items:n,total:r,currency:o,checkout:s}=Cr(),i=ye(Lt),a=V(null);async function l(){a.value=null;try{const u=await s({redirect:(i==null?void 0:i.value.checkout.redirect)??!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(!(u!=null&&u.completed))throw new ja}catch(u){if(a.value=u.message,!(u instanceof ja))if(u instanceof Nn)t.reportProblem("error",{type:u.name,title:u.title,detail:u.detail,status:u.status,errors:u.errors?Object.fromEntries(Object.entries(u.errors).map(([c,d])=>[c,[d]])):void 0,instance:"Cart.vue:startCheckout"});else{const c=u;t.reportProblem("error",{type:c.name,title:c.message,instance:"Cart.vue:startCheckout"})}throw u}}return(u,c)=>{var d,f;return g(),C("div",I5,[b(n).length>0?(g(),C("ul",{key:0,role:"list",class:"moonbase:cart-items","data-background":(d=b(i))==null?void 0:d.theme.colors.background},[(g(!0),C($e,null,yt(b(n),h=>(g(),C("li",{key:h.id},[h.type==="Product"?(g(),J(D5,{key:0,"line-item":h,currency:b(o)},null,8,["line-item","currency"])):h.type==="Bundle"?(g(),J(T5,{key:1,"line-item":h,currency:b(o)},null,8,["line-item","currency"])):fe("",!0)]))),128))],8,M5)):(g(),C("div",{key:1,class:"moonbase:cart-empty","data-corners":(f=b(i))==null?void 0:f.theme.corners},[w(b(s_)),w(Ct,null,{default:O(()=>c[0]||(c[0]=[M(" Your cart is empty ")])),_:1})],8,V5)),H("div",R5,[c[1]||(c[1]=H("label",null," Total ",-1)),H("span",null,j(b(Jt)(b(r).amount,b(r).currency)),1),c[2]||(c[2]=H("p",null," Sales tax to be calculated at checkout ",-1)),H("p",L5,j(a.value),1)]),w(at,{handler:l,disabled:b(n).length===0,label:"Checkout",error:a.value?"Error":"Cancelled",variant:"primary"},null,8,["disabled","error"])])}}}),F5={class:"moonbase:account"},U5={key:0,class:"moonbase:error"},B5={key:1,class:"moonbase:notification"},H5={key:0,class:"moonbase:error"},q5=pe({__name:"Account",setup(e){var q,z,B;const t=Ae(),{user:n,update:r,setPassword:o,signOut:s}=tt(),i=ye(Rr),a=V(((q=n.value)==null?void 0:q.name)??""),l=V(((z=n.value)==null?void 0:z.email)??""),u=V(((B=n.value)==null?void 0:B.communicationPreferences)??{newsletterOptIn:!1}),c=V(null),d=V(!1),f=V(""),h=V(""),p=V(null);async function _(){c.value=null,d.value=!1;try{(await r(a.value,l.value,void 0,u.value)).needsEmailConfirmationToken&&(d.value=!0)}catch(L){throw c.value=L,L}}async function x(){p.value=null;try{await o(f.value,h.value),f.value="",h.value=""}catch(L){throw p.value=L,L}}async function N(){const L={...n.value};await s(),i==null||i(qt.SignedOut,{user:L}),t.reset()}return(L,D)=>(g(),C("div",F5,[w(sr,{handler:_},{default:O(()=>[w(Nt,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=m=>a.value=m),label:"Full name",name:"name",autocomplete:"name",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":D[1]||(D[1]=m=>l.value=m),label:"Email address",name:"email",type:"email",autocomplete:"email",required:""},null,8,["modelValue"]),w(Wp,{modelValue:u.value.newsletterOptIn,"onUpdate:modelValue":D[2]||(D[2]=m=>u.value.newsletterOptIn=m),label:"Newsletter subscription",name:"newsletter-opt-in",hint:"Receive updates and offers by email"},null,8,["modelValue"]),w(ir,{label:"Update",error:"Error",success:"Updated"}),c.value?(g(),C("p",U5,j(c.value.message),1)):d.value?(g(),C("p",B5," You need to confirm your new email address, please check your inbox ")):fe("",!0)]),_:1}),w(sr,{handler:x},{default:O(()=>[w(Nt,{modelValue:f.value,"onUpdate:modelValue":D[3]||(D[3]=m=>f.value=m),label:"Current password",name:"old-password",type:"password",autocomplete:"current-password",required:""},null,8,["modelValue"]),w(Nt,{modelValue:h.value,"onUpdate:modelValue":D[4]||(D[4]=m=>h.value=m),label:"New password",name:"new-password",type:"password",autocomplete:"new-password",required:""},null,8,["modelValue"]),w(ir,{label:"Change password",error:"Error",success:"Password changed"}),p.value?(g(),C("p",H5,j(p.value.message),1)):fe("",!0)]),_:1}),w(at,{label:"Log out",success:"Logged out",error:"Error",variant:"subtle",handler:N})]))}}),z5={class:"moonbase:products"},W5={key:0,class:"moonbase:loader"},Z5={key:1,class:"moonbase:loader"},Y5={class:"moonbase:products-item-content"},G5=pe({__name:"Products",setup(e){const t=Ae(),{getProducts:n}=so(),r=V(null);return qe(async()=>{let o=await n();for(r.value=o.items;o.hasMore&&o.next;)o=await n(o.next),r.value.push(...o.items)}),(o,s)=>(g(),C("div",z5,[r.value?r.value.length===0?(g(),C("div",Z5," No products found ")):fe("",!0):(g(),C("div",W5,[w(Qt),s[0]||(s[0]=M(" Loading products.. "))])),(g(!0),C($e,null,yt(r.value||[],i=>(g(),C("div",{key:i.id,class:"moonbase:products-item"},[w(en,{url:i.iconUrl,size:48},null,8,["url"]),H("div",Y5,[w(Ct,null,{default:O(()=>[M(j(i.name),1)]),_:2},1024),i.numberOfLicenses||i.subscriptionLicenses?(g(),J(Le,{key:0},{default:O(()=>[M(j((i.numberOfLicenses??0)+(i.subscriptionLicenses??0))+" licenses ",1)]),_:2},1024)):fe("",!0)]),H("div",null,[w(qo,{variant:"subtle",onClick:a=>b(t).show(b(le).Product,b(te).ViewProduct,{product_id:i.id})},{default:O(()=>[w(b(Qh)),s[1]||(s[1]=H("span",{class:"moonbase:clickable"},null,-1))]),_:2},1032,["onClick"])])]))),128))]))}}),K5={class:"moonbase:bundle-redemption-item-content"},X5={class:"moonbase:bundle-redemption-item-summary"},J5=["data-open"],Q5=["data-open"],Yp=pe({__name:"BundleRedemptionItem",props:{bundle:{},quantity:{}},setup(e){const t=V(!1),n=V(null);return et(t,r=>{n.value&&(n.value.style.height=r?`${n.value.scrollHeight}px`:"0px")}),(r,o)=>(g(),J(En,{class:"moonbase:bundle-redemption-item"},{addon:O(()=>{var s;return[H("div",X5,[r.bundle?(g(),C("button",{key:0,onClick:o[0]||(o[0]=i=>t.value=!t.value)},[w(Ct,null,{default:O(()=>{var i;return[M(j((i=r.bundle)==null?void 0:i.products.length)+" products ",1)]}),_:1}),w(Le,null,{default:O(()=>[M(j(t.value?"Hide":"Show")+" ",1),(g(),C("svg",{"data-open":t.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},o[1]||(o[1]=[H("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,J5))]),_:1})])):fe("",!0)]),H("div",{ref_key:"productListRef",ref:n,class:"moonbase:bundle-redemption-item-product-list",style:{height:"0px"},"data-open":t.value||void 0},[(g(!0),C($e,null,yt(((s=r.bundle)==null?void 0:s.products)||[],i=>(g(),C("div",{key:i.id},[w(en,{url:i.iconUrl,size:48},null,8,["url"]),H("div",null,[w(Ct,null,{default:O(()=>[M(j(i.name),1)]),_:2},1024),i.tagline?(g(),J(Le,{key:0},{default:O(()=>[M(j(i.tagline),1)]),_:2},1024)):fe("",!0)])]))),128))],8,Q5)]}),default:O(()=>[w(en,{url:r.bundle.iconUrl,size:72},null,8,["url"]),H("div",K5,[w(Ct,null,{default:O(()=>{var s;return[M(j((s=r.bundle)==null?void 0:s.name),1)]}),_:1}),w(Le,{class:"moonbase:bundle-redemption-item-tagline"},{default:O(()=>{var s;return[M(j((s=r.bundle)==null?void 0:s.tagline),1)]}),_:1})])]),_:1}))}}),ex={class:"moonbase:product-redemption-item-content"},Gp=pe({__name:"ProductRedemptionItem",props:{product:{},quantity:{}},setup(e){return(t,n)=>(g(),J(En,{class:"moonbase:product-redemption-item"},{default:O(()=>[w(en,{url:t.product.iconUrl,size:72},null,8,["url"]),H("div",ex,[w(Ct,null,{default:O(()=>{var r;return[M(j((r=t.product)==null?void 0:r.name),1)]}),_:1}),w(Le,{class:"moonbase:product-redemption-item-tagline"},{default:O(()=>{var r;return[M(j((r=t.product)==null?void 0:r.tagline),1)]}),_:1})])]),_:1}))}}),tx={class:"moonbase:redeem"},nx=["data-visible"],rx={key:1,class:"moonbase:redeem-voucher"},ox={key:0,class:"moonbase:redeem-voucher-content"},sx={key:1,class:"moonbase:redeem-voucher-return"},ix=pe({__name:"Redeem",setup(e){const{redeem:t}=lh(),n=Ae(),r=tt(),o=ye(Rr),s=V(null),i=V(null),a=V(n.getParameter("code")||"");async function l(){i.value=null;try{const u=await t(a.value);s.value=u,o==null||o(qt.RedeemedVoucher,{voucher:u,user:r.user.value})}catch(u){throw i.value=u,u}}return(u,c)=>(g(),C("div",tx,[w(Gs,{mode:"out-in",name:"moonbase:slide-left"},{default:O(()=>[s.value?(g(),C("div",rx,[H("div",null,[w(es,null,{default:O(()=>[M(j(s.value.name),1)]),_:1}),s.value.description?(g(),J(nt,{key:0},{default:O(()=>[M(' "'+j(s.value.description)+'" ',1)]),_:1})):fe("",!0),w(Le,null,{default:O(()=>[w(b(K1)),c[2]||(c[2]=M(" Licenses have been added to your account. "))]),_:1}),w(Le,null,{default:O(()=>[c[3]||(c[3]=M(" Code: ")),H("strong",null,j(s.value.code),1)]),_:1})]),w(nt,null,{default:O(()=>c[4]||(c[4]=[M(" Voucher summary ")])),_:1}),s.value.redeemsProducts.length>0||s.value.redeemsBundles.length>0?(g(),C("div",ox,[(g(!0),C($e,null,yt(s.value.redeemsProducts,({value:d,quantity:f})=>(g(),J(Gp,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(g(!0),C($e,null,yt(s.value.redeemsBundles,({value:d,quantity:f})=>(g(),J(Yp,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):fe("",!0),b(n).next&&b(n).next[0]===b(le).Activation&&(s.value.redeemsProducts.some(d=>{var f,h;return d.value.id===((h=(f=b(n).next)==null?void 0:f[2])==null?void 0:h.product_id)})||s.value.redeemsBundles.some(d=>d.value.products.some(f=>{var h,p;return f.id===((p=(h=b(n).next)==null?void 0:h[2])==null?void 0:p.product_id)})))?(g(),C("div",sx,[w(at,{label:"Return to activation",variant:"primary",icon:b(G1),handler:()=>b(n).dequeue()},null,8,["icon","handler"])])):fe("",!0)])):(g(),J(sr,{key:0,handler:l},{default:O(()=>{var d;return[w(rt,null,{default:O(()=>c[1]||(c[1]=[M(" Do you have a voucher you want to redeem? "),H("br",null,null,-1),M(" Please enter the code below: ")])),_:1}),w(Nt,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=f=>a.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),w(ir,{label:"Redeem voucher",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!i.value||void 0},j((d=i.value)==null?void 0:d.message),9,nx)]}),_:1}))]),_:1})]))}}),Kp=6048e5,ax=864e5,Fa=43200,Xp=1440,Jp=Symbol.for("constructDateFrom");function ar(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Jp in e?e[Jp](t):e instanceof Date?new e.constructor(t):new Date(t)}function vt(e,t){return ar(t||e,e)}let lx={};function di(){return lx}function fi(e,t){var a,l,u,c;const n=di(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=vt(e,t==null?void 0:t.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Ua(e,t){return fi(e,{...t,weekStartsOn:1})}function Qp(e,t){const n=vt(e,t==null?void 0:t.in),r=n.getFullYear(),o=ar(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Ua(o),i=ar(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Ua(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Ba(e){const t=vt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ha(e,...t){const n=ar.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function em(e,t){const n=vt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function ux(e,t,n){const[r,o]=Ha(n==null?void 0:n.in,e,t),s=em(r),i=em(o),a=+s-Ba(s),l=+i-Ba(i);return Math.round((a-l)/ax)}function cx(e,t){const n=Qp(e,t),r=ar(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ua(r)}function qa(e,t){const n=+vt(e)-+vt(t);return n<0?-1:n>0?1:n}function dx(e){return ar(e,Date.now())}function fx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function hx(e){return!(!fx(e)&&typeof e!="number"||isNaN(+vt(e)))}function px(e,t,n){const[r,o]=Ha(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function mx(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function bx(e,t){return+vt(e)-+vt(t)}function gx(e,t){const n=vt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function vx(e,t){const n=vt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function yx(e,t){const n=vt(e,t==null?void 0:t.in);return+gx(n,t)==+vx(n,t)}function _x(e,t,n){const[r,o,s]=Ha(n==null?void 0:n.in,e,e,t),i=qa(o,s),a=Math.abs(px(o,s));if(a<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-i*a);let l=qa(o,s)===-i;yx(r)&&a===1&&qa(r,s)===1&&(l=!1);const u=i*(a-+l);return u===0?0:u}function wx(e,t,n){const r=bx(e,t)/1e3;return mx(n==null?void 0:n.roundingMethod)(r)}function Ex(e,t){const n=vt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const xx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},kx=(e,t,n)=>{let r;const o=xx[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function nc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Ox={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Nx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cx={date:nc({formats:Ox,defaultWidth:"full"}),time:nc({formats:Sx,defaultWidth:"full"}),dateTime:nc({formats:Nx,defaultWidth:"full"})},Tx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Px=(e,t,n,r)=>Tx[e];function hi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const $x={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ax={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Dx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ix={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Mx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Vx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Rx={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:hi({values:$x,defaultWidth:"wide"}),quarter:hi({values:Ax,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hi({values:Dx,defaultWidth:"wide"}),day:hi({values:Ix,defaultWidth:"wide"}),dayPeriod:hi({values:Mx,defaultWidth:"wide",formattingValues:Vx,defaultFormattingWidth:"wide"})};function pi(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?jx(a,d=>d.test(i)):Lx(a,d=>d.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(i.length);return{value:u,rest:c}}}function Lx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function jx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Fx(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const Ux=/^(\d+)(th|st|nd|rd)?/i,Bx=/\d+/i,Hx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},qx={any:[/^b/i,/^(a|c)/i]},zx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wx={any:[/1/i,/2/i,/3/i,/4/i]},Zx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Yx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Gx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Kx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Jx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Qx={ordinalNumber:Fx({matchPattern:Ux,parsePattern:Bx,valueCallback:e=>parseInt(e,10)}),era:pi({matchPatterns:Hx,defaultMatchWidth:"wide",parsePatterns:qx,defaultParseWidth:"any"}),quarter:pi({matchPatterns:zx,defaultMatchWidth:"wide",parsePatterns:Wx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:pi({matchPatterns:Zx,defaultMatchWidth:"wide",parsePatterns:Yx,defaultParseWidth:"any"}),day:pi({matchPatterns:Gx,defaultMatchWidth:"wide",parsePatterns:Kx,defaultParseWidth:"any"}),dayPeriod:pi({matchPatterns:Xx,defaultMatchWidth:"any",parsePatterns:Jx,defaultParseWidth:"any"})},tm={code:"en-US",formatDistance:kx,formatLong:Cx,formatRelative:Px,localize:Rx,match:Qx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ek(e,t){const n=vt(e,t==null?void 0:t.in);return ux(n,Ex(n))+1}function tk(e,t){const n=vt(e,t==null?void 0:t.in),r=+Ua(n)-+cx(n);return Math.round(r/Kp)+1}function nm(e,t){var c,d,f,h;const n=vt(e,t==null?void 0:t.in),r=n.getFullYear(),o=di(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=ar((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=fi(i,t),l=ar((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=fi(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function nk(e,t){var a,l,u,c;const n=di(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=nm(e,t),s=ar((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),fi(s,t)}function rk(e,t){const n=vt(e,t==null?void 0:t.in),r=+fi(n,t)-+nk(n,t);return Math.round(r/Kp)+1}function Ge(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Mr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ge(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ge(n+1,2)},d(e,t){return Ge(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ge(e.getHours()%12||12,t.length)},H(e,t){return Ge(e.getHours(),t.length)},m(e,t){return Ge(e.getMinutes(),t.length)},s(e,t){return Ge(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Ge(o,t.length)}},ns={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},rm={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Mr.y(e,t)},Y:function(e,t,n,r){const o=nm(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return Ge(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ge(s,t.length)},R:function(e,t){const n=Qp(e);return Ge(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ge(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ge(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ge(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Mr.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ge(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=rk(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Ge(o,t.length)},I:function(e,t,n){const r=tk(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ge(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Mr.d(e,t)},D:function(e,t,n){const r=ek(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ge(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ge(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ge(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Ge(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=ns.noon:r===0?o=ns.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=ns.evening:r>=12?o=ns.afternoon:r>=4?o=ns.morning:o=ns.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Mr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Mr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ge(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Mr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Mr.s(e,t)},S:function(e,t){return Mr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return sm(r);case"XXXX":case"XX":return mo(r);case"XXXXX":case"XXX":default:return mo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return sm(r);case"xxxx":case"xx":return mo(r);case"xxxxx":case"xxx":default:return mo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+om(r,":");case"OOOO":default:return"GMT"+mo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+om(r,":");case"zzzz":default:return"GMT"+mo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ge(r,t.length)},T:function(e,t,n){return Ge(+e,t.length)}};function om(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+Ge(s,2)}function sm(e,t){return e%60===0?(e>0?"-":"+")+Ge(Math.abs(e)/60,2):mo(e,t)}function mo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ge(Math.trunc(r/60),2),s=Ge(r%60,2);return n+o+t+s}const im=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},am=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ok={p:am,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return im(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",im(r,t)).replace("{{time}}",am(o,t))}},sk=/^D+$/,ik=/^Y+$/,ak=["D","DD","YY","YYYY"];function lk(e){return sk.test(e)}function uk(e){return ik.test(e)}function ck(e,t,n){const r=dk(e,t,n);if(console.warn(r),ak.includes(e))throw new RangeError(r)}function dk(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const fk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,hk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pk=/^'([^]*?)'?$/,mk=/''/g,bk=/[a-zA-Z]/;function gk(e,t,n){var c,d,f,h;const r=di(),o=r.locale??tm,s=r.firstWeekContainsDate??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=vt(e,n==null?void 0:n.in);if(!hx(a))throw new RangeError("Invalid time value");let l=t.match(hk).map(p=>{const _=p[0];if(_==="p"||_==="P"){const x=ok[_];return x(p,o.formatLong)}return p}).join("").match(fk).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const _=p[0];if(_==="'")return{isToken:!1,value:vk(p)};if(rm[_])return{isToken:!0,value:p};if(_.match(bk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:p}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return l.map(p=>{if(!p.isToken)return p.value;const _=p.value;(uk(_)||lk(_))&&ck(_,t,String(e));const x=rm[_[0]];return x(a,_,o.localize,u)}).join("")}function vk(e){const t=e.match(pk);return t?t[1].replace(mk,"'"):e}function yk(e,t,n){const r=di(),o=(n==null?void 0:n.locale)??r.locale??tm,s=2520,i=qa(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i}),[l,u]=Ha(n==null?void 0:n.in,...i>0?[t,e]:[e,t]),c=wx(u,l),d=(Ba(u)-Ba(l))/1e3,f=Math.round((c-d)/60);let h;if(f<2)return n!=null&&n.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,a):c<10?o.formatDistance("lessThanXSeconds",10,a):c<20?o.formatDistance("lessThanXSeconds",20,a):c<40?o.formatDistance("halfAMinute",0,a):c<60?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",1,a):f===0?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",f,a);if(f<45)return o.formatDistance("xMinutes",f,a);if(f<90)return o.formatDistance("aboutXHours",1,a);if(f<Xp){const p=Math.round(f/60);return o.formatDistance("aboutXHours",p,a)}else{if(f<s)return o.formatDistance("xDays",1,a);if(f<Fa){const p=Math.round(f/Xp);return o.formatDistance("xDays",p,a)}else if(f<Fa*2)return h=Math.round(f/Fa),o.formatDistance("aboutXMonths",h,a)}if(h=_x(u,l),h<12){const p=Math.round(f/Fa);return o.formatDistance("xMonths",p,a)}else{const p=h%12,_=Math.trunc(h/12);return p<3?o.formatDistance("aboutXYears",_,a):p<9?o.formatDistance("overXYears",_,a):o.formatDistance("almostXYears",_+1,a)}}function _k(e,t){return yk(e,dx(e),t)}function wk(e){return _k(e,{addSuffix:!0})}function mi(e,t){return gk(e,t||"PPP")}const Ek={class:"moonbase:subscriptions"},xk={key:0,class:"moonbase:loader"},kk={key:1,class:"moonbase:loader"},Ok=["data-subscription-status"],Sk={class:"moonbase:subscriptions-item-content"},Nk={class:"moonbase:subscriptions-item-content"},Ck=pe({__name:"Subscriptions",setup(e){const t=Ae(),{getSubscriptions:n}=so(),r=V(new Date),o=V(null);return qe(async()=>{let s=await n();for(o.value=s.items;s.hasMore&&s.next;)s=await n(s.next),o.value.push(...s.items)}),(s,i)=>(g(),C("div",Ek,[o.value?o.value.length===0?(g(),C("div",kk," No subscriptions found ")):fe("",!0):(g(),C("div",xk,[w(Qt),i[0]||(i[0]=M(" Loading subscriptions.. "))])),(g(!0),C($e,null,yt(o.value||[],a=>(g(),C("div",{key:a.id,"data-subscription-status":a.status,class:"moonbase:subscriptions-item"},[a.content.type==="Product"?(g(),C($e,{key:0},[w(en,{url:a.content.product.iconUrl,size:48},null,8,["url"]),H("div",Sk,[w(Ct,null,{default:O(()=>[M(j(a.content.quantity)+" x "+j(a.content.product.name),1)]),_:2},1024),w(Le,null,{default:O(()=>[M(j(a.status===b(br).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+j(b(mi)(a.expiresAt)),1)]),_:2},1024)])],64)):(g(),C($e,{key:1},[w(en,{url:a.content.bundle.iconUrl,size:48},null,8,["url"]),H("div",Nk,[w(Ct,null,{default:O(()=>[M(j(a.content.quantity)+" x "+j(a.content.bundle.name),1)]),_:2},1024),w(Le,null,{default:O(()=>[M(j(a.status===b(br).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+j(b(mi)(a.expiresAt)),1)]),_:2},1024)])],64)),H("div",null,[w(qo,{variant:"subtle",onClick:l=>b(t).show(b(le).Subscription,b(te).ManageSubscription,{subscription_id:a.id})},{default:O(()=>[w(b(Qh)),i[1]||(i[1]=H("span",{class:"moonbase:clickable"},null,-1))]),_:2},1032,["onClick"])])],8,Ok))),128))]))}}),Tk={class:"moonbase:customer"},Pk=pe({__name:"Customer",setup(e){const t=Ae(),{user:n}=tt(),r=ye(Lt),o=se(()=>[{intent:te.ViewProducts,title:"Products",content:G5},{intent:te.ViewSubscriptions,title:"Subscriptions",content:Ck,predicate:()=>{var a;return((a=n.value)==null?void 0:a.hasSubscriptions)??!1}},{intent:te.ViewAccount,title:"Account",content:q5},{intent:te.RedeemVoucher,title:"Redeem",content:ix}].filter(a=>a.predicate===void 0||a.predicate())),s=se(()=>o.value.findIndex(a=>a.intent===t.intent));function i(a){t.intent=o.value[a].intent}return(a,l)=>(g(),C("div",Tk,[w(b(M1),{"selected-index":s.value,onChange:i},{default:O(()=>{var u,c;return[w(b(V1),{"data-corners":(u=b(r))==null?void 0:u.theme.corners,"data-background":(c=b(r))==null?void 0:c.theme.colors.background},{default:O(()=>[(g(!0),C($e,null,yt(o.value,d=>(g(),J(b(R1),{key:d.intent},{default:O(()=>[M(j(d.title),1)]),_:2},1024))),128))]),_:1},8,["data-corners","data-background"]),w(b(L1),null,{default:O(()=>[(g(!0),C($e,null,yt(o.value,d=>(g(),J(b(j1),{key:d.intent},{default:O(()=>[(g(),J(Fl(d.content)))]),_:2},1024))),128))]),_:1})]}),_:1},8,["selected-index"])]))}}),$k={class:"moonbase:product-card-content"},Ak=["data-open"],Dk=pe({__name:"ProductCard",props:{product:{}},setup(e){const t=V(!1),n=V(null),r=se(()=>n.value&&n.value.$el&&n.value.$el.scrollHeight>n.value.$el.clientHeight);return(o,s)=>(g(),J(En,{class:"moonbase:product-card"},{addon:O(()=>[H("div",{class:"moonbase:product-card-description","data-open":t.value||void 0},[w(Le,{ref_key:"descriptionRef",ref:n},{default:O(()=>[M(j(o.product.description),1)]),_:1},512),!t.value&&r.value?(g(),C("button",{key:0,onClick:s[0]||(s[0]=i=>t.value=!0)},[w(Ct,null,{default:O(()=>s[1]||(s[1]=[M(" read more ")])),_:1})])):fe("",!0)],8,Ak)]),default:O(()=>[w(en,{url:o.product.iconUrl,size:72},null,8,["url"]),H("div",$k,[w(es,null,{default:O(()=>{var i;return[M(j((i=o.product)==null?void 0:i.name),1)]}),_:1}),w(Le,{class:"moonbase:product-card-tagline"},{default:O(()=>{var i;return[M(j((i=o.product)==null?void 0:i.tagline),1)]}),_:1})])]),_:1}))}});function Ik(e){const t=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e<1)return`${e} B`;const n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);e=Number(e/1024**n);const r=t[n];return e>=10||e%1===0?`${e.toFixed(0)} ${r}`:`${e.toFixed(1)} ${r}`}const Mk={class:"moonbase:product-downloads"},Vk=["data-open"],Rk={key:1,class:"moonbase:product-downloads-content"},Lk={key:2,class:"moonbase:product-downloads-content"},jk={key:3,class:"moonbase:product-downloads-content"},Fk={key:4,class:"moonbase:product-downloads-content"},Uk={class:"moonbase:product-downloads-list"},Bk={class:"moonbase:product-downloads-download-actions"},Hk=pe({__name:"ProductDownloads",props:{product:{}},setup(e){const t=e,n=Ae(),r=tt(),o=ec(),s=ye(Rr),{downloadProduct:i}=so(),a=V(!1),l=V(null),u=se(()=>l.value&&l.value.$el&&l.value.$el.scrollHeight>l.value.$el.clientHeight);function c(){n.enqueue(le.Product,te.DownloadProduct,n.parameters??void 0),n.show(le.Authentication,te.SignIn)}const d=[Sn.Windows,Sn.Mac,Sn.Linux,Sn.Universal];function f(){var q;const N=(((q=navigator.userAgentData)==null?void 0:q.platform)??navigator.platform??"Unknown").toLowerCase();return/mac/.test(N)?Sn.Mac:/win/.test(N)?Sn.Windows:/linux/.test(N)?Sn.Linux:Sn.Universal}const h=f(),p=[h,...d.filter(N=>N!==h)],_=se(()=>p.flatMap(N=>[...(t.product.downloads??[]).filter(q=>q.platform===N)]));async function x(N){try{await i(N),s==null||s(qt.DownloadedProduct,{product:t.product,download:N,user:r.user.value})}catch(q){if(q instanceof Nn)o.reportProblem("error",{type:q.name,title:q.title,detail:q.detail,status:q.status,errors:q.errors?Object.fromEntries(Object.entries(q.errors).map(([z,B])=>[z,[B]])):void 0,instance:"ProductDownloads.vue:startDownload"});else{const z=q;o.reportProblem("error",{type:z.name,title:z.message,instance:"ProductDownloads.vue:startDownload"})}throw q}}return(N,q)=>(g(),C("div",Mk,[w(nt,null,{default:O(()=>[q[1]||(q[1]=M(" Downloads ")),w(Le,null,{default:O(()=>[M(" Version "+j(N.product.version),1)]),_:1})]),_:1}),N.product.releaseDescription?(g(),C("div",{key:0,class:"moonbase:product-downloads-description","data-open":a.value||void 0},[w(Le,{ref_key:"descriptionRef",ref:l},{default:O(()=>[M(j(N.product.releaseDescription),1)]),_:1},512),!a.value&&u.value?(g(),C("button",{key:0,onClick:q[0]||(q[0]=z=>a.value=!0)},[w(Ct,null,{default:O(()=>q[2]||(q[2]=[M(" read more ")])),_:1})])):fe("",!0)],8,Vk)):fe("",!0),N.product.downloadsNeedsUser&&N.product.downloadsNeedsOwnership&&!N.product.numberOfLicenses&&!N.product.subscriptionLicenses?(g(),C("div",Rk,[w(rt,{"data-center":""},{default:O(()=>q[3]||(q[3]=[M(" This product requires ownership to download ")])),_:1}),w(at,{label:"Sign in",handler:c})])):N.product.downloadsNeedsUser&&!b(r).user?(g(),C("div",Lk,[w(rt,{"data-center":""},{default:O(()=>q[4]||(q[4]=[M(" This product requires an account to download ")])),_:1}),w(at,{label:"Sign in",handler:c})])):N.product.downloadsNeedsOwnership&&!N.product.numberOfLicenses&&!N.product.subscriptionLicenses?(g(),C("div",jk,[w(rt,{"data-center":""},{default:O(()=>q[5]||(q[5]=[M(" This product requires ownership to download ")])),_:1})])):(g(),C("div",Fk,[H("div",Uk,[(g(!0),C($e,null,yt(_.value,z=>(g(),J(En,{key:z.key,class:"moonbase:product-downloads-download"},{addon:O(()=>[H("div",Bk,[w(at,{label:`Download for ${z.platform}`,variant:z.platform===b(h)?"primary":"secondary","no-reset":!0,handler:()=>x(z),icon:b(W1)},null,8,["label","variant","handler","icon"])])]),default:O(()=>[H("div",null,[w(nt,null,{default:O(()=>[M(j(z.platform),1)]),_:2},1024),w(Ir,null,{default:O(()=>[M(j(z.name)+" - "+j(b(Ik)(z.size)),1)]),_:2},1024)])]),_:2},1024))),128))]),_.value.length===0?(g(),J(rt,{key:0,"data-center":""},{default:O(()=>q[6]||(q[6]=[M(" No downloadable files found ")])),_:1})):fe("",!0)]))]))}}),qk={class:"moonbase:product-licenses"},zk={key:0,class:"moonbase:loader"},Wk={key:1,class:"moonbase:empty"},Zk={key:0,class:"moonbase:loader"},Yk={key:1,class:"moonbase:product-licenses-activations"},Gk={key:0},Kk={class:"moonbase:product-licenses-activation-actions"},Xk={key:2,class:"moonbase:loader"},Jk={key:3,class:"moonbase:product-licenses-licenses"},Qk=pe({__name:"ProductLicenses",props:{product:{}},emits:["revoked"],setup(e,{emit:t}){const n=e,r=t,{getProductActivations:o,getProductLicenses:s,revokeActivation:i}=so(),a=ec(),l=V(null),u=V(null),c=V(!0);qe(async()=>{if(n.product.maxActivations){let f=await o(n.product.id);for(l.value=f.items.map(h=>({...h,revoking:!1}));f.hasMore&&f.next;)f=await o(n.product.id,f.next),l.value.push(...f.items.map(h=>({...h,revoking:!1})))}if(n.product.externalLicenses){let f=await s(n.product.id);for(u.value=f.items;f.hasMore&&f.next;)f=await s(n.product.id,f.next),u.value.push(...f.items)}c.value=!1});async function d(f){try{await i(f),r("revoked",f),l.value&&Ht(1e3).then(()=>{var h,p;return(p=l.value)==null?void 0:p.splice((h=l.value)==null?void 0:h.indexOf(f),1)})}catch(h){if(h instanceof Nn)a.reportProblem("error",{type:h.name,title:h.title,detail:h.detail,status:h.status,errors:h.errors?Object.fromEntries(Object.entries(h.errors).map(([p,_])=>[p,[_]])):void 0,instance:"ProductLicenses.vue:revoke"});else{const p=h;a.reportProblem("error",{type:p.name,title:p.message,instance:"ProductLicenses.vue:revoke"})}throw h}}return(f,h)=>(g(),C("div",qk,[w(nt,null,{default:O(()=>[h[0]||(h[0]=M(" Licenses ")),f.product.maxActivations&&f.product.maxActivations>0?(g(),J(Le,{key:0},{default:O(()=>[M(j(f.product.currentActivations??0)+" of "+j(f.product.maxActivations)+" seats used ",1)]),_:1})):fe("",!0)]),_:1}),c.value?(g(),C("div",zk,[w(Qt)])):!f.product.numberOfLicenses&&!f.product.subscriptionLicenses?(g(),C("div",Wk,[w(rt,null,{default:O(()=>h[1]||(h[1]=[M(" You don't own any licenses for this product yet ")])),_:1}),f.product&&f.product.website?(g(),J(Qu,{key:0,type:"anchor",href:f.product.website,label:"Purchase",icon:b(Y1)},null,8,["href","icon"])):fe("",!0)])):fe("",!0),c.value?fe("",!0):(g(),C($e,{key:2},[f.product.maxActivations&&f.product.maxActivations>0&&!f.product.currentActivations?(g(),C("div",Zk,[w(b(ep)),w(nt,null,{default:O(()=>h[2]||(h[2]=[M(" No activations yet ")])),_:1})])):fe("",!0),f.product.maxActivations&&l.value?(g(),C("div",Yk,[(g(!0),C($e,null,yt(l.value??[],p=>(g(),J(En,{key:p.id,class:"moonbase:product-licenses-activation"},Gd({default:O(()=>[H("div",null,[w(Ir,null,{default:O(()=>h[3]||(h[3]=[M(" Device ")])),_:1}),w(nt,null,{default:O(()=>[M(j(p.name),1)]),_:2},1024)]),H("div",null,[w(Ir,null,{default:O(()=>h[4]||(h[4]=[M(" Activation ")])),_:1}),w(nt,null,{default:O(()=>[M(j(p.activationMethod),1)]),_:2},1024)]),p.lastValidatedAt?(g(),C("div",Gk,[w(Ir,null,{default:O(()=>h[5]||(h[5]=[M(" First activated ")])),_:1}),w(nt,null,{default:O(()=>[M(j(b(wk)(p.firstValidatedAt)),1)]),_:2},1024)])):fe("",!0)]),_:2},[p.activationMethod===b(Ai).Online?{name:"addon",fn:O(()=>[H("div",Kk,[w(at,{label:"Revoke",variant:"secondary","no-reset":!0,handler:()=>d(p)},null,8,["handler"])])]),key:"0"}:void 0]),1024))),128))])):fe("",!0),(!u.value||u.value.length===0)&&!f.product.maxActivations&&(f.product.numberOfLicenses||f.product.subscriptionLicenses)?(g(),C("div",Xk,[w(b(ep)),f.product.numberOfLicenses?(g(),J(nt,{key:0},{default:O(()=>[M(" You own "+j(f.product.numberOfLicenses)+" license"+j(f.product.numberOfLicenses!==1?"s":"")+" for this product ",1)]),_:1})):fe("",!0),f.product.subscriptionLicenses?(g(),J(nt,{key:1},{default:O(()=>[M(" You have "+j(f.product.subscriptionLicenses)+" subscription license"+j(f.product.subscriptionLicenses!==1?"s":"")+" for this product ",1)]),_:1})):fe("",!0)])):f.product.externalLicenses&&u.value?(g(),C("div",Jk,[(g(!0),C($e,null,yt((u.value??[]).filter(p=>p.externalFulfillment),p=>(g(),J(En,{key:p.id,class:"moonbase:product-licenses-license"},Gd({default:O(()=>[H("div",null,[w(Ir,null,{default:O(()=>[M(j(f.product.name)+" license ",1)]),_:1}),w(nt,null,{default:O(()=>[M(j(p.id),1)]),_:2},1024)])]),_:2},[p.externalFulfillment?{name:"addon",fn:O(()=>[H("code",null,j(p.externalFulfillment),1)]),key:"0"}:void 0]),1024))),128))])):fe("",!0)],64))]))}}),eO={class:"moonbase:download-product"},tO={key:0,class:"moonbase:loader"},nO={key:1,class:"moonbase:loader"},rO={key:2,class:"moonbase:loader"},oO={key:3},sO=pe({__name:"Product",setup(e){const t=Ae(),n=tt(),{loaded:r}=tt(),{getProduct:o}=so(),s=V(null),i=V(null),a=V(!0);return qe(async()=>{const l=t.getParameter("product_id"),u=t.getParameter("version");if(!l){i.value="Link is broken";return}try{s.value=await o(l,u||void 0)}catch(c){i.value=c.message}a.value=!1}),(l,u)=>(g(),C("div",eO,[a.value||!b(r)?(g(),C("div",tO,[w(Qt)])):i.value?(g(),C("div",nO,j(i.value),1)):s.value?(g(),C("div",oO,[w(Dk,{product:s.value},null,8,["product"]),s.value.downloads?(g(),J(Hk,{key:0,product:s.value},null,8,["product"])):fe("",!0),b(n).user.value?(g(),J(Qk,{key:1,product:s.value,onRevoked:u[0]||(u[0]=c=>s.value.currentActivations=(s.value.currentActivations??1)-1)},null,8,["product"])):fe("",!0)])):(g(),C("div",rO," Could not find product "))]))}}),iO={class:"moonbase:peek"},aO=["data-visible"],lO={key:1,class:"moonbase:peek-voucher"},uO={key:0,class:"moonbase:peek-voucher-content"},cO={class:"moonbase:peek-voucher-auth"},dO=pe({__name:"Redeem",setup(e){const{peek:t}=lh(),n=Ae(),r=V(null),o=V(null),s=V(n.getParameter("code")||"");async function i(){o.value=null;try{r.value=await t(s.value),n.parameters={code:r.value.code}}catch(u){throw o.value=u,u}}function a(){n.enqueue(le.Customer,te.RedeemVoucher,{code:s.value}),n.show(le.Authentication,te.SignIn)}function l(){n.enqueue(le.Customer,te.RedeemVoucher,{code:s.value}),n.show(le.Authentication,te.SignUp)}return(u,c)=>(g(),C("div",iO,[w(Gs,{mode:"out-in",name:"moonbase:slide-left"},{default:O(()=>[r.value?(g(),C("div",lO,[H("div",null,[w(es,null,{default:O(()=>[M(j(r.value.name),1)]),_:1}),r.value.description?(g(),J(nt,{key:0},{default:O(()=>[M(' "'+j(r.value.description)+'" ',1)]),_:1})):fe("",!0),w(Le,null,{default:O(()=>[c[2]||(c[2]=M(" Code: ")),H("strong",null,j(r.value.code),1)]),_:1})]),w(nt,null,{default:O(()=>c[3]||(c[3]=[M(" Voucher summary ")])),_:1}),r.value.redeemsProducts.length>0||r.value.redeemsBundles.length>0?(g(),C("div",uO,[(g(!0),C($e,null,yt(r.value.redeemsProducts,({value:d,quantity:f})=>(g(),J(Gp,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(g(!0),C($e,null,yt(r.value.redeemsBundles,({value:d,quantity:f})=>(g(),J(Yp,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):fe("",!0),H("div",cO,[w(rt,null,{default:O(()=>c[4]||(c[4]=[M(" Sign in or create an account to redeem products ")])),_:1}),w(at,{label:"Sign in",variant:"primary",handler:a}),w(at,{label:"Create account",variant:"subtle",handler:l})])])):(g(),J(sr,{key:0,handler:i},{default:O(()=>{var d;return[w(rt,null,{default:O(()=>c[1]||(c[1]=[M(" Do you have a voucher you want to redeem? "),H("br",null,null,-1),M(" Please enter the code below: ")])),_:1}),w(Nt,{modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=f=>s.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),w(ir,{label:"Redeem voucher",error:"Error"}),H("span",{class:"moonbase:error","data-visible":!!o.value||void 0},j((d=o.value)==null?void 0:d.message),9,aO)]}),_:1}))]),_:1})]))}}),fO={class:"moonbase:subscription-content-card-content"},hO=["data-open"],pO={class:"moonbase:subscription-content-card-content"},mO=["data-open"],bO=pe({__name:"ContentCard",props:{subscription:{}},setup(e){const t=V(new Date),n=V(!1),r=V(null),o=se(()=>r.value&&r.value.$el&&r.value.$el.scrollHeight>r.value.$el.clientHeight);return(s,i)=>s.subscription.content.type==="Product"?(g(),J(En,{key:0,class:"moonbase:subscription-content-card"},{addon:O(()=>[H("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[w(Le,{ref_key:"descriptionRef",ref:r},{default:O(()=>[M(j(s.subscription.content.product.description),1)]),_:1},512),!n.value&&o.value?(g(),C("button",{key:0,onClick:i[0]||(i[0]=a=>n.value=!0)},[w(Ct,null,{default:O(()=>i[2]||(i[2]=[M(" read more ")])),_:1})])):fe("",!0)],8,hO)]),default:O(()=>[w(en,{url:s.subscription.content.product.iconUrl,size:72},null,8,["url"]),H("div",fO,[w(es,null,{default:O(()=>{var a;return[M(j((a=s.subscription.content.product)==null?void 0:a.name),1)]}),_:1}),w(Le,{class:"moonbase:subscription-content-card-tagline"},{default:O(()=>{var a;return[M(j((a=s.subscription.content.product)==null?void 0:a.tagline),1)]}),_:1}),w(Le,{class:"moonbase:subscription-content-card-expiry"},{default:O(()=>[M(j(s.subscription.status===b(br).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),H("strong",null,j(b(mi)(s.subscription.expiresAt)),1)]),_:1})])]),_:1})):(g(),J(En,{key:1,class:"moonbase:subscription-content-card"},{addon:O(()=>[H("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[w(Le,{ref_key:"descriptionRef",ref:r},{default:O(()=>[M(j(s.subscription.content.bundle.description),1)]),_:1},512),!n.value&&o.value?(g(),C("button",{key:0,onClick:i[1]||(i[1]=a=>n.value=!0)},[w(Ct,null,{default:O(()=>i[3]||(i[3]=[M(" read more ")])),_:1})])):fe("",!0)],8,mO)]),default:O(()=>[w(en,{url:s.subscription.content.bundle.iconUrl,size:72},null,8,["url"]),H("div",pO,[w(es,null,{default:O(()=>{var a;return[M(j((a=s.subscription.content.bundle)==null?void 0:a.name),1)]}),_:1}),w(Le,{class:"moonbase:subscription-content-card-tagline"},{default:O(()=>{var a;return[M(j((a=s.subscription.content.bundle)==null?void 0:a.tagline),1)]}),_:1}),w(Le,{class:"moonbase:subscription-content-card-expiry"},{default:O(()=>[M(j(s.subscription.status===b(br).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),H("strong",null,j(b(mi)(s.subscription.expiresAt)),1)]),_:1})])]),_:1}))}}),gO={class:"moonbase:subscription"},vO={key:0,class:"moonbase:loader"},yO={key:1,class:"moonbase:loader"},_O={key:2,class:"moonbase:loader"},wO={key:3},EO={class:"moonbase:subscription-actions"},xO=pe({__name:"Subscription",setup(e){const t=Ae(),{loaded:n}=tt(),{getSubscription:r,renewSubscription:o,cancelSubscription:s}=so(),i=V(null),a=V(new Date),l=V(null),u=V(!0);qe(async()=>{const f=t.getParameter("subscription_id");if(!f){l.value="Link is broken";return}try{i.value=await r(f)}catch(h){l.value=h.message}u.value=!1});async function c(){if(!i.value)return;if((await o(i.value.id,{redirect:!1})).completed){const h=await r(i.value.id);Ht(1500).then(()=>i.value=h)}else throw new ja}async function d(){i.value&&(i.value=await s(i.value.id))}return(f,h)=>(g(),C("div",gO,[u.value||!b(n)?(g(),C("div",vO,[w(Qt)])):l.value?(g(),C("div",yO,j(l.value),1)):i.value?(g(),C("div",wO,[w(bO,{subscription:i.value},null,8,["subscription"]),H("div",EO,[i.value.status===b(br).Active?(g(),J(at,{key:0,label:"Cancel subscription",variant:"danger",handler:d})):(g(),J(at,{key:1,label:"Continue subscription",variant:"primary",handler:c})),i.value.status===b(br).Active?(g(),J(Ir,{key:2},{default:O(()=>[h[0]||(h[0]=M(" Cancelling a subscription will let you use the products to the end of the current period, after which you will lose access. If you want to continue using the products later, you may simply renew this subscription whenever you wish. You are currently paying ")),H("strong",null,j(b(Jt)(i.value.total.due)),1),M(" per "+j(b(tc)(i.value.cycleLength))+" for this subscription. ",1)]),_:1})):(g(),J(Ir,{key:3},{default:O(()=>[M(" This subscription has been stopped, and "+j(i.value.expiresAt>a.value?"expires":"expired")+" "+j(b(mi)(i.value.expiresAt))+". If you want to continue using the products after this date, you may continue the subscription to regain access. ",1)]),_:1}))])])):(g(),C("div",_O," Could not find subscription "))]))}}),kO=pe({__name:"App",setup(e){const t=ye(Lt),n=Ae();et(()=>[n.active,n.intent],([o,s])=>{});const r={Inter:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",Roboto:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap","EB Garamond":"https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap",Merriweather:"https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap",Poppins:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap","PT Serif":"https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap",Montserrat:"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap",Aleo:"https://fonts.googleapis.com/css2?family=Aleo:ital,wght@0,100..900;1,100..900&display=swap"};if(t){const o=document.createElement("link");o.rel="stylesheet",o.href=r[t.value.theme.fonts.body],document.head.appendChild(o),document.documentElement.style.setProperty("--moonbase-font-body",t.value.theme.fonts.body??"");const s=document.createElement("link");s.rel="stylesheet",s.href=r[t.value.theme.fonts.heading],document.head.appendChild(s),document.documentElement.style.setProperty("--moonbase-font-heading",t.value.theme.fonts.heading??"");let i=t.value.theme.colors.primary;typeof i=="string"&&(i=Object.fromEntries(N2(i).map(a=>[a.number<=100||a.number===950?a.number-50:a.number-100,a.hexcode]))),document.documentElement.style.setProperty("--moonbase-brand-50",i[50]??""),document.documentElement.style.setProperty("--moonbase-brand-100",i[100]??""),document.documentElement.style.setProperty("--moonbase-brand-200",i[200]??""),document.documentElement.style.setProperty("--moonbase-brand-300",i[300]??""),document.documentElement.style.setProperty("--moonbase-brand-400",i[400]??""),document.documentElement.style.setProperty("--moonbase-brand-500",i[500]??""),document.documentElement.style.setProperty("--moonbase-brand-600",i[600]??""),document.documentElement.style.setProperty("--moonbase-brand-700",i[700]??""),document.documentElement.style.setProperty("--moonbase-brand-800",i[800]??""),document.documentElement.style.setProperty("--moonbase-brand-900",i[900]??"")}return et(()=>t==null?void 0:t.value.theme.dark,o=>{o?document.documentElement.classList.add("moonbase:dark"):document.documentElement.classList.remove("moonbase:dark")},{immediate:!0}),T_(),(o,s)=>{var i;return g(),C($e,null,[(i=b(t))!=null&&i.toolbar.enabled?(g(),J(C_,{key:0})):fe("",!0),w(__,null,{default:O(()=>[b(n).active===b(le).Cart?(g(),J(j5,{key:0})):b(n).active===b(le).Authentication?(g(),J(b5,{key:1})):b(n).active===b(le).Activation?(g(),J(NE,{key:2})):b(n).active===b(le).Product?(g(),J(sO,{key:3})):b(n).active===b(le).Subscription?(g(),J(xO,{key:4})):b(n).active===b(le).Customer?(g(),J(Pk,{key:5})):b(n).active===b(le).Redeem?(g(),J(dO,{key:6})):b(n).active===b(le).About?(g(),J(j2,{key:7})):fe("",!0)]),_:1})],64)}}});function za(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof HTMLElement)}function Wa(e,...t){if(t.length===0)return e;const n=t.shift();if(!n)return e;if(za(e)&&za(n)){for(const r in e)if(Object.prototype.hasOwnProperty.call(n,r)){const o=n[r];za(o)&&za(e[r])?e[r]=Wa(e[r],o):o!==void 0&&(e[r]=o)}}return Wa(e,...t)}function OO(e){const t=n=>Array.isArray(n)?n.map(r=>t(r)):Xe(n)||pn(n)||Po(n)?t(Se(n)):n&&typeof n=="object"?Object.keys(n).reduce((r,o)=>(r[o]=t(n[o]),r),{}):n;return t(e)}const rc=Symbol("url"),Vr=(e,t)=>window.dispatchEvent(new CustomEvent(`moonbase-storefront-${e}`,{detail:OO(t)})),Rr=Symbol("event-emitter");class SO{constructor(){bo(this,"initialized",!1);bo(this,"pinia");bo(this,"storefront");bo(this,"options")}async setup(t,n){var l,u;if(typeof window>"u")throw console.error("Moonbase setup must be done client-side"),new Error("Moonbase setup must be done client-side");if(document.getElementById("moonbase")){console.warn("Moonbase has already been initialized!");return}this.options=V(Wa(((l=this.options)==null?void 0:l.value)??Ch,n??{})),bu("Merged options:",this.options.value);const r=document.createElement("div");r.id="moonbase",r.classList.add("moonbase"),(this.options.value.target??document.body).append(r),this.storefront=vy(t),this.pinia=Hy(),Jv(kO).use(this.storefront).use(this.pinia).provide(Lt,this.options).provide(rc,t.replace(/\/$/,"")).provide(Rr,Vr).mount("#moonbase"),this.initialized=!0,window&&window.location&&this.handleLocationIntent(window.location);const i=Ae(this.pinia),a=tt(this.storefront);(u=this.storefront)==null||u.onCheckoutInitiated((c,d)=>{Vr(qt.CheckoutInitiated,{order:c,total:d,user:a.user.value})}),this.storefront.onCheckoutClosed(c=>{Vr(qt.CheckoutClosed,{order:this.storefront.currentOrder.value,user:a.user.value}),c===te.ViewProducts&&(a.user?i.show(le.Customer,te.ViewProducts):i.show(le.Cart,te.ViewCart))}),this.storefront.onCheckoutCompleted(c=>{Vr(qt.CheckoutCompleted,{order:c,user:a.user.value})})}configure(t){var r;const n=Wa(((r=this.options)==null?void 0:r.value)??Ch,t??{});this.options?this.options.value=n:this.options=V(n)}on(t,n){window.addEventListener(`moonbase-storefront-${t}`,r=>n(r.detail))}handleLocationIntent(t){const n=new URLSearchParams(t.search),r=n.get("mb_intent");if(r&&Object.values(te).includes(r)){const o=Object.fromEntries([...n.entries()].filter(([i])=>i.startsWith("mb_")).map(([i,a])=>[i.substring(3),a]));if(r===te.Checkout&&o.complete)return;this[r](o);for(const i of Object.keys(o))n.delete(`mb_${i}`);const s=n.toString();window.history.replaceState(null,"",t.href.split("?")[0]+(s?`?${s}`:""))}}sign_in(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Authentication,te.SignIn,t)}sign_up(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!((r=this.options)!=null&&r.value.auth.signUp.enabled))throw new Error("Sign ups are not enabled");Ae(this.pinia).show(le.Authentication,te.SignUp,t)}forgot_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Authentication,te.ForgotPassword,t)}reset_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Authentication,te.ResetPassword,t)}confirm_account(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Authentication,te.ConfirmAccount,t)}confirm_email(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Authentication,te.ConfirmEmail,t)}confirm_email_change(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Ae(this.pinia);tt(this.storefront).user.value?n.show(le.Authentication,te.ConfirmEmailChange,t):(n.enqueue(le.Authentication,te.ConfirmEmailChange,t),n.show(le.Authentication,te.SignIn))}view_account(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const t=Ae(this.pinia);tt(this.storefront).user.value?t.show(le.Customer,te.ViewAccount):(t.enqueue(le.Customer,te.ViewAccount),t.show(le.Authentication,te.SignIn))}view_products(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Customer,te.ViewProducts)}view_subscriptions(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Customer,te.ViewSubscriptions)}redeem_voucher(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Ae(this.pinia);tt(this.storefront).user.value?n.show(le.Customer,te.RedeemVoucher,t):n.show(le.Redeem,te.RedeemVoucher,t)}view_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Product,te.ViewProduct,t)}download_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Product,te.DownloadProduct,t)}activate_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Ae(this.pinia),r=tt(this.storefront);!(t!=null&&t.token)&&!r.user.value?(n.enqueue(le.Activation,te.ActivateProduct,t),n.show(le.Authentication,te.SignIn)):n.show(le.Activation,te.ActivateProduct,t)}manage_subscription(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Ae(this.pinia);tt(this.storefront).user.value?n.show(le.Subscription,te.ManageSubscription,t):(n.enqueue(le.Subscription,te.ManageSubscription,t),n.show(le.Authentication,te.SignIn))}view_cart(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.Cart,te.ViewCart)}async add_to_cart(t){var o,s,i,a;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!(t!=null&&t.product_id)&&!(t!=null&&t.bundle_id))throw new Error("You need to provide a product or bundle ID when adding to cart");const n=Cr(this.storefront),r=tt(this.storefront);if(t!=null&&t.product_id){const l=Js(t.product_id,this.storefront);if(l.value){let u=n.addToCart(l.value,(o=l.value.variations)==null?void 0:o.find(c=>c.id===t.variation_id));t!=null&&t.quantity&&(u=n.setQuantity(u,u.quantity+t.quantity-1)),Vr(qt.AddedToCart,{item:u,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const u=Js(t.product_id,this.storefront);if(u.value){let c=n.addToCart(u.value,(s=u.value.variations)==null?void 0:s.find(d=>d.id===t.variation_id));t!=null&&t.quantity&&(c=n.setQuantity(c,c.quantity+t.quantity-1)),Vr(qt.AddedToCart,{item:c,currency:n.currency.value,user:r.user.value})}else throw new Error(`Product '${t.product_id}' not found`)}}if(t!=null&&t.bundle_id){const l=ba(t.bundle_id,this.storefront);if(l.value){let u=n.addToCart(l.value,(i=l.value.variations)==null?void 0:i.find(c=>c.id===t.variation_id));t!=null&&t.quantity&&(u=n.setQuantity(u,u.quantity+t.quantity-1)),Vr(qt.AddedToCart,{item:u,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const u=ba(t.bundle_id,this.storefront);if(u.value){let c=n.addToCart(u.value,(a=u.value.variations)==null?void 0:a.find(d=>d.id===t.variation_id));t!=null&&t.quantity&&(c=n.setQuantity(c,c.quantity+t.quantity-1)),Vr(qt.AddedToCart,{item:c,currency:n.currency.value,user:r.user.value})}else throw new Error(`Bundle '${t.bundle_id}' not found`)}}(t==null?void 0:t.show_cart)!==!1&&Ae(this.pinia).show(le.Cart,te.AddToCart)}async purchase(t){var o,s,i,a,l;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(o=this.storefront)!=null&&o.loadedStorefront||await((s=this.storefront)==null?void 0:s.loadedStorefrontPromise);const n=t?Array.isArray(t)?t:[t]:[];if(n.length===0)throw new Error("No items given to purchase");const r=[];for(const u of n){if(!u.product_id&&!u.bundle_id)throw new Error("You need to provide a product or bundle ID when purchasing");if(u.product_id){const c=Js(u.product_id,this.storefront);if(c.value)r.push({item:c.value,variation:(i=c.value.variations)==null?void 0:i.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Product '${u.product_id}' not found`)}if(u.bundle_id){const c=ba(u.bundle_id,this.storefront);if(c.value)r.push({item:c.value,variation:(a=c.value.variations)==null?void 0:a.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Bundle '${u.bundle_id}' not found`)}}await by(r,{redirect:((l=this.options)==null?void 0:l.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`},this.storefront)}checkout(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(t!=null&&t.complete)return;Cr(this.storefront).checkout({redirect:((r=this.options)==null?void 0:r.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`})}close_checkout(){var t;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(t=this.storefront)==null||t.closeCheckout()}view_about(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(le.About,te.ViewAbout)}}const lm=new SO;globalThis&&(globalThis.Moonbase?console.warn("Multiple instances of Moonbase detected, only one will be initialized"):globalThis.Moonbase=lm),Pt.MoonbaseIntent=te,Pt.default=lm,Pt.eventEmitterKey=Rr,Pt.urlKey=rc,Object.defineProperties(Pt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.29",
|
|
5
5
|
"description": "Package to let you embed Moonbase.sh into your storefront as a payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"date-fns": "^4.1.0",
|
|
25
25
|
"pinia": "^2.1.7",
|
|
26
26
|
"vue": "^3.5.3",
|
|
27
|
-
"@moonbase.sh/vue": "0.3.
|
|
27
|
+
"@moonbase.sh/vue": "0.3.29"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/chroma-js": "^2.4.4",
|