@moonbase.sh/storefront 0.4.55 → 0.4.56

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.
@@ -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 jt=Cv;function pv(e){return mv(e)}function mv(e,t){hv();const n=As();n.__VUE__=!0,C.NODE_ENV!=="production"&&Gd(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=gt,insertStaticContent:p}=e,g=(w,O,F,K=null,W=null,Y=null,ae=void 0,oe=null,re=C.NODE_ENV!=="production"&&kn?!1:!!O.dynamicChildren)=>{if(w===O)return;w&&!so(w,O)&&(K=il(w),$e(w,W,Y,!0),w=null),O.patchFlag===-2&&(re=!1,O.dynamicChildren=null);const{type:X,ref:Ee,shapeFlag:le}=O;switch(X){case Xs:_(w,O,F,K);break;case lt:S(w,O,F,K);break;case Js:w==null?R(O,F,K,ae):C.NODE_ENV!=="production"&&H(w,O,F,ae);break;case ye:ie(w,O,F,K,W,Y,ae,oe,re);break;default:le&1?I(w,O,F,K,W,Y,ae,oe,re):le&6?Se(w,O,F,K,W,Y,ae,oe,re):le&64||le&128?X.process(w,O,F,K,W,Y,ae,oe,re,Ci):C.NODE_ENV!=="production"&&G("Invalid VNode type:",X,`(${typeof X})`)}Ee!=null&&W?Ws(Ee,w&&w.ref,Y,O||w,!O):Ee==null&&w&&w.ref!=null&&Ws(w.ref,null,Y,w,!0)},_=(w,O,F,K)=>{if(w==null)r(O.el=a(O.children),F,K);else{const W=O.el=w.el;O.children!==w.children&&u(W,O.children)}},S=(w,O,F,K)=>{w==null?r(O.el=l(O.children||""),F,K):O.el=w.el},R=(w,O,F,K)=>{[w.el,w.anchor]=p(w.children,O,F,K,w.el,w.anchor)},H=(w,O,F,K)=>{if(O.children!==w.children){const W=f(w.anchor);B(w),[O.el,O.anchor]=p(O.children,F,W,K)}else O.el=w.el,O.anchor=w.anchor},z=({el:w,anchor:O},F,K)=>{let W;for(;w&&w!==O;)W=f(w),r(w,F,K),w=W;r(O,F,K)},B=({el:w,anchor:O})=>{let F;for(;w&&w!==O;)F=f(w),o(w),w=F;o(O)},I=(w,O,F,K,W,Y,ae,oe,re)=>{O.type==="svg"?ae="svg":O.type==="math"&&(ae="mathml"),w==null?y(O,F,K,W,Y,ae,oe,re):$(w,O,W,Y,ae,oe,re)},y=(w,O,F,K,W,Y,ae,oe)=>{let re,X;const{props:Ee,shapeFlag:le,transition:_e,dirs:Pe}=w;if(re=w.el=i(w.type,Y,Ee&&Ee.is,Ee),le&8?c(re,w.children):le&16&&D(w.children,re,null,K,W,su(w,Y),ae,oe),Pe&&Qr(w,null,K,"created"),P(re,w,w.scopeId,ae,K),Ee){for(const et in Ee)et!=="value"&&!Ps(et)&&s(re,et,null,Ee[et],Y,K);"value"in Ee&&s(re,"value",null,Ee.value,Y),(X=Ee.onVnodeBeforeMount)&&Ln(X,K,w)}C.NODE_ENV!=="production"&&($s(re,"__vnode",w,!0),$s(re,"__vueParentComponent",K,!0)),Pe&&Qr(w,null,K,"beforeMount");const Fe=bv(W,_e);Fe&&_e.beforeEnter(re),r(re,O,F),((X=Ee&&Ee.onVnodeMounted)||Fe||Pe)&&jt(()=>{X&&Ln(X,K,w),Fe&&_e.enter(re),Pe&&Qr(w,null,K,"mounted")},W)},P=(w,O,F,K,W)=>{if(F&&h(w,F),K)for(let Y=0;Y<K.length;Y++)h(w,K[Y]);if(W){let Y=W.subTree;if(C.NODE_ENV!=="production"&&Y.patchFlag>0&&Y.patchFlag&2048&&(Y=lu(Y.children)||Y),O===Y||Wf(Y.type)&&(Y.ssContent===O||Y.ssFallback===O)){const ae=W.vnode;P(w,ae,ae.scopeId,ae.slotScopeIds,W.parent)}}},D=(w,O,F,K,W,Y,ae,oe,re=0)=>{for(let X=re;X<w.length;X++){const Ee=w[X]=oe?Tr(w[X]):On(w[X]);g(null,Ee,O,F,K,W,Y,ae,oe)}},$=(w,O,F,K,W,Y,ae)=>{const oe=O.el=w.el;C.NODE_ENV!=="production"&&(oe.__vnode=O);let{patchFlag:re,dynamicChildren:X,dirs:Ee}=O;re|=w.patchFlag&16;const le=w.props||We,_e=O.props||We;let Pe;if(F&&ro(F,!1),(Pe=_e.onVnodeBeforeUpdate)&&Ln(Pe,F,O,w),Ee&&Qr(O,w,F,"beforeUpdate"),F&&ro(F,!0),C.NODE_ENV!=="production"&&kn&&(re=0,ae=!1,X=null),(le.innerHTML&&_e.innerHTML==null||le.textContent&&_e.textContent==null)&&c(oe,""),X?(T(w.dynamicChildren,X,oe,F,K,su(O,W),Y),C.NODE_ENV!=="production"&&Ks(w,O)):ae||be(w,O,oe,null,F,K,su(O,W),Y,!1),re>0){if(re&16)M(oe,le,_e,F,W);else if(re&2&&le.class!==_e.class&&s(oe,"class",null,_e.class,W),re&4&&s(oe,"style",le.style,_e.style,W),re&8){const Fe=O.dynamicProps;for(let et=0;et<Fe.length;et++){const Ge=Fe[et],Gt=le[Ge],Kt=_e[Ge];(Kt!==Gt||Ge==="value")&&s(oe,Ge,Gt,Kt,W,F)}}re&1&&w.children!==O.children&&c(oe,O.children)}else!ae&&X==null&&M(oe,le,_e,F,W);((Pe=_e.onVnodeUpdated)||Ee)&&jt(()=>{Pe&&Ln(Pe,F,O,w),Ee&&Qr(O,w,F,"updated")},K)},T=(w,O,F,K,W,Y,ae)=>{for(let oe=0;oe<O.length;oe++){const re=w[oe],X=O[oe],Ee=re.el&&(re.type===ye||!so(re,X)||re.shapeFlag&198)?d(re.el):F;g(re,X,Ee,null,K,W,Y,ae,!0)}},M=(w,O,F,K,W)=>{if(O!==F){if(O!==We)for(const Y in O)!Ps(Y)&&!(Y in F)&&s(w,Y,O[Y],null,W,K);for(const Y in F){if(Ps(Y))continue;const ae=F[Y],oe=O[Y];ae!==oe&&Y!=="value"&&s(w,Y,oe,ae,W,K)}"value"in F&&s(w,"value",O.value,F.value,W)}},ie=(w,O,F,K,W,Y,ae,oe,re)=>{const X=O.el=w?w.el:a(""),Ee=O.anchor=w?w.anchor:a("");let{patchFlag:le,dynamicChildren:_e,slotScopeIds:Pe}=O;C.NODE_ENV!=="production"&&(kn||le&2048)&&(le=0,re=!1,_e=null),Pe&&(oe=oe?oe.concat(Pe):Pe),w==null?(r(X,F,K),r(Ee,F,K),D(O.children||[],F,Ee,W,Y,ae,oe,re)):le>0&&le&64&&_e&&w.dynamicChildren?(T(w.dynamicChildren,_e,F,W,Y,ae,oe),C.NODE_ENV!=="production"?Ks(w,O):(O.key!=null||W&&O===W.subTree)&&Ks(w,O,!0)):be(w,O,F,Ee,W,Y,ae,oe,re)},Se=(w,O,F,K,W,Y,ae,oe,re)=>{O.slotScopeIds=oe,w==null?O.shapeFlag&512?W.ctx.activate(O,F,K,ae,re):N(O,F,K,W,Y,ae,re):q(w,O,re)},N=(w,O,F,K,W,Y,ae)=>{const oe=w.component=Dv(w,K,W);if(C.NODE_ENV!=="production"&&oe.type.__hmrId&&fg(oe),C.NODE_ENV!=="production"&&(oa(w),jo(oe,"mount")),Zs(w)&&(oe.ctx.renderer=Ci),C.NODE_ENV!=="production"&&jo(oe,"init"),Mv(oe,!1,ae),C.NODE_ENV!=="production"&&Uo(oe,"init"),C.NODE_ENV!=="production"&&kn&&(w.el=null),oe.asyncDep){if(W&&W.registerDep(oe,U,ae),!w.el){const re=oe.subTree=E(lt);S(null,re,O,F)}}else U(oe,w,O,F,W,Y,ae);C.NODE_ENV!=="production"&&(sa(),Uo(oe,"mount"))},q=(w,O,F)=>{const K=O.component=w.component;if(Ov(w,O,F))if(K.asyncDep&&!K.asyncResolved){C.NODE_ENV!=="production"&&oa(O),ne(K,O,F),C.NODE_ENV!=="production"&&sa();return}else K.next=O,K.update();else O.el=w.el,K.vnode=O},U=(w,O,F,K,W,Y,ae)=>{const oe=()=>{if(w.isMounted){let{next:le,bu:_e,u:Pe,parent:Fe,vnode:et}=w;{const Hn=Lf(w);if(Hn){le&&(le.el=et.el,ne(w,le,ae)),Hn.asyncDep.then(()=>{w.isUnmounted||oe()});return}}let Ge=le,Gt;C.NODE_ENV!=="production"&&oa(le||w.vnode),ro(w,!1),le?(le.el=et.el,ne(w,le,ae)):le=et,_e&&Ts(_e),(Gt=le.props&&le.props.onVnodeBeforeUpdate)&&Ln(Gt,Fe,le,et),ro(w,!0),C.NODE_ENV!=="production"&&jo(w,"render");const Kt=Ff(w);C.NODE_ENV!=="production"&&Uo(w,"render");const zn=w.subTree;w.subTree=Kt,C.NODE_ENV!=="production"&&jo(w,"patch"),g(zn,Kt,d(zn.el),il(zn),w,W,Y),C.NODE_ENV!=="production"&&Uo(w,"patch"),le.el=Kt.el,Ge===null&&Sv(w,Kt.el),Pe&&jt(Pe,W),(Gt=le.props&&le.props.onVnodeUpdated)&&jt(()=>Ln(Gt,Fe,le,et),W),C.NODE_ENV!=="production"&&Kd(w),C.NODE_ENV!=="production"&&sa()}else{let le;const{el:_e,props:Pe}=O,{bm:Fe,m:et,parent:Ge,root:Gt,type:Kt}=w,zn=Lo(O);ro(w,!1),Fe&&Ts(Fe),!zn&&(le=Pe&&Pe.onVnodeBeforeMount)&&Ln(le,Ge,O),ro(w,!0);{Gt.ce&&Gt.ce._def.shadowRoot!==!1&&Gt.ce._injectChildStyle(Kt),C.NODE_ENV!=="production"&&jo(w,"render");const Hn=w.subTree=Ff(w);C.NODE_ENV!=="production"&&Uo(w,"render"),C.NODE_ENV!=="production"&&jo(w,"patch"),g(null,Hn,F,K,w,W,Y),C.NODE_ENV!=="production"&&Uo(w,"patch"),O.el=Hn.el}if(et&&jt(et,W),!zn&&(le=Pe&&Pe.onVnodeMounted)){const Hn=O;jt(()=>Ln(le,Ge,Hn),W)}(O.shapeFlag&256||Ge&&Lo(Ge.vnode)&&Ge.vnode.shapeFlag&256)&&w.a&&jt(w.a,W),w.isMounted=!0,C.NODE_ENV!=="production"&&vg(w),O=F=K=null}};w.scope.on();const re=w.effect=new bd(oe);w.scope.off();const X=w.update=re.run.bind(re),Ee=w.job=re.runIfDirty.bind(re);Ee.i=w,Ee.id=w.uid,re.scheduler=()=>la(Ee),ro(w,!0),C.NODE_ENV!=="production"&&(re.onTrack=w.rtc?le=>Ts(w.rtc,le):void 0,re.onTrigger=w.rtg?le=>Ts(w.rtg,le):void 0),X()},ne=(w,O,F)=>{O.component=w;const K=w.vnode.props;w.vnode=O,w.next=null,nv(w,O.props,K,F),fv(w,O.children,F),yn(),Hd(w),_n()},be=(w,O,F,K,W,Y,ae,oe,re=!1)=>{const X=w&&w.children,Ee=w?w.shapeFlag:0,le=O.children,{patchFlag:_e,shapeFlag:Pe}=O;if(_e>0){if(_e&128){he(X,le,F,K,W,Y,ae,oe,re);return}else if(_e&256){ce(X,le,F,K,W,Y,ae,oe,re);return}}Pe&8?(Ee&16&&Si(X,W,Y),le!==X&&c(F,le)):Ee&16?Pe&16?he(X,le,F,K,W,Y,ae,oe,re):Si(X,W,Y,!0):(Ee&8&&c(F,""),Pe&16&&D(le,F,K,W,Y,ae,oe,re))},ce=(w,O,F,K,W,Y,ae,oe,re)=>{w=w||Ao,O=O||Ao;const X=w.length,Ee=O.length,le=Math.min(X,Ee);let _e;for(_e=0;_e<le;_e++){const Pe=O[_e]=re?Tr(O[_e]):On(O[_e]);g(w[_e],Pe,F,null,W,Y,ae,oe,re)}X>Ee?Si(w,W,Y,!0,!1,le):D(O,F,K,W,Y,ae,oe,re,le)},he=(w,O,F,K,W,Y,ae,oe,re)=>{let X=0;const Ee=O.length;let le=w.length-1,_e=Ee-1;for(;X<=le&&X<=_e;){const Pe=w[X],Fe=O[X]=re?Tr(O[X]):On(O[X]);if(so(Pe,Fe))g(Pe,Fe,F,null,W,Y,ae,oe,re);else break;X++}for(;X<=le&&X<=_e;){const Pe=w[le],Fe=O[_e]=re?Tr(O[_e]):On(O[_e]);if(so(Pe,Fe))g(Pe,Fe,F,null,W,Y,ae,oe,re);else break;le--,_e--}if(X>le){if(X<=_e){const Pe=_e+1,Fe=Pe<Ee?O[Pe].el:K;for(;X<=_e;)g(null,O[X]=re?Tr(O[X]):On(O[X]),F,Fe,W,Y,ae,oe,re),X++}}else if(X>_e)for(;X<=le;)$e(w[X],W,Y,!0),X++;else{const Pe=X,Fe=X,et=new Map;for(X=Fe;X<=_e;X++){const Wt=O[X]=re?Tr(O[X]):On(O[X]);Wt.key!=null&&(C.NODE_ENV!=="production"&&et.has(Wt.key)&&G("Duplicate keys found during update:",JSON.stringify(Wt.key),"Make sure keys are unique."),et.set(Wt.key,X))}let Ge,Gt=0;const Kt=_e-Fe+1;let zn=!1,Hn=0;const Ni=new Array(Kt);for(X=0;X<Kt;X++)Ni[X]=0;for(X=Pe;X<=le;X++){const Wt=w[X];if(Gt>=Kt){$e(Wt,W,Y,!0);continue}let qn;if(Wt.key!=null)qn=et.get(Wt.key);else for(Ge=Fe;Ge<=_e;Ge++)if(Ni[Ge-Fe]===0&&so(Wt,O[Ge])){qn=Ge;break}qn===void 0?$e(Wt,W,Y,!0):(Ni[qn-Fe]=X+1,qn>=Hn?Hn=qn:zn=!0,g(Wt,O[qn],F,null,W,Y,ae,oe,re),Gt++)}const Mm=zn?gv(Ni):Ao;for(Ge=Mm.length-1,X=Kt-1;X>=0;X--){const Wt=Fe+X,qn=O[Wt],Vm=Wt+1<Ee?O[Wt+1].el:K;Ni[X]===0?g(null,qn,F,Vm,W,Y,ae,oe,re):zn&&(Ge<0||X!==Mm[Ge]?we(qn,F,Vm,2):Ge--)}}},we=(w,O,F,K,W=null)=>{const{el:Y,type:ae,transition:oe,children:re,shapeFlag:X}=w;if(X&6){we(w.component.subTree,O,F,K);return}if(X&128){w.suspense.move(O,F,K);return}if(X&64){ae.move(w,O,F,Ci);return}if(ae===ye){r(Y,O,F);for(let le=0;le<re.length;le++)we(re[le],O,F,K);r(w.anchor,O,F);return}if(ae===Js){z(w,O,F);return}if(K!==2&&X&1&&oe)if(K===0)oe.beforeEnter(Y),r(Y,O,F),jt(()=>oe.enter(Y),W);else{const{leave:le,delayLeave:_e,afterLeave:Pe}=oe,Fe=()=>{w.ctx.isUnmounted?o(Y):r(Y,O,F)},et=()=>{le(Y,()=>{Fe(),Pe&&Pe()})};_e?_e(Y,Fe,et):et()}else r(Y,O,F)},$e=(w,O,F,K=!1,W=!1)=>{const{type:Y,props:ae,ref:oe,children:re,dynamicChildren:X,shapeFlag:Ee,patchFlag:le,dirs:_e,cacheIndex:Pe}=w;if(le===-2&&(W=!1),oe!=null&&(yn(),Ws(oe,null,F,w,!0),_n()),Pe!=null&&(O.renderCache[Pe]=void 0),Ee&256){O.ctx.deactivate(w);return}const Fe=Ee&1&&_e,et=!Lo(w);let Ge;if(et&&(Ge=ae&&ae.onVnodeBeforeUnmount)&&Ln(Ge,O,w),Ee&6)S3(w.component,F,K);else{if(Ee&128){w.suspense.unmount(F,K);return}Fe&&Qr(w,null,O,"beforeUnmount"),Ee&64?w.type.remove(w,O,F,Ci,K):X&&!X.hasOnce&&(Y!==ye||le>0&&le&64)?Si(X,O,F,!1,!0):(Y===ye&&le&384||!W&&Ee&16)&&Si(re,O,F),K&&Et(w)}(et&&(Ge=ae&&ae.onVnodeUnmounted)||Fe)&&jt(()=>{Ge&&Ln(Ge,O,w),Fe&&Qr(w,null,O,"unmounted")},F)},Et=w=>{const{type:O,el:F,anchor:K,transition:W}=w;if(O===ye){C.NODE_ENV!=="production"&&w.patchFlag>0&&w.patchFlag&2048&&W&&!W.persisted?w.children.forEach(ae=>{ae.type===lt?o(ae.el):Et(ae)}):Ur(F,K);return}if(O===Js){B(w);return}const Y=()=>{o(F),W&&!W.persisted&&W.afterLeave&&W.afterLeave()};if(w.shapeFlag&1&&W&&!W.persisted){const{leave:ae,delayLeave:oe}=W,re=()=>ae(F,Y);oe?oe(w.el,Y,re):re()}else Y()},Ur=(w,O)=>{let F;for(;w!==O;)F=f(w),o(w),w=F;o(O)},S3=(w,O,F)=>{C.NODE_ENV!=="production"&&w.type.__hmrId&&hg(w);const{bum:K,scope:W,job:Y,subTree:ae,um:oe,m:re,a:X,parent:Ee,slots:{__:le}}=w;jf(re),jf(X),K&&Ts(K),Ee&&ve(le)&&le.forEach(_e=>{Ee.renderCache[_e]=void 0}),W.stop(),Y&&(Y.flags|=8,$e(ae,w,O,F)),oe&&jt(oe,O),jt(()=>{w.isUnmounted=!0},O),O&&O.pendingBranch&&!O.isUnmounted&&w.asyncDep&&!w.asyncResolved&&w.suspenseId===O.pendingId&&(O.deps--,O.deps===0&&O.resolve()),C.NODE_ENV!=="production"&&_g(w)},Si=(w,O,F,K=!1,W=!1,Y=0)=>{for(let ae=Y;ae<w.length;ae++)$e(w[ae],O,F,K,W)},il=w=>{if(w.shapeFlag&6)return il(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const O=f(w.anchor||w.el),F=O&&O[ef];return F?f(F):O};let fc=!1;const Im=(w,O,F)=>{w==null?O._vnode&&$e(O._vnode,null,null,!0):g(O._vnode||null,w,O,null,null,null,F),O._vnode=w,fc||(fc=!0,Hd(),qd(),fc=!1)},Ci={p:g,um:$e,m:we,r:Et,mt:N,mc:D,pc:be,pbc:T,n:il,o:e};return{render:Im,hydrate:void 0,createApp:Jg(Im)}}function su({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 ro({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function bv(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ks(e,t,n=!1){const r=e.children,o=t.children;if(ve(r)&&ve(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]=Tr(o[s]),a.el=i.el),!n&&a.patchFlag!==-2&&Ks(i,a)),a.type===Xs&&(a.el=i.el),a.type===lt&&!a.el&&(a.el=i.el),C.NODE_ENV!=="production"&&a.el&&(a.el.__vnode=a)}}function gv(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 Lf(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Lf(t)}function jf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const vv=Symbol.for("v-scx"),yv=()=>{{const e=me(vv);return e||C.NODE_ENV!=="production"&&G("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Jt(e,t){return iu(e,null,t)}function Xe(e,t,n){return C.NODE_ENV!=="production"&&!ke(t)&&G("`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."),iu(e,t,n)}function iu(e,t,n=We){const{immediate:r,deep:o,flush:s,once:i}=n;C.NODE_ENV!=="production"&&!t&&(r!==void 0&&G('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&G('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&G('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=at({},n);C.NODE_ENV!=="production"&&(a.onWarn=G);const l=t&&r||!t&&s!=="post";let u;if(ni){if(s==="sync"){const h=yv();u=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=gt,h.resume=gt,h.pause=gt,h}}const c=ht;a.call=(h,p,g)=>En(h,c,p,g);let d=!1;s==="post"?a.scheduler=h=>{jt(h,c&&c.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(h,p)=>{p?h():la(h)}),a.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const f=rg(e,t,a);return ni&&(u?u.push(f):l&&f()),f}function _v(e,t,n){const r=this.proxy,o=tt(e)?e.includes(".")?Uf(r,e):()=>r[e]:e.bind(r,r);let s;ke(t)?s=t:(s=t.handler,n=t);const i=ti(this),a=iu(o,s.bind(r),n);return i(),a}function Uf(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 wv=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${It(t)}Modifiers`]||e[`${Er(t)}Modifiers`];function Ev(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||We;if(C.NODE_ENV!=="production"){const{emitsOptions:c,propsOptions:[d]}=e;if(c)if(!(t in c))(!d||!(Yr(It(t))in d))&&G(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${Yr(It(t))}" prop.`);else{const f=c[t];ke(f)&&(f(...n)||G(`Invalid event arguments: event validation failed for event "${t}".`))}}let o=n;const s=t.startsWith("update:"),i=s&&wv(r,t.slice(7));if(i&&(i.trim&&(o=n.map(c=>tt(c)?c.trim():c)),i.number&&(o=n.map(mb))),C.NODE_ENV!=="production"&&kg(e,t,o),C.NODE_ENV!=="production"){const c=t.toLowerCase();c!==t&&r[Yr(c)]&&G(`Event "${c}" is emitted in component ${xa(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 "${Er(t)}" instead of "${t}".`)}let a,l=r[a=Yr(t)]||r[a=Yr(It(t))];!l&&s&&(l=r[a=Yr(Er(t))]),l&&En(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,En(u,e,6,o)}}function Bf(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(!ke(e)){const l=u=>{const c=Bf(u,t,!0);c&&(a=!0,at(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):(ve(s)?s.forEach(l=>i[l]=null):at(i,s),He(e)&&r.set(e,i),i)}function ya(e,t){return!e||!Ns(t)?!1:(t=t.slice(2).replace(/Once$/,""),Be(e,t[0].toLowerCase()+t.slice(1))||Be(e,Er(t))||Be(e,t))}let au=!1;function _a(){au=!0}function Ff(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:g}=e,_=da(e);let S,R;C.NODE_ENV!=="production"&&(au=!1);try{if(n.shapeFlag&4){const B=o||r,I=C.NODE_ENV!=="production"&&h.__isScriptSetup?new Proxy(B,{get(y,P,D){return G(`Property '${String(P)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(y,P,D)}}):B;S=On(u.call(I,B,c,C.NODE_ENV!=="production"?In(d):d,h,f,p)),R=a}else{const B=t;C.NODE_ENV!=="production"&&a===d&&_a(),S=On(B.length>1?B(C.NODE_ENV!=="production"?In(d):d,C.NODE_ENV!=="production"?{get attrs(){return _a(),In(a)},slots:i,emit:l}:{attrs:a,slots:i,emit:l}):B(C.NODE_ENV!=="production"?In(d):d,null)),R=t.props?a:kv(a)}}catch(B){Qs.length=0,Bs(B,e,1),S=E(lt)}let H=S,z;if(C.NODE_ENV!=="production"&&S.patchFlag>0&&S.patchFlag&2048&&([H,z]=zf(S)),R&&g!==!1){const B=Object.keys(R),{shapeFlag:I}=H;if(B.length){if(I&7)s&&B.some(Wi)&&(R=xv(R,s)),H=xn(H,R,!1,!0);else if(C.NODE_ENV!=="production"&&!au&&H.type!==lt){const y=Object.keys(a),P=[],D=[];for(let $=0,T=y.length;$<T;$++){const M=y[$];Ns(M)?Wi(M)||P.push(M[2].toLowerCase()+M.slice(3)):D.push(M)}D.length&&G(`Extraneous non-props attributes (${D.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),P.length&&G(`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&&(C.NODE_ENV!=="production"&&!Hf(H)&&G("Runtime directive used on component with non-element root node. The directives will not function as intended."),H=xn(H,null,!1,!0),H.dirs=H.dirs?H.dirs.concat(n.dirs):n.dirs),n.transition&&(C.NODE_ENV!=="production"&&!Hf(H)&&G("Component inside <Transition> renders non-element root node that cannot be animated."),qs(H,n.transition)),C.NODE_ENV!=="production"&&z?z(H):S=H,da(_),S}const zf=e=>{const t=e.children,n=e.dynamicChildren,r=lu(t,!1);if(r){if(C.NODE_ENV!=="production"&&r.patchFlag>0&&r.patchFlag&2048)return zf(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[On(r),i]};function lu(e,t=!0){let n;for(let r=0;r<e.length;r++){const o=e[r];if(oo(o)){if(o.type!==lt||o.children==="v-if"){if(n)return;if(n=o,C.NODE_ENV!=="production"&&t&&n.patchFlag>0&&n.patchFlag&2048)return lu(n.children)}}else return}return n}const kv=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ns(n))&&((t||(t={}))[n]=e[n]);return t},xv=(e,t)=>{const n={};for(const r in e)(!Wi(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n},Hf=e=>e.shapeFlag&7||e.type===lt;function Ov(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:a,patchFlag:l}=t,u=s.emitsOptions;if(C.NODE_ENV!=="production"&&(o||a)&&kn||t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?qf(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]&&!ya(u,f))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?qf(r,i,u):!0:!!i;return!1}function qf(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]&&!ya(n,s))return!0}return!1}function Sv({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 Wf=e=>e.__isSuspense;function Cv(e,t){t&&t.pendingBranch?ve(e)?t.effects.push(...e):t.effects.push(e):zd(e)}const ye=Symbol.for("v-fgt"),Xs=Symbol.for("v-txt"),lt=Symbol.for("v-cmt"),Js=Symbol.for("v-stc"),Qs=[];let Qt=null;function b(e=!1){Qs.push(Qt=e?null:[])}function Nv(){Qs.pop(),Qt=Qs[Qs.length-1]||null}let ei=1;function Zf(e,t=!1){ei+=e,e<0&&Qt&&t&&(Qt.hasOnce=!0)}function Yf(e){return e.dynamicChildren=ei>0?Qt||Ao:null,Nv(),ei>0&&Qt&&Qt.push(e),e}function x(e,t,n,r,o,s){return Yf(j(e,t,n,r,o,s,!0))}function Z(e,t,n,r,o){return Yf(E(e,t,n,r,o,!0))}function oo(e){return e?e.__v_isVNode===!0:!1}function so(e,t){if(C.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const n=ua.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 Pv=(...e)=>Kf(...e),Gf=({key:e})=>e??null,wa=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?tt(e)||Ke(e)||ke(e)?{i:dt,r:e,k:t,f:!!n}:e:null);function j(e,t=null,n=null,r=0,o=null,s=e===ye?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Gf(t),ref:t&&wa(t),scopeId:Jd,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:dt};return a?(uu(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=tt(n)?8:16),C.NODE_ENV!=="production"&&l.key!==l.key&&G("VNode created with invalid key (NaN). VNode type:",l.type),ei>0&&!i&&Qt&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Qt.push(l),l}const E=C.NODE_ENV!=="production"?Pv:Kf;function Kf(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===bf)&&(C.NODE_ENV!=="production"&&!e&&G(`Invalid vnode type when creating vnode: ${e}.`),e=lt),oo(e)){const a=xn(e,t,!0);return n&&uu(a,n),ei>0&&!s&&Qt&&(a.shapeFlag&6?Qt[Qt.indexOf(e)]=a:Qt.push(a)),a.patchFlag=-2,a}if(oh(e)&&(e=e.__vccOpts),t){t=Tv(t);let{class:a,style:l}=t;a&&!tt(a)&&(t.class=Is(a)),He(l)&&(Io(l)&&!ve(l)&&(l=at({},l)),t.style=Ds(l))}const i=tt(e)?1:Wf(e)?128:tf(e)?64:He(e)?4:ke(e)?2:0;return C.NODE_ENV!=="production"&&i&4&&Io(e)&&(e=Oe(e),G("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)),j(e,t,n,r,o,i,s,!0)}function Tv(e){return e?Io(e)||Pf(e)?at({},e):e:null}function xn(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:a,transition:l}=e,u=t?cu(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Gf(u),ref:t&&t.ref?n&&s?ve(s)?s.concat(wa(t)):[s,wa(t)]:wa(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:C.NODE_ENV!=="production"&&i===-1&&ve(a)?a.map(Xf):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ye?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&&xn(e.ssContent),ssFallback:e.ssFallback&&xn(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&qs(c,l.clone(c)),c}function Xf(e){const t=xn(e);return ve(e.children)&&(t.children=e.children.map(Xf)),t}function A(e=" ",t=0){return E(Xs,null,e,t)}function Jf(e,t){const n=E(Js,null,e);return n.staticCount=t,n}function se(e="",t=!1){return t?(b(),Z(lt,null,e)):E(lt,null,e)}function On(e){return e==null||typeof e=="boolean"?E(lt):ve(e)?E(ye,null,e.slice()):oo(e)?Tr(e):E(Xs,null,String(e))}function Tr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:xn(e)}function uu(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ve(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),uu(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Pf(t)?t._ctx=dt:o===3&&dt&&(dt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ke(t)?(t={default:t,_ctx:dt},n=32):(t=String(t),r&64?(n=16,t=[A(t)]):n=8);e.children=t,e.shapeFlag|=n}function cu(...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=Is([t.class,r.class]));else if(o==="style")t.style=Ds([t.style,r.style]);else if(Ns(o)){const s=t[o],i=r[o];i&&s!==i&&!(ve(s)&&s.includes(i))&&(t[o]=s?[].concat(s,i):i)}else o!==""&&(t[o]=r[o])}return t}function Ln(e,t,n,r=null){En(e,t,7,[n,r])}const $v=Sf();let Av=0;function Dv(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||$v,s={uid:Av++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new hd(!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:$f(r,o),emitsOptions:Bf(r,o),emit:null,emitted:null,propsDefaults:We,inheritAttrs:r.inheritAttrs,ctx:We,data:We,props:We,attrs:We,slots:We,refs:We,setupState:We,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 C.NODE_ENV!=="production"?s.ctx=Fg(s):s.ctx={_:s},s.root=t?t.root:s,s.emit=Ev.bind(null,s),e.ce&&e.ce(s),s}let ht=null;const Ea=()=>ht||dt;let ka,du;{const e=As(),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)}};ka=t("__VUE_INSTANCE_SETTERS__",n=>ht=n),du=t("__VUE_SSR_SETTERS__",n=>ni=n)}const ti=e=>{const t=ht;return ka(e),e.scope.on(),()=>{e.scope.off(),ka(t)}},Qf=()=>{ht&&ht.scope.off(),ka(null)},Iv=Gn("slot,component");function fu(e,{isNativeTag:t}){(Iv(e)||t(e))&&G("Do not use built-in or reserved HTML elements as component id: "+e)}function eh(e){return e.vnode.shapeFlag&4}let ni=!1;function Mv(e,t=!1,n=!1){t&&du(t);const{props:r,children:o}=e.vnode,s=eh(e);ev(e,r,s,t),dv(e,o,n||t);const i=s?Vv(e,t):void 0;return t&&du(!1),i}function Vv(e,t){var n;const r=e.type;if(C.NODE_ENV!=="production"){if(r.name&&fu(r.name,e.appContext.config),r.components){const s=Object.keys(r.components);for(let i=0;i<s.length;i++)fu(s[i],e.appContext.config)}if(r.directives){const s=Object.keys(r.directives);for(let i=0;i<s.length;i++)Qd(s[i])}r.compilerOptions&&Rv()&&G('"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,yf),C.NODE_ENV!=="production"&&zg(e);const{setup:o}=r;if(o){yn();const s=e.setupContext=o.length>1?jv(e):null,i=ti(e),a=Mo(o,e,0,[C.NODE_ENV!=="production"?In(e.props):e.props,s]),l=xl(a);if(_n(),i(),(l||e.sp)&&!Lo(e)&&pf(e),l){if(a.then(Qf,Qf),t)return a.then(u=>{th(e,u,t)}).catch(u=>{Bs(u,e,0)});if(e.asyncDep=a,C.NODE_ENV!=="production"&&!e.suspense){const u=(n=r.name)!=null?n:"Anonymous";G(`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 th(e,a,t)}else nh(e,t)}function th(e,t,n){ke(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:He(t)?(C.NODE_ENV!=="production"&&oo(t)&&G("setup() should not return VNodes directly - return a render function instead."),C.NODE_ENV!=="production"&&(e.devtoolsRawSetupState=t),e.setupState=Rd(t),C.NODE_ENV!=="production"&&Hg(e)):C.NODE_ENV!=="production"&&t!==void 0&&G(`setup() should return an object. Received: ${t===null?"null":typeof t}`),nh(e,n)}const Rv=()=>!0;function nh(e,t,n){const r=e.type;e.render||(e.render=r.render||gt);{const o=ti(e);yn();try{Wg(e)}finally{_n(),o()}}C.NODE_ENV!=="production"&&!r.render&&e.render===gt&&!t&&(r.template?G('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".'):G("Component is missing template or render function: ",r))}const rh=C.NODE_ENV!=="production"?{get(e,t){return _a(),vt(e,"get",""),e[t]},set(){return G("setupContext.attrs is readonly."),!1},deleteProperty(){return G("setupContext.attrs is readonly."),!1}}:{get(e,t){return vt(e,"get",""),e[t]}};function Lv(e){return new Proxy(e.slots,{get(t,n){return vt(e,"get","$slots"),t[n]}})}function jv(e){const t=n=>{if(C.NODE_ENV!=="production"&&(e.exposed&&G("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(ve(n)?r="array":Ke(n)&&(r="ref")),r!=="object"&&G(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(C.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,rh))},get slots(){return r||(r=Lv(e))},get emit(){return(o,...s)=>e.emit(o,...s)},expose:t})}else return{attrs:new Proxy(e.attrs,rh),slots:e.slots,emit:e.emit,expose:t}}function hu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Rd(xr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in to)return to[n](e)},has(t,n){return n in t||n in to}})):e.proxy}const Uv=/(?:^|[-_])(\w)/g,Bv=e=>e.replace(Uv,t=>t.toUpperCase()).replace(/[-_]/g,"");function pu(e,t=!0){return ke(e)?e.displayName||e.name:e.name||t&&e.__name}function xa(e,t,n=!1){let r=pu(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?Bv(r):n?"App":"Anonymous"}function oh(e){return ke(e)&&"__vccOpts"in e}const te=(e,t)=>{const n=tg(e,t,ni);if(C.NODE_ENV!=="production"){const r=Ea();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function pt(e,t,n){const r=arguments.length;return r===2?He(t)&&!ve(t)?oo(t)?E(e,null,[t]):E(e,t):E(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&oo(n)&&(n=[n]),E(e,t,n))}function Fv(){if(C.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){if(!He(d))return null;if(d.__isVue)return["div",e,"VueInstance"];if(Ke(d)){yn();const f=d.value;return _n(),["div",{},["span",e,c(d)],"<",a(f),">"]}else{if(wn(d))return["div",{},["span",e,Mt(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${Mn(d)?" (readonly)":""}`];if(Mn(d))return["div",{},["span",e,Mt(d)?"ShallowReadonly":"Readonly"],"<",a(d),">"]}return 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",Oe(d.props))),d.setupState!==We&&f.push(i("setup",d.setupState)),d.data!==We&&f.push(i("data",Oe(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=at({},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?Oe(d):d}]:["span",n,String(d)]}function l(d,f){const h=d.type;if(ke(h))return;const p={};for(const g in d.ctx)u(h,g,f)&&(p[g]=d.ctx[g]);return p}function u(d,f,h){const p=d[h];if(ve(p)&&p.includes(f)||He(p)&&f in p||d.extends&&u(d.extends,f,h)||d.mixins&&d.mixins.some(g=>u(g,f,h)))return!0}function c(d){return Mt(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const sh="3.5.17",Qn=C.NODE_ENV!=="production"?G:gt;var jn={};let mu;const ih=typeof window<"u"&&window.trustedTypes;if(ih)try{mu=ih.createPolicy("vue",{createHTML:e=>e})}catch(e){jn.NODE_ENV!=="production"&&Qn(`Error creating trusted types policy: ${e}`)}const ah=mu?e=>mu.createHTML(e):e=>e,zv="http://www.w3.org/2000/svg",Hv="http://www.w3.org/1998/Math/MathML",er=typeof document<"u"?document:null,lh=er&&er.createElement("template"),qv={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"?er.createElementNS(zv,e):t==="mathml"?er.createElementNS(Hv,e):n?er.createElement(e,{is:n}):er.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>er.createTextNode(e),createComment:e=>er.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>er.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{lh.innerHTML=ah(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=lh.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]}},$r="transition",ri="animation",oi=Symbol("_vtc"),uh={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},Wv=at({},lf,uh),si=(e=>(e.displayName="Transition",e.props=Wv,e))((e,{slots:t})=>pt(Ng,Zv(e),t)),io=(e,t=[])=>{ve(e)?e.forEach(n=>n(...t)):e&&e(...t)},ch=e=>e?ve(e)?e.some(t=>t.length>1):e.length>1:!1;function Zv(e){const t={};for(const M in e)M in uh||(t[M]=e[M]);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=Yv(o),g=p&&p[0],_=p&&p[1],{onBeforeEnter:S,onEnter:R,onEnterCancelled:H,onLeave:z,onLeaveCancelled:B,onBeforeAppear:I=S,onAppear:y=R,onAppearCancelled:P=H}=t,D=(M,ie,Se,N)=>{M._enterCancelled=N,ao(M,ie?c:a),ao(M,ie?u:i),Se&&Se()},$=(M,ie)=>{M._isLeaving=!1,ao(M,d),ao(M,h),ao(M,f),ie&&ie()},T=M=>(ie,Se)=>{const N=M?y:R,q=()=>D(ie,M,Se);io(N,[ie,q]),dh(()=>{ao(ie,M?l:s),tr(ie,M?c:a),ch(N)||fh(ie,r,g,q)})};return at(t,{onBeforeEnter(M){io(S,[M]),tr(M,s),tr(M,i)},onBeforeAppear(M){io(I,[M]),tr(M,l),tr(M,u)},onEnter:T(!1),onAppear:T(!0),onLeave(M,ie){M._isLeaving=!0;const Se=()=>$(M,ie);tr(M,d),M._enterCancelled?(tr(M,f),mh()):(mh(),tr(M,f)),dh(()=>{M._isLeaving&&(ao(M,d),tr(M,h),ch(z)||fh(M,r,_,Se))}),io(z,[M,Se])},onEnterCancelled(M){D(M,!1,void 0,!0),io(H,[M])},onAppearCancelled(M){D(M,!0,void 0,!0),io(P,[M])},onLeaveCancelled(M){$(M),io(B,[M])}})}function Yv(e){if(e==null)return null;if(He(e))return[bu(e.enter),bu(e.leave)];{const t=bu(e);return[t,t]}}function bu(e){const t=bb(e);return jn.NODE_ENV!=="production"&&lg(t,"<transition> explicit duration"),t}function tr(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[oi]||(e[oi]=new Set)).add(t)}function ao(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[oi];n&&(n.delete(t),n.size||(e[oi]=void 0))}function dh(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Gv=0;function fh(e,t,n,r){const o=e._endId=++Gv,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:a,propCount:l}=Kv(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 Kv(e,t){const n=window.getComputedStyle(e),r=p=>(n[p]||"").split(", "),o=r(`${$r}Delay`),s=r(`${$r}Duration`),i=hh(o,s),a=r(`${ri}Delay`),l=r(`${ri}Duration`),u=hh(a,l);let c=null,d=0,f=0;t===$r?i>0&&(c=$r,d=i,f=s.length):t===ri?u>0&&(c=ri,d=u,f=l.length):(d=Math.max(i,u),c=d>0?i>u?$r:ri:null,f=c?c===$r?s.length:l.length:0);const h=c===$r&&/\b(transform|all)(,|$)/.test(r(`${$r}Property`).toString());return{type:c,timeout:d,propCount:f,hasTransform:h}}function hh(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ph(n)+ph(e[r])))}function ph(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function mh(){return document.body.offsetHeight}function Xv(e,t,n){const r=e[oi];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const bh=Symbol("_vod"),Jv=Symbol("_vsh"),Qv=Symbol(jn.NODE_ENV!=="production"?"CSS_VAR_TEXT":""),ey=/(^|;)\s*display\s*:/;function ty(e,t,n){const r=e.style,o=tt(n);let s=!1;if(n&&!o){if(t)if(tt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Oa(r,a,"")}else for(const i in t)n[i]==null&&Oa(r,i,"");for(const i in n)i==="display"&&(s=!0),Oa(r,i,n[i])}else if(o){if(t!==n){const i=r[Qv];i&&(n+=";"+i),r.cssText=n,s=ey.test(n)}}else t&&e.removeAttribute("style");bh in e&&(e[bh]=s?r.display:"",e[Jv]&&(r.display="none"))}const ny=/[^\\];\s*$/,gh=/\s*!important$/;function Oa(e,t,n){if(ve(n))n.forEach(r=>Oa(e,t,r));else if(n==null&&(n=""),jn.NODE_ENV!=="production"&&ny.test(n)&&Qn(`Unexpected semicolon at the end of '${t}' style value: '${n}'`),t.startsWith("--"))e.setProperty(t,n);else{const r=ry(e,t);gh.test(n)?e.setProperty(Er(r),n.replace(gh,""),"important"):e[r]=n}}const vh=["Webkit","Moz","ms"],gu={};function ry(e,t){const n=gu[t];if(n)return n;let r=It(t);if(r!=="filter"&&r in e)return gu[t]=r;r=Zr(r);for(let o=0;o<vh.length;o++){const s=vh[o]+r;if(s in e)return gu[t]=s}return t}const yh="http://www.w3.org/1999/xlink";function _h(e,t,n,r,o,s=Cb(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(yh,t.slice(6,t.length)):e.setAttributeNS(yh,t,n):n==null||s&&!cd(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Kn(n)?String(n):n)}function wh(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ah(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=cd(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch(a){jn.NODE_ENV!=="production"&&!i&&Qn(`Failed setting prop "${t}" on <${s.toLowerCase()}>: value ${n} is invalid.`,a)}i&&e.removeAttribute(o||t)}function oy(e,t,n,r){e.addEventListener(t,n,r)}function sy(e,t,n,r){e.removeEventListener(t,n,r)}const Eh=Symbol("_vei");function iy(e,t,n,r,o=null){const s=e[Eh]||(e[Eh]={}),i=s[t];if(r&&i)i.value=jn.NODE_ENV!=="production"?xh(r,t):r;else{const[a,l]=ay(t);if(r){const u=s[t]=cy(jn.NODE_ENV!=="production"?xh(r,t):r,o);oy(e,a,u,l)}else i&&(sy(e,a,i,l),s[t]=void 0)}}const kh=/(?:Once|Passive|Capture)$/;function ay(e){let t;if(kh.test(e)){t={};let r;for(;r=e.match(kh);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Er(e.slice(2)),t]}let vu=0;const ly=Promise.resolve(),uy=()=>vu||(ly.then(()=>vu=0),vu=Date.now());function cy(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;En(dy(r,n.value),t,5,[r])};return n.value=e,n.attached=uy(),n}function xh(e,t){return ke(e)||ve(e)?e:(Qn(`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}.`),gt)}function dy(e,t){if(ve(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 Oh=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,fy=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?Xv(e,r,i):t==="style"?ty(e,n,r):Ns(t)?Wi(t)||iy(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):hy(e,t,r,i))?(wh(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_h(e,t,r,i,s,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!tt(r))?wh(e,It(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),_h(e,t,r,i))};function hy(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Oh(t)&&ke(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||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 Oh(t)&&tt(n)?!1:t in e}const py=["ctrl","shift","alt","meta"],my={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)=>py.some(n=>e[`${n}Key`]&&!t.includes(n))},Ar=(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=my[t[i]];if(a&&a(o,t))return}return e(o,...s)})},by=at({patchProp:fy},qv);let Sh;function gy(){return Sh||(Sh=pv(by))}const vy=(...e)=>{const t=gy().createApp(...e);jn.NODE_ENV!=="production"&&(_y(t),wy(t));const{mount:n}=t;return t.mount=r=>{const o=Ey(r);if(!o)return;const s=t._component;!ke(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,yy(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t};function yy(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function _y(e){Object.defineProperty(e.config,"isNativeTag",{value:t=>xb(t)||Ob(t)||Sb(t),writable:!1})}function wy(e){{const t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){Qn("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 Qn(r),n},set(){Qn(r)}})}}function Ey(e){if(tt(e)){const t=document.querySelector(e);return jn.NODE_ENV!=="production"&&!t&&Qn(`Failed to mount app: mount target selector "${e}" returned null.`),t}return jn.NODE_ENV!=="production"&&window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode==="closed"&&Qn('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}var ky={};function xy(){Fv()}ky.NODE_ENV!=="production"&&xy();let Sa;const Oy=new Uint8Array(16);function Sy(){if(!Sa&&(Sa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sa(Oy)}const Ot=[];for(let e=0;e<256;++e)Ot.push((e+256).toString(16).slice(1));function Cy(e,t=0){return Ot[e[t+0]]+Ot[e[t+1]]+Ot[e[t+2]]+Ot[e[t+3]]+"-"+Ot[e[t+4]]+Ot[e[t+5]]+"-"+Ot[e[t+6]]+Ot[e[t+7]]+"-"+Ot[e[t+8]]+Ot[e[t+9]]+"-"+Ot[e[t+10]]+Ot[e[t+11]]+Ot[e[t+12]]+Ot[e[t+13]]+Ot[e[t+14]]+Ot[e[t+15]]}const Ch={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ii(e,t,n){if(Ch.randomUUID&&!e)return Ch.randomUUID();e=e||{};const r=e.random||(e.rng||Sy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Cy(r)}var Ut=Symbol("storefront");function Ny(e,t=100){let n=0;return async(...o)=>{clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}var Py=m.object({source:m.literal("moonbase-checkout"),event:m.literal("close"),intent:m.string().optional(),completed:m.boolean()}),Ty=m.object({source:m.literal("moonbase-checkout"),event:m.literal("completed"),order:wl.orders.completedOrderSchema}),$y=m.discriminatedUnion("event",[Py,Ty]);function Ay(){var e;const t=document.getElementById("moonbase-checkout");!t||!(t instanceof HTMLIFrameElement)||(e=t.contentWindow)==null||e.postMessage("close","*")}function Ca(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=$y.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 Dy=m.object({source:m.literal("moonbase-subscription"),event:m.literal("close"),completed:m.boolean()}),Iy=m.object({source:m.literal("moonbase-subscription"),event:m.literal("updated-payment-method")}),My=m.discriminatedUnion("event",[Dy,Iy]);function Nh(e){if(typeof window>"u"){console.warn("Can not mount subscription server side");return}if(document.getElementById("moonbase-subscription"))return;const t=document.createElement("iframe");t.id="moonbase-subscription",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=My.parse(n.data);o.event==="close"&&(document.body.contains(t)&&(document.documentElement.style.removeProperty("overflow"),document.body.removeChild(t)),window.dispatchEvent(new CustomEvent("moonbase-subscription-closed",{detail:o})))}catch(o){((r=n.data)==null?void 0:r.source)==="moonbase-subscription"&&console.error("Could not parse event:",n.data,o)}}}var ai=class ct{constructor(t,n,r){this.configuration=t,this.client=n,this.stateFactory=r,this.currentUser=L(null),this.loadedUser=L(!1),this.refreshOrderAbortController=new AbortController,this.debouncedPushOrderContent=Ny(l=>this.client.orders.pushContent(l,void 0,this.hasUtmOrReferrer?this.utm.value:void 0),500);var o;if(typeof window>"u"){this.currentOrder=L({id:ii(),status:$o.Open,currency:"",items:[],couponsApplied:[]}),this.storefront=r(ct.storefrontKey,{suggestedCurrency:"",enabledCurrencies:[],bundles:[],products:[],offers:[]}),this.loadedStorefront=r(`${ct.storefrontKey}_loaded`,!1),this.utm=r(ct.utmKey,void 0);return}window.addEventListener("storage",l=>this.handleStorageUpdate(l));const s=new URLSearchParams(window.location.search);if(this.utm=r(ct.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:sessionStorage).setItem(ct.utmKey,JSON.stringify(this.utm.value));else{const l=(t.persistUtm?localStorage:sessionStorage).getItem(ct.utmKey);if(l)try{const u=JSON.parse(l);this.utm.value=u}catch(u){console.warn(`Could not parse cached UTM from ${ct.utmKey}`,u)}}const i=localStorage.getItem(ct.sessionKey);i?(this.currentOrder=L(JSON.parse(i)),this.refreshOrder()):(this.currentOrder=L({id:ii(),status:$o.Open,currency:"",items:[],couponsApplied:[]}),this.hasUtmOrReferrer&&this.pushOrderContent());const a=localStorage.getItem(ct.storefrontKey);if(a?(this.storefront=r(ct.storefrontKey,JSON.parse(a)),this.loadedStorefront=r(`${ct.storefrontKey}_loaded`,!0)):(this.storefront=r(ct.storefrontKey,{suggestedCurrency:"",enabledCurrencies:[],bundles:[],products:[],offers:[]}),this.loadedStorefront=r(`${ct.storefrontKey}_loaded`,!1)),this.client.tokenStore.user&&(this.currentUser.value=wl.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]);Ca(f.toString()),window.history.replaceState(null,"",window.location.href.split("?")[0])}if(u==="update_subscription"&&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]);Nh(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=>{Xe(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=>{Xe(this.loadedUser,n=>{n&&t()},{immediate:!0})})}closeCheckout(){Ay()}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(Ut,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 Ui||console.error("Could not load user",t),this.currentUser.value=null}finally{this.loadedUser.value=!0}return this.currentUser.value}async updateStorefront(){var t;const n=await this.client.storefront.get(this.hasUtm?this.utm.value:void 0);return n&&(typeof window<"u"&&localStorage.setItem(ct.storefrontKey,JSON.stringify(n)),this.storefront.value=n,this.loadedStorefront.value=!0,(!this.currentOrder.value.currency||!((t=n.enabledCurrencies)!=null&&t.includes(this.currentOrder.value.currency)))&&(this.currentOrder.value.currency=n.suggestedCurrency),this.currentOrder.value.items=this.enrichLineItems(this.currentOrder.value.items)),n}async pushOrderContent(){typeof window<"u"&&localStorage.setItem(ct.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 ct.sessionKey:this.currentOrder.value=t.newValue?JSON.parse(t.newValue):{id:ii(),currency:((n=this.storefront.value)==null?void 0:n.suggestedCurrency)||"",status:$o.Open,items:[],couponsApplied:[]};break;case ct.storefrontKey:this.storefront.value=JSON.parse(t.newValue);break;case ct.utmKey:this.utm.value=JSON.parse(t.newValue);break;case Qc.storageKey:t.newValue?console.warn("User was updated",t.newValue):(this.currentUser.value=null,console.warn("User was removed"))}}async refreshOrder(){var t;try{const n=await this.client.orders.get(this.currentOrder.value.id,{abort:this.refreshOrderAbortController.signal});n&&(n.status!==$o.Open?this.resetOrder():(n.items=this.enrichLineItems(n.items),typeof window<"u"&&localStorage.setItem(ct.sessionKey,JSON.stringify(n)),this.storefront.value&&!((t=this.storefront.value.enabledCurrencies)!=null&&t.includes(n.currency))&&(n.currency=this.storefront.value.suggestedCurrency),this.currentOrder.value=n))}catch(n){n instanceof Mc&&this.resetOrder()}}resetOrder(){var t;this.currentOrder.value={id:ii(),currency:((t=this.storefront.value)==null?void 0:t.suggestedCurrency)||"",status:$o.Open,items:[],couponsApplied:[]},typeof window<"u"&&localStorage.removeItem(ct.sessionKey)}async surrenderOrder(){try{await this.client.orders.removeBillingDetails(this.currentOrder.value.id)}catch(t){if(t instanceof _r)return;console.warn("Could not surrender order:",t)}}enrichLineItems(t){return this.storefront?t.map(n=>{var r,o,s;const i=(r=this.storefront.value.offers)==null?void 0:r.find(a=>a.id===n.offerId);if(n.type==="Product"){const a=this.storefront.value.products.find(c=>c.id===n.productId);let u=((a==null?void 0:a.variations)||[]).find(c=>c.id===n.variationId);return i&&u&&qr.eligible(i,this.currentOrder.value)&&(u=qr.applyToVariation(i,u)),{...n,product:a,variation:u,price:u==null?void 0:u.price,appliedDiscount:(o=u==null?void 0:u.discount)!=null?o:n.appliedDiscount}}else{const a=this.storefront.value.bundles.find(c=>c.id===n.bundleId);let u=((a==null?void 0:a.variations)||[]).find(c=>c.id===n.variationId);return i&&u&&qr.eligible(i,this.currentOrder.value)&&(u=qr.applyToVariation(i,u)),{...n,bundle:a,variation:u,price:u==null?void 0:u.price,appliedDiscount:(s=u==null?void 0:u.discount)!=null?s:n.appliedDiscount}}}):t}};ai.userKey="moonbase_user",ai.sessionKey="moonbase_session",ai.storefrontKey="moonbase_storefront",ai.utmKey="moonbase_utm";var Vy=ai;function Ry(e,t){const n=me(Ut);if(!n)throw new Error("No storefront configured");const r=n.stateFactory(`activation-request-${Or(e)}`,null),o=n.stateFactory(`activation-request-${Or(e)}-error`,null),s=n.stateFactory(`activation-request-${Or(e)}-loading`,!0),i=n.stateFactory(`activation-request-${Or(e)}-fulfilling`,!1),a=n.stateFactory(`activation-request-${Or(e)}-completing`,!1),l=n.stateFactory(`activation-request-${Or(e)}-completion-timeout`,null),u=async()=>{if(!r.value)return;await n.client.activationRequests.isCompleted(r.value.id)&&r.value?(r.value.status=mn.Completed,a.value=!1):l.value=setTimeout(u,1500)};return Xe(()=>Or(e),async c=>{try{c&&c.length>0?(r.value=await n.client.activationRequests.get(c),r.value.status===mn.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}),Yl(()=>{l.value&&clearTimeout(l.value)}),Xe(n.currentUser,async()=>{var c,d;const f=Or(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===mn.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:te(()=>{var c;return r&&((c=r.value)==null?void 0:c.status)===mn.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 Ui?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===mn.Cancelled||(r.value=await n.client.activationRequests.cancel(r.value.id))}}}function nt(e){const t=e??me(Ut);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 Na(e,t){const n=t??me(Ut);if(!n)throw new Error("No storefront configured");return te(()=>n.storefront.value.bundles.find(r=>r.id===e)||null)}function Ly(e){const t=me(Ut);if(!t)throw new Error("No storefront configured");return te(()=>t.storefront.value.bundles)}function nr(e){const t=e??me(Ut);if(!t)throw new Error("No storefront configured");const n=te(()=>{const i=t.currentOrder.value.currency||t.storefront.value.suggestedCurrency;return{amount:t.currentOrder.value.items.reduce((l,u)=>{var c,d,f,h,p,g,_,S,R,H;let z;if(u.type==="Product"){const I=t.storefront.value.products.find(T=>T.id===u.productId),P=((I==null?void 0:I.variations)||[]).find(T=>T.id===u.variationId),D=(d=(c=P==null?void 0:P.pricingTiers)==null?void 0:c.filter(T=>u.quantity>=T.minQuantity))!=null?d:[],$=D.length>0?D[D.length-1]:null;z=(g=(p=(f=$==null?void 0:$.price[i])!=null?f:P==null?void 0:P.price[i])!=null?p:(h=I==null?void 0:I.defaultVariation)==null?void 0:h.price[i])!=null?g:0}else{const I=t.storefront.value.bundles.find(D=>D.id===u.bundleId),P=((I==null?void 0:I.variations)||[]).find(D=>D.id===u.variationId);z=(R=(S=P==null?void 0:P.price[i])!=null?S:(_=I==null?void 0:I.defaultVariation)==null?void 0:_.price[i])!=null?R:0}const B=u.offerId?(H=t.storefront.value.offers)==null?void 0:H.find(I=>I.id===u.offerId):null;if(B&&qr.eligible(B,t.currentOrder.value)){const I=El.apply(B.discount,{[i]:z});z-=I[i]}return l+z*u.quantity},0),currency:i}});function r(i,a,l,u){var c,d,f;if(i=v(i),a??(a=i.defaultVariation),!a)throw new Error("Added item does not have a default variation, and none have been specified");const h=`${i.type==="Bundle"?"b":"p"}/${i.id}/${a.id}`;let p=t==null?void 0:t.currentOrder.value.items.find(g=>g.id===h);if(p)p.quantity+=1,(f=p.offerId)!=null||(p.offerId=l==null?void 0:l.id),!p.variation&&a&&(p.variation=a),!p.price&&a&&(p.price=a.price),!p.appliedDiscount&&a.discount&&(p.appliedDiscount=a.discount),p.type==="Product"&&i.type==="Product"&&!p.product&&(p.product=i),p.type==="Bundle"&&i.type==="Bundle"&&!p.bundle&&(p.bundle=i);else if(i.type==="Bundle"){if(p={id:h,type:"Bundle",bundleId:i.id,bundle:i,quantity:1,variation:a,variationId:a.id,offerId:l==null?void 0:l.id,price:a.price,appliedDiscount:a.discount,isDefaultVariation:a.id===((c=i.defaultVariation)==null?void 0:c.id)},(u==null?void 0:u.bundleBehaviour)==="replace"){const g=t==null?void 0:t.currentOrder.value.items.filter(_=>_.type==="Product"&&i.products.some(S=>S.included&&S.id===_.productId));for(const _ of g??[]){const S=t==null?void 0:t.currentOrder.value.items.findIndex(R=>R.id===_.id);S!==void 0&&(t==null||t.currentOrder.value.items.splice(S,1))}p.replaced=g==null?void 0:g.filter(_=>_.type==="Product").map(_=>`${_.productId}/${_.variationId}`)}t==null||t.currentOrder.value.items.push(p)}else if(i.type==="Product")p={id:h,type:"Product",productId:i.id,product:i,quantity:1,variation:a,variationId:a.id,offerId:l==null?void 0:l.id,price:a.price,appliedDiscount:a.discount,isDefaultVariation:a.id===((d=i.defaultVariation)==null?void 0:d.id)},t==null||t.currentOrder.value.items.push(p);else throw new bn("Invalid input",`Could not handle item of type '${i.type}'`);return t==null||t.pushOrderContent(),p}function o(i){var a,l;if(t&&i.type==="Bundle"&&i.replaced&&i.replaced.length>0)for(const{productId:u,variationId:c}of i.replaced.map(d=>({productId:d.split("/")[0],variationId:d.split("/")[1]}))){const d=t.storefront.value.products.find(h=>h.id===u),f=(a=d==null?void 0:d.variations)==null?void 0:a.find(h=>h.id===c);if(d&&f&&!t.currentOrder.value.items.some(h=>h.type==="Product"&&h.productId===u)){const h=`p/${d.id}/${c}`;t.currentOrder.value.items.push({id:h,type:"Product",productId:d.id,product:d,quantity:1,variation:f,variationId:c,price:f.price,appliedDiscount:f.discount,isDefaultVariation:f.id===((l=d.defaultVariation)==null?void 0:l.id)})}}}function s(){var i;if(t){for(const a of t.currentOrder.value.items)if(a.offerId){const l=(i=t.storefront.value.offers)==null?void 0:i.find(u=>u.id===a.offerId);(!l||!qr.eligible(l,t.currentOrder.value))&&(a.offerId=void 0)}}}return{items:te(()=>t.enrichLineItems(t.currentOrder.value.items)),currency:te(()=>t.currentOrder.value.currency||t.storefront.value.suggestedCurrency),total:n,addToCart:r,setQuantity:(i,a)=>{const l=t.currentOrder.value.items.find(u=>u.id===i.id);if(!l)throw new Error("Cart item not found");if(l.quantity=a,l.quantity<=0){const u=t.currentOrder.value.items.findIndex(c=>c.id===l.id);t.currentOrder.value.items.splice(u,1),o(i),s()}return t.pushOrderContent(),i},removeFromCart:i=>{const a=t.currentOrder.value.items.findIndex(l=>l.id===i.id);t.currentOrder.value.items.splice(a,1),o(i),s(),t.pushOrderContent()},checkout:async i=>{var a;const l=typeof window<"u"?window.location.pathname:"",u=new URL((a=i.returnUrl)!=null?a:l,document.baseURI).href,c=await t.client.orders.pushContent(t.currentOrder.value,{returnUrl:u},t.hasUtm?t.utm.value:void 0);if(c.items=t.enrichLineItems(c.items),window.dispatchEvent(new CustomEvent("moonbase-checkout-initiated",{detail:{order:c,total:n.value}})),!i.redirect&&c.embeddedCheckoutUrl&&typeof window<"u"){const d=c.embeddedCheckoutUrl;return new Promise(f=>{Ca(d.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",h=>{const p=h;f({next:p.detail.intent,completed:p.detail.completed})},{once:!0})})}else{if(i.redirect&&c.checkoutUrl&&typeof window<"u")return window.location.href=c.checkoutUrl,{next:void 0,completed:!1};throw new Error("No checkout URL found")}}}}async function jy(e,t,n){var r,o;const s=n??me(Ut);if(!s)throw new Error("No storefront configured");const i=[];for(const c of e){const d=v(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 bn("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:ii(),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=>{Ca(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 lo(e){const t=me(Ut);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=>{Ca(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})})},updateSubscriptionPaymentMethod: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,a=await t.client.inventory.subscriptions.getById(n.id,{toUpdatePaymentMethod:!0,returnUrl:i});if(window.dispatchEvent(new CustomEvent("moonbase-subscription-payment-method-update-initiated",{detail:{subscription:Oe(n)}})),a.embeddedUpdatePaymentUrl&&typeof window<"u"){const l=a.embeddedUpdatePaymentUrl;return new Promise(u=>{Nh(l.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-subscription-closed",c=>{u({completed:c.detail.completed})},{once:!0})})}else throw new Error("No update URL found")}}}function Uy(e,t){const n=me(Ut);if(!n)throw new Error("No storefront configured");return te(()=>{var r;return((r=n.storefront.value.offers)==null?void 0:r.find(o=>o.id===e))||null})}function By(e){const t=me(Ut);if(!t)throw new Error("No storefront configured");return te(()=>{var n;return((n=t.storefront.value.offers)!=null?n:[]).filter(r=>qr.eligible(r,t.currentOrder.value)&&!Fy(r,t.currentOrder.value))})}function Fy(e,t){return!!t.items.some(n=>n.type==="Product"&&e.target.type==="Product"&&n.productId===e.target.id||n.type==="Bundle"&&e.target.type==="Bundle"&&n.bundleId===e.target.id)}function li(e,t){const n=t??me(Ut);if(!n)throw new Error("No storefront configured");return te(()=>n.storefront.value.products.find(r=>r.id===e)||null)}function zy(e){const t=me(Ut);if(!t)throw new Error("No storefront configured");return te(()=>t.storefront.value.products)}function Ph(e){const t=me(Ut);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 _r?new Error("Voucher code invalid"):r}},redeem:async n=>{try{return await t.client.vouchers.redeem(n)}catch(r){throw r instanceof _r?new Error("Voucher code invalid"):r}}}}function Hy(e,t,n){const r={endpoint:e};return new Vy(r,new ub(r),(o,s)=>L(s))}function Pa(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 yu(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function qy(){return Th().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Th(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Wy=typeof Proxy=="function",Zy="devtools-plugin:setup",Yy="plugin:settings:set";let Bo,_u;function Gy(){var e;return Bo!==void 0||(typeof window<"u"&&window.performance?(Bo=!0,_u=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(Bo=!0,_u=globalThis.perf_hooks.performance):Bo=!1),Bo}function Ky(){return Gy()?_u.now():Date.now()}class Xy{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(Yy,(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 $h(e,t){const n=e,r=Th(),o=qy(),s=Wy&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(Zy,e,t);else{const i=s?new Xy(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}var Ue={};let ui;const ci=e=>ui=e,Ah=Ue.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function uo(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Un;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Un||(Un={}));const co=typeof window<"u",Dh=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 Jy(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 wu(e,t,n){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){Vh(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function Ih(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Ta(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 $a=typeof navigator=="object"?navigator:{userAgent:""},Mh=/Macintosh/.test($a.userAgent)&&/AppleWebKit/.test($a.userAgent)&&!/Safari/.test($a.userAgent),Vh=co?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!Mh?Qy:"msSaveOrOpenBlob"in $a?e1:t1:()=>{};function Qy(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?Ih(r.href)?wu(e,t,n):(r.target="_blank",Ta(r)):Ta(r)):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Ta(r)},0))}function e1(e,t="download",n){if(typeof e=="string")if(Ih(e))wu(e,t,n);else{const r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){Ta(r)})}else navigator.msSaveOrOpenBlob(Jy(e,n),t)}function t1(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return wu(e,t,n);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(Dh.HTMLElement))||"safari"in Dh,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||o&&s||Mh)&&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 yt(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 Eu(e){return"_a"in e&&"install"in e}function Rh(){if(!("clipboard"in navigator))return yt("Your browser doesn't support the Clipboard API","error"),!0}function Lh(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(yt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function n1(e){if(!Rh())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),yt("Global state copied to clipboard.")}catch(t){if(Lh(t))return;yt("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function r1(e){if(!Rh())try{jh(e,JSON.parse(await navigator.clipboard.readText())),yt("Global state pasted from clipboard.")}catch(t){if(Lh(t))return;yt("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function o1(e){try{Vh(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){yt("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let rr;function s1(){rr||(rr=document.createElement("input"),rr.type="file",rr.accept=".json");function e(){return new Promise((t,n)=>{rr.onchange=async()=>{const r=rr.files;if(!r)return t(null);const o=r.item(0);return t(o?{text:await o.text(),file:o}:null)},rr.oncancel=()=>t(null),rr.onerror=n,rr.click()})}return e}async function i1(e){try{const n=await s1()();if(!n)return;const{text:r,file:o}=n;jh(e,JSON.parse(r)),yt(`Global state imported from "${o.name}".`)}catch(t){yt("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function jh(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 Sn(e){return{_custom:{display:e}}}const Uh="🍍 Pinia (root)",Aa="_root";function a1(e){return Eu(e)?{id:Aa,label:Uh}:{id:e.$id,label:e.$id}}function l1(e){if(Eu(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 u1(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:Sn(e.type),key:Sn(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function c1(e){switch(e){case Un.direct:return"mutation";case Un.patchFunction:return"$patch";case Un.patchObject:return"$patch";default:return"unknown"}}let Fo=!0;const Da=[],fo="pinia:mutations",Pt="pinia",{assign:d1}=Object,Ia=e=>"🍍 "+e;function f1(e,t){$h({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Da,app:e},n=>{typeof n.now!="function"&&yt("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:fo,label:"Pinia 🍍",color:15064968}),n.addInspector({id:Pt,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{n1(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await r1(t),n.sendInspectorTree(Pt),n.sendInspectorState(Pt)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{o1(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await i1(t),n.sendInspectorTree(Pt),n.sendInspectorState(Pt)},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"?yt(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(o.$reset(),yt(`Store "${r}" reset.`)):yt(`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:Ia(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:Oe(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:Ia(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===Pt){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()):Uh.toLowerCase().includes(r.filter.toLowerCase())):o).map(a1)}}),globalThis.$pinia=t,n.on.getInspectorState(r=>{if(r.app===e&&r.inspectorId===Pt){const o=r.nodeId===Aa?t:t._s.get(r.nodeId);if(!o)return;o&&(r.nodeId!==Aa&&(globalThis.$store=Oe(o)),r.state=l1(o))}}),n.on.editInspectorState((r,o)=>{if(r.app===e&&r.inspectorId===Pt){const s=r.nodeId===Aa?t:t._s.get(r.nodeId);if(!s)return yt(`store "${r.nodeId}" not found`,"error");const{path:i}=r;Eu(s)?i.unshift("state"):(i.length!==1||!s._customProperties.has(i[0])||i[0]in s.$state)&&i.unshift("$state"),Fo=!1,r.set(s,i,r.state.value),Fo=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const o=r.type.replace(/^🍍\s*/,""),s=t._s.get(o);if(!s)return yt(`store "${o}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return yt(`Invalid path for store "${o}":
15
+ Expected function or array of functions, received type ${typeof e}.`),gt)}function dy(e,t){if(ve(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 Oh=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,fy=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?Xv(e,r,i):t==="style"?ty(e,n,r):Ns(t)?Wi(t)||iy(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):hy(e,t,r,i))?(wh(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_h(e,t,r,i,s,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!tt(r))?wh(e,It(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),_h(e,t,r,i))};function hy(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Oh(t)&&ke(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||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 Oh(t)&&tt(n)?!1:t in e}const py=["ctrl","shift","alt","meta"],my={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)=>py.some(n=>e[`${n}Key`]&&!t.includes(n))},Ar=(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=my[t[i]];if(a&&a(o,t))return}return e(o,...s)})},by=at({patchProp:fy},qv);let Sh;function gy(){return Sh||(Sh=pv(by))}const vy=(...e)=>{const t=gy().createApp(...e);jn.NODE_ENV!=="production"&&(_y(t),wy(t));const{mount:n}=t;return t.mount=r=>{const o=Ey(r);if(!o)return;const s=t._component;!ke(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,yy(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t};function yy(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function _y(e){Object.defineProperty(e.config,"isNativeTag",{value:t=>xb(t)||Ob(t)||Sb(t),writable:!1})}function wy(e){{const t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){Qn("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 Qn(r),n},set(){Qn(r)}})}}function Ey(e){if(tt(e)){const t=document.querySelector(e);return jn.NODE_ENV!=="production"&&!t&&Qn(`Failed to mount app: mount target selector "${e}" returned null.`),t}return jn.NODE_ENV!=="production"&&window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode==="closed"&&Qn('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}var ky={};function xy(){Fv()}ky.NODE_ENV!=="production"&&xy();let Sa;const Oy=new Uint8Array(16);function Sy(){if(!Sa&&(Sa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sa(Oy)}const Ot=[];for(let e=0;e<256;++e)Ot.push((e+256).toString(16).slice(1));function Cy(e,t=0){return Ot[e[t+0]]+Ot[e[t+1]]+Ot[e[t+2]]+Ot[e[t+3]]+"-"+Ot[e[t+4]]+Ot[e[t+5]]+"-"+Ot[e[t+6]]+Ot[e[t+7]]+"-"+Ot[e[t+8]]+Ot[e[t+9]]+"-"+Ot[e[t+10]]+Ot[e[t+11]]+Ot[e[t+12]]+Ot[e[t+13]]+Ot[e[t+14]]+Ot[e[t+15]]}const Ch={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ii(e,t,n){if(Ch.randomUUID&&!e)return Ch.randomUUID();e=e||{};const r=e.random||(e.rng||Sy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Cy(r)}var Ut=Symbol("storefront");function Ny(e,t=100){let n=0;return async(...o)=>{clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}var Py=m.object({source:m.literal("moonbase-checkout"),event:m.literal("close"),intent:m.string().optional(),completed:m.boolean()}),Ty=m.object({source:m.literal("moonbase-checkout"),event:m.literal("completed"),order:wl.orders.completedOrderSchema}),$y=m.discriminatedUnion("event",[Py,Ty]);function Ay(){var e;const t=document.getElementById("moonbase-checkout");!t||!(t instanceof HTMLIFrameElement)||(e=t.contentWindow)==null||e.postMessage("close","*")}function Ca(e){var t;if(typeof window>"u"){console.warn("Can not mount checkout server side");return}if(document.getElementById("moonbase-checkout"))return;const n=(t=document.head.querySelector('meta[name="color-scheme"]'))==null?void 0:t.getAttribute("content");n&&(e+=`${e.includes("?")?"&":"?"}color_scheme=${encodeURIComponent(n)}`);const r=document.createElement("iframe");r.id="moonbase-checkout",r.src=e,r.style.position="fixed",r.style.top="0px",r.style.left="0px",r.style.right="0px",r.style.border="none",r.style.colorScheme="normal",r.style.backgroundColor="transparent",r.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),r.setAttribute("background","transparent"),r.setAttribute("frameborder","0"),r.setAttribute("allowtransparency","true"),r.setAttribute("allow","payment"),r.height="100%",r.width="100%",document.body.append(r),document.documentElement.style.overflow="hidden",window.onmessage=function(o){var s;try{const i=$y.parse(o.data);i.event==="close"&&(document.body.contains(r)&&(document.documentElement.style.removeProperty("overflow"),document.body.removeChild(r)),window.dispatchEvent(new CustomEvent("moonbase-checkout-closed",{detail:i}))),i.event==="completed"&&window.dispatchEvent(new CustomEvent("moonbase-checkout-completed",{detail:i}))}catch(i){((s=o.data)==null?void 0:s.source)==="moonbase-checkout"&&console.error("Could not parse event:",o.data,i)}}}var Dy=m.object({source:m.literal("moonbase-subscription"),event:m.literal("close"),completed:m.boolean()}),Iy=m.object({source:m.literal("moonbase-subscription"),event:m.literal("updated-payment-method")}),My=m.discriminatedUnion("event",[Dy,Iy]);function Nh(e){if(typeof window>"u"){console.warn("Can not mount subscription server side");return}if(document.getElementById("moonbase-subscription"))return;const t=document.createElement("iframe");t.id="moonbase-subscription",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=My.parse(n.data);o.event==="close"&&(document.body.contains(t)&&(document.documentElement.style.removeProperty("overflow"),document.body.removeChild(t)),window.dispatchEvent(new CustomEvent("moonbase-subscription-closed",{detail:o})))}catch(o){((r=n.data)==null?void 0:r.source)==="moonbase-subscription"&&console.error("Could not parse event:",n.data,o)}}}var ai=class ct{constructor(t,n,r){this.configuration=t,this.client=n,this.stateFactory=r,this.currentUser=L(null),this.loadedUser=L(!1),this.refreshOrderAbortController=new AbortController,this.debouncedPushOrderContent=Ny(l=>this.client.orders.pushContent(l,void 0,this.hasUtmOrReferrer?this.utm.value:void 0),500);var o;if(typeof window>"u"){this.currentOrder=L({id:ii(),status:$o.Open,currency:"",items:[],couponsApplied:[]}),this.storefront=r(ct.storefrontKey,{suggestedCurrency:"",enabledCurrencies:[],bundles:[],products:[],offers:[]}),this.loadedStorefront=r(`${ct.storefrontKey}_loaded`,!1),this.utm=r(ct.utmKey,void 0);return}window.addEventListener("storage",l=>this.handleStorageUpdate(l));const s=new URLSearchParams(window.location.search);if(this.utm=r(ct.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:sessionStorage).setItem(ct.utmKey,JSON.stringify(this.utm.value));else{const l=(t.persistUtm?localStorage:sessionStorage).getItem(ct.utmKey);if(l)try{const u=JSON.parse(l);this.utm.value=u}catch(u){console.warn(`Could not parse cached UTM from ${ct.utmKey}`,u)}}const i=localStorage.getItem(ct.sessionKey);i?(this.currentOrder=L(JSON.parse(i)),this.refreshOrder()):(this.currentOrder=L({id:ii(),status:$o.Open,currency:"",items:[],couponsApplied:[]}),this.hasUtmOrReferrer&&this.pushOrderContent());const a=localStorage.getItem(ct.storefrontKey);if(a?(this.storefront=r(ct.storefrontKey,JSON.parse(a)),this.loadedStorefront=r(`${ct.storefrontKey}_loaded`,!0)):(this.storefront=r(ct.storefrontKey,{suggestedCurrency:"",enabledCurrencies:[],bundles:[],products:[],offers:[]}),this.loadedStorefront=r(`${ct.storefrontKey}_loaded`,!1)),this.client.tokenStore.user&&(this.currentUser.value=wl.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]);Ca(f.toString()),window.history.replaceState(null,"",window.location.href.split("?")[0])}if(u==="update_subscription"&&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]);Nh(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=>{Xe(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=>{Xe(this.loadedUser,n=>{n&&t()},{immediate:!0})})}closeCheckout(){Ay()}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(Ut,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 Ui||console.error("Could not load user",t),this.currentUser.value=null}finally{this.loadedUser.value=!0}return this.currentUser.value}async updateStorefront(){var t;const n=await this.client.storefront.get(this.hasUtm?this.utm.value:void 0);return n&&(typeof window<"u"&&localStorage.setItem(ct.storefrontKey,JSON.stringify(n)),this.storefront.value=n,this.loadedStorefront.value=!0,(!this.currentOrder.value.currency||!((t=n.enabledCurrencies)!=null&&t.includes(this.currentOrder.value.currency)))&&(this.currentOrder.value.currency=n.suggestedCurrency),this.currentOrder.value.items=this.enrichLineItems(this.currentOrder.value.items)),n}async pushOrderContent(){typeof window<"u"&&localStorage.setItem(ct.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 ct.sessionKey:this.currentOrder.value=t.newValue?JSON.parse(t.newValue):{id:ii(),currency:((n=this.storefront.value)==null?void 0:n.suggestedCurrency)||"",status:$o.Open,items:[],couponsApplied:[]};break;case ct.storefrontKey:this.storefront.value=JSON.parse(t.newValue);break;case ct.utmKey:this.utm.value=JSON.parse(t.newValue);break;case Qc.storageKey:t.newValue?console.warn("User was updated",t.newValue):(this.currentUser.value=null,console.warn("User was removed"))}}async refreshOrder(){var t;try{const n=await this.client.orders.get(this.currentOrder.value.id,{abort:this.refreshOrderAbortController.signal});n&&(n.status!==$o.Open?this.resetOrder():(n.items=this.enrichLineItems(n.items),typeof window<"u"&&localStorage.setItem(ct.sessionKey,JSON.stringify(n)),this.storefront.value&&!((t=this.storefront.value.enabledCurrencies)!=null&&t.includes(n.currency))&&(n.currency=this.storefront.value.suggestedCurrency),this.currentOrder.value=n))}catch(n){n instanceof Mc&&this.resetOrder()}}resetOrder(){var t;this.currentOrder.value={id:ii(),currency:((t=this.storefront.value)==null?void 0:t.suggestedCurrency)||"",status:$o.Open,items:[],couponsApplied:[]},typeof window<"u"&&localStorage.removeItem(ct.sessionKey)}async surrenderOrder(){try{await this.client.orders.removeBillingDetails(this.currentOrder.value.id)}catch(t){if(t instanceof _r)return;console.warn("Could not surrender order:",t)}}enrichLineItems(t){return this.storefront?t.map(n=>{var r,o,s;const i=(r=this.storefront.value.offers)==null?void 0:r.find(a=>a.id===n.offerId);if(n.type==="Product"){const a=this.storefront.value.products.find(c=>c.id===n.productId);let u=((a==null?void 0:a.variations)||[]).find(c=>c.id===n.variationId);return i&&u&&qr.eligible(i,this.currentOrder.value)&&(u=qr.applyToVariation(i,u)),{...n,product:a,variation:u,price:u==null?void 0:u.price,appliedDiscount:(o=u==null?void 0:u.discount)!=null?o:n.appliedDiscount}}else{const a=this.storefront.value.bundles.find(c=>c.id===n.bundleId);let u=((a==null?void 0:a.variations)||[]).find(c=>c.id===n.variationId);return i&&u&&qr.eligible(i,this.currentOrder.value)&&(u=qr.applyToVariation(i,u)),{...n,bundle:a,variation:u,price:u==null?void 0:u.price,appliedDiscount:(s=u==null?void 0:u.discount)!=null?s:n.appliedDiscount}}}):t}};ai.userKey="moonbase_user",ai.sessionKey="moonbase_session",ai.storefrontKey="moonbase_storefront",ai.utmKey="moonbase_utm";var Vy=ai;function Ry(e,t){const n=me(Ut);if(!n)throw new Error("No storefront configured");const r=n.stateFactory(`activation-request-${Or(e)}`,null),o=n.stateFactory(`activation-request-${Or(e)}-error`,null),s=n.stateFactory(`activation-request-${Or(e)}-loading`,!0),i=n.stateFactory(`activation-request-${Or(e)}-fulfilling`,!1),a=n.stateFactory(`activation-request-${Or(e)}-completing`,!1),l=n.stateFactory(`activation-request-${Or(e)}-completion-timeout`,null),u=async()=>{if(!r.value)return;await n.client.activationRequests.isCompleted(r.value.id)&&r.value?(r.value.status=mn.Completed,a.value=!1):l.value=setTimeout(u,1500)};return Xe(()=>Or(e),async c=>{try{c&&c.length>0?(r.value=await n.client.activationRequests.get(c),r.value.status===mn.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}),Yl(()=>{l.value&&clearTimeout(l.value)}),Xe(n.currentUser,async()=>{var c,d;const f=Or(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===mn.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:te(()=>{var c;return r&&((c=r.value)==null?void 0:c.status)===mn.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 Ui?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===mn.Cancelled||(r.value=await n.client.activationRequests.cancel(r.value.id))}}}function nt(e){const t=e??me(Ut);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 Na(e,t){const n=t??me(Ut);if(!n)throw new Error("No storefront configured");return te(()=>n.storefront.value.bundles.find(r=>r.id===e)||null)}function Ly(e){const t=me(Ut);if(!t)throw new Error("No storefront configured");return te(()=>t.storefront.value.bundles)}function nr(e){const t=e??me(Ut);if(!t)throw new Error("No storefront configured");const n=te(()=>{const i=t.currentOrder.value.currency||t.storefront.value.suggestedCurrency;return{amount:t.currentOrder.value.items.reduce((l,u)=>{var c,d,f,h,p,g,_,S,R,H;let z;if(u.type==="Product"){const I=t.storefront.value.products.find(T=>T.id===u.productId),P=((I==null?void 0:I.variations)||[]).find(T=>T.id===u.variationId),D=(d=(c=P==null?void 0:P.pricingTiers)==null?void 0:c.filter(T=>u.quantity>=T.minQuantity))!=null?d:[],$=D.length>0?D[D.length-1]:null;z=(g=(p=(f=$==null?void 0:$.price[i])!=null?f:P==null?void 0:P.price[i])!=null?p:(h=I==null?void 0:I.defaultVariation)==null?void 0:h.price[i])!=null?g:0}else{const I=t.storefront.value.bundles.find(D=>D.id===u.bundleId),P=((I==null?void 0:I.variations)||[]).find(D=>D.id===u.variationId);z=(R=(S=P==null?void 0:P.price[i])!=null?S:(_=I==null?void 0:I.defaultVariation)==null?void 0:_.price[i])!=null?R:0}const B=u.offerId?(H=t.storefront.value.offers)==null?void 0:H.find(I=>I.id===u.offerId):null;if(B&&qr.eligible(B,t.currentOrder.value)){const I=El.apply(B.discount,{[i]:z});z-=I[i]}return l+z*u.quantity},0),currency:i}});function r(i,a,l,u){var c,d,f;if(i=v(i),a??(a=i.defaultVariation),!a)throw new Error("Added item does not have a default variation, and none have been specified");const h=`${i.type==="Bundle"?"b":"p"}/${i.id}/${a.id}`;let p=t==null?void 0:t.currentOrder.value.items.find(g=>g.id===h);if(p)p.quantity+=1,(f=p.offerId)!=null||(p.offerId=l==null?void 0:l.id),!p.variation&&a&&(p.variation=a),!p.price&&a&&(p.price=a.price),!p.appliedDiscount&&a.discount&&(p.appliedDiscount=a.discount),p.type==="Product"&&i.type==="Product"&&!p.product&&(p.product=i),p.type==="Bundle"&&i.type==="Bundle"&&!p.bundle&&(p.bundle=i);else if(i.type==="Bundle"){if(p={id:h,type:"Bundle",bundleId:i.id,bundle:i,quantity:1,variation:a,variationId:a.id,offerId:l==null?void 0:l.id,price:a.price,appliedDiscount:a.discount,isDefaultVariation:a.id===((c=i.defaultVariation)==null?void 0:c.id)},(u==null?void 0:u.bundleBehaviour)==="replace"){const g=t==null?void 0:t.currentOrder.value.items.filter(_=>_.type==="Product"&&i.products.some(S=>S.included&&S.id===_.productId));for(const _ of g??[]){const S=t==null?void 0:t.currentOrder.value.items.findIndex(R=>R.id===_.id);S!==void 0&&(t==null||t.currentOrder.value.items.splice(S,1))}p.replaced=g==null?void 0:g.filter(_=>_.type==="Product").map(_=>`${_.productId}/${_.variationId}`)}t==null||t.currentOrder.value.items.push(p)}else if(i.type==="Product")p={id:h,type:"Product",productId:i.id,product:i,quantity:1,variation:a,variationId:a.id,offerId:l==null?void 0:l.id,price:a.price,appliedDiscount:a.discount,isDefaultVariation:a.id===((d=i.defaultVariation)==null?void 0:d.id)},t==null||t.currentOrder.value.items.push(p);else throw new bn("Invalid input",`Could not handle item of type '${i.type}'`);return t==null||t.pushOrderContent(),p}function o(i){var a,l;if(t&&i.type==="Bundle"&&i.replaced&&i.replaced.length>0)for(const{productId:u,variationId:c}of i.replaced.map(d=>({productId:d.split("/")[0],variationId:d.split("/")[1]}))){const d=t.storefront.value.products.find(h=>h.id===u),f=(a=d==null?void 0:d.variations)==null?void 0:a.find(h=>h.id===c);if(d&&f&&!t.currentOrder.value.items.some(h=>h.type==="Product"&&h.productId===u)){const h=`p/${d.id}/${c}`;t.currentOrder.value.items.push({id:h,type:"Product",productId:d.id,product:d,quantity:1,variation:f,variationId:c,price:f.price,appliedDiscount:f.discount,isDefaultVariation:f.id===((l=d.defaultVariation)==null?void 0:l.id)})}}}function s(){var i;if(t){for(const a of t.currentOrder.value.items)if(a.offerId){const l=(i=t.storefront.value.offers)==null?void 0:i.find(u=>u.id===a.offerId);(!l||!qr.eligible(l,t.currentOrder.value))&&(a.offerId=void 0)}}}return{items:te(()=>t.enrichLineItems(t.currentOrder.value.items)),currency:te(()=>t.currentOrder.value.currency||t.storefront.value.suggestedCurrency),total:n,addToCart:r,setQuantity:(i,a)=>{const l=t.currentOrder.value.items.find(u=>u.id===i.id);if(!l)throw new Error("Cart item not found");if(l.quantity=a,l.quantity<=0){const u=t.currentOrder.value.items.findIndex(c=>c.id===l.id);t.currentOrder.value.items.splice(u,1),o(i),s()}return t.pushOrderContent(),i},removeFromCart:i=>{const a=t.currentOrder.value.items.findIndex(l=>l.id===i.id);t.currentOrder.value.items.splice(a,1),o(i),s(),t.pushOrderContent()},checkout:async i=>{var a;const l=typeof window<"u"?window.location.pathname:"",u=new URL((a=i.returnUrl)!=null?a:l,document.baseURI).href,c=await t.client.orders.pushContent(t.currentOrder.value,{returnUrl:u},t.hasUtm?t.utm.value:void 0);if(c.items=t.enrichLineItems(c.items),window.dispatchEvent(new CustomEvent("moonbase-checkout-initiated",{detail:{order:c,total:n.value}})),!i.redirect&&c.embeddedCheckoutUrl&&typeof window<"u"){const d=c.embeddedCheckoutUrl;return new Promise(f=>{Ca(d.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",h=>{const p=h;f({next:p.detail.intent,completed:p.detail.completed})},{once:!0})})}else{if(i.redirect&&c.checkoutUrl&&typeof window<"u")return window.location.href=c.checkoutUrl,{next:void 0,completed:!1};throw new Error("No checkout URL found")}}}}async function jy(e,t,n){var r,o;const s=n??me(Ut);if(!s)throw new Error("No storefront configured");const i=[];for(const c of e){const d=v(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 bn("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:ii(),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=>{Ca(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 lo(e){const t=me(Ut);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=>{Ca(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})})},updateSubscriptionPaymentMethod: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,a=await t.client.inventory.subscriptions.getById(n.id,{toUpdatePaymentMethod:!0,returnUrl:i});if(window.dispatchEvent(new CustomEvent("moonbase-subscription-payment-method-update-initiated",{detail:{subscription:Oe(n)}})),a.embeddedUpdatePaymentUrl&&typeof window<"u"){const l=a.embeddedUpdatePaymentUrl;return new Promise(u=>{Nh(l.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-subscription-closed",c=>{u({completed:c.detail.completed})},{once:!0})})}else throw new Error("No update URL found")}}}function Uy(e,t){const n=me(Ut);if(!n)throw new Error("No storefront configured");return te(()=>{var r;return((r=n.storefront.value.offers)==null?void 0:r.find(o=>o.id===e))||null})}function By(e){const t=me(Ut);if(!t)throw new Error("No storefront configured");return te(()=>{var n;return((n=t.storefront.value.offers)!=null?n:[]).filter(r=>qr.eligible(r,t.currentOrder.value)&&!Fy(r,t.currentOrder.value))})}function Fy(e,t){return!!t.items.some(n=>n.type==="Product"&&e.target.type==="Product"&&n.productId===e.target.id||n.type==="Bundle"&&e.target.type==="Bundle"&&n.bundleId===e.target.id)}function li(e,t){const n=t??me(Ut);if(!n)throw new Error("No storefront configured");return te(()=>n.storefront.value.products.find(r=>r.id===e)||null)}function zy(e){const t=me(Ut);if(!t)throw new Error("No storefront configured");return te(()=>t.storefront.value.products)}function Ph(e){const t=me(Ut);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 _r?new Error("Voucher code invalid"):r}},redeem:async n=>{try{return await t.client.vouchers.redeem(n)}catch(r){throw r instanceof _r?new Error("Voucher code invalid"):r}}}}function Hy(e,t,n){const r={endpoint:e};return new Vy(r,new ub(r),(o,s)=>L(s))}function Pa(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 yu(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function qy(){return Th().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Th(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Wy=typeof Proxy=="function",Zy="devtools-plugin:setup",Yy="plugin:settings:set";let Bo,_u;function Gy(){var e;return Bo!==void 0||(typeof window<"u"&&window.performance?(Bo=!0,_u=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(Bo=!0,_u=globalThis.perf_hooks.performance):Bo=!1),Bo}function Ky(){return Gy()?_u.now():Date.now()}class Xy{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(Yy,(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 $h(e,t){const n=e,r=Th(),o=qy(),s=Wy&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(Zy,e,t);else{const i=s?new Xy(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}var Ue={};let ui;const ci=e=>ui=e,Ah=Ue.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function uo(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Un;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Un||(Un={}));const co=typeof window<"u",Dh=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 Jy(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 wu(e,t,n){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){Vh(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function Ih(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Ta(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 $a=typeof navigator=="object"?navigator:{userAgent:""},Mh=/Macintosh/.test($a.userAgent)&&/AppleWebKit/.test($a.userAgent)&&!/Safari/.test($a.userAgent),Vh=co?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!Mh?Qy:"msSaveOrOpenBlob"in $a?e1:t1:()=>{};function Qy(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?Ih(r.href)?wu(e,t,n):(r.target="_blank",Ta(r)):Ta(r)):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Ta(r)},0))}function e1(e,t="download",n){if(typeof e=="string")if(Ih(e))wu(e,t,n);else{const r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){Ta(r)})}else navigator.msSaveOrOpenBlob(Jy(e,n),t)}function t1(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return wu(e,t,n);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(Dh.HTMLElement))||"safari"in Dh,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||o&&s||Mh)&&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 yt(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 Eu(e){return"_a"in e&&"install"in e}function Rh(){if(!("clipboard"in navigator))return yt("Your browser doesn't support the Clipboard API","error"),!0}function Lh(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(yt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function n1(e){if(!Rh())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),yt("Global state copied to clipboard.")}catch(t){if(Lh(t))return;yt("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function r1(e){if(!Rh())try{jh(e,JSON.parse(await navigator.clipboard.readText())),yt("Global state pasted from clipboard.")}catch(t){if(Lh(t))return;yt("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function o1(e){try{Vh(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){yt("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let rr;function s1(){rr||(rr=document.createElement("input"),rr.type="file",rr.accept=".json");function e(){return new Promise((t,n)=>{rr.onchange=async()=>{const r=rr.files;if(!r)return t(null);const o=r.item(0);return t(o?{text:await o.text(),file:o}:null)},rr.oncancel=()=>t(null),rr.onerror=n,rr.click()})}return e}async function i1(e){try{const n=await s1()();if(!n)return;const{text:r,file:o}=n;jh(e,JSON.parse(r)),yt(`Global state imported from "${o.name}".`)}catch(t){yt("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function jh(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 Sn(e){return{_custom:{display:e}}}const Uh="🍍 Pinia (root)",Aa="_root";function a1(e){return Eu(e)?{id:Aa,label:Uh}:{id:e.$id,label:e.$id}}function l1(e){if(Eu(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 u1(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:Sn(e.type),key:Sn(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function c1(e){switch(e){case Un.direct:return"mutation";case Un.patchFunction:return"$patch";case Un.patchObject:return"$patch";default:return"unknown"}}let Fo=!0;const Da=[],fo="pinia:mutations",Pt="pinia",{assign:d1}=Object,Ia=e=>"🍍 "+e;function f1(e,t){$h({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Da,app:e},n=>{typeof n.now!="function"&&yt("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:fo,label:"Pinia 🍍",color:15064968}),n.addInspector({id:Pt,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{n1(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await r1(t),n.sendInspectorTree(Pt),n.sendInspectorState(Pt)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{o1(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await i1(t),n.sendInspectorTree(Pt),n.sendInspectorState(Pt)},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"?yt(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(o.$reset(),yt(`Store "${r}" reset.`)):yt(`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:Ia(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:Oe(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:Ia(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===Pt){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()):Uh.toLowerCase().includes(r.filter.toLowerCase())):o).map(a1)}}),globalThis.$pinia=t,n.on.getInspectorState(r=>{if(r.app===e&&r.inspectorId===Pt){const o=r.nodeId===Aa?t:t._s.get(r.nodeId);if(!o)return;o&&(r.nodeId!==Aa&&(globalThis.$store=Oe(o)),r.state=l1(o))}}),n.on.editInspectorState((r,o)=>{if(r.app===e&&r.inspectorId===Pt){const s=r.nodeId===Aa?t:t._s.get(r.nodeId);if(!s)return yt(`store "${r.nodeId}" not found`,"error");const{path:i}=r;Eu(s)?i.unshift("state"):(i.length!==1||!s._customProperties.has(i[0])||i[0]in s.$state)&&i.unshift("$state"),Fo=!1,r.set(s,i,r.state.value),Fo=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const o=r.type.replace(/^🍍\s*/,""),s=t._s.get(o);if(!s)return yt(`store "${o}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return yt(`Invalid path for store "${o}":
16
16
  ${i}
17
17
  Only state can be modified.`);i[0]="$state",Fo=!1,r.set(s,i,r.state.value),Fo=!0}})})}function h1(e,t){Da.includes(Ia(t.$id))||Da.push(Ia(t.$id)),$h({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Da,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=Bh++;n.addTimelineEvent({layerId:fo,event:{time:r(),title:"🛫 "+l,subtitle:"start",data:{store:Sn(t.$id),action:Sn(l),args:u},groupId:c}}),i(d=>{Dr=void 0,n.addTimelineEvent({layerId:fo,event:{time:r(),title:"🛬 "+l,subtitle:"end",data:{store:Sn(t.$id),action:Sn(l),args:u,result:d},groupId:c}})}),a(d=>{Dr=void 0,n.addTimelineEvent({layerId:fo,event:{time:r(),logType:"error",title:"💥 "+l,subtitle:"end",data:{store:Sn(t.$id),action:Sn(l),args:u,error:d},groupId:c}})})},!0),t._customProperties.forEach(i=>{Xe(()=>v(t[i]),(a,l)=>{n.notifyComponentUpdate(),n.sendInspectorState(Pt),Fo&&n.addTimelineEvent({layerId:fo,event:{time:r(),title:"Change",subtitle:i,data:{newValue:a,oldValue:l},groupId:Dr}})},{deep:!0})}),t.$subscribe(({events:i,type:a},l)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(Pt),!Fo)return;const u={time:r(),title:c1(a),data:d1({store:Sn(t.$id)},u1(i)),groupId:Dr};a===Un.patchFunction?u.subtitle="⤵️":a===Un.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:fo,event:u})},{detached:!0,flush:"sync"});const o=t._hotUpdate;t._hotUpdate=xr(i=>{o(i),n.addTimelineEvent({layerId:fo,event:{time:r(),title:"🔥 "+t.$id,subtitle:"HMR update",data:{store:Sn(t.$id),info:Sn("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(Pt),n.sendInspectorState(Pt)});const{$dispose:s}=t;t.$dispose=()=>{s(),n.notifyComponentUpdate(),n.sendInspectorTree(Pt),n.sendInspectorState(Pt),n.getSettings().logStoreChanges&&yt(`Disposed "${t.$id}" store 🗑`)},n.notifyComponentUpdate(),n.sendInspectorTree(Pt),n.sendInspectorState(Pt),n.getSettings().logStoreChanges&&yt(`"${t.$id}" store installed 🆕`)})}let Bh=0,Dr;function Fh(e,t,n){const r=t.reduce((o,s)=>(o[s]=Oe(e)[s],o),{});for(const o in r)e[o]=function(){const s=Bh,i=n?new Proxy(e,{get(...l){return Dr=s,Reflect.get(...l)},set(...l){return Dr=s,Reflect.set(...l)}}):e;Dr=s;const a=r[o].apply(i,arguments);return Dr=void 0,a}}function p1({app:e,store:t,options:n}){if(!t.$id.startsWith("__hot:")){if(t._isOptionsAPI=!!n.state,!t._p._testing){Fh(t,Object.keys(n.actions),t._isOptionsAPI);const r=t._hotUpdate;Oe(t)._hotUpdate=function(o){r.apply(this,arguments),Fh(t,Object.keys(o._hmrPayload.actions),!!t._isOptionsAPI)}}h1(e,t)}}function m1(){const e=pd(!0),t=e.run(()=>L({}));let n=[],r=[];const o=xr({install(s){ci(o),o._a=s,s.provide(Ah,o),s.config.globalProperties.$pinia=o,Ue.NODE_ENV!=="production"&&Ue.NODE_ENV!=="test"&&co&&f1(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 Ue.NODE_ENV!=="production"&&Ue.NODE_ENV!=="test"&&typeof Proxy<"u"&&o.use(p1),o}function zh(e,t){for(const n in t){const r=t[n];if(!(n in e))continue;const o=e[n];uo(o)&&uo(r)&&!Ke(r)&&!wn(r)?e[n]=zh(o,r):e[n]=r}return e}const Hh=()=>{};function qh(e,t,n,r=Hh){e.push(t);const o=()=>{const s=e.indexOf(t);s>-1&&(e.splice(s,1),r())};return!n&&md()&&Nb(o),o}function zo(e,...t){e.slice().forEach(n=>{n(...t)})}const b1=e=>e(),Wh=Symbol(),ku=Symbol();function xu(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];uo(o)&&uo(r)&&e.hasOwnProperty(n)&&!Ke(r)&&!wn(r)?e[n]=xu(o,r):e[n]=r}return e}const g1=Ue.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function v1(e){return!uo(e)||!e.hasOwnProperty(g1)}const{assign:sn}=Object;function Zh(e){return!!(Ke(e)&&e.effect)}function Yh(e,t,n,r){const{state:o,actions:s,getters:i}=t,a=n.state.value[e];let l;function u(){!a&&(Ue.NODE_ENV==="production"||!r)&&(n.state.value[e]=o?o():{});const c=Ue.NODE_ENV!=="production"&&r?Ld(L(o?o():{}).value):Ld(n.state.value[e]);return sn(c,s,Object.keys(i||{}).reduce((d,f)=>(Ue.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]=xr(te(()=>{ci(n);const h=n._s.get(e);return i[f].call(h,h)})),d),{}))}return l=Ou(e,u,t,n,r,!0),l}function Ou(e,t,n={},r,o,s){let i;const a=sn({actions:{}},n);if(Ue.NODE_ENV!=="production"&&!r._e.active)throw new Error("Pinia destroyed");const l={deep:!0};Ue.NODE_ENV!=="production"&&(l.onTrigger=$=>{u?h=$:u==!1&&!y._hotUpdating&&(Array.isArray(h)?h.push($):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&&(Ue.NODE_ENV==="production"||!o)&&(r.state.value[e]={});const g=L({});let _;function S($){let T;u=c=!1,Ue.NODE_ENV!=="production"&&(h=[]),typeof $=="function"?($(r.state.value[e]),T={type:Un.patchFunction,storeId:e,events:h}):(xu(r.state.value[e],$),T={type:Un.patchObject,payload:$,storeId:e,events:h});const M=_=Symbol();aa().then(()=>{_===M&&(u=!0)}),c=!0,zo(d,T,r.state.value[e])}const R=s?function(){const{state:T}=n,M=T?T():{};this.$patch(ie=>{sn(ie,M)})}:Ue.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:Hh;function H(){i.stop(),d=[],f=[],r._s.delete(e)}const z=($,T="")=>{if(Wh in $)return $[ku]=T,$;const M=function(){ci(r);const ie=Array.from(arguments),Se=[],N=[];function q(be){Se.push(be)}function U(be){N.push(be)}zo(f,{args:ie,name:M[ku],store:y,after:q,onError:U});let ne;try{ne=$.apply(this&&this.$id===e?this:y,ie)}catch(be){throw zo(N,be),be}return ne instanceof Promise?ne.then(be=>(zo(Se,be),be)).catch(be=>(zo(N,be),Promise.reject(be))):(zo(Se,ne),ne)};return M[Wh]=!0,M[ku]=T,M},B=xr({actions:{},getters:{},state:[],hotState:g}),I={_p:r,$id:e,$onAction:qh.bind(null,f),$patch:S,$reset:R,$subscribe($,T={}){const M=qh(d,$,T.detached,()=>ie()),ie=i.run(()=>Xe(()=>r.state.value[e],Se=>{(T.flush==="sync"?c:u)&&$({storeId:e,type:Un.direct,events:h},Se)},sn({},l,T)));return M},$dispose:H},y=Us(Ue.NODE_ENV!=="production"||Ue.NODE_ENV!=="production"&&Ue.NODE_ENV!=="test"&&co?sn({_hmrPayload:B,_customProperties:xr(new Set)},I):I);r._s.set(e,y);const D=(r._a&&r._a.runWithContext||b1)(()=>r._e.run(()=>(i=pd()).run(()=>t({action:z}))));for(const $ in D){const T=D[$];if(Ke(T)&&!Zh(T)||wn(T))Ue.NODE_ENV!=="production"&&o?Pa(g.value,$,Ll(D,$)):s||(p&&v1(T)&&(Ke(T)?T.value=p[$]:xu(T,p[$])),r.state.value[e][$]=T),Ue.NODE_ENV!=="production"&&B.state.push($);else if(typeof T=="function"){const M=Ue.NODE_ENV!=="production"&&o?T:z(T,$);D[$]=M,Ue.NODE_ENV!=="production"&&(B.actions[$]=T),a.actions[$]=T}else Ue.NODE_ENV!=="production"&&Zh(T)&&(B.getters[$]=s?n.getters[$]:T,co&&(D._getters||(D._getters=xr([]))).push($))}if(sn(y,D),sn(Oe(y),D),Object.defineProperty(y,"$state",{get:()=>Ue.NODE_ENV!=="production"&&o?g.value:r.state.value[e],set:$=>{if(Ue.NODE_ENV!=="production"&&o)throw new Error("cannot set hotState");S(T=>{sn(T,$)})}}),Ue.NODE_ENV!=="production"&&(y._hotUpdate=xr($=>{y._hotUpdating=!0,$._hmrPayload.state.forEach(T=>{if(T in y.$state){const M=$.$state[T],ie=y.$state[T];typeof M=="object"&&uo(M)&&uo(ie)?zh(M,ie):$.$state[T]=ie}Pa(y,T,Ll($.$state,T))}),Object.keys(y.$state).forEach(T=>{T in $.$state||yu(y,T)}),u=!1,c=!1,r.state.value[e]=Ll($._hmrPayload,"hotState"),c=!0,aa().then(()=>{u=!0});for(const T in $._hmrPayload.actions){const M=$[T];Pa(y,T,z(M,T))}for(const T in $._hmrPayload.getters){const M=$._hmrPayload.getters[T],ie=s?te(()=>(ci(r),M.call(y,y))):M;Pa(y,T,ie)}Object.keys(y._hmrPayload.getters).forEach(T=>{T in $._hmrPayload.getters||yu(y,T)}),Object.keys(y._hmrPayload.actions).forEach(T=>{T in $._hmrPayload.actions||yu(y,T)}),y._hmrPayload=$._hmrPayload,y._getters=$._getters,y._hotUpdating=!1})),Ue.NODE_ENV!=="production"&&Ue.NODE_ENV!=="test"&&co){const $={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(T=>{Object.defineProperty(y,T,sn({value:y[T]},$))})}return r._p.forEach($=>{if(Ue.NODE_ENV!=="production"&&Ue.NODE_ENV!=="test"&&co){const T=i.run(()=>$({store:y,app:r._a,pinia:r,options:a}));Object.keys(T||{}).forEach(M=>y._customProperties.add(M)),sn(y,T)}else sn(y,i.run(()=>$({store:y,app:r._a,pinia:r,options:a})))}),Ue.NODE_ENV!=="production"&&y.$state&&typeof y.$state=="object"&&typeof y.$state.constructor=="function"&&!y.$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=ui,a._s.has(r)||(s?Ou(r,t,o,a):Yh(r,o,a),Ue.NO
33
33
  *
34
34
  * You can read more about the APCA Readability Criterion at
35
35
  * https://readtech.org/ARC/
36
- */const Bp=.027,N2=5e-4,P2=.1,Fp=1.14,Wa=.022,zp=1.414,T2=(e,t)=>{e=new Q(e),t=new Q(t),e.alpha()<1&&(e=Jo(t,e,e.alpha(),"rgb"));const n=Hp(...e.rgb()),r=Hp(...t.rgb()),o=n>=Wa?n:n+Math.pow(Wa-n,zp),s=r>=Wa?r:r+Math.pow(Wa-r,zp),i=Math.pow(s,.56)-Math.pow(o,.57),a=Math.pow(s,.65)-Math.pow(o,.62),l=Math.abs(s-o)<N2?0:o<s?i*Fp:a*Fp;return(Math.abs(l)<P2?0:l>0?l-Bp:l+Bp)*100};function Hp(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:ar,pow:mt,min:$2,max:A2,atan2:qp,abs:Wp,cos:Za,sin:Zp,exp:D2,PI:Yp}=Math;function I2(e,t,n=1,r=1,o=1){var s=function($e){return 360*$e/(2*Yp)},i=function($e){return 2*Yp*$e/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=ar(mt(l,2)+mt(u,2)),g=ar(mt(d,2)+mt(f,2)),_=(p+g)/2,S=.5*(1-ar(mt(_,7)/(mt(_,7)+mt(25,7)))),R=l*(1+S),H=d*(1+S),z=ar(mt(R,2)+mt(u,2)),B=ar(mt(H,2)+mt(f,2)),I=(z+B)/2,y=s(qp(u,R)),P=s(qp(f,H)),D=y>=0?y:y+360,$=P>=0?P:P+360,T=Wp(D-$)>180?(D+$+360)/2:(D+$)/2,M=1-.17*Za(i(T-30))+.24*Za(i(2*T))+.32*Za(i(3*T+6))-.2*Za(i(4*T-63));let ie=$-D;ie=Wp(ie)<=180?ie:$<=D?ie+360:ie-360,ie=2*ar(z*B)*Zp(i(ie)/2);const Se=c-a,N=B-z,q=1+.015*mt(h-50,2)/ar(20+mt(h-50,2)),U=1+.045*I,ne=1+.015*I*M,be=30*D2(-mt((T-275)/25,2)),he=-(2*ar(mt(I,7)/(mt(I,7)+mt(25,7))))*Zp(2*i(be)),we=ar(mt(Se/(n*q),2)+mt(N/(r*U),2)+mt(ie/(o*ne),2)+he*(N/(r*U))*(ie/(o*ne)));return A2(0,$2(100,we))}function M2(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 V2=(...e)=>{try{return new Q(...e),!0}catch{return!1}},R2={cool(){return qa([Ve.hsl(180,1,.9),Ve.hsl(250,.7,.4)])},hot(){return qa(["#000","#f00","#ff0","#fff"]).mode("rgb")}},rc={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"]},Gp=Object.keys(rc),Kp=new Map(Gp.map(e=>[e.toLowerCase(),e])),L2=typeof Proxy=="function"?new Proxy(rc,{get(e,t){const n=t.toLowerCase();if(Kp.has(n))return e[Kp.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(Gp)}}):rc,j2=(...e)=>{e=Ie(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:Xp}=Math,U2=(...e)=>{let[t,n,r]=Ie(e,"rgb");t=t/255,n=n/255,r=r/255;const o=1-Xp(t,Xp(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 U2(this._rgb)},Object.assign(Ve,{cmyk:(...e)=>new Q(...e,"cmyk")}),Te.format.cmyk=j2,Te.autodetect.push({p:2,test:(...e)=>{if(e=Ie(e,"cmyk"),je(e)==="array"&&e.length===4)return"cmyk"}});const B2=(...e)=>{const t=Ie(e,"hsla");let n=Ko(e)||"lsa";return t[0]=ln(t[0]||0)+"deg",t[1]=ln(t[1]*100)+"%",t[2]=ln(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(" ")})`},F2=(...e)=>{const t=Ie(e,"lab");let n=Ko(e)||"lab";return t[0]=ln(t[0])+"%",t[1]=ln(t[1]),t[2]=ln(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},z2=(...e)=>{const t=Ie(e,"lch");let n=Ko(e)||"lab";return t[0]=ln(t[0])+"%",t[1]=ln(t[1]),t[2]=isNaN(t[2])?"none":ln(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(" ")})`},H2=(...e)=>{const t=Ie(e,"lab");return t[0]=ln(t[0]*100)+"%",t[1]=Bu(t[1]),t[2]=Bu(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},Jp=(...e)=>{const[t,n,r,...o]=Ie(e,"rgb"),[s,i,a]=Qu(t,n,r),[l,u,c]=Ap(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},q2=(...e)=>{const t=Ie(e,"lch");return t[0]=ln(t[0]*100)+"%",t[1]=Bu(t[1]),t[2]=isNaN(t[2])?"none":ln(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:oc}=Math,W2=(...e)=>{const t=Ie(e,"rgba");let n=Ko(e)||"rgb";if(n.substr(0,3)==="hsl")return B2(Ip(t),n);if(n.substr(0,3)==="lab"){const r=_i();ir("d50");const o=F2(qu(t),n);return ir(r),o}if(n.substr(0,3)==="lch"){const r=_i();ir("d50");const o=z2(Gu(t),n);return ir(r),o}return n.substr(0,5)==="oklab"?H2(Qu(t)):n.substr(0,5)==="oklch"?q2(Jp(t)):(t[0]=oc(t[0]),t[1]=oc(t[1]),t[2]=oc(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(" ")})`)},Qp=(...e)=>{e=Ie(e,"lch");const[t,n,r,...o]=e,[s,i,a]=$p(t,n,r),[l,u,c]=Ju(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},lr=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,Nn=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Ya=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,un=/\s*/.source,ns=/\s+/.source,sc=/\s*,\s*/.source,Ga=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,rs=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,em=new RegExp("^rgba?\\("+un+[lr,lr,lr].join(ns)+rs+"\\)$"),tm=new RegExp("^rgb\\("+un+[lr,lr,lr].join(sc)+un+"\\)$"),nm=new RegExp("^rgba\\("+un+[lr,lr,lr,Nn].join(sc)+un+"\\)$"),rm=new RegExp("^hsla?\\("+un+[Ga,Ya,Ya].join(ns)+rs+"\\)$"),om=new RegExp("^hsl?\\("+un+[Ga,Ya,Ya].join(sc)+un+"\\)$"),sm=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,im=new RegExp("^lab\\("+un+[Nn,Nn,Nn].join(ns)+rs+"\\)$"),am=new RegExp("^lch\\("+un+[Nn,Nn,Ga].join(ns)+rs+"\\)$"),lm=new RegExp("^oklab\\("+un+[Nn,Nn,Nn].join(ns)+rs+"\\)$"),um=new RegExp("^oklch\\("+un+[Nn,Nn,Ga].join(ns)+rs+"\\)$"),{round:cm}=Math,os=e=>e.map((t,n)=>n<=2?vo(cm(t),0,255):t),bt=(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),Ft=(e,t)=>e==="none"?t:e,ic=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(em))||(t=e.match(tm))){let n=t.slice(1,4);for(let o=0;o<3;o++)n[o]=+bt(Ft(n[o],0),0,255);n=os(n);const r=t[4]!==void 0?+bt(t[4],0,1):1;return n[3]=r,n}if(t=e.match(nm)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+bt(n[r],0,255);return n}if((t=e.match(rm))||(t=e.match(om))){const n=t.slice(1,4);n[0]=+Ft(n[0].replace("deg",""),0),n[1]=+bt(Ft(n[1],0),0,100)*.01,n[2]=+bt(Ft(n[2],0),0,100)*.01;const r=os(Xu(n)),o=t[4]!==void 0?+bt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(sm)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Xu(n);for(let o=0;o<3;o++)r[o]=cm(r[o]);return r[3]=+t[4],r}if(t=e.match(im)){const n=t.slice(1,4);n[0]=bt(Ft(n[0],0),0,100),n[1]=bt(Ft(n[1],0),-125,125,!0),n[2]=bt(Ft(n[2],0),-125,125,!0);const r=_i();ir("d50");const o=os(zu(n));ir(r);const s=t[4]!==void 0?+bt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(am)){const n=t.slice(1,4);n[0]=bt(n[0],0,100),n[1]=bt(Ft(n[1],0),0,150,!1),n[2]=+Ft(n[2].replace("deg",""),0);const r=_i();ir("d50");const o=os(Yu(n));ir(r);const s=t[4]!==void 0?+bt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(lm)){const n=t.slice(1,4);n[0]=bt(Ft(n[0],0),0,1),n[1]=bt(Ft(n[1],0),-.4,.4,!0),n[2]=bt(Ft(n[2],0),-.4,.4,!0);const r=os(Ju(n)),o=t[4]!==void 0?+bt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(um)){const n=t.slice(1,4);n[0]=bt(Ft(n[0],0),0,1),n[1]=bt(Ft(n[1],0),0,.4,!1),n[2]=+Ft(n[2].replace("deg",""),0);const r=os(Qp(n)),o=t[4]!==void 0?+bt(t[4],0,1):1;return r[3]=o,r}};ic.test=e=>em.test(e)||rm.test(e)||im.test(e)||am.test(e)||lm.test(e)||um.test(e)||tm.test(e)||nm.test(e)||om.test(e)||sm.test(e)||e==="transparent",Q.prototype.css=function(e){return W2(this._rgb,e)};const Z2=(...e)=>new Q(...e,"css");Ve.css=Z2,Te.format.css=ic,Te.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&je(e)==="string"&&ic.test(e))return"css"}}),Te.format.gl=(...e)=>{const t=Ie(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const Y2=(...e)=>new Q(...e,"gl");Ve.gl=Y2,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 Np(this._rgb,e)};const G2=(...e)=>new Q(...e,"hex");Ve.hex=G2,Te.format.hex=Cp,Te.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&je(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:Ka}=Math,dm=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*Ka(r),o=t<20?0:-254.76935184120902+.8274096064007395*(o=t-10)+115.67994401066147*Ka(o)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*Ka(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*Ka(r),o=255),[n,r,o,1]},{round:K2}=Math,X2=(...e)=>{const t=Ie(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=dm(a);l[2]/l[0]>=r/n?s=a:o=a}return K2(a)};Q.prototype.temp=Q.prototype.kelvin=Q.prototype.temperature=function(){return X2(this._rgb)};const ac=(...e)=>new Q(...e,"temp");Object.assign(Ve,{temp:ac,kelvin:ac,temperature:ac}),Te.format.temp=Te.format.kelvin=Te.format.temperature=dm,Q.prototype.oklch=function(){return Jp(this._rgb)},Object.assign(Ve,{oklch:(...e)=>new Q(...e,"oklch")}),Te.format.oklch=Qp,Te.autodetect.push({p:2,test:(...e)=>{if(e=Ie(e,"oklch"),je(e)==="array"&&e.length===3)return"oklch"}}),Object.assign(Ve,{analyze:jp,average:t2,bezier:a2,blend:Cn,brewer:L2,Color:Q,colors:Xo,contrast:C2,contrastAPCA:T2,cubehelix:y2,deltaE:I2,distance:M2,input:Te,interpolate:Jo,limits:Up,mix:Jo,random:k2,scale:qa,scales:R2,valid:V2});const J2=[{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 Q2(e){const r=J2.filter(i=>i.reference).map(i=>({...i,shades:i.shades.map(a=>({...a,delta:Ve.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(Ve(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 eE(e){const t=Ve(e),n=Q2(t),r=t.get("hsl.h"),o=Ve(n.closestShade.hexcode).get("hsl.h"),s=r-o,i=s===0?o.toString():s>0?`+${s}`:s.toString(),a=t.get("hsl.s")/Ve(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=Ve(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 ss extends Error{constructor(){super(),this.name="IndiscriminateError"}}const tE={},nE={fill:"none",viewBox:"0 0 24 24"};function rE(e,t){return b(),x("svg",nE,t[0]||(t[0]=[j("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),j("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 nn=or(tE,[["render",rE],["__scopeId","data-v-687bcaf0"]]),oE={"aria-hidden":"true"},lc=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=me(ut),r=te(()=>t.success?t.successLabel??t.label:t.error?t.errorLabel??t.label:t.label),o=te(()=>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 b(),Z(Gl(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=v(n))==null?void 0:a.theme.corners,"data-background":(l=v(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:k(()=>[j("div",oE,[s.working?(b(),Z(nn,{key:0})):s.success?(b(),Z(v(k_),{key:1})):s.error?(b(),Z(v(C_),{key:2})):s.icon?(b(),Z(Gl(s.icon),{key:3})):se("",!0)]),A(" "+V(r.value),1)]),_:1},8,["type","disabled","data-success","data-error","data-working","data-variant","data-size","data-corners","data-background","data-icon-visible"])}}}),Qe=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=L(!1),r=L(!1),o=L(!1);async function s(){try{const i=t.handler();i instanceof Promise&&(n.value=!0,await i,n.value=!1,r.value=!0,await Yt(2500),t.noReset||(r.value=!1))}catch(i){if(n.value=!1,i instanceof ss)return;o.value=!0,await Yt(2500),o.value=!1}}return(i,a)=>(b(),Z(lc,{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"]))}}),sE={},iE={class:"moonbase:text-body"};function aE(e,t){return b(),x("span",iE,[Nt(e.$slots,"default")])}const ot=or(sE,[["render",aE]]),lE={},uE={class:"moonbase:text-subtext"};function cE(e,t){return b(),x("span",uE,[Nt(e.$slots,"default")])}const Me=or(lE,[["render",cE]]),dE={class:"moonbase:about"},fE=pe({__name:"About",setup(e){const t=De(),n="0.4.55";return(r,o)=>(b(),x("div",dE,[o[2]||(o[2]=Jf('<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)),E(v(pp),{as:"h3"},{default:k(()=>o[0]||(o[0]=[A(" Moonbase Embedded Storefront ")])),_:1,__:[0]}),E(Me,null,{default:k(()=>[A(" Version "+V(v(n)),1)]),_:1}),E(ot,null,{default:k(()=>o[1]||(o[1]=[A(" This store is using the "),j("a",{href:"https://moonbase.sh/solutions/payments",target:"_blank"},"Moonbase Embedded Storefront",-1),A(" module to accept payments, provide authentication and power software licensing. ")])),_:1,__:[1]}),E(Qe,{label:"Close",variant:"primary",handler:()=>v(t).reset()},null,8,["handler"])]))}});var zt=(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))(zt||{});const hE=["data-corners","data-variant"],pE={class:"moonbase:card-content"},cn=pe({__name:"MoonCard",setup(e){const t=me(ut);return(n,r)=>{var o,s;return b(),x("div",{class:"moonbase:card","data-corners":(o=v(t))==null?void 0:o.theme.corners,"data-variant":(s=v(t))==null?void 0:s.theme.cards},[j("div",pE,[Nt(n.$slots,"default")]),Nt(n.$slots,"addon")],8,hE)}}}),mE=["data-corners"],bE=["href"],gE=["src"],vE=["src"],yE={key:2,class:"moonbase:image-placeholder"},Ht=pe({__name:"ProductIcon",props:{url:{},href:{},size:{}},setup(e){const t=me(ut);return(n,r)=>{var o;return b(),x("div",{class:"moonbase:product-icon",style:Ds({width:`${n.size}px`,height:`${n.size}px`}),"data-corners":(o=v(t))==null?void 0:o.theme.corners},[n.href&&n.url?(b(),x("a",{key:0,href:n.href},[j("img",{src:n.url,alt:""},null,8,gE)],8,bE)):n.url?(b(),x("img",{key:1,src:n.url,alt:""},null,8,vE)):(b(),x("div",yE,[E(v(x_))]))],12,mE)}}}),_E={},wE={class:"moonbase:text-title"};function EE(e,t){return b(),x("h4",wE,[Nt(e.$slots,"default")])}const is=or(_E,[["render",EE]]),kE={class:"moonbase:product-card-content"},fm=pe({__name:"ProductCard",props:{product:{}},setup(e){return(t,n)=>(b(),Z(cn,{class:"moonbase:product-card"},{default:k(()=>[E(Ht,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",kE,[E(is,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.name),1)]}),_:1}),E(Me,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.tagline),1)]}),_:1}),Nt(t.$slots,"description")]),Nt(t.$slots,"default")]),_:3}))}}),xE={class:"moonbase:auto-activation"},OE={key:0,class:"moonbase:loader"},SE={key:1,class:"moonbase:loader"},CE={key:2,class:"moonbase:loader"},NE={key:3},PE={key:1,class:"moonbase:loader"},TE={key:2,class:"moonbase:loader"},$E={key:3,class:"moonbase:loader"},AE={key:4,class:"moonbase:auto-activation-content"},DE={key:0,class:"moonbase:auto-activation-option"},IE={class:"moonbase:auto-activation-cta"},ME={key:1,class:"moonbase:auto-activation-option"},VE={class:"moonbase:auto-activation-cta"},RE={key:2,class:"moonbase:auto-activation-option"},LE={key:3,class:"moonbase:auto-activation-option"},jE={class:"moonbase:auto-activation-cta"},UE={key:4,class:"moonbase:auto-activation-option"},BE={key:4,class:"moonbase:auto-activation-cta"},FE={key:5,class:"moonbase:auto-activation-cta"},zE=pe({__name:"AutoActivation",setup(e){const t=De(),{user:n,loaded:r}=nt(),o=me(jr),s=t.getParameter("token"),{activationRequest:i,loading:a,fulfilling:l,completing:u,error:c,fulfillLicense:d,fulfillTrial:f}=Ry(s),h=me(Ut);Xe(i,y=>{var P;!l.value&&!u.value&&(y==null?void 0:y.status)===mn.Requested&&((P=y==null?void 0:y.licenseEligibility)!=null&&P.eligible)&&d(),(y==null?void 0:y.status)===mn.Completed&&(o==null||o(zt.ActivatedProduct,{product:y.product,fulfillmentType:y.fulfillmentType,user:n.value}))},{deep:!0});const p=te(()=>{if(i.value)return v(li(i.value.product.id))}),g=te(()=>p.value&&p.value.defaultVariation),{currency:_,addToCart:S,setQuantity:R}=nr();function H(){t.show(ue.Product,J.ViewProduct,{product_id:i.value.product.id})}function z(){t.enqueue(ue.Activation,J.ActivateProduct,t.parameters??void 0),t.show(ue.Authentication,J.SignIn)}function B(){if(!p.value)return;const y=S(p.value);R(y,1),t.enqueue(ue.Activation,J.ActivateProduct,t.parameters),t.show(ue.Cart,J.ViewCart)}function I(){var y;t.enqueue(ue.Activation,J.ActivateProduct,{...t.parameters,product_id:((y=i.value)==null?void 0:y.product.id)??""}),n.value?t.show(ue.Customer,J.RedeemVoucher):t.show(ue.Redeem,J.RedeemVoucher)}return(y,P)=>{var D,$,T,M,ie,Se,N;return b(),x("div",xE,[v(a)||!v(r)||!((D=v(h))!=null&&D.loadedStorefront)?(b(),x("div",OE,[E(nn)])):v(c)?(b(),x("div",SE,[E(rt,null,{default:k(()=>P[0]||(P[0]=[A(" Uh oh ")])),_:1,__:[0]}),E(ot,null,{default:k(()=>[A(V(v(c)),1)]),_:1})])):v(i)?(b(),x("div",NE,[v(i).product?(b(),Z(fm,{key:0,product:v(i).product},null,8,["product"])):se("",!0),(($=v(i))==null?void 0:$.status)===v(mn).Cancelled?(b(),x("div",PE,[E(rt,null,{default:k(()=>P[3]||(P[3]=[A(" Uh oh ")])),_:1,__:[3]}),E(ot,null,{default:k(()=>P[4]||(P[4]=[A(" This activation request was cancelled, open your app to try again. ")])),_:1,__:[4]})])):v(l)||v(u)?(b(),x("div",TE,[E(nn),E(ot,null,{default:k(()=>[A(" Activating "+V(v(i).product.name)+"... ",1)]),_:1})])):((T=v(i))==null?void 0:T.status)===v(mn).Completed?(b(),x("div",$E,[E(rt,null,{default:k(()=>P[5]||(P[5]=[A(" Done! ")])),_:1,__:[5]}),E(ot,null,{default:k(()=>P[6]||(P[6]=[A(" Your product is activated. "),j("br",null,null,-1),A(" You may close this window and return to the app. ")])),_:1,__:[6]})])):(b(),x("div",AE,[g.value?(b(),x("div",DE,[E(rt,null,{default:k(()=>P[7]||(P[7]=[A(" Option 1: Purchase product ")])),_:1,__:[7]}),E(ot,null,{default:k(()=>[A(" Buy a copy of "+V(p.value.name)+" for ",1),j("strong",null,V(v(Bt)(p.value.defaultVariation.price[v(_)],v(_))),1),P[8]||(P[8]=A(". "))]),_:1,__:[8]}),j("span",IE,[E(Qe,{label:"Purchase",variant:"primary",handler:()=>B()},null,8,["handler"])])])):se("",!0),v(n)?!v(n).ownedProducts||!((M=v(n).ownedProducts)!=null&&M.includes(v(i).product.id))&&!v(n).subscribedProducts||!((ie=v(n).subscribedProducts)!=null&&ie.includes(v(i).product.id))?(b(),x("div",RE,[E(rt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(ot,null,{default:k(()=>P[10]||(P[10]=[A(" You don't own any licenses for this product. ")])),_:1,__:[10]})])):(Se=v(n).ownedProducts)!=null&&Se.includes(v(i).product.id)||(N=v(n).subscribedProducts)!=null&&N.includes(v(i).product.id)?(b(),x("div",LE,[E(rt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(ot,null,{default:k(()=>P[11]||(P[11]=[A(" You don't have enough free seats on your licenses to activate this device. Either free up a seat or purchase additional licenses. ")])),_:1,__:[11]}),j("span",jE,[E(Qe,{label:"Licenses",variant:"secondary",handler:()=>H()},null,8,["handler"])])])):se("",!0):(b(),x("div",ME,[E(rt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(ot,null,{default:k(()=>P[9]||(P[9]=[A(" Please sign in to use a license for this product. ")])),_:1,__:[9]}),j("span",VE,[E(Qe,{label:"Sign in",variant:"secondary",handler:()=>z()},null,8,["handler"])])])),v(i).trialEligibility?(b(),x("div",UE,[E(rt,null,{default:k(()=>[A(" Option "+V(g.value?"3":"2")+": Start trial ",1)]),_:1}),v(i).trialEligibility.eligible&&v(i).trialEligibility.requiresAccount&&!v(n)?(b(),Z(ot,{key:0},{default:k(()=>P[12]||(P[12]=[A(" You need to be signed in to start a trial for this product. ")])),_:1,__:[12]})):v(i).trialEligibility.eligible&&v(i).trialEligibility.existing?(b(),Z(ot,{key:1},{default:k(()=>[A(" You are eligible for a "+V(v(i).trialEligibility.numberOfDaysPerProduct)+" day trial of which you have "+V(v(i).trialEligibility.numberOfDaysRemaining)+" days remaining. ",1)]),_:1})):v(i).trialEligibility.eligible?(b(),Z(ot,{key:2},{default:k(()=>[A(" You are eligible for a "+V(v(i).trialEligibility.numberOfDaysPerProduct)+" day trial. ",1)]),_:1})):(b(),Z(ot,{key:3},{default:k(()=>P[13]||(P[13]=[A(" This device or product is not eligible for a trial. ")])),_:1,__:[13]})),v(i).trialEligibility.eligible&&v(i).trialEligibility.requiresAccount&&!v(n)?(b(),x("span",BE,[E(Qe,{label:"Sign in",variant:"secondary",handler:()=>z()},null,8,["handler"])])):v(i).trialEligibility.eligible?(b(),x("span",FE,[E(Qe,{label:"Start trial",variant:"secondary",handler:v(f)},null,8,["handler"])])):se("",!0)])):se("",!0),P[15]||(P[15]=j("div",{class:"moonbase:grow"},null,-1)),E(Me,{class:"moonbase:auto-activation-redeem"},{default:k(()=>[P[14]||(P[14]=A(" Have a voucher code? ")),j("button",{type:"button",onClick:I}," Redeem now ")]),_:1,__:[14]})]))])):(b(),x("div",CE,[E(rt,null,{default:k(()=>P[1]||(P[1]=[A(" Uh oh ")])),_:1,__:[1]}),E(ot,null,{default:k(()=>P[2]||(P[2]=[A(" Could not find activation request ")])),_:1,__:[2]})]))])}}}),HE={},qE={class:"moonbase:text-caption"};function WE(e,t){return b(),x("span",qE,[Nt(e.$slots,"default")])}const qt=or(HE,[["render",WE]]),ZE=["data-corners"],YE=["accept"],GE={"data-error":""},KE=pe({__name:"DeviceTokenInput",props:{error:{}},emits:["input","error"],setup(e,{emit:t}){const n=t,r=me(ut),o=L(!1),s=te(()=>{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 b(),x("div",{class:Is(["moonbase:device-token-input",{"moonbase:device-token-input--hovering":o.value}]),"data-corners":(d=v(r))==null?void 0:d.theme.corners,onDrag:c[0]||(c[0]=Ar(()=>{},["prevent","stop"])),onDragstart:c[1]||(c[1]=Ar(()=>{},["prevent","stop"])),onDragend:c[2]||(c[2]=Ar(h=>o.value=!1,["prevent","stop"])),onDragover:c[3]||(c[3]=Ar(h=>o.value=!0,["prevent","stop"])),onDragenter:c[4]||(c[4]=Ar(h=>o.value=!0,["prevent","stop"])),onDragleave:c[5]||(c[5]=Ar(h=>o.value=!1,["prevent","stop"])),onDrop:Ar(a,["prevent","stop"])},[E(v(S_)),c[6]||(c[6]=j("label",{for:"fallback-input"},[j("span",{class:"moonbase:underline"},"Choose a machine file"),A(" or drag here to upload ")],-1)),j("input",{id:"fallback-input",type:"file",accept:s.value,class:"moonbase:sr-only",onChange:l},null,40,YE),j("p",GE,V((f=u.error)==null?void 0:f.message),1)],42,ZE)}}}),XE={class:"moonbase:manual-activation"},JE={key:1,class:"moonbase:loader"},QE={key:2,class:"moonbase:manual-activation-content"},e5=pe({__name:"ManualActivation",setup(e){const t=me(ut),{activateProduct:n}=lo(),r=Fi.Offline,o=L(0),s=L(null),i=L(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)=>(b(),x("div",XE,[E(ot,null,{default:k(()=>u[2]||(u[2]=[A(" 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,__:[2]}),E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[o.value===0?(b(),Z(KE,{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?(b(),x("div",JE,[E(nn)])):o.value===2&&i.value?(b(),x("div",QE,[E(rt,null,{default:k(()=>u[3]||(u[3]=[A(" Success! ")])),_:1,__:[3]}),E(ot,null,{default:k(()=>u[4]||(u[4]=[A(" Your license can be downloaded below: ")])),_:1,__:[4]}),i.value.license.product?(b(),Z(fm,{key:0,product:i.value.license.product},{description:k(()=>[E(qt,null,{default:k(()=>[A(V(i.value.license.activeNumberOfActivations)+" of "+V(i.value.license.maxNumberOfActivations)+" devices activated ",1)]),_:1})]),default:k(()=>{var c;return[E(Yo,{href:i.value.url,target:"_blank",download:((c=v(t))==null?void 0:c.activation.licenseTokenFileName)??"license-file.mb",class:"moonbase:manual-activation-download-button"},{default:k(()=>[E(v(O_))]),_:1},8,["href","download"])]}),_:1},8,["product"])):se("",!0),u[5]||(u[5]=j("div",null,null,-1)),u[6]||(u[6]=j("div",null,null,-1))])):se("",!0)]),_:1})]))}}),t5={class:"moonbase:activation"},n5=pe({__name:"Activation",setup(e){const t=De();return(n,r)=>(b(),x("div",t5,[v(t).getParameter("token")?(b(),Z(zE,{key:0})):(b(),Z(e5,{key:1}))]))}}),r5=["disabled"],hm=Symbol("form-state"),ur=pe({__name:"MoonForm",props:{handler:{type:Function},disabled:{type:Boolean},noReset:{type:Boolean}},setup(e){const t=e,n=L(!1),r=L(!1),o=L(!1),s=te(()=>t.disabled||n.value||r.value||!1);Zt(hm,{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 Yt(2500),t.noReset||(r.value=!1)}catch{n.value=!1,o.value=!0,await Yt(2500),o.value=!1}}return(a,l)=>(b(),x("form",{disabled:s.value,onSubmit:Ar(i,["prevent"])},[Nt(a.$slots,"default",{working:n.value,isSuccess:r.value,isError:o.value,disabled:n.value||r.value})],40,r5))}}),o5=["hidden"],s5=["for"],i5=["id","type","name","placeholder","value","disabled","aria-invalid","aria-describedby","data-corners"],a5=["id"],l5=["id"],At=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=me(ut);return(n,r)=>{var o;return b(),x("div",{class:"moonbase:input",hidden:n.hidden||void 0},[j("label",{for:`mb-${n.name}`},V(n.label),9,s5),j("input",cu({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=v(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,i5),n.error?(b(),x("p",{key:0,id:`mb-${n.name}-error`,class:"moonbase:input-hint","data-type":"error"},V(n.error),9,a5)):n.hint?(b(),x("p",{key:1,id:`mb-${n.name}-hint`,class:"moonbase:input-hint"},V(n.hint),9,l5)):se("",!0)],8,o5)}}}),cr=pe({__name:"MoonSubmitButton",props:{label:{},success:{},error:{},variant:{},size:{}},setup(e){const{working:t,isSuccess:n,isError:r,disabled:o}=me(hm);return(s,i)=>(b(),Z(lc,{label:s.label,working:v(t),"success-label":s.success,success:v(n),"error-label":s.error,error:v(r),type:"submit",disabled:v(o),variant:s.variant,size:s.size},null,8,["label","working","success-label","success","error-label","error","disabled","variant","size"]))}}),u5=["data-visible"],c5={class:"moonbase:sign-in-actions"},d5=["data-corners"],f5=pe({__name:"SignIn",emits:["signedIn"],setup(e,{emit:t}){const n=t,r=De(),o=nt(),s=me(ut),i=me(jr),a=L(r.getParameter("email")??""),l=L(""),u=L(null);async function c(){u.value=null;try{const d=await o.signIn(a.value,l.value);i==null||i(zt.SignedIn,{user:d}),Yt(1500).then(()=>n("signedIn",d))}catch(d){throw d instanceof _r?u.value="User not found":u.value=d.message,d}}return(d,f)=>(b(),Z(ur,{handler:c,class:"moonbase:sign-in"},{default:k(()=>{var h,p,g;return[E(At,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=_=>a.value=_),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),E(At,{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=_=>l.value=_),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},V(u.value),9,u5),E(cr,{success:"Signed in",label:"Sign in",error:"Error"}),j("div",c5,[(h=v(s))!=null&&h.auth.signUp.enabled?(b(),Z(Qe,{key:0,label:"Create account",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).SignUp,{email:a.value})},null,8,["handler"])):se("",!0),E(Qe,{label:"Forgot password",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).ForgotPassword,{email:a.value})},null,8,["handler"])]),(p=v(s))!=null&&p.auth.signIn.hint?(b(),x("div",{key:0,class:"moonbase:sign-in-hint","data-corners":(g=v(s))==null?void 0:g.theme.corners},[E(v(N_)),E(Me,null,{default:k(()=>[A(V(v(s).auth.signIn.hint),1)]),_:1})],8,d5)):se("",!0)]}),_:1}))}}),uc={default:[{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)}],lax:[{title:"Password must be at least 6 characters long",test:e=>e.length>=6}]},h5={key:0,class:"moonbase:loader"},p5={key:1,class:"moonbase:error","data-visible":""},m5={key:0,class:"moonbase:password-validation"},b5=["data-visible"],g5=pe({__name:"ConfirmAccount",emits:["confirmedAccount"],setup(e,{emit:t}){const n=t,r=De(),o=nt(),s=me(ut),i=L(!0),a=L(null),l=L(""),u=L(!1),c=L(null),d=te(()=>uc[(s==null?void 0:s.value.auth.passwords)??"default"]),f=te(()=>d.value.some(p=>!p.test(l.value)));ze(async()=>{try{const p=r.getParameter("email"),g=r.getParameter("code");if(!p||!g)throw new Error("Link is broken");a.value=await o.confirmAccount(p,g)}catch(p){p instanceof _r?c.value="Could not find a user to confirm":c.value=p.message}i.value=!1});async function h(){var p,g;if(c.value=null,!!((p=a.value)!=null&&p.resetPasswordToken))try{const _=r.getParameter("email");await o.resetPassword(_,l.value,(g=a.value)==null?void 0:g.resetPasswordToken);const S=await o.signIn(_,l.value);Yt(1500).then(()=>n("confirmedAccount",S))}catch(_){throw c.value=_.message,_}}return(p,g)=>(b(),Z(ur,{handler:h,disabled:f.value,class:"moonbase:confirm-account"},{default:k(()=>[i.value?(b(),x("div",h5,[E(nn)])):a.value?(b(),x(ye,{key:2},[j("h3",null," Hi "+V(a.value.name)+", ",1),g[2]||(g[2]=j("p",null," Please create a new password for your account: ",-1)),E(At,{"model-value":v(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),E(At,{modelValue:l.value,"onUpdate:modelValue":g[0]||(g[0]=_=>l.value=_),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:g[1]||(g[1]=_=>u.value=!0)},null,8,["modelValue"]),u.value&&f.value?(b(),x("div",m5,[(b(!0),x(ye,null,ft(d.value.filter(_=>!_.test(l.value)),_=>(b(),Z(Me,{key:_.title,"data-error":""},{default:k(()=>[A(V(_.title),1)]),_:2},1024))),128))])):se("",!0),E(cr,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!c.value||void 0},V(c.value),9,b5)],64)):(b(),x("div",p5,V(c.value),1))]),_:1},8,["disabled"]))}}),v5={class:"moonbase:confirm-email-change"},y5={key:0,class:"moonbase:loader"},_5={key:1,class:"moonbase:error","data-visible":""},w5=pe({__name:"ConfirmEmail",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=De(),{user:o,confirmEmail:s}=nt(),i=L(!0),a=L(null);return ze(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Yt(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>(b(),x("div",v5,[i.value?(b(),x("div",y5,[E(nn)])):a.value?(b(),x("div",_5,V(a.value),1)):(b(),x(ye,{key:2},[E(rt,null,{default:k(()=>u[0]||(u[0]=[A(" Success! ")])),_:1,__:[0]}),u[1]||(u[1]=j("p",null," Thanks for confirming your new email. ",-1)),v(o)?(b(),Z(Qe,{key:0,handler:()=>v(r).show(v(ue).Customer,v(J).ViewAccount,void 0,!0),label:"Continue"},null,8,["handler"])):se("",!0)],64))]))}}),E5={class:"moonbase:confirm-email-change"},k5={key:0,class:"moonbase:loader"},x5={key:1,class:"moonbase:error","data-visible":""},O5=pe({__name:"ConfirmEmailChange",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=De(),{user:o,confirmEmailChange:s}=nt(),i=L(!0),a=L(null);return ze(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Yt(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>{var c;return b(),x("div",E5,[i.value?(b(),x("div",k5,[E(nn)])):a.value?(b(),x("div",x5,V(a.value),1)):(b(),x(ye,{key:2},[j("h3",null," Hi "+V((c=v(o))==null?void 0:c.name)+", ",1),u[0]||(u[0]=j("p",null," Thanks for confirming your new email. You can now sign in using this new address. ",-1))],64))])}}}),S5=["data-visible"],C5=pe({__name:"ForgotPassword",setup(e){const t=De(),n=nt(),r=L(t.getParameter("email")??""),o=L(null),s=L(!1);async function i(){o.value=null;try{await n.forgotPassword(r.value),Yt(1500).then(()=>{s.value=!0})}catch(a){throw a instanceof _r?o.value="User not found":o.value=a.message,a}}return(a,l)=>(b(),Z(ur,{handler:i,class:"moonbase:sign-in","no-reset":""},{default:k(({disabled:u})=>[l[1]||(l[1]=j("p",null," Please enter your email address below. You will receive an email message with instructions on how to reset your password. ",-1)),E(At,{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"]),E(cr,{success:"Email sent",label:"Reset password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},V(o.value),9,S5)]),_:1,__:[1]}))}}),N5={key:0,class:"moonbase:password-validation"},P5=["data-visible"],T5=pe({__name:"ResetPassword",emits:["passwordReset"],setup(e,{emit:t}){const n=t,r=De(),o=nt(),s=me(ut),i=te(()=>r.getParameter("email")),a=L(""),l=L(!1),u=L(null),c=te(()=>uc[(s==null?void 0:s.value.auth.passwords)??"default"]),d=te(()=>c.value.some(h=>!h.test(a.value)));ze(()=>{(!r.getParameter("email")||!r.getParameter("code"))&&(u.value="Link broken, please try again")});async function f(){u.value=null;const h=r.getParameter("code");if(h)try{await o.resetPassword(i.value,a.value,h);const p=await o.signIn(i.value,a.value);Yt(1500).then(()=>n("passwordReset",p))}catch(p){throw u.value=p.message,p}}return(h,p)=>(b(),Z(ur,{handler:f,disabled:d.value,class:"moonbase:reset-password"},{default:k(()=>[j("h3",null," Hi "+V(i.value)+", ",1),p[2]||(p[2]=j("p",null," Please create a new password for your account: ",-1)),E(At,{"model-value":v(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),E(At,{modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=g=>a.value=g),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:p[1]||(p[1]=g=>l.value=!0)},null,8,["modelValue"]),l.value&&d.value?(b(),x("div",N5,[(b(!0),x(ye,null,ft(c.value.filter(g=>!g.test(a.value)),g=>(b(),Z(Me,{key:g.title,"data-error":""},{default:k(()=>[A(V(g.title),1)]),_:2},1024))),128))])):se("",!0),E(cr,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},V(u.value),9,P5)]),_:1,__:[2]},8,["disabled"]))}}),$5={class:"moonbase:checkbox"},A5={class:"moonbase:checkbox-container"},D5=["id","name","checked","disabled","aria-invalid","aria-describedby"],I5={class:"moonbase:checkbox-description"},M5=["for"],V5=["id"],R5=["id"],pm=pe({inheritAttrs:!1,__name:"MoonCheckbox",props:{name:{},label:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,n)=>(b(),x("div",$5,[j("div",A5,[j("input",cu({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,D5)]),j("div",I5,[j("label",{for:`mb-${t.name}`},V(t.label),9,M5),t.error?(b(),x("p",{key:0,id:`mb-${t.name}-error`,"data-type":"error"},V(t.error),9,V5)):t.hint?(b(),x("p",{key:1,id:`mb-${t.name}-hint`},V(t.hint),9,R5)):se("",!0)])]))}}),L5={key:0,class:"moonbase:password-validation"},j5=["href"],U5=["href"],B5=["data-visible"],F5=pe({__name:"SignUp",emits:["signedUp"],setup(e,{emit:t}){const n=t,r=De(),o=nt(),s=me(dc),i=me(jr),a=me(ut),l=L(""),u=L(r.getParameter("email")??""),c=L(""),d=L(!1),f=L(!1),h=L(null),p=te(()=>uc[(a==null?void 0:a.value.auth.passwords)??"default"]),g=te(()=>p.value.some(S=>!S.test(c.value)));async function _(){h.value=null;try{const S=await o.signUp(l.value,u.value,c.value,null,!0,!0,f.value);i==null||i(zt.SignedUp,{user:S}),Yt(1500).then(()=>n("signedUp",S))}catch(S){throw h.value=S.message,S}}return(S,R)=>(b(),Z(ur,{handler:_,disabled:g.value,class:"moonbase:sign-up"},{default:k(()=>[E(At,{modelValue:l.value,"onUpdate:modelValue":R[0]||(R[0]=H=>l.value=H),label:"Full name",name:"name",type:"text",placeholder:"Full name",autocomplete:"name",required:""},null,8,["modelValue"]),E(At,{modelValue:u.value,"onUpdate:modelValue":R[1]||(R[1]=H=>u.value=H),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),E(At,{modelValue:c.value,"onUpdate:modelValue":R[2]||(R[2]=H=>c.value=H),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:"",onBlur:R[3]||(R[3]=H=>d.value=!0)},null,8,["modelValue"]),d.value&&g.value?(b(),x("div",L5,[(b(!0),x(ye,null,ft(p.value.filter(H=>!H.test(c.value)),H=>(b(),Z(Me,{key:H.title,"data-error":""},{default:k(()=>[A(V(H.title),1)]),_:2},1024))),128))])):se("",!0),E(pm,{modelValue:f.value,"onUpdate:modelValue":R[4]||(R[4]=H=>f.value=H),label:"Receive updates and offers by email",name:"newsletter-opt-in"},null,8,["modelValue"]),E(Me,null,{default:k(()=>[R[5]||(R[5]=A(" By signing up, you accept our ")),j("a",{href:`${v(s)}/terms-of-use`,target:"_blank",rel:"noopener"},"terms",8,j5),R[6]||(R[6]=A(" and ")),j("a",{href:`${v(s)}/privacy-policy`,target:"_blank",rel:"noopener"},"privacy policy",8,U5),R[7]||(R[7]=A(". "))]),_:1,__:[5,6,7]}),E(cr,{success:"Signed up",label:"Sign up",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!h.value||void 0},V(h.value),9,B5),E(Qe,{label:"I already have an account",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).SignIn,{email:u.value})},null,8,["handler"])]),_:1},8,["disabled"]))}}),z5={class:"moonbase:authentication"},H5={key:0,class:"moonbase:loader"},q5=pe({__name:"Authentication",setup(e){const t=De(),{loaded:n}=nt();return(r,o)=>(b(),x("div",z5,[E(si,{name:v(t).direction===v(Su).Forward?"moonbase:slide-left":"moonbase:slide-right",mode:"out-in"},{default:k(()=>[v(n)?v(t).intent===v(J).SignIn?(b(),Z(f5,{key:1,onSignedIn:o[0]||(o[0]=s=>v(t).dequeue())})):v(t).intent===v(J).SignUp?(b(),Z(F5,{key:2,onSignedUp:o[1]||(o[1]=s=>v(t).next?v(t).dequeue():v(t).show(v(ue).Customer,v(J).ViewAccount,void 0,!0))})):v(t).intent===v(J).ConfirmAccount?(b(),Z(g5,{key:3,onConfirmedAccount:o[2]||(o[2]=s=>v(t).show(v(ue).Customer,v(J).ViewProducts,void 0,!0))})):v(t).intent===v(J).ConfirmEmail?(b(),Z(w5,{key:4})):v(t).intent===v(J).ConfirmEmailChange?(b(),Z(O5,{key:5})):v(t).intent===v(J).ForgotPassword?(b(),Z(C5,{key:6})):v(t).intent===v(J).ResetPassword?(b(),Z(T5,{key:7,onPasswordReset:o[3]||(o[3]=s=>v(t).show(v(ue).Customer,v(J).ViewAccount,void 0))})):se("",!0):(b(),x("div",H5,[E(nn)]))]),_:1},8,["name"])]))}}),W5={},Z5={class:"moonbase:text-subtext-bold"};function Y5(e,t){return b(),x("span",Z5,[Nt(e.$slots,"default")])}const it=or(W5,[["render",Y5]]);function Xa(){const e=me(Ut);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 G5=["data-corners","data-cards"],mm=pe({__name:"Counter",props:{modelValue:{}},emits:["update:modelValue"],setup(e){const t=me(ut);return(n,r)=>{var o,s;return b(),x("div",{class:"moonbase:counter","data-corners":(o=v(t))==null?void 0:o.theme.corners,"data-cards":(s=v(t))==null?void 0:s.theme.cards},[j("button",{onClick:r[0]||(r[0]=i=>n.$emit("update:modelValue",n.modelValue-1))},[E(v(P_))]),E(Me,null,{default:k(()=>[A(V(n.modelValue.toString().padStart(2,"0")),1)]),_:1}),j("button",{onClick:r[1]||(r[1]=i=>n.$emit("update:modelValue",n.modelValue+1))},[E(v(T_))])],8,G5)}}});function wi(e){switch(e){case vr.Daily:return"day";case vr.Weekly:return"week";case vr.Monthly:return"month";case vr.Quarterly:return"quarter";case vr.Yearly:return"year"}throw new Error("Unknown cycle length")}const K5={class:"moonbase:bundle-cart-item-content"},X5={key:0,class:"moonbase:bundle-cart-item-total"},J5={key:0,class:"moonbase:discount"},Q5={class:"moonbase:bundle-cart-item-summary"},ek=["data-open"],tk=["data-open"],nk={class:"moonbase:bundle-cart-item-product-list-item-content"},rk={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},ok=pe({__name:"BundleCartItem",props:{lineItem:{},currency:{}},setup(e){const n=Na(e.lineItem.bundleId),r=me(ut),o=nr(),s=L(!1),i=L(null);return Xe(s,a=>{i.value&&(i.value.style.height=a?`${i.value.scrollHeight}px`:"0px")}),(a,l)=>{var u;return b(),Z(cn,{class:"moonbase:bundle-cart-item"},ba({default:k(()=>{var c,d,f,h,p,g;return[E(Ht,{url:(c=a.lineItem.bundle)==null?void 0:c.iconUrl,size:72},null,8,["url"]),j("div",K5,[E(it,null,{default:k(()=>{var _;return[A(V((_=a.lineItem.bundle)==null?void 0:_.name),1)]}),_:1}),E(Me,{class:"moonbase:bundle-cart-item-tagline","data-truncate":a.lineItem.variation&&a.lineItem.variation.id!==((f=(d=v(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)||void 0},{default:k(()=>{var _;return[A(V((_=a.lineItem.bundle)==null?void 0:_.tagline),1)]}),_:1},8,["data-truncate"]),a.lineItem.variation&&a.lineItem.variation.id!==((p=(h=v(n))==null?void 0:h.defaultVariation)==null?void 0:p.id)?(b(),Z(Me,{key:0,class:"moonbase:bundle-cart-item-variation"},{default:k(()=>[A(V(a.lineItem.variation.name),1)]),_:1})):se("",!0)]),a.lineItem.variation?(b(),x("div",X5,[E(Go,null,{default:k(()=>{var _;return[a.lineItem.variation.hasDiscount?(b(),x("span",J5,V(v(Bt)(a.lineItem.variation.originalPrice[a.currency]*a.lineItem.quantity,a.currency)),1)):se("",!0),A(" "+V(v(Bt)(a.lineItem.variation.price[a.currency]*a.lineItem.quantity,a.currency))+" ",1),((_=a.lineItem.variation)==null?void 0:_.recurrence.type)==="Recurring"?(b(),Z(ot,{key:1},{default:k(()=>[A(" / "+V(v(wi)(a.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):se("",!0)]}),_:1}),((g=v(r))==null?void 0:g.cart.quantity)==="selectable"?(b(),Z(mm,{key:0,"model-value":a.lineItem.quantity,"onUpdate:modelValue":l[0]||(l[0]=_=>v(o).setQuantity(a.lineItem,_))},null,8,["model-value"])):(b(),Z(Qe,{key:1,label:"Remove",variant:"subtle-danger",size:"small",handler:()=>v(o).setQuantity(a.lineItem,0)},null,8,["handler"]))])):se("",!0)]}),_:2},[(u=v(r))!=null&&u.cart.bundles.showProducts?{name:"addon",fn:k(()=>{var c;return[j("div",Q5,[a.lineItem.bundle?(b(),x("button",{key:0,onClick:l[1]||(l[1]=d=>s.value=!s.value)},[E(it,null,{default:k(()=>{var d,f,h;return[A(V((d=a.lineItem.bundle)==null?void 0:d.products.filter(p=>p.included).length)+" ",1),(f=a.lineItem.bundle)!=null&&f.products.some(p=>!p.included)?(b(),x(ye,{key:0},[A(" of "+V((h=a.lineItem.bundle)==null?void 0:h.products.length),1)],64)):se("",!0),l[2]||(l[2]=A(" products "))]}),_:1,__:[2]}),E(Me,null,{default:k(()=>[A(V(s.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":s.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},l[3]||(l[3]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,ek))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:i,class:"moonbase:bundle-cart-item-product-list",style:{height:"0px"},"data-open":s.value||void 0},[(b(!0),x(ye,null,ft(((c=a.lineItem.bundle)==null?void 0:c.products)||[],d=>(b(),x("div",{key:d.id,class:"moonbase:bundle-cart-item-product-list-item"},[E(Ht,{url:d==null?void 0:d.iconUrl,size:48},null,8,["url"]),j("div",nk,[E(it,{"data-included":d.included||void 0},{default:k(()=>[d.included?(b(),x("svg",rk,l[4]||(l[4]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):se("",!0),A(" "+V(d==null?void 0:d.name),1)]),_:2},1032,["data-included"]),d.included?d!=null&&d.tagline?(b(),Z(Me,{key:1},{default:k(()=>[A(V(d.tagline),1)]),_:2},1024)):se("",!0):(b(),Z(Me,{key:0},{default:k(()=>l[5]||(l[5]=[A(" You already own this ")])),_:1,__:[5]}))])]))),128))],8,tk)]}),key:"0"}:void 0]),1024)}}}),sk={class:"moonbase:cart-offer-content"},ik=["href"],ak={class:"moonbase:cart-offer-cta"},lk={key:0,class:"moonbase:discount"},uk={class:"moonbase:cart-offer-bundle-summary"},ck=["data-open"],dk=["data-open"],fk={class:"moonbase:cart-offer-bundle-product-list-item-content"},hk={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},pk=["href"],mk=pe({__name:"OfferUpsell",props:{offer:{}},setup(e){const t=e,n=me(ut),{addToCart:r,currency:o}=nr(),s=L(!1),i=L(null);Xe(s,c=>{i.value&&(i.value.style.height=c?`${i.value.scrollHeight}px`:"0px")});const a=te(()=>{var c;return(c=t.offer.target.defaultVariation)==null?void 0:c.originalPrice}),l=te(()=>t.offer.target.defaultVariation?od.subtract(t.offer.target.defaultVariation.price,El.apply(t.offer.discount,t.offer.target.defaultVariation.price)):a.value),u=te(()=>!Kh(a.value,l.value));return(c,d)=>(b(),Z(cn,{class:"moonbase:cart-offer"},ba({default:k(()=>[E(Ht,{url:c.offer.target.iconUrl,href:c.offer.target.type==="Product"?c.offer.target.website:void 0,size:64},null,8,["url","href"]),j("div",sk,[E(it,{class:"moonbase:cart-offer-name"},{default:k(()=>[c.offer.target.type==="Product"&&c.offer.target.website?(b(),x("a",{key:0,href:c.offer.target.website},V(c.offer.discount.name),9,ik)):(b(),x(ye,{key:1},[A(V(c.offer.discount.name),1)],64))]),_:1}),c.offer.discount.description?(b(),Z(Me,{key:0,class:"moonbase:cart-offer-description"},{default:k(()=>[A(V(c.offer.discount.description),1)]),_:1})):se("",!0)]),j("div",ak,[l.value?(b(),Z(Go,{key:0},{default:k(()=>[u.value&&a.value?(b(),x("span",lk,V(v(Bt)(a.value[v(o)],v(o))),1)):se("",!0),A(" "+V(v(Bt)(l.value[v(o)],v(o))),1)]),_:1})):se("",!0),E(Qe,{label:"Add to cart",variant:"secondary",size:"small",handler:()=>{var f;return v(r)(c.offer.target,void 0,c.offer,{bundleBehaviour:(f=v(n))==null?void 0:f.cart.bundles.onAdd})}},null,8,["handler"])])]),_:2},[c.offer.target.type==="Bundle"?{name:"addon",fn:k(()=>{var f;return[j("div",uk,[c.offer.target?(b(),x("button",{key:0,onClick:d[0]||(d[0]=h=>s.value=!s.value)},[E(it,null,{default:k(()=>{var h,p,g;return[A(" Contains "+V((h=c.offer.target)==null?void 0:h.products.filter(_=>_.included).length)+" ",1),(p=c.offer.target)!=null&&p.products.some(_=>!_.included)?(b(),x(ye,{key:0},[A(" of "+V((g=c.offer.target)==null?void 0:g.products.length),1)],64)):se("",!0),d[1]||(d[1]=A(" products "))]}),_:1,__:[1]}),E(Me,null,{default:k(()=>[A(V(s.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":s.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},d[2]||(d[2]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,ck))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:i,class:"moonbase:cart-offer-bundle-product-list",style:{height:"0px"},"data-open":s.value||void 0},[(b(!0),x(ye,null,ft(((f=c.offer.target)==null?void 0:f.products)||[],h=>(b(),x("div",{key:h.id,class:"moonbase:cart-offer-bundle-product-list-item"},[E(Ht,{url:h.iconUrl,href:h.website,size:48},null,8,["url","href"]),j("div",fk,[E(it,{"data-included":h.included||void 0},{default:k(()=>[h.included?(b(),x("svg",hk,d[3]||(d[3]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):se("",!0),h.website?(b(),x("a",{key:1,href:h.website},V(h.name),9,pk)):(b(),x(ye,{key:2},[A(V(h.name),1)],64))]),_:2},1032,["data-included"]),h.included?h.tagline?(b(),Z(Me,{key:1},{default:k(()=>[A(V(h.tagline),1)]),_:2},1024)):se("",!0):(b(),Z(Me,{key:0},{default:k(()=>d[4]||(d[4]=[A(" You already own this ")])),_:1,__:[4]}))])]))),128))],8,dk)]}),key:"0"}:void 0]),1024))}}),bk={class:"moonbase:product-cart-item-content"},gk={class:"moonbase:product-cart-item-total"},vk={key:0,class:"moonbase:discount"},yk=pe({__name:"ProductCartItem",props:{lineItem:{},currency:{}},setup(e){const t=e,n=li(t.lineItem.productId),r=me(ut);function o(l){var c;if(!l.variation)throw new Error("No variation found");const u=i(l);return(u==null?void 0:u.price[t.currency])??((c=l.variation)==null?void 0:c.price[t.currency])}function s(l){return!!i(l)}function i(l){var c,d;const u=((d=(c=l.variation)==null?void 0:c.pricingTiers)==null?void 0:d.filter(f=>l.quantity>=f.minQuantity))??[];return u.length>0?u[u.length-1]:null}const a=nr();return(l,u)=>(b(),Z(cn,{class:"moonbase:product-cart-item"},{default:k(()=>{var c,d,f,h,p,g;return[E(Ht,{url:(c=l.lineItem.product)==null?void 0:c.iconUrl,size:72},null,8,["url"]),j("div",bk,[E(it,null,{default:k(()=>{var _;return[A(V((_=l.lineItem.product)==null?void 0:_.name),1)]}),_:1}),E(Me,{class:"moonbase:product-cart-item-tagline","data-truncate":l.lineItem.variation&&l.lineItem.variation.id!==((f=(d=v(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)||void 0},{default:k(()=>{var _;return[A(V((_=l.lineItem.product)==null?void 0:_.tagline),1)]}),_:1},8,["data-truncate"]),l.lineItem.variation&&l.lineItem.variation.id!==((p=(h=v(n))==null?void 0:h.defaultVariation)==null?void 0:p.id)?(b(),Z(Me,{key:0,class:"moonbase:product-cart-item-variation"},{default:k(()=>[A(V(l.lineItem.variation.name),1)]),_:1})):se("",!0)]),j("div",gk,[l.lineItem.variation?(b(),Z(Go,{key:0},{default:k(()=>{var _;return[l.lineItem.variation.hasDiscount||s(l.lineItem)?(b(),x("span",vk,V(v(Bt)(l.lineItem.variation.originalPrice[l.currency]*l.lineItem.quantity,l.currency)),1)):se("",!0),A(" "+V(v(Bt)(o(l.lineItem)*l.lineItem.quantity,l.currency))+" ",1),((_=l.lineItem.variation)==null?void 0:_.recurrence.type)==="Recurring"?(b(),Z(ot,{key:1},{default:k(()=>[A(" / "+V(v(wi)(l.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):se("",!0)]}),_:1})):se("",!0),((g=v(r))==null?void 0:g.cart.quantity)==="selectable"?(b(),Z(mm,{key:1,"model-value":l.lineItem.quantity,"onUpdate:modelValue":u[0]||(u[0]=_=>v(a).setQuantity(l.lineItem,_))},null,8,["model-value"])):(b(),Z(Qe,{key:2,label:"Remove",variant:"subtle-danger",size:"small",handler:()=>v(a).setQuantity(l.lineItem,0)},null,8,["handler"]))])]}),_:1}))}}),_k={class:"moonbase:cart"},wk=["data-background"],Ek=["data-corners"],kk={class:"moonbase:cart-total"},xk={"data-error":""},Ok=pe({__name:"Cart",setup(e){const t=Xa(),{items:n,total:r,currency:o,checkout:s}=nr(),i=me(ut),a=By(),l=te(()=>a.value.length===0?null:a.value.find(d=>!d.target.owned)||a.value[0]),u=L(null);async function c(){u.value=null;try{const d=await s({redirect:(i==null?void 0:i.value.checkout.redirect)??!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(!(d!=null&&d.completed))throw new ss}catch(d){if(u.value=d.message,!(d instanceof ss))if(d instanceof bn)t.reportProblem("error",{type:d.name,title:d.title,detail:d.detail,status:d.status,errors:d.errors?Object.fromEntries(Object.entries(d.errors).map(([f,h])=>[f,[h]])):void 0,instance:"Cart.vue:startCheckout"});else{const f=d;t.reportProblem("error",{type:f.name,title:f.message,instance:"Cart.vue:startCheckout"})}throw d}}return(d,f)=>{var h,p;return b(),x("div",_k,[v(n).length>0?(b(),x("ul",{key:0,role:"list",class:"moonbase:cart-items","data-background":(h=v(i))==null?void 0:h.theme.colors.background},[(b(!0),x(ye,null,ft(v(n),g=>(b(),x("li",{key:g.id},[g.type==="Product"?(b(),Z(yk,{key:0,"line-item":g,currency:v(o)},null,8,["line-item","currency"])):g.type==="Bundle"?(b(),Z(ok,{key:1,"line-item":g,currency:v(o)},null,8,["line-item","currency"])):se("",!0)]))),128)),l.value?(b(),x(ye,{key:0},[f[0]||(f[0]=j("li",{class:"moonbase:grow"},null,-1)),j("li",null,[E(it,null,{default:k(()=>{var g;return[A(V((g=v(i))==null?void 0:g.cart.offers.label),1)]}),_:1}),E(mk,{offer:l.value},null,8,["offer"])])],64)):se("",!0)],8,wk)):(b(),x("div",{key:1,class:"moonbase:cart-empty","data-corners":(p=v(i))==null?void 0:p.theme.corners},[E(v($_)),E(it,null,{default:k(()=>f[1]||(f[1]=[A(" Your cart is empty ")])),_:1,__:[1]})],8,Ek)),j("div",kk,[f[2]||(f[2]=j("label",null," Total ",-1)),j("span",null,V(v(Bt)(v(r).amount,v(r).currency)),1),f[3]||(f[3]=j("p",null," Sales tax to be calculated at checkout ",-1)),j("p",xk,V(u.value),1)]),E(Qe,{handler:c,disabled:v(n).length===0,label:"Checkout",error:u.value?"Error":"Cancelled",variant:"primary"},null,8,["disabled","error"])])}}}),Sk={class:"moonbase:account"},Ck={key:0,class:"moonbase:error"},Nk={key:1,class:"moonbase:notification"},Pk={key:0,class:"moonbase:error"},Tk=pe({__name:"Account",setup(e){var R,H,z;const t=De(),{user:n,update:r,setPassword:o,signOut:s}=nt(),i=me(jr),a=L(((R=n.value)==null?void 0:R.name)??""),l=L(((H=n.value)==null?void 0:H.email)??""),u=L(((z=n.value)==null?void 0:z.communicationPreferences)??{newsletterOptIn:!1}),c=L(null),d=L(!1),f=L(""),h=L(""),p=L(null);async function g(){c.value=null,d.value=!1;try{(await r(a.value,l.value,void 0,u.value)).needsEmailConfirmationToken&&(d.value=!0)}catch(B){throw c.value=B,B}}async function _(){p.value=null;try{await o(f.value,h.value),f.value="",h.value=""}catch(B){throw p.value=B,B}}async function S(){const B={...n.value};await s(),i==null||i(zt.SignedOut,{user:B}),t.reset()}return(B,I)=>(b(),x("div",Sk,[E(ur,{handler:g},{default:k(()=>[E(At,{modelValue:a.value,"onUpdate:modelValue":I[0]||(I[0]=y=>a.value=y),label:"Full name",name:"name",autocomplete:"name",required:""},null,8,["modelValue"]),E(At,{modelValue:l.value,"onUpdate:modelValue":I[1]||(I[1]=y=>l.value=y),label:"Email address",name:"email",type:"email",autocomplete:"email",required:""},null,8,["modelValue"]),E(pm,{modelValue:u.value.newsletterOptIn,"onUpdate:modelValue":I[2]||(I[2]=y=>u.value.newsletterOptIn=y),label:"Newsletter subscription",name:"newsletter-opt-in",hint:"Receive updates and offers by email"},null,8,["modelValue"]),E(cr,{label:"Update",error:"Error",success:"Updated"}),c.value?(b(),x("p",Ck,V(c.value.message),1)):d.value?(b(),x("p",Nk," You need to confirm your new email address, please check your inbox ")):se("",!0)]),_:1}),E(ur,{handler:_},{default:k(()=>[E(At,{modelValue:f.value,"onUpdate:modelValue":I[3]||(I[3]=y=>f.value=y),label:"Current password",name:"old-password",type:"password",autocomplete:"current-password",required:""},null,8,["modelValue"]),E(At,{modelValue:h.value,"onUpdate:modelValue":I[4]||(I[4]=y=>h.value=y),label:"New password",name:"new-password",type:"password",autocomplete:"new-password",required:""},null,8,["modelValue"]),E(cr,{label:"Change password",error:"Error",success:"Password changed"}),p.value?(b(),x("p",Pk,V(p.value.message),1)):se("",!0)]),_:1}),E(Qe,{label:"Log out",success:"Logged out",error:"Error",variant:"subtle",handler:S})]))}}),bm=e=>e.includes("."),$k={class:"moonbase:products"},Ak={key:0,class:"moonbase:loader"},Dk={key:1,class:"moonbase:loader"},Ik=["data-is-sub-product"],Mk={key:0,class:"moonbase:products-item-sub-product-icon"},Vk={class:"moonbase:products-item-content"},Rk=pe({__name:"Products",setup(e){const t=De(),{getProducts:n}=lo(),r=L(null);return ze(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)=>(b(),x("div",$k,[r.value?r.value.length===0?(b(),x("div",Dk," No products found ")):se("",!0):(b(),x("div",Ak,[E(nn),s[0]||(s[0]=A(" Loading products.. "))])),(b(!0),x(ye,null,ft(r.value||[],i=>(b(),x("div",{key:i.id,class:"moonbase:products-item","data-is-sub-product":v(bm)(i.id)||void 0},[v(bm)(i.id)?(b(),x("div",Mk,s[1]||(s[1]=[j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.49 12 3.75 3.75m0 0-3.75 3.75m3.75-3.75H3.74V4.499"})],-1)]))):se("",!0),E(Ht,{url:i.iconUrl,size:48},null,8,["url"]),j("div",Vk,[E(it,null,{default:k(()=>[A(V(i.name),1)]),_:2},1024),i.numberOfLicenses||i.subscriptionLicenses?(b(),Z(Me,{key:0},{default:k(()=>[A(V((i.numberOfLicenses??0)+(i.subscriptionLicenses??0))+" licenses ",1)]),_:2},1024)):se("",!0)]),j("div",null,[E(Yo,{variant:"subtle",onClick:a=>v(t).show(v(ue).Product,v(J).ViewProduct,{product_id:i.id})},{default:k(()=>[E(v(wp)),s[2]||(s[2]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2,__:[2]},1032,["onClick"])])],8,Ik))),128))]))}}),Lk={class:"moonbase:bundle-redemption-item-content"},jk={class:"moonbase:bundle-redemption-item-summary"},Uk=["data-open"],Bk=["data-open"],gm=pe({__name:"BundleRedemptionItem",props:{bundle:{},quantity:{}},setup(e){const t=L(!1),n=L(null);return Xe(t,r=>{n.value&&(n.value.style.height=r?`${n.value.scrollHeight}px`:"0px")}),(r,o)=>(b(),Z(cn,{class:"moonbase:bundle-redemption-item"},{addon:k(()=>{var s;return[j("div",jk,[r.bundle?(b(),x("button",{key:0,onClick:o[0]||(o[0]=i=>t.value=!t.value)},[E(it,null,{default:k(()=>{var i;return[A(V((i=r.bundle)==null?void 0:i.products.length)+" products ",1)]}),_:1}),E(Me,null,{default:k(()=>[A(V(t.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":t.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},o[1]||(o[1]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,Uk))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:n,class:"moonbase:bundle-redemption-item-product-list",style:{height:"0px"},"data-open":t.value||void 0},[(b(!0),x(ye,null,ft(((s=r.bundle)==null?void 0:s.products)||[],i=>(b(),x("div",{key:i.id},[E(Ht,{url:i.iconUrl,size:48},null,8,["url"]),j("div",null,[E(it,null,{default:k(()=>[A(V(i.name),1)]),_:2},1024),i.tagline?(b(),Z(Me,{key:0},{default:k(()=>[A(V(i.tagline),1)]),_:2},1024)):se("",!0)])]))),128))],8,Bk)]}),default:k(()=>[E(Ht,{url:r.bundle.iconUrl,size:72},null,8,["url"]),j("div",Lk,[E(it,null,{default:k(()=>{var s;return[A(V((s=r.bundle)==null?void 0:s.name),1)]}),_:1}),E(Me,{class:"moonbase:bundle-redemption-item-tagline"},{default:k(()=>{var s;return[A(V((s=r.bundle)==null?void 0:s.tagline),1)]}),_:1})])]),_:1}))}}),Fk={class:"moonbase:product-redemption-item-content"},vm=pe({__name:"ProductRedemptionItem",props:{product:{},quantity:{}},setup(e){return(t,n)=>(b(),Z(cn,{class:"moonbase:product-redemption-item"},{default:k(()=>[E(Ht,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",Fk,[E(it,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.name),1)]}),_:1}),E(Me,{class:"moonbase:product-redemption-item-tagline"},{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.tagline),1)]}),_:1})])]),_:1}))}}),zk={class:"moonbase:redeem"},Hk=["data-visible"],qk={key:1,class:"moonbase:redeem-voucher"},Wk={key:0,class:"moonbase:redeem-voucher-content"},Zk={key:1,class:"moonbase:redeem-voucher-return"},Yk=pe({__name:"Redeem",setup(e){const{redeem:t}=Ph(),n=De(),r=nt(),o=me(jr),s=L(null),i=L(null),a=L(n.getParameter("code")||"");async function l(){i.value=null;try{const u=await t(a.value);s.value=u,o==null||o(zt.RedeemedVoucher,{voucher:u,user:r.user.value})}catch(u){throw i.value=u,u}}return(u,c)=>(b(),x("div",zk,[E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[s.value?(b(),x("div",qk,[j("div",null,[E(is,null,{default:k(()=>[A(V(s.value.name),1)]),_:1}),s.value.description?(b(),Z(rt,{key:0},{default:k(()=>[A(' "'+V(s.value.description)+'" ',1)]),_:1})):se("",!0),E(Me,null,{default:k(()=>[E(v(E_)),c[2]||(c[2]=A(" Licenses have been added to your account. "))]),_:1,__:[2]}),E(Me,null,{default:k(()=>[c[3]||(c[3]=A(" Code: ")),j("strong",null,V(s.value.code),1)]),_:1,__:[3]})]),E(rt,null,{default:k(()=>c[4]||(c[4]=[A(" Voucher summary ")])),_:1,__:[4]}),s.value.redeemsProducts.length>0||s.value.redeemsBundles.length>0?(b(),x("div",Wk,[(b(!0),x(ye,null,ft(s.value.redeemsProducts,({value:d,quantity:f})=>(b(),Z(vm,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(b(!0),x(ye,null,ft(s.value.redeemsBundles,({value:d,quantity:f})=>(b(),Z(gm,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):se("",!0),v(n).next&&v(n).next[0]===v(ue).Activation&&(s.value.redeemsProducts.some(d=>{var f,h;return d.value.id===((h=(f=v(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=v(n).next)==null?void 0:h[2])==null?void 0:p.product_id)})))?(b(),x("div",Zk,[E(Qe,{label:"Return to activation",variant:"primary",icon:v(w_),handler:()=>v(n).dequeue()},null,8,["icon","handler"])])):se("",!0)])):(b(),Z(ur,{key:0,handler:l},{default:k(()=>{var d;return[E(ot,null,{default:k(()=>c[1]||(c[1]=[A(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),A(" Please enter the code below: ")])),_:1,__:[1]}),E(At,{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"]),E(cr,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!i.value||void 0},V((d=i.value)==null?void 0:d.message),9,Hk)]}),_:1}))]),_:1})]))}}),Gk=["data-status"],Kk=["data-fulfilled"],ym=pe({__name:"MilestoneProgressBar",props:{progress:{}},setup(e){return(t,n)=>(b(),x("div",{class:"moonbase:milestone-progress-bar",style:Ds({gridTemplateColumns:`repeat(${t.progress.toNormalizedCycleNumber-t.progress.fromNormalizedCycleNumber+1}, 1fr)`})},[(b(!0),x(ye,null,ft(Array(t.progress.toNormalizedCycleNumber-t.progress.fromNormalizedCycleNumber+1),(r,o)=>(b(),x("div",{key:o},[j("div",{"data-status":o+1<t.progress.currentNormalizedCycleNumber+(t.progress.currentCycleIsCompleted?1:0)?"done":o+1===t.progress.currentNormalizedCycleNumber+(t.progress.currentCycleIsCompleted?1:0)?"in-progress":"future"},null,8,Gk),t.progress.events[o+1]?(b(),x("span",{key:0,"data-fulfilled":t.progress.events[o+1].some(s=>s.fulfilled)||void 0},null,8,Kk)):se("",!0)]))),128))],4))}}),_m=6048e5,Xk=864e5,Ja=43200,wm=1440,Em=Symbol.for("constructDateFrom");function dr(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Em in e?e[Em](t):e instanceof Date?new e.constructor(t):new Date(t)}function wt(e,t){return dr(t||e,e)}let Jk={};function Ei(){return Jk}function ki(e,t){var a,l,u,c;const n=Ei(),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=wt(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 Qa(e,t){return ki(e,{...t,weekStartsOn:1})}function km(e,t){const n=wt(e,t==null?void 0:t.in),r=n.getFullYear(),o=dr(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Qa(o),i=dr(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Qa(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function el(e){const t=wt(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 tl(e,...t){const n=dr.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function xm(e,t){const n=wt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Qk(e,t,n){const[r,o]=tl(n==null?void 0:n.in,e,t),s=xm(r),i=xm(o),a=+s-el(s),l=+i-el(i);return Math.round((a-l)/Xk)}function ex(e,t){const n=km(e,t),r=dr(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Qa(r)}function nl(e,t){const n=+wt(e)-+wt(t);return n<0?-1:n>0?1:n}function tx(e){return dr(e,Date.now())}function nx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function rx(e){return!(!nx(e)&&typeof e!="number"||isNaN(+wt(e)))}function ox(e,t,n){const[r,o]=tl(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function sx(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function ix(e,t){return+wt(e)-+wt(t)}function ax(e,t){const n=wt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function lx(e,t){const n=wt(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 ux(e,t){const n=wt(e,t==null?void 0:t.in);return+ax(n,t)==+lx(n,t)}function cx(e,t,n){const[r,o,s]=tl(n==null?void 0:n.in,e,e,t),i=nl(o,s),a=Math.abs(ox(o,s));if(a<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-i*a);let l=nl(o,s)===-i;ux(r)&&a===1&&nl(r,s)===1&&(l=!1);const u=i*(a-+l);return u===0?0:u}function dx(e,t,n){const r=ix(e,t)/1e3;return sx(n==null?void 0:n.roundingMethod)(r)}function fx(e,t){const n=wt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const hx={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"}},px=(e,t,n)=>{let r;const o=hx[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 cc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const mx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vx={date:cc({formats:mx,defaultWidth:"full"}),time:cc({formats:bx,defaultWidth:"full"}),dateTime:cc({formats:gx,defaultWidth:"full"})},yx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_x=(e,t,n,r)=>yx[e];function xi(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 wx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ex={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},kx={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"]},xx={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"]},Ox={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"}},Sx={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"}},Cx={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:xi({values:wx,defaultWidth:"wide"}),quarter:xi({values:Ex,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xi({values:kx,defaultWidth:"wide"}),day:xi({values:xx,defaultWidth:"wide"}),dayPeriod:xi({values:Ox,defaultWidth:"wide",formattingValues:Sx,defaultFormattingWidth:"wide"})};function Oi(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)?Px(a,d=>d.test(i)):Nx(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 Nx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Px(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Tx(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 $x=/^(\d+)(th|st|nd|rd)?/i,Ax=/\d+/i,Dx={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},Ix={any:[/^b/i,/^(a|c)/i]},Mx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vx={any:[/1/i,/2/i,/3/i,/4/i]},Rx={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},Lx={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]},jx={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},Ux={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]},Bx={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},Fx={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}},zx={ordinalNumber:Tx({matchPattern:$x,parsePattern:Ax,valueCallback:e=>parseInt(e,10)}),era:Oi({matchPatterns:Dx,defaultMatchWidth:"wide",parsePatterns:Ix,defaultParseWidth:"any"}),quarter:Oi({matchPatterns:Mx,defaultMatchWidth:"wide",parsePatterns:Vx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Oi({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Lx,defaultParseWidth:"any"}),day:Oi({matchPatterns:jx,defaultMatchWidth:"wide",parsePatterns:Ux,defaultParseWidth:"any"}),dayPeriod:Oi({matchPatterns:Bx,defaultMatchWidth:"any",parsePatterns:Fx,defaultParseWidth:"any"})},Om={code:"en-US",formatDistance:px,formatLong:vx,formatRelative:_x,localize:Cx,match:zx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Hx(e,t){const n=wt(e,t==null?void 0:t.in);return Qk(n,fx(n))+1}function qx(e,t){const n=wt(e,t==null?void 0:t.in),r=+Qa(n)-+ex(n);return Math.round(r/_m)+1}function Sm(e,t){var c,d,f,h;const n=wt(e,t==null?void 0:t.in),r=n.getFullYear(),o=Ei(),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=dr((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=ki(i,t),l=dr((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=ki(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function Wx(e,t){var a,l,u,c;const n=Ei(),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=Sm(e,t),s=dr((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),ki(s,t)}function Zx(e,t){const n=wt(e,t==null?void 0:t.in),r=+ki(n,t)-+Wx(n,t);return Math.round(r/_m)+1}function Ye(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Rr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ye(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ye(n+1,2)},d(e,t){return Ye(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 Ye(e.getHours()%12||12,t.length)},H(e,t){return Ye(e.getHours(),t.length)},m(e,t){return Ye(e.getMinutes(),t.length)},s(e,t){return Ye(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Ye(o,t.length)}},as={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cm={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 Rr.y(e,t)},Y:function(e,t,n,r){const o=Sm(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return Ye(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ye(s,t.length)},R:function(e,t){const n=km(e);return Ye(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ye(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 Ye(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 Ye(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 Rr.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 Ye(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=Zx(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Ye(o,t.length)},I:function(e,t,n){const r=qx(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ye(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Rr.d(e,t)},D:function(e,t,n){const r=Hx(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ye(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 Ye(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 Ye(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 Ye(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=as.noon:r===0?o=as.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=as.evening:r>=12?o=as.afternoon:r>=4?o=as.morning:o=as.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 Rr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Rr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ye(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ye(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Rr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Rr.s(e,t)},S:function(e,t){return Rr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Pm(r);case"XXXX":case"XX":return yo(r);case"XXXXX":case"XXX":default:return yo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Pm(r);case"xxxx":case"xx":return yo(r);case"xxxxx":case"xxx":default:return yo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nm(r,":");case"OOOO":default:return"GMT"+yo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nm(r,":");case"zzzz":default:return"GMT"+yo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ye(r,t.length)},T:function(e,t,n){return Ye(+e,t.length)}};function Nm(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+Ye(s,2)}function Pm(e,t){return e%60===0?(e>0?"-":"+")+Ye(Math.abs(e)/60,2):yo(e,t)}function yo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ye(Math.trunc(r/60),2),s=Ye(r%60,2);return n+o+t+s}const Tm=(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"})}},$m=(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"})}},Yx={p:$m,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Tm(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}}",Tm(r,t)).replace("{{time}}",$m(o,t))}},Gx=/^D+$/,Kx=/^Y+$/,Xx=["D","DD","YY","YYYY"];function Jx(e){return Gx.test(e)}function Qx(e){return Kx.test(e)}function eO(e,t,n){const r=tO(e,t,n);if(console.warn(r),Xx.includes(e))throw new RangeError(r)}function tO(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 nO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,oO=/^'([^]*?)'?$/,sO=/''/g,iO=/[a-zA-Z]/;function aO(e,t,n){var c,d,f,h;const r=Ei(),o=r.locale??Om,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=wt(e,n==null?void 0:n.in);if(!rx(a))throw new RangeError("Invalid time value");let l=t.match(rO).map(p=>{const g=p[0];if(g==="p"||g==="P"){const _=Yx[g];return _(p,o.formatLong)}return p}).join("").match(nO).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:lO(p)};if(Cm[g])return{isToken:!0,value:p};if(g.match(iO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");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 g=p.value;(Qx(g)||Jx(g))&&eO(g,t,String(e));const _=Cm[g[0]];return _(a,g,o.localize,u)}).join("")}function lO(e){const t=e.match(oO);return t?t[1].replace(sO,"'"):e}function uO(e,t,n){const r=Ei(),o=(n==null?void 0:n.locale)??r.locale??Om,s=2520,i=nl(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]=tl(n==null?void 0:n.in,...i>0?[t,e]:[e,t]),c=dx(u,l),d=(el(u)-el(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<wm){const p=Math.round(f/60);return o.formatDistance("aboutXHours",p,a)}else{if(f<s)return o.formatDistance("xDays",1,a);if(f<Ja){const p=Math.round(f/wm);return o.formatDistance("xDays",p,a)}else if(f<Ja*2)return h=Math.round(f/Ja),o.formatDistance("aboutXMonths",h,a)}if(h=cx(u,l),h<12){const p=Math.round(f/Ja);return o.formatDistance("xMonths",p,a)}else{const p=h%12,g=Math.trunc(h/12);return p<3?o.formatDistance("aboutXYears",g,a):p<9?o.formatDistance("overXYears",g,a):o.formatDistance("almostXYears",g+1,a)}}function cO(e,t){return uO(e,tx(e),t)}function dO(e){return cO(e,{addSuffix:!0})}function ls(e,t){return aO(e,t||"PPP")}const fO={class:"moonbase:subscriptions"},hO={key:0,class:"moonbase:loader"},pO={key:1,class:"moonbase:loader"},mO=["data-subscription-status"],bO={class:"moonbase:subscriptions-item-content"},gO={class:"moonbase:subscriptions-item-content"},vO={key:0,class:"moonbase:subscriptions-item-milestone-progress"},yO={class:"moonbase:subscriptions-item-milestone-progress-title"},_O=pe({__name:"Subscriptions",setup(e){const t=De(),{getSubscriptions:n}=lo(),r=L(new Date),o=L(null);return ze(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)=>(b(),x("div",fO,[o.value?o.value.length===0?(b(),x("div",pO," No subscriptions found ")):se("",!0):(b(),x("div",hO,[E(nn),i[0]||(i[0]=A(" Loading subscriptions.. "))])),(b(!0),x(ye,null,ft(o.value||[],a=>(b(),x(ye,{key:a.id},[j("div",{"data-subscription-status":a.status,class:"moonbase:subscriptions-item"},[a.content.type==="Product"?(b(),x(ye,{key:0},[E(Ht,{url:a.content.product.iconUrl,size:48},null,8,["url"]),j("div",bO,[E(it,null,{default:k(()=>[A(V(a.content.quantity)+" x "+V(a.content.product.name),1)]),_:2},1024),E(Me,null,{default:k(()=>[A(V(a.status===v(wr).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+V(v(ls)(a.expiresAt)),1)]),_:2},1024)])],64)):(b(),x(ye,{key:1},[E(Ht,{url:a.content.bundle.iconUrl,size:48},null,8,["url"]),j("div",gO,[E(it,null,{default:k(()=>[A(V(a.content.quantity)+" x "+V(a.content.bundle.name),1)]),_:2},1024),E(Me,null,{default:k(()=>[A(V(a.status===v(wr).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+V(v(ls)(a.expiresAt)),1)]),_:2},1024)])],64)),j("div",null,[E(Yo,{variant:"subtle",onClick:l=>v(t).show(v(ue).Subscription,v(J).ManageSubscription,{subscription_id:a.id})},{default:k(()=>[E(v(wp)),i[1]||(i[1]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2,__:[1]},1032,["onClick"])])],8,mO),a.milestoneProgress?(b(),x("div",vO,[j("div",yO,[E(it,null,{default:k(()=>[A(V(a.milestoneProgress.title),1)]),_:2},1024),E(qt,null,{default:k(()=>[A(V(a.milestoneProgress.currentNormalizedCycleNumber-(a.milestoneProgress.currentCycleIsCompleted?0:1))+" / "+V(a.milestoneProgress.toNormalizedCycleNumber)+" "+V(v(wi)(a.cycleLength))+"s ",1)]),_:2},1024)]),E(ym,{progress:a.milestoneProgress},null,8,["progress"])])):se("",!0)],64))),128))]))}}),wO={class:"moonbase:customer"},EO=pe({__name:"Customer",setup(e){const t=De(),{user:n}=nt(),r=me(ut),o=te(()=>[{intent:J.ViewProducts,title:"Products",content:Rk},{intent:J.ViewSubscriptions,title:"Subscriptions",content:_O,predicate:()=>{var a;return((a=n.value)==null?void 0:a.hasSubscriptions)??!1}},{intent:J.ViewAccount,title:"Account",content:Tk},{intent:J.RedeemVoucher,title:"Redeem",content:Yk}].filter(a=>a.predicate===void 0||a.predicate())),s=te(()=>o.value.findIndex(a=>a.intent===t.intent));function i(a){t.intent=o.value[a].intent}return(a,l)=>(b(),x("div",wO,[E(v(a_),{"selected-index":s.value,onChange:i},{default:k(()=>{var u,c;return[E(v(l_),{"data-corners":(u=v(r))==null?void 0:u.theme.corners,"data-background":(c=v(r))==null?void 0:c.theme.colors.background},{default:k(()=>[(b(!0),x(ye,null,ft(o.value,d=>(b(),Z(v(u_),{key:d.intent},{default:k(()=>[A(V(d.title),1)]),_:2},1024))),128))]),_:1},8,["data-corners","data-background"]),E(v(c_),null,{default:k(()=>[(b(!0),x(ye,null,ft(o.value,d=>(b(),Z(v(d_),{key:d.intent},{default:k(()=>[(b(),Z(Gl(d.content)))]),_:2},1024))),128))]),_:1})]}),_:1},8,["selected-index"])]))}}),kO={class:"moonbase:product-card-content"},xO=["data-open"],OO=pe({__name:"ProductCard",props:{product:{}},setup(e){const t=L(!1),n=L(null),r=te(()=>n.value&&n.value.$el&&n.value.$el.scrollHeight>n.value.$el.clientHeight);return(o,s)=>(b(),Z(cn,{class:"moonbase:product-card"},{addon:k(()=>[j("div",{class:"moonbase:product-card-description","data-open":t.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:n},{default:k(()=>[A(V(o.product.description),1)]),_:1},512),!t.value&&r.value?(b(),x("button",{key:0,onClick:s[0]||(s[0]=i=>t.value=!0)},[E(it,null,{default:k(()=>s[1]||(s[1]=[A(" read more ")])),_:1,__:[1]})])):se("",!0)],8,xO)]),default:k(()=>[E(Ht,{url:o.product.iconUrl,size:72},null,8,["url"]),j("div",kO,[E(is,null,{default:k(()=>{var i;return[A(V((i=o.product)==null?void 0:i.name),1)]}),_:1}),E(Me,{class:"moonbase:product-card-tagline"},{default:k(()=>{var i;return[A(V((i=o.product)==null?void 0:i.tagline),1)]}),_:1})])]),_:1}))}});function SO(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 CO={class:"moonbase:product-downloads"},NO=["data-open"],PO={key:1,class:"moonbase:product-downloads-content"},TO={key:2,class:"moonbase:product-downloads-content"},$O={key:3,class:"moonbase:product-downloads-content"},AO={key:4,class:"moonbase:product-downloads-content"},DO={class:"moonbase:product-downloads-list"},IO={class:"moonbase:product-downloads-download-actions"},MO=pe({__name:"ProductDownloads",props:{product:{}},setup(e){const t=e,n=De(),r=nt(),o=Xa(),s=me(jr),{downloadProduct:i}=lo(),a=L(!1),l=L(null),u=te(()=>l.value&&l.value.$el&&l.value.$el.scrollHeight>l.value.$el.clientHeight);function c(){n.enqueue(ue.Product,J.DownloadProduct,n.parameters??void 0),n.show(ue.Authentication,J.SignIn)}const d=[An.Windows,An.Mac,An.Linux,An.Universal];function f(){var R;const S=(((R=navigator.userAgentData)==null?void 0:R.platform)??navigator.platform??"Unknown").toLowerCase();return/mac/.test(S)?An.Mac:/win/.test(S)?An.Windows:/linux/.test(S)?An.Linux:An.Universal}const h=f(),p=[h,...d.filter(S=>S!==h)],g=te(()=>p.flatMap(S=>[...(t.product.downloads??[]).filter(R=>R.platform===S)]));async function _(S){try{await i(S),s==null||s(zt.DownloadedProduct,{product:t.product,download:S,user:r.user.value})}catch(R){if(R instanceof bn)o.reportProblem("error",{type:R.name,title:R.title,detail:R.detail,status:R.status,errors:R.errors?Object.fromEntries(Object.entries(R.errors).map(([H,z])=>[H,[z]])):void 0,instance:"ProductDownloads.vue:startDownload"});else{const H=R;o.reportProblem("error",{type:H.name,title:H.message,instance:"ProductDownloads.vue:startDownload"})}throw R}}return(S,R)=>(b(),x("div",CO,[E(rt,null,{default:k(()=>[R[1]||(R[1]=A(" Downloads ")),E(Me,null,{default:k(()=>[A(" Version "+V(S.product.version),1)]),_:1})]),_:1,__:[1]}),S.product.releaseDescription?(b(),x("div",{key:0,class:"moonbase:product-downloads-description","data-open":a.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:l},{default:k(()=>[A(V(S.product.releaseDescription),1)]),_:1},512),!a.value&&u.value?(b(),x("button",{key:0,onClick:R[0]||(R[0]=H=>a.value=!0)},[E(it,null,{default:k(()=>R[2]||(R[2]=[A(" read more ")])),_:1,__:[2]})])):se("",!0)],8,NO)):se("",!0),S.product.downloadsNeedsUser&&S.product.downloadsNeedsOwnership&&!S.product.numberOfLicenses&&!S.product.subscriptionLicenses?(b(),x("div",PO,[E(ot,{"data-center":""},{default:k(()=>R[3]||(R[3]=[A(" This product requires ownership to download ")])),_:1,__:[3]}),E(Qe,{label:"Sign in",handler:c})])):S.product.downloadsNeedsUser&&!v(r).user?(b(),x("div",TO,[E(ot,{"data-center":""},{default:k(()=>R[4]||(R[4]=[A(" This product requires an account to download ")])),_:1,__:[4]}),E(Qe,{label:"Sign in",handler:c})])):S.product.downloadsNeedsOwnership&&!S.product.numberOfLicenses&&!S.product.subscriptionLicenses?(b(),x("div",$O,[E(ot,{"data-center":""},{default:k(()=>R[5]||(R[5]=[A(" This product requires ownership to download ")])),_:1,__:[5]})])):(b(),x("div",AO,[j("div",DO,[(b(!0),x(ye,null,ft(g.value,H=>(b(),Z(cn,{key:H.key,class:"moonbase:product-downloads-download"},{addon:k(()=>[j("div",IO,[E(Qe,{label:`Download for ${H.platform}`,variant:H.platform===v(h)?"primary":"secondary","no-reset":!0,handler:()=>_(H),icon:v(v_)},null,8,["label","variant","handler","icon"])])]),default:k(()=>[j("div",null,[E(rt,null,{default:k(()=>[A(V(H.name),1)]),_:2},1024),E(qt,null,{default:k(()=>[A(V(H.platform)+" - "+V(v(SO)(H.size)),1)]),_:2},1024)])]),_:2},1024))),128))]),g.value.length===0?(b(),Z(ot,{key:0,"data-center":""},{default:k(()=>R[6]||(R[6]=[A(" No downloadable files found ")])),_:1,__:[6]})):se("",!0)]))]))}}),VO={class:"moonbase:product-licenses"},RO={key:0,class:"moonbase:loader"},LO={key:1,class:"moonbase:empty"},jO={key:0,class:"moonbase:loader"},UO={key:1,class:"moonbase:product-licenses-activations"},BO={key:0},FO={class:"moonbase:product-licenses-activation-actions"},zO={key:2,class:"moonbase:loader"},HO={key:3,class:"moonbase:product-licenses-licenses"},qO=pe({__name:"ProductLicenses",props:{product:{}},emits:["revoked"],setup(e,{emit:t}){const n=e,r=t,{getProductActivations:o,getProductLicenses:s,revokeActivation:i}=lo(),a=Xa(),l=L(null),u=L(null),c=L(!0);ze(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&&Yt(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 bn)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,g])=>[p,[g]])):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)=>(b(),x("div",VO,[E(rt,null,{default:k(()=>[h[0]||(h[0]=A(" Licenses ")),f.product.maxActivations&&f.product.maxActivations>0?(b(),Z(Me,{key:0},{default:k(()=>[A(V(f.product.currentActivations??0)+" of "+V(f.product.maxActivations)+" seats used ",1)]),_:1})):se("",!0)]),_:1,__:[0]}),c.value?(b(),x("div",RO,[E(nn)])):!f.product.numberOfLicenses&&!f.product.subscriptionLicenses?(b(),x("div",LO,[E(ot,null,{default:k(()=>h[1]||(h[1]=[A(" You don't own any licenses for this product yet ")])),_:1,__:[1]}),f.product&&f.product.website?(b(),Z(lc,{key:0,type:"anchor",href:f.product.website,label:"Purchase",icon:v(__)},null,8,["href","icon"])):se("",!0)])):se("",!0),c.value?se("",!0):(b(),x(ye,{key:2},[f.product.maxActivations&&f.product.maxActivations>0&&!f.product.currentActivations?(b(),x("div",jO,[E(v(Ep)),E(rt,null,{default:k(()=>h[2]||(h[2]=[A(" No activations yet ")])),_:1,__:[2]})])):se("",!0),f.product.maxActivations&&l.value?(b(),x("div",UO,[(b(!0),x(ye,null,ft(l.value??[],p=>(b(),Z(cn,{key:p.id,class:"moonbase:product-licenses-activation"},ba({default:k(()=>[j("div",null,[E(qt,null,{default:k(()=>h[3]||(h[3]=[A(" Device ")])),_:1,__:[3]}),E(rt,null,{default:k(()=>[A(V(p.name),1)]),_:2},1024)]),j("div",null,[E(qt,null,{default:k(()=>h[4]||(h[4]=[A(" Activation ")])),_:1,__:[4]}),E(rt,null,{default:k(()=>[A(V(p.activationMethod),1)]),_:2},1024)]),p.lastValidatedAt?(b(),x("div",BO,[E(qt,null,{default:k(()=>h[5]||(h[5]=[A(" First activated ")])),_:1,__:[5]}),E(rt,null,{default:k(()=>[A(V(v(dO)(p.firstValidatedAt)),1)]),_:2},1024)])):se("",!0)]),_:2},[p.activationMethod===v(Fi).Online?{name:"addon",fn:k(()=>[j("div",FO,[E(Qe,{label:"Revoke",variant:"secondary","no-reset":!0,handler:()=>d(p)},null,8,["handler"])])]),key:"0"}:void 0]),1024))),128))])):se("",!0),(!u.value||u.value.length===0)&&!f.product.maxActivations&&(f.product.numberOfLicenses||f.product.subscriptionLicenses)?(b(),x("div",zO,[E(v(Ep)),f.product.numberOfLicenses?(b(),Z(rt,{key:0},{default:k(()=>[A(" You own "+V(f.product.numberOfLicenses)+" license"+V(f.product.numberOfLicenses!==1?"s":"")+" for this product ",1)]),_:1})):se("",!0),f.product.subscriptionLicenses?(b(),Z(rt,{key:1},{default:k(()=>[A(" You have "+V(f.product.subscriptionLicenses)+" subscription license"+V(f.product.subscriptionLicenses!==1?"s":"")+" for this product ",1)]),_:1})):se("",!0)])):f.product.externalLicenses&&u.value?(b(),x("div",HO,[(b(!0),x(ye,null,ft((u.value??[]).filter(p=>p.externalFulfillment),p=>(b(),Z(cn,{key:p.id,class:"moonbase:product-licenses-license"},ba({default:k(()=>[j("div",null,[E(qt,null,{default:k(()=>[A(V(f.product.name)+" license ",1)]),_:1}),E(rt,null,{default:k(()=>[A(V(p.id),1)]),_:2},1024)])]),_:2},[p.externalFulfillment?{name:"addon",fn:k(()=>[j("code",null,V(p.externalFulfillment),1)]),key:"0"}:void 0]),1024))),128))])):se("",!0)],64))]))}}),WO={class:"moonbase:download-product"},ZO={key:0,class:"moonbase:loader"},YO={key:1,class:"moonbase:loader"},GO={key:2,class:"moonbase:loader"},KO={key:3},XO=pe({__name:"Product",setup(e){const t=De(),n=nt(),{loaded:r}=nt(),{getProduct:o}=lo(),s=L(null),i=L(null),a=L(!0);return ze(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)=>(b(),x("div",WO,[a.value||!v(r)?(b(),x("div",ZO,[E(nn)])):i.value?(b(),x("div",YO,V(i.value),1)):s.value?(b(),x("div",KO,[E(OO,{product:s.value},null,8,["product"]),s.value.downloads?(b(),Z(MO,{key:0,product:s.value},null,8,["product"])):se("",!0),v(n).user.value?(b(),Z(qO,{key:1,product:s.value,onRevoked:u[0]||(u[0]=c=>s.value.currentActivations=(s.value.currentActivations??1)-1)},null,8,["product"])):se("",!0)])):(b(),x("div",GO," Could not find product "))]))}}),JO={class:"moonbase:peek"},QO=["data-visible"],e3={key:1,class:"moonbase:peek-voucher"},t3={key:0,class:"moonbase:peek-voucher-content"},n3={class:"moonbase:peek-voucher-auth"},r3=pe({__name:"Redeem",setup(e){const{peek:t}=Ph(),n=De(),r=L(null),o=L(null),s=L(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(ue.Customer,J.RedeemVoucher,{code:s.value}),n.show(ue.Authentication,J.SignIn)}function l(){n.enqueue(ue.Customer,J.RedeemVoucher,{code:s.value}),n.show(ue.Authentication,J.SignUp)}return(u,c)=>(b(),x("div",JO,[E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[r.value?(b(),x("div",e3,[j("div",null,[E(is,null,{default:k(()=>[A(V(r.value.name),1)]),_:1}),r.value.description?(b(),Z(rt,{key:0},{default:k(()=>[A(' "'+V(r.value.description)+'" ',1)]),_:1})):se("",!0),E(Me,null,{default:k(()=>[c[2]||(c[2]=A(" Code: ")),j("strong",null,V(r.value.code),1)]),_:1,__:[2]})]),E(rt,null,{default:k(()=>c[3]||(c[3]=[A(" Voucher summary ")])),_:1,__:[3]}),r.value.redeemsProducts.length>0||r.value.redeemsBundles.length>0?(b(),x("div",t3,[(b(!0),x(ye,null,ft(r.value.redeemsProducts,({value:d,quantity:f})=>(b(),Z(vm,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(b(!0),x(ye,null,ft(r.value.redeemsBundles,({value:d,quantity:f})=>(b(),Z(gm,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):se("",!0),j("div",n3,[E(ot,null,{default:k(()=>c[4]||(c[4]=[A(" Sign in or create an account to redeem products ")])),_:1,__:[4]}),E(Qe,{label:"Sign in",variant:"primary",handler:a}),E(Qe,{label:"Create account",variant:"subtle",handler:l})])])):(b(),Z(ur,{key:0,handler:i},{default:k(()=>{var d;return[E(ot,null,{default:k(()=>c[1]||(c[1]=[A(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),A(" Please enter the code below: ")])),_:1,__:[1]}),E(At,{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"]),E(cr,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},V((d=o.value)==null?void 0:d.message),9,QO)]}),_:1}))]),_:1})]))}});function Am(e,t){return b(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[j("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z","clip-rule":"evenodd"})])}const o3={class:"moonbase:subscription-content-card-content"},s3=["data-open"],i3={class:"moonbase:subscription-content-card-content"},a3=["data-open"],l3=pe({__name:"ContentCard",props:{subscription:{}},setup(e){const t=L(new Date),n=L(!1),r=L(null),o=te(()=>r.value&&r.value.$el&&r.value.$el.scrollHeight>r.value.$el.clientHeight);return(s,i)=>s.subscription.content.type==="Product"?(b(),Z(cn,{key:0,class:"moonbase:subscription-content-card"},{addon:k(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:r},{default:k(()=>[A(V(s.subscription.content.product.description),1)]),_:1},512),!n.value&&o.value?(b(),x("button",{key:0,onClick:i[0]||(i[0]=a=>n.value=!0)},[E(it,null,{default:k(()=>i[2]||(i[2]=[A(" read more ")])),_:1,__:[2]})])):se("",!0)],8,s3)]),default:k(()=>[E(Ht,{url:s.subscription.content.product.iconUrl,size:72},null,8,["url"]),j("div",o3,[E(is,null,{default:k(()=>{var a;return[A(V((a=s.subscription.content.product)==null?void 0:a.name),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-tagline"},{default:k(()=>{var a;return[A(V((a=s.subscription.content.product)==null?void 0:a.tagline),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-expiry"},{default:k(()=>[A(V(s.subscription.status===v(wr).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,V(v(ls)(s.subscription.expiresAt)),1)]),_:1})])]),_:1})):(b(),Z(cn,{key:1,class:"moonbase:subscription-content-card"},{addon:k(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:r},{default:k(()=>[A(V(s.subscription.content.bundle.description),1)]),_:1},512),!n.value&&o.value?(b(),x("button",{key:0,onClick:i[1]||(i[1]=a=>n.value=!0)},[E(it,null,{default:k(()=>i[3]||(i[3]=[A(" read more ")])),_:1,__:[3]})])):se("",!0)],8,a3)]),default:k(()=>[E(Ht,{url:s.subscription.content.bundle.iconUrl,size:72},null,8,["url"]),j("div",i3,[E(is,null,{default:k(()=>{var a;return[A(V((a=s.subscription.content.bundle)==null?void 0:a.name),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-tagline"},{default:k(()=>{var a;return[A(V((a=s.subscription.content.bundle)==null?void 0:a.tagline),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-expiry"},{default:k(()=>[A(V(s.subscription.status===v(wr).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,V(v(ls)(s.subscription.expiresAt)),1)]),_:1})])]),_:1}))}}),u3={class:"moonbase:milestone-rewards"},c3={class:"moonbase:milestone-rewards-list"},d3={key:0},f3={key:1},h3=pe({__name:"MilestoneRewards",props:{progress:{}},setup(e){return(t,n)=>(b(),x("div",u3,[E(it,null,{default:k(()=>n[0]||(n[0]=[A(" Rewards: ")])),_:1,__:[0]}),j("div",c3,[(b(!0),x(ye,null,ft(Object.values(t.progress.events).flatMap(r=>r).filter(r=>r.fulfilled),r=>(b(),x("div",{key:r.milestoneId,class:"moonbase:milestone-rewards-item"},[E(Me,null,{default:k(()=>[A(V(r.message),1)]),_:2},1024),r.type==="CouponCodeMilestone"&&r.fulfilled&&r.code?(b(),x("div",d3,[E(qt,null,{default:k(()=>n[1]||(n[1]=[A(" Your coupon code: ")])),_:1,__:[1]}),n[2]||(n[2]=j("br",null,null,-1)),j("code",null,V(r.code),1)])):r.type==="PerpetualLicenseConversionMilestone"&&r.fulfilled?(b(),x("div",f3,[E(qt,null,{default:k(()=>[E(v(Am),{class:"moonbase:success-icon"}),n[3]||(n[3]=A(" Your licenses have been converted to perpetual licenses. "))]),_:1,__:[3]})])):se("",!0)]))),128))])]))}}),p3={class:"moonbase:subscription"},m3={key:0,class:"moonbase:loader"},b3={key:1,class:"moonbase:loader"},g3={key:2,class:"moonbase:loader"},v3={key:3},y3={key:0,class:"moonbase:subscription-milestones"},_3={class:"moonbase:subscription-milestone-progress-title"},w3={class:"moonbase:subscription-actions"},E3=pe({__name:"Subscription",setup(e){const t=De(),{loaded:n}=nt(),r=Xa(),{getSubscription:o,renewSubscription:s,cancelSubscription:i,updateSubscriptionPaymentMethod:a}=lo(),l=L(null),u=L(new Date),c=L(null),d=L(!0);ze(async()=>{const g=t.getParameter("subscription_id");if(!g){c.value="Link is broken";return}try{l.value=await o(g)}catch(_){c.value=_.message}d.value=!1});async function f(){if(!l.value)return;if((await s(l.value.id,{redirect:!1})).completed){const _=await o(l.value.id);Yt(1500).then(()=>l.value=_)}else throw new ss}async function h(){l.value&&(l.value=await i(l.value.id))}async function p(){if(l.value){c.value=null;try{const g=await a(l.value,{returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(g!=null&&g.completed)l.value=await o(l.value.id);else throw new ss}catch(g){if(c.value=g.message,!(g instanceof ss))if(g instanceof bn)r.reportProblem("error",{type:g.name,title:g.title,detail:g.detail,status:g.status,errors:g.errors?Object.fromEntries(Object.entries(g.errors).map(([_,S])=>[_,[S]])):void 0,instance:"Subscription.vue:startUpdate"});else{const _=g;r.reportProblem("error",{type:_.name,title:_.message,instance:"Subscription.vue:startUpdate"})}throw g}}}return(g,_)=>(b(),x("div",p3,[d.value||!v(n)?(b(),x("div",m3,[E(nn)])):c.value?(b(),x("div",b3,V(c.value),1)):l.value?(b(),x("div",v3,[E(l3,{subscription:l.value},null,8,["subscription"]),l.value.milestoneProgress?(b(),x("div",y3,[j("div",_3,[E(it,null,{default:k(()=>[A(V(l.value.milestoneProgress.title),1)]),_:1}),E(qt,null,{default:k(()=>[A(V(l.value.milestoneProgress.currentNormalizedCycleNumber-(l.value.milestoneProgress.currentCycleIsCompleted?0:1))+" / "+V(l.value.milestoneProgress.toNormalizedCycleNumber)+" "+V(v(wi)(l.value.cycleLength))+"s ",1)]),_:1})]),E(ym,{progress:l.value.milestoneProgress},null,8,["progress"]),l.value.milestoneProgress.description?(b(),Z(qt,{key:0},{default:k(()=>[A(V(l.value.milestoneProgress.description),1)]),_:1})):se("",!0),Object.values(l.value.milestoneProgress.events).flatMap(S=>S).some(S=>S.fulfilled)?(b(),Z(h3,{key:1,progress:l.value.milestoneProgress},null,8,["progress"])):se("",!0)])):se("",!0),j("div",w3,[l.value.status===v(wr).Active?(b(),x(ye,{key:0},[E(Qe,{label:"Update payment method",variant:"secondary",handler:p}),E(Qe,{label:"Cancel subscription",variant:"danger",handler:h}),E(qt,null,{default:k(()=>[_[1]||(_[1]=A(" 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 ")),j("strong",null,V(v(Bt)(l.value.total.due)),1),A(" per "+V(v(wi)(l.value.cycleLength))+" for this subscription",1),l.value.paymentMethod?(b(),x(ye,{key:0},[_[0]||(_[0]=A(" using payment method ")),j("strong",null,V(l.value.paymentMethod),1)],64)):se("",!0),_[2]||(_[2]=A(". "))]),_:1,__:[1,2]})],64)):l.value.status===v(wr).Completed?(b(),Z(qt,{key:1},{default:k(()=>[E(v(Am),{class:"moonbase:success-icon"}),_[3]||(_[3]=A(" This subscription has been completed, and cannot be renewed. "))]),_:1,__:[3]})):(b(),x(ye,{key:2},[l.value.nextPaymentScheduledAt&&l.value.cancellable?(b(),x(ye,{key:0},[E(Qe,{label:"Continue subscription",variant:"primary",handler:f}),E(Qe,{label:"Cancel subscription",variant:"danger",handler:h}),E(qt,null,{default:k(()=>[A(" We could not renew this subscription on the expiry date, the next attempt will be "+V(v(ls)(l.value.nextPaymentScheduledAt))+". To make sure you can use your products un-interrupted, continue the subscription, or cancel it if you do not wish to keep using these products. ",1)]),_:1})],64)):(b(),x(ye,{key:1},[E(Qe,{label:"Continue subscription",variant:"primary",handler:f}),E(qt,null,{default:k(()=>[A(" This subscription has been stopped, and "+V(l.value.expiresAt>u.value?"expires":"expired")+" "+V(v(ls)(l.value.expiresAt))+". If you want to continue using the products after this date, you may continue the subscription to regain access. ",1)]),_:1})],64))],64))])])):(b(),x("div",g3," Could not find subscription "))]))}}),k3=pe({__name:"App",setup(e){const t=me(ut),n=De();Xe(()=>[n.active,n.intent],([o,s])=>{Je("UI updated",{view:o,intent: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??"")}return Xe(()=>t==null?void 0:t.value.theme.colors.primary,o=>{if(!o)return;let s=o;typeof s=="string"&&(s=Object.fromEntries(eE(s).map(i=>[i.number<=100||i.number===950?i.number-50:i.number-100,i.hexcode]))),document.documentElement.style.setProperty("--moonbase-brand-50",s[50]??""),document.documentElement.style.setProperty("--moonbase-brand-100",s[100]??""),document.documentElement.style.setProperty("--moonbase-brand-200",s[200]??""),document.documentElement.style.setProperty("--moonbase-brand-300",s[300]??""),document.documentElement.style.setProperty("--moonbase-brand-400",s[400]??""),document.documentElement.style.setProperty("--moonbase-brand-500",s[500]??""),document.documentElement.style.setProperty("--moonbase-brand-600",s[600]??""),document.documentElement.style.setProperty("--moonbase-brand-700",s[700]??""),document.documentElement.style.setProperty("--moonbase-brand-800",s[800]??""),document.documentElement.style.setProperty("--moonbase-brand-900",s[900]??"")},{immediate:!0}),Xe(()=>t==null?void 0:t.value.theme.dark,o=>{o?document.documentElement.classList.add("moonbase:dark"):document.documentElement.classList.remove("moonbase:dark")},{immediate:!0}),tw(),nw(),(o,s)=>{var i;return b(),x(ye,null,[(i=v(t))!=null&&i.toolbar.enabled?(b(),Z(ew,{key:0})):se("",!0),E(W_,null,{default:k(()=>[v(n).active===v(ue).Cart?(b(),Z(Ok,{key:0})):v(n).active===v(ue).Authentication?(b(),Z(q5,{key:1})):v(n).active===v(ue).Activation?(b(),Z(n5,{key:2})):v(n).active===v(ue).Product?(b(),Z(XO,{key:3})):v(n).active===v(ue).Subscription?(b(),Z(E3,{key:4})):v(n).active===v(ue).Customer?(b(),Z(EO,{key:5})):v(n).active===v(ue).Redeem?(b(),Z(r3,{key:6})):v(n).active===v(ue).About?(b(),Z(fE,{key:7})):se("",!0)]),_:1})],64)}}});function rl(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof HTMLElement)}function ol(e,...t){if(t.length===0)return e;const n=t.shift();if(!n)return e;if(rl(e)&&rl(n)){for(const r in e)if(Object.prototype.hasOwnProperty.call(n,r)){const o=n[r];rl(o)&&rl(e[r])?e[r]=ol(e[r],o):o!==void 0&&(e[r]=o)}}return ol(e,...t)}function x3(e){const t=n=>Array.isArray(n)?n.map(r=>t(r)):Ke(n)||wn(n)||Io(n)?t(Oe(n)):n&&typeof n=="object"?Object.keys(n).reduce((r,o)=>(r[o]=t(n[o]),r),{}):n;return t(e)}const dc=Symbol("url"),Dm=Symbol("moonbase_instance"),Lr=(e,t)=>window.dispatchEvent(new CustomEvent(`moonbase-storefront-${e}`,{detail:x3(t)})),jr=Symbol("event-emitter");class O3{constructor(){_o(this,"initialized",!1);_o(this,"pinia");_o(this,"storefront");_o(this,"options")}async setup(t,n){var u,c;if(typeof window>"u")throw console.error("Moonbase setup must be done client-side"),new Error("Moonbase setup must be done client-side");if(globalThis.MoonbaseCSS&&globalThis.MoonbaseCSS.inject(),document.getElementById("moonbase")){console.warn("Moonbase has already been initialized!");return}Je("Given options:",n),this.options=L(ol(((u=this.options)==null?void 0:u.value)??Gh,n??{})),Je("Merged options:",this.options.value);const r=document.createElement("div");r.id="moonbase",r.classList.add("moonbase");const o=this.options.value.target??document.body;Je("Mounting to target element",o),o.append(r);let s=t;if(t.includes(".moonbase.sh")){const d=/^(https:\/\/[a-z\-]+\.(?:beta\.)?moonbase\.sh)(.+)/.exec(t);d&&d.length>1&&d[1]&&(s=d[1],console.warn(`Moonbase url set up incorrectly, should be ${s}, was ${t}`))}this.storefront=Hy(s),this.pinia=m1(),vy(k3).use(this.storefront).use(this.pinia).provide(ut,this.options).provide(dc,s.replace(/\/$/,"")).provide(jr,Lr).provide(Dm,this).mount("#moonbase"),this.initialized=!0,window&&window.location&&this.handleLocationIntent(window.location);const a=De(this.pinia),l=nt(this.storefront);(c=this.storefront)==null||c.onCheckoutInitiated((d,f)=>{Lr(zt.CheckoutInitiated,{order:d,total:f,user:l.user.value})}),this.storefront.onCheckoutClosed(d=>{Lr(zt.CheckoutClosed,{order:this.storefront.currentOrder.value,user:l.user.value}),d===J.ViewProducts&&(l.user?a.show(ue.Customer,J.ViewProducts):a.show(ue.Cart,J.ViewCart))}),this.storefront.onCheckoutCompleted(d=>{Lr(zt.CheckoutCompleted,{order:d,user:l.user.value})})}configure(t){var r;Je("Given options:",t);const n=ol(((r=this.options)==null?void 0:r.value)??Gh,t??{});Je("Merged options:",n),this.options?this.options.value=n:this.options=L(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(J).includes(r)){const o=Object.fromEntries([...n.entries()].filter(([i])=>i.startsWith("mb_")).map(([i,a])=>[i.substring(3),a]));if(r===J.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");De(this.pinia).show(ue.Authentication,J.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");De(this.pinia).show(ue.Authentication,J.SignUp,t)}forgot_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ForgotPassword,t)}reset_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ResetPassword,t)}confirm_account(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ConfirmAccount,t)}confirm_email(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ConfirmEmail,t)}confirm_email_change(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);nt(this.storefront).user.value?n.show(ue.Authentication,J.ConfirmEmailChange,t):(n.enqueue(ue.Authentication,J.ConfirmEmailChange,t),n.show(ue.Authentication,J.SignIn))}view_account(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const t=De(this.pinia);nt(this.storefront).user.value?t.show(ue.Customer,J.ViewAccount):(t.enqueue(ue.Customer,J.ViewAccount),t.show(ue.Authentication,J.SignIn))}view_products(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Customer,J.ViewProducts)}view_subscriptions(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Customer,J.ViewSubscriptions)}redeem_voucher(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);nt(this.storefront).user.value?n.show(ue.Customer,J.RedeemVoucher,t):n.show(ue.Redeem,J.RedeemVoucher,t)}view_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Product,J.ViewProduct,t)}download_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Product,J.DownloadProduct,t)}activate_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia),r=nt(this.storefront);!(t!=null&&t.token)&&!r.user.value?(n.enqueue(ue.Activation,J.ActivateProduct,t),n.show(ue.Authentication,J.SignIn)):n.show(ue.Activation,J.ActivateProduct,t)}manage_subscription(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);nt(this.storefront).user.value?n.show(ue.Subscription,J.ManageSubscription,t):(n.enqueue(ue.Subscription,J.ManageSubscription,t),n.show(ue.Authentication,J.SignIn))}view_cart(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Cart,J.ViewCart)}async add_to_cart(t){var s,i,a,l,u,c,d,f,h,p;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=nr(this.storefront),r=nt(this.storefront),o=t.offer_id?Uy(t.offer_id):null;if(t!=null&&t.product_id){const g=li(t.product_id,this.storefront);if(g.value){let _=n.addToCart(g.value,(s=g.value.variations)==null?void 0:s.find(S=>S.id===t.variation_id),(o==null?void 0:o.value)||void 0);t!=null&&t.quantity&&(_=n.setQuantity(_,_.quantity+t.quantity-1)),((i=this.options)==null?void 0:i.value.cart.quantity)==="single"&&(_=n.setQuantity(_,1)),Lr(zt.AddedToCart,{item:_,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const _=li(t.product_id,this.storefront);if(_.value){let S=n.addToCart(_.value,(a=_.value.variations)==null?void 0:a.find(R=>R.id===t.variation_id),(o==null?void 0:o.value)||void 0);t!=null&&t.quantity&&(S=n.setQuantity(S,S.quantity+t.quantity-1)),((l=this.options)==null?void 0:l.value.cart.quantity)==="single"&&(S=n.setQuantity(S,1)),Lr(zt.AddedToCart,{item:S,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 g=Na(t.bundle_id,this.storefront);if(g.value){const _=(u=g.value.variations)==null?void 0:u.find(R=>R.id===t.variation_id);let S=n.addToCart(g.value,_,(o==null?void 0:o.value)||void 0,{bundleBehaviour:(c=this.options)==null?void 0:c.value.cart.bundles.onAdd});t!=null&&t.quantity&&(S=n.setQuantity(S,S.quantity+t.quantity-1)),((d=this.options)==null?void 0:d.value.cart.quantity)==="single"&&(S=n.setQuantity(S,1)),Lr(zt.AddedToCart,{item:S,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const _=Na(t.bundle_id,this.storefront);if(_.value){const S=(f=_.value.variations)==null?void 0:f.find(H=>H.id===t.variation_id);let R=n.addToCart(_.value,S,(o==null?void 0:o.value)||void 0,{bundleBehaviour:(h=this.options)==null?void 0:h.value.cart.bundles.onAdd});t!=null&&t.quantity&&(R=n.setQuantity(R,R.quantity+t.quantity-1)),((p=this.options)==null?void 0:p.value.cart.quantity)==="single"&&(R=n.setQuantity(R,1)),Lr(zt.AddedToCart,{item:R,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&&De(this.pinia).show(ue.Cart,J.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=li(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=Na(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 jy(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;nr(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");De(this.pinia).show(ue.About,J.ViewAbout)}}const sl=new O3;globalThis&&(globalThis.Moonbase?console.warn("Multiple instances of Moonbase detected, only one will be initialized"):globalThis.Moonbase=sl),kt.MoonbaseEvent=zt,kt.MoonbaseIntent=J,kt.default=sl,kt.eventEmitterKey=jr,kt.instanceKey=Dm,kt.urlKey=dc,Object.defineProperties(kt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
36
+ */const Bp=.027,N2=5e-4,P2=.1,Fp=1.14,Wa=.022,zp=1.414,T2=(e,t)=>{e=new Q(e),t=new Q(t),e.alpha()<1&&(e=Jo(t,e,e.alpha(),"rgb"));const n=Hp(...e.rgb()),r=Hp(...t.rgb()),o=n>=Wa?n:n+Math.pow(Wa-n,zp),s=r>=Wa?r:r+Math.pow(Wa-r,zp),i=Math.pow(s,.56)-Math.pow(o,.57),a=Math.pow(s,.65)-Math.pow(o,.62),l=Math.abs(s-o)<N2?0:o<s?i*Fp:a*Fp;return(Math.abs(l)<P2?0:l>0?l-Bp:l+Bp)*100};function Hp(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:ar,pow:mt,min:$2,max:A2,atan2:qp,abs:Wp,cos:Za,sin:Zp,exp:D2,PI:Yp}=Math;function I2(e,t,n=1,r=1,o=1){var s=function($e){return 360*$e/(2*Yp)},i=function($e){return 2*Yp*$e/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=ar(mt(l,2)+mt(u,2)),g=ar(mt(d,2)+mt(f,2)),_=(p+g)/2,S=.5*(1-ar(mt(_,7)/(mt(_,7)+mt(25,7)))),R=l*(1+S),H=d*(1+S),z=ar(mt(R,2)+mt(u,2)),B=ar(mt(H,2)+mt(f,2)),I=(z+B)/2,y=s(qp(u,R)),P=s(qp(f,H)),D=y>=0?y:y+360,$=P>=0?P:P+360,T=Wp(D-$)>180?(D+$+360)/2:(D+$)/2,M=1-.17*Za(i(T-30))+.24*Za(i(2*T))+.32*Za(i(3*T+6))-.2*Za(i(4*T-63));let ie=$-D;ie=Wp(ie)<=180?ie:$<=D?ie+360:ie-360,ie=2*ar(z*B)*Zp(i(ie)/2);const Se=c-a,N=B-z,q=1+.015*mt(h-50,2)/ar(20+mt(h-50,2)),U=1+.045*I,ne=1+.015*I*M,be=30*D2(-mt((T-275)/25,2)),he=-(2*ar(mt(I,7)/(mt(I,7)+mt(25,7))))*Zp(2*i(be)),we=ar(mt(Se/(n*q),2)+mt(N/(r*U),2)+mt(ie/(o*ne),2)+he*(N/(r*U))*(ie/(o*ne)));return A2(0,$2(100,we))}function M2(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 V2=(...e)=>{try{return new Q(...e),!0}catch{return!1}},R2={cool(){return qa([Ve.hsl(180,1,.9),Ve.hsl(250,.7,.4)])},hot(){return qa(["#000","#f00","#ff0","#fff"]).mode("rgb")}},rc={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"]},Gp=Object.keys(rc),Kp=new Map(Gp.map(e=>[e.toLowerCase(),e])),L2=typeof Proxy=="function"?new Proxy(rc,{get(e,t){const n=t.toLowerCase();if(Kp.has(n))return e[Kp.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(Gp)}}):rc,j2=(...e)=>{e=Ie(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:Xp}=Math,U2=(...e)=>{let[t,n,r]=Ie(e,"rgb");t=t/255,n=n/255,r=r/255;const o=1-Xp(t,Xp(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 U2(this._rgb)},Object.assign(Ve,{cmyk:(...e)=>new Q(...e,"cmyk")}),Te.format.cmyk=j2,Te.autodetect.push({p:2,test:(...e)=>{if(e=Ie(e,"cmyk"),je(e)==="array"&&e.length===4)return"cmyk"}});const B2=(...e)=>{const t=Ie(e,"hsla");let n=Ko(e)||"lsa";return t[0]=ln(t[0]||0)+"deg",t[1]=ln(t[1]*100)+"%",t[2]=ln(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(" ")})`},F2=(...e)=>{const t=Ie(e,"lab");let n=Ko(e)||"lab";return t[0]=ln(t[0])+"%",t[1]=ln(t[1]),t[2]=ln(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},z2=(...e)=>{const t=Ie(e,"lch");let n=Ko(e)||"lab";return t[0]=ln(t[0])+"%",t[1]=ln(t[1]),t[2]=isNaN(t[2])?"none":ln(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(" ")})`},H2=(...e)=>{const t=Ie(e,"lab");return t[0]=ln(t[0]*100)+"%",t[1]=Bu(t[1]),t[2]=Bu(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},Jp=(...e)=>{const[t,n,r,...o]=Ie(e,"rgb"),[s,i,a]=Qu(t,n,r),[l,u,c]=Ap(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},q2=(...e)=>{const t=Ie(e,"lch");return t[0]=ln(t[0]*100)+"%",t[1]=Bu(t[1]),t[2]=isNaN(t[2])?"none":ln(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:oc}=Math,W2=(...e)=>{const t=Ie(e,"rgba");let n=Ko(e)||"rgb";if(n.substr(0,3)==="hsl")return B2(Ip(t),n);if(n.substr(0,3)==="lab"){const r=_i();ir("d50");const o=F2(qu(t),n);return ir(r),o}if(n.substr(0,3)==="lch"){const r=_i();ir("d50");const o=z2(Gu(t),n);return ir(r),o}return n.substr(0,5)==="oklab"?H2(Qu(t)):n.substr(0,5)==="oklch"?q2(Jp(t)):(t[0]=oc(t[0]),t[1]=oc(t[1]),t[2]=oc(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(" ")})`)},Qp=(...e)=>{e=Ie(e,"lch");const[t,n,r,...o]=e,[s,i,a]=$p(t,n,r),[l,u,c]=Ju(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},lr=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,Nn=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Ya=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,un=/\s*/.source,ns=/\s+/.source,sc=/\s*,\s*/.source,Ga=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,rs=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,em=new RegExp("^rgba?\\("+un+[lr,lr,lr].join(ns)+rs+"\\)$"),tm=new RegExp("^rgb\\("+un+[lr,lr,lr].join(sc)+un+"\\)$"),nm=new RegExp("^rgba\\("+un+[lr,lr,lr,Nn].join(sc)+un+"\\)$"),rm=new RegExp("^hsla?\\("+un+[Ga,Ya,Ya].join(ns)+rs+"\\)$"),om=new RegExp("^hsl?\\("+un+[Ga,Ya,Ya].join(sc)+un+"\\)$"),sm=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,im=new RegExp("^lab\\("+un+[Nn,Nn,Nn].join(ns)+rs+"\\)$"),am=new RegExp("^lch\\("+un+[Nn,Nn,Ga].join(ns)+rs+"\\)$"),lm=new RegExp("^oklab\\("+un+[Nn,Nn,Nn].join(ns)+rs+"\\)$"),um=new RegExp("^oklch\\("+un+[Nn,Nn,Ga].join(ns)+rs+"\\)$"),{round:cm}=Math,os=e=>e.map((t,n)=>n<=2?vo(cm(t),0,255):t),bt=(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),Ft=(e,t)=>e==="none"?t:e,ic=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(em))||(t=e.match(tm))){let n=t.slice(1,4);for(let o=0;o<3;o++)n[o]=+bt(Ft(n[o],0),0,255);n=os(n);const r=t[4]!==void 0?+bt(t[4],0,1):1;return n[3]=r,n}if(t=e.match(nm)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+bt(n[r],0,255);return n}if((t=e.match(rm))||(t=e.match(om))){const n=t.slice(1,4);n[0]=+Ft(n[0].replace("deg",""),0),n[1]=+bt(Ft(n[1],0),0,100)*.01,n[2]=+bt(Ft(n[2],0),0,100)*.01;const r=os(Xu(n)),o=t[4]!==void 0?+bt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(sm)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Xu(n);for(let o=0;o<3;o++)r[o]=cm(r[o]);return r[3]=+t[4],r}if(t=e.match(im)){const n=t.slice(1,4);n[0]=bt(Ft(n[0],0),0,100),n[1]=bt(Ft(n[1],0),-125,125,!0),n[2]=bt(Ft(n[2],0),-125,125,!0);const r=_i();ir("d50");const o=os(zu(n));ir(r);const s=t[4]!==void 0?+bt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(am)){const n=t.slice(1,4);n[0]=bt(n[0],0,100),n[1]=bt(Ft(n[1],0),0,150,!1),n[2]=+Ft(n[2].replace("deg",""),0);const r=_i();ir("d50");const o=os(Yu(n));ir(r);const s=t[4]!==void 0?+bt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(lm)){const n=t.slice(1,4);n[0]=bt(Ft(n[0],0),0,1),n[1]=bt(Ft(n[1],0),-.4,.4,!0),n[2]=bt(Ft(n[2],0),-.4,.4,!0);const r=os(Ju(n)),o=t[4]!==void 0?+bt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(um)){const n=t.slice(1,4);n[0]=bt(Ft(n[0],0),0,1),n[1]=bt(Ft(n[1],0),0,.4,!1),n[2]=+Ft(n[2].replace("deg",""),0);const r=os(Qp(n)),o=t[4]!==void 0?+bt(t[4],0,1):1;return r[3]=o,r}};ic.test=e=>em.test(e)||rm.test(e)||im.test(e)||am.test(e)||lm.test(e)||um.test(e)||tm.test(e)||nm.test(e)||om.test(e)||sm.test(e)||e==="transparent",Q.prototype.css=function(e){return W2(this._rgb,e)};const Z2=(...e)=>new Q(...e,"css");Ve.css=Z2,Te.format.css=ic,Te.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&je(e)==="string"&&ic.test(e))return"css"}}),Te.format.gl=(...e)=>{const t=Ie(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const Y2=(...e)=>new Q(...e,"gl");Ve.gl=Y2,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 Np(this._rgb,e)};const G2=(...e)=>new Q(...e,"hex");Ve.hex=G2,Te.format.hex=Cp,Te.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&je(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:Ka}=Math,dm=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*Ka(r),o=t<20?0:-254.76935184120902+.8274096064007395*(o=t-10)+115.67994401066147*Ka(o)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*Ka(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*Ka(r),o=255),[n,r,o,1]},{round:K2}=Math,X2=(...e)=>{const t=Ie(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=dm(a);l[2]/l[0]>=r/n?s=a:o=a}return K2(a)};Q.prototype.temp=Q.prototype.kelvin=Q.prototype.temperature=function(){return X2(this._rgb)};const ac=(...e)=>new Q(...e,"temp");Object.assign(Ve,{temp:ac,kelvin:ac,temperature:ac}),Te.format.temp=Te.format.kelvin=Te.format.temperature=dm,Q.prototype.oklch=function(){return Jp(this._rgb)},Object.assign(Ve,{oklch:(...e)=>new Q(...e,"oklch")}),Te.format.oklch=Qp,Te.autodetect.push({p:2,test:(...e)=>{if(e=Ie(e,"oklch"),je(e)==="array"&&e.length===3)return"oklch"}}),Object.assign(Ve,{analyze:jp,average:t2,bezier:a2,blend:Cn,brewer:L2,Color:Q,colors:Xo,contrast:C2,contrastAPCA:T2,cubehelix:y2,deltaE:I2,distance:M2,input:Te,interpolate:Jo,limits:Up,mix:Jo,random:k2,scale:qa,scales:R2,valid:V2});const J2=[{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 Q2(e){const r=J2.filter(i=>i.reference).map(i=>({...i,shades:i.shades.map(a=>({...a,delta:Ve.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(Ve(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 eE(e){const t=Ve(e),n=Q2(t),r=t.get("hsl.h"),o=Ve(n.closestShade.hexcode).get("hsl.h"),s=r-o,i=s===0?o.toString():s>0?`+${s}`:s.toString(),a=t.get("hsl.s")/Ve(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=Ve(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 ss extends Error{constructor(){super(),this.name="IndiscriminateError"}}const tE={},nE={fill:"none",viewBox:"0 0 24 24"};function rE(e,t){return b(),x("svg",nE,t[0]||(t[0]=[j("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),j("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 nn=or(tE,[["render",rE],["__scopeId","data-v-687bcaf0"]]),oE={"aria-hidden":"true"},lc=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=me(ut),r=te(()=>t.success?t.successLabel??t.label:t.error?t.errorLabel??t.label:t.label),o=te(()=>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 b(),Z(Gl(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=v(n))==null?void 0:a.theme.corners,"data-background":(l=v(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:k(()=>[j("div",oE,[s.working?(b(),Z(nn,{key:0})):s.success?(b(),Z(v(k_),{key:1})):s.error?(b(),Z(v(C_),{key:2})):s.icon?(b(),Z(Gl(s.icon),{key:3})):se("",!0)]),A(" "+V(r.value),1)]),_:1},8,["type","disabled","data-success","data-error","data-working","data-variant","data-size","data-corners","data-background","data-icon-visible"])}}}),Qe=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=L(!1),r=L(!1),o=L(!1);async function s(){try{const i=t.handler();i instanceof Promise&&(n.value=!0,await i,n.value=!1,r.value=!0,await Yt(2500),t.noReset||(r.value=!1))}catch(i){if(n.value=!1,i instanceof ss)return;o.value=!0,await Yt(2500),o.value=!1}}return(i,a)=>(b(),Z(lc,{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"]))}}),sE={},iE={class:"moonbase:text-body"};function aE(e,t){return b(),x("span",iE,[Nt(e.$slots,"default")])}const ot=or(sE,[["render",aE]]),lE={},uE={class:"moonbase:text-subtext"};function cE(e,t){return b(),x("span",uE,[Nt(e.$slots,"default")])}const Me=or(lE,[["render",cE]]),dE={class:"moonbase:about"},fE=pe({__name:"About",setup(e){const t=De(),n="0.4.56";return(r,o)=>(b(),x("div",dE,[o[2]||(o[2]=Jf('<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)),E(v(pp),{as:"h3"},{default:k(()=>o[0]||(o[0]=[A(" Moonbase Embedded Storefront ")])),_:1,__:[0]}),E(Me,null,{default:k(()=>[A(" Version "+V(v(n)),1)]),_:1}),E(ot,null,{default:k(()=>o[1]||(o[1]=[A(" This store is using the "),j("a",{href:"https://moonbase.sh/solutions/payments",target:"_blank"},"Moonbase Embedded Storefront",-1),A(" module to accept payments, provide authentication and power software licensing. ")])),_:1,__:[1]}),E(Qe,{label:"Close",variant:"primary",handler:()=>v(t).reset()},null,8,["handler"])]))}});var zt=(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))(zt||{});const hE=["data-corners","data-variant"],pE={class:"moonbase:card-content"},cn=pe({__name:"MoonCard",setup(e){const t=me(ut);return(n,r)=>{var o,s;return b(),x("div",{class:"moonbase:card","data-corners":(o=v(t))==null?void 0:o.theme.corners,"data-variant":(s=v(t))==null?void 0:s.theme.cards},[j("div",pE,[Nt(n.$slots,"default")]),Nt(n.$slots,"addon")],8,hE)}}}),mE=["data-corners"],bE=["href"],gE=["src"],vE=["src"],yE={key:2,class:"moonbase:image-placeholder"},Ht=pe({__name:"ProductIcon",props:{url:{},href:{},size:{}},setup(e){const t=me(ut);return(n,r)=>{var o;return b(),x("div",{class:"moonbase:product-icon",style:Ds({width:`${n.size}px`,height:`${n.size}px`}),"data-corners":(o=v(t))==null?void 0:o.theme.corners},[n.href&&n.url?(b(),x("a",{key:0,href:n.href},[j("img",{src:n.url,alt:""},null,8,gE)],8,bE)):n.url?(b(),x("img",{key:1,src:n.url,alt:""},null,8,vE)):(b(),x("div",yE,[E(v(x_))]))],12,mE)}}}),_E={},wE={class:"moonbase:text-title"};function EE(e,t){return b(),x("h4",wE,[Nt(e.$slots,"default")])}const is=or(_E,[["render",EE]]),kE={class:"moonbase:product-card-content"},fm=pe({__name:"ProductCard",props:{product:{}},setup(e){return(t,n)=>(b(),Z(cn,{class:"moonbase:product-card"},{default:k(()=>[E(Ht,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",kE,[E(is,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.name),1)]}),_:1}),E(Me,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.tagline),1)]}),_:1}),Nt(t.$slots,"description")]),Nt(t.$slots,"default")]),_:3}))}}),xE={class:"moonbase:auto-activation"},OE={key:0,class:"moonbase:loader"},SE={key:1,class:"moonbase:loader"},CE={key:2,class:"moonbase:loader"},NE={key:3},PE={key:1,class:"moonbase:loader"},TE={key:2,class:"moonbase:loader"},$E={key:3,class:"moonbase:loader"},AE={key:4,class:"moonbase:auto-activation-content"},DE={key:0,class:"moonbase:auto-activation-option"},IE={class:"moonbase:auto-activation-cta"},ME={key:1,class:"moonbase:auto-activation-option"},VE={class:"moonbase:auto-activation-cta"},RE={key:2,class:"moonbase:auto-activation-option"},LE={key:3,class:"moonbase:auto-activation-option"},jE={class:"moonbase:auto-activation-cta"},UE={key:4,class:"moonbase:auto-activation-option"},BE={key:4,class:"moonbase:auto-activation-cta"},FE={key:5,class:"moonbase:auto-activation-cta"},zE=pe({__name:"AutoActivation",setup(e){const t=De(),{user:n,loaded:r}=nt(),o=me(jr),s=t.getParameter("token"),{activationRequest:i,loading:a,fulfilling:l,completing:u,error:c,fulfillLicense:d,fulfillTrial:f}=Ry(s),h=me(Ut);Xe(i,y=>{var P;!l.value&&!u.value&&(y==null?void 0:y.status)===mn.Requested&&((P=y==null?void 0:y.licenseEligibility)!=null&&P.eligible)&&d(),(y==null?void 0:y.status)===mn.Completed&&(o==null||o(zt.ActivatedProduct,{product:y.product,fulfillmentType:y.fulfillmentType,user:n.value}))},{deep:!0});const p=te(()=>{if(i.value)return v(li(i.value.product.id))}),g=te(()=>p.value&&p.value.defaultVariation),{currency:_,addToCart:S,setQuantity:R}=nr();function H(){t.show(ue.Product,J.ViewProduct,{product_id:i.value.product.id})}function z(){t.enqueue(ue.Activation,J.ActivateProduct,t.parameters??void 0),t.show(ue.Authentication,J.SignIn)}function B(){if(!p.value)return;const y=S(p.value);R(y,1),t.enqueue(ue.Activation,J.ActivateProduct,t.parameters),t.show(ue.Cart,J.ViewCart)}function I(){var y;t.enqueue(ue.Activation,J.ActivateProduct,{...t.parameters,product_id:((y=i.value)==null?void 0:y.product.id)??""}),n.value?t.show(ue.Customer,J.RedeemVoucher):t.show(ue.Redeem,J.RedeemVoucher)}return(y,P)=>{var D,$,T,M,ie,Se,N;return b(),x("div",xE,[v(a)||!v(r)||!((D=v(h))!=null&&D.loadedStorefront)?(b(),x("div",OE,[E(nn)])):v(c)?(b(),x("div",SE,[E(rt,null,{default:k(()=>P[0]||(P[0]=[A(" Uh oh ")])),_:1,__:[0]}),E(ot,null,{default:k(()=>[A(V(v(c)),1)]),_:1})])):v(i)?(b(),x("div",NE,[v(i).product?(b(),Z(fm,{key:0,product:v(i).product},null,8,["product"])):se("",!0),(($=v(i))==null?void 0:$.status)===v(mn).Cancelled?(b(),x("div",PE,[E(rt,null,{default:k(()=>P[3]||(P[3]=[A(" Uh oh ")])),_:1,__:[3]}),E(ot,null,{default:k(()=>P[4]||(P[4]=[A(" This activation request was cancelled, open your app to try again. ")])),_:1,__:[4]})])):v(l)||v(u)?(b(),x("div",TE,[E(nn),E(ot,null,{default:k(()=>[A(" Activating "+V(v(i).product.name)+"... ",1)]),_:1})])):((T=v(i))==null?void 0:T.status)===v(mn).Completed?(b(),x("div",$E,[E(rt,null,{default:k(()=>P[5]||(P[5]=[A(" Done! ")])),_:1,__:[5]}),E(ot,null,{default:k(()=>P[6]||(P[6]=[A(" Your product is activated. "),j("br",null,null,-1),A(" You may close this window and return to the app. ")])),_:1,__:[6]})])):(b(),x("div",AE,[g.value?(b(),x("div",DE,[E(rt,null,{default:k(()=>P[7]||(P[7]=[A(" Option 1: Purchase product ")])),_:1,__:[7]}),E(ot,null,{default:k(()=>[A(" Buy a copy of "+V(p.value.name)+" for ",1),j("strong",null,V(v(Bt)(p.value.defaultVariation.price[v(_)],v(_))),1),P[8]||(P[8]=A(". "))]),_:1,__:[8]}),j("span",IE,[E(Qe,{label:"Purchase",variant:"primary",handler:()=>B()},null,8,["handler"])])])):se("",!0),v(n)?!v(n).ownedProducts||!((M=v(n).ownedProducts)!=null&&M.includes(v(i).product.id))&&!v(n).subscribedProducts||!((ie=v(n).subscribedProducts)!=null&&ie.includes(v(i).product.id))?(b(),x("div",RE,[E(rt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(ot,null,{default:k(()=>P[10]||(P[10]=[A(" You don't own any licenses for this product. ")])),_:1,__:[10]})])):(Se=v(n).ownedProducts)!=null&&Se.includes(v(i).product.id)||(N=v(n).subscribedProducts)!=null&&N.includes(v(i).product.id)?(b(),x("div",LE,[E(rt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(ot,null,{default:k(()=>P[11]||(P[11]=[A(" You don't have enough free seats on your licenses to activate this device. Either free up a seat or purchase additional licenses. ")])),_:1,__:[11]}),j("span",jE,[E(Qe,{label:"Licenses",variant:"secondary",handler:()=>H()},null,8,["handler"])])])):se("",!0):(b(),x("div",ME,[E(rt,null,{default:k(()=>[A(" Option "+V(g.value?"2":"1")+": Use license ",1)]),_:1}),E(ot,null,{default:k(()=>P[9]||(P[9]=[A(" Please sign in to use a license for this product. ")])),_:1,__:[9]}),j("span",VE,[E(Qe,{label:"Sign in",variant:"secondary",handler:()=>z()},null,8,["handler"])])])),v(i).trialEligibility?(b(),x("div",UE,[E(rt,null,{default:k(()=>[A(" Option "+V(g.value?"3":"2")+": Start trial ",1)]),_:1}),v(i).trialEligibility.eligible&&v(i).trialEligibility.requiresAccount&&!v(n)?(b(),Z(ot,{key:0},{default:k(()=>P[12]||(P[12]=[A(" You need to be signed in to start a trial for this product. ")])),_:1,__:[12]})):v(i).trialEligibility.eligible&&v(i).trialEligibility.existing?(b(),Z(ot,{key:1},{default:k(()=>[A(" You are eligible for a "+V(v(i).trialEligibility.numberOfDaysPerProduct)+" day trial of which you have "+V(v(i).trialEligibility.numberOfDaysRemaining)+" days remaining. ",1)]),_:1})):v(i).trialEligibility.eligible?(b(),Z(ot,{key:2},{default:k(()=>[A(" You are eligible for a "+V(v(i).trialEligibility.numberOfDaysPerProduct)+" day trial. ",1)]),_:1})):(b(),Z(ot,{key:3},{default:k(()=>P[13]||(P[13]=[A(" This device or product is not eligible for a trial. ")])),_:1,__:[13]})),v(i).trialEligibility.eligible&&v(i).trialEligibility.requiresAccount&&!v(n)?(b(),x("span",BE,[E(Qe,{label:"Sign in",variant:"secondary",handler:()=>z()},null,8,["handler"])])):v(i).trialEligibility.eligible?(b(),x("span",FE,[E(Qe,{label:"Start trial",variant:"secondary",handler:v(f)},null,8,["handler"])])):se("",!0)])):se("",!0),P[15]||(P[15]=j("div",{class:"moonbase:grow"},null,-1)),E(Me,{class:"moonbase:auto-activation-redeem"},{default:k(()=>[P[14]||(P[14]=A(" Have a voucher code? ")),j("button",{type:"button",onClick:I}," Redeem now ")]),_:1,__:[14]})]))])):(b(),x("div",CE,[E(rt,null,{default:k(()=>P[1]||(P[1]=[A(" Uh oh ")])),_:1,__:[1]}),E(ot,null,{default:k(()=>P[2]||(P[2]=[A(" Could not find activation request ")])),_:1,__:[2]})]))])}}}),HE={},qE={class:"moonbase:text-caption"};function WE(e,t){return b(),x("span",qE,[Nt(e.$slots,"default")])}const qt=or(HE,[["render",WE]]),ZE=["data-corners"],YE=["accept"],GE={"data-error":""},KE=pe({__name:"DeviceTokenInput",props:{error:{}},emits:["input","error"],setup(e,{emit:t}){const n=t,r=me(ut),o=L(!1),s=te(()=>{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 b(),x("div",{class:Is(["moonbase:device-token-input",{"moonbase:device-token-input--hovering":o.value}]),"data-corners":(d=v(r))==null?void 0:d.theme.corners,onDrag:c[0]||(c[0]=Ar(()=>{},["prevent","stop"])),onDragstart:c[1]||(c[1]=Ar(()=>{},["prevent","stop"])),onDragend:c[2]||(c[2]=Ar(h=>o.value=!1,["prevent","stop"])),onDragover:c[3]||(c[3]=Ar(h=>o.value=!0,["prevent","stop"])),onDragenter:c[4]||(c[4]=Ar(h=>o.value=!0,["prevent","stop"])),onDragleave:c[5]||(c[5]=Ar(h=>o.value=!1,["prevent","stop"])),onDrop:Ar(a,["prevent","stop"])},[E(v(S_)),c[6]||(c[6]=j("label",{for:"fallback-input"},[j("span",{class:"moonbase:underline"},"Choose a machine file"),A(" or drag here to upload ")],-1)),j("input",{id:"fallback-input",type:"file",accept:s.value,class:"moonbase:sr-only",onChange:l},null,40,YE),j("p",GE,V((f=u.error)==null?void 0:f.message),1)],42,ZE)}}}),XE={class:"moonbase:manual-activation"},JE={key:1,class:"moonbase:loader"},QE={key:2,class:"moonbase:manual-activation-content"},e5=pe({__name:"ManualActivation",setup(e){const t=me(ut),{activateProduct:n}=lo(),r=Fi.Offline,o=L(0),s=L(null),i=L(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)=>(b(),x("div",XE,[E(ot,null,{default:k(()=>u[2]||(u[2]=[A(" 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,__:[2]}),E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[o.value===0?(b(),Z(KE,{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?(b(),x("div",JE,[E(nn)])):o.value===2&&i.value?(b(),x("div",QE,[E(rt,null,{default:k(()=>u[3]||(u[3]=[A(" Success! ")])),_:1,__:[3]}),E(ot,null,{default:k(()=>u[4]||(u[4]=[A(" Your license can be downloaded below: ")])),_:1,__:[4]}),i.value.license.product?(b(),Z(fm,{key:0,product:i.value.license.product},{description:k(()=>[E(qt,null,{default:k(()=>[A(V(i.value.license.activeNumberOfActivations)+" of "+V(i.value.license.maxNumberOfActivations)+" devices activated ",1)]),_:1})]),default:k(()=>{var c;return[E(Yo,{href:i.value.url,target:"_blank",download:((c=v(t))==null?void 0:c.activation.licenseTokenFileName)??"license-file.mb",class:"moonbase:manual-activation-download-button"},{default:k(()=>[E(v(O_))]),_:1},8,["href","download"])]}),_:1},8,["product"])):se("",!0),u[5]||(u[5]=j("div",null,null,-1)),u[6]||(u[6]=j("div",null,null,-1))])):se("",!0)]),_:1})]))}}),t5={class:"moonbase:activation"},n5=pe({__name:"Activation",setup(e){const t=De();return(n,r)=>(b(),x("div",t5,[v(t).getParameter("token")?(b(),Z(zE,{key:0})):(b(),Z(e5,{key:1}))]))}}),r5=["disabled"],hm=Symbol("form-state"),ur=pe({__name:"MoonForm",props:{handler:{type:Function},disabled:{type:Boolean},noReset:{type:Boolean}},setup(e){const t=e,n=L(!1),r=L(!1),o=L(!1),s=te(()=>t.disabled||n.value||r.value||!1);Zt(hm,{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 Yt(2500),t.noReset||(r.value=!1)}catch{n.value=!1,o.value=!0,await Yt(2500),o.value=!1}}return(a,l)=>(b(),x("form",{disabled:s.value,onSubmit:Ar(i,["prevent"])},[Nt(a.$slots,"default",{working:n.value,isSuccess:r.value,isError:o.value,disabled:n.value||r.value})],40,r5))}}),o5=["hidden"],s5=["for"],i5=["id","type","name","placeholder","value","disabled","aria-invalid","aria-describedby","data-corners"],a5=["id"],l5=["id"],At=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=me(ut);return(n,r)=>{var o;return b(),x("div",{class:"moonbase:input",hidden:n.hidden||void 0},[j("label",{for:`mb-${n.name}`},V(n.label),9,s5),j("input",cu({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=v(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,i5),n.error?(b(),x("p",{key:0,id:`mb-${n.name}-error`,class:"moonbase:input-hint","data-type":"error"},V(n.error),9,a5)):n.hint?(b(),x("p",{key:1,id:`mb-${n.name}-hint`,class:"moonbase:input-hint"},V(n.hint),9,l5)):se("",!0)],8,o5)}}}),cr=pe({__name:"MoonSubmitButton",props:{label:{},success:{},error:{},variant:{},size:{}},setup(e){const{working:t,isSuccess:n,isError:r,disabled:o}=me(hm);return(s,i)=>(b(),Z(lc,{label:s.label,working:v(t),"success-label":s.success,success:v(n),"error-label":s.error,error:v(r),type:"submit",disabled:v(o),variant:s.variant,size:s.size},null,8,["label","working","success-label","success","error-label","error","disabled","variant","size"]))}}),u5=["data-visible"],c5={class:"moonbase:sign-in-actions"},d5=["data-corners"],f5=pe({__name:"SignIn",emits:["signedIn"],setup(e,{emit:t}){const n=t,r=De(),o=nt(),s=me(ut),i=me(jr),a=L(r.getParameter("email")??""),l=L(""),u=L(null);async function c(){u.value=null;try{const d=await o.signIn(a.value,l.value);i==null||i(zt.SignedIn,{user:d}),Yt(1500).then(()=>n("signedIn",d))}catch(d){throw d instanceof _r?u.value="User not found":u.value=d.message,d}}return(d,f)=>(b(),Z(ur,{handler:c,class:"moonbase:sign-in"},{default:k(()=>{var h,p,g;return[E(At,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=_=>a.value=_),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),E(At,{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=_=>l.value=_),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},V(u.value),9,u5),E(cr,{success:"Signed in",label:"Sign in",error:"Error"}),j("div",c5,[(h=v(s))!=null&&h.auth.signUp.enabled?(b(),Z(Qe,{key:0,label:"Create account",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).SignUp,{email:a.value})},null,8,["handler"])):se("",!0),E(Qe,{label:"Forgot password",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).ForgotPassword,{email:a.value})},null,8,["handler"])]),(p=v(s))!=null&&p.auth.signIn.hint?(b(),x("div",{key:0,class:"moonbase:sign-in-hint","data-corners":(g=v(s))==null?void 0:g.theme.corners},[E(v(N_)),E(Me,null,{default:k(()=>[A(V(v(s).auth.signIn.hint),1)]),_:1})],8,d5)):se("",!0)]}),_:1}))}}),uc={default:[{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)}],lax:[{title:"Password must be at least 6 characters long",test:e=>e.length>=6}]},h5={key:0,class:"moonbase:loader"},p5={key:1,class:"moonbase:error","data-visible":""},m5={key:0,class:"moonbase:password-validation"},b5=["data-visible"],g5=pe({__name:"ConfirmAccount",emits:["confirmedAccount"],setup(e,{emit:t}){const n=t,r=De(),o=nt(),s=me(ut),i=L(!0),a=L(null),l=L(""),u=L(!1),c=L(null),d=te(()=>uc[(s==null?void 0:s.value.auth.passwords)??"default"]),f=te(()=>d.value.some(p=>!p.test(l.value)));ze(async()=>{try{const p=r.getParameter("email"),g=r.getParameter("code");if(!p||!g)throw new Error("Link is broken");a.value=await o.confirmAccount(p,g)}catch(p){p instanceof _r?c.value="Could not find a user to confirm":c.value=p.message}i.value=!1});async function h(){var p,g;if(c.value=null,!!((p=a.value)!=null&&p.resetPasswordToken))try{const _=r.getParameter("email");await o.resetPassword(_,l.value,(g=a.value)==null?void 0:g.resetPasswordToken);const S=await o.signIn(_,l.value);Yt(1500).then(()=>n("confirmedAccount",S))}catch(_){throw c.value=_.message,_}}return(p,g)=>(b(),Z(ur,{handler:h,disabled:f.value,class:"moonbase:confirm-account"},{default:k(()=>[i.value?(b(),x("div",h5,[E(nn)])):a.value?(b(),x(ye,{key:2},[j("h3",null," Hi "+V(a.value.name)+", ",1),g[2]||(g[2]=j("p",null," Please create a new password for your account: ",-1)),E(At,{"model-value":v(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),E(At,{modelValue:l.value,"onUpdate:modelValue":g[0]||(g[0]=_=>l.value=_),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:g[1]||(g[1]=_=>u.value=!0)},null,8,["modelValue"]),u.value&&f.value?(b(),x("div",m5,[(b(!0),x(ye,null,ft(d.value.filter(_=>!_.test(l.value)),_=>(b(),Z(Me,{key:_.title,"data-error":""},{default:k(()=>[A(V(_.title),1)]),_:2},1024))),128))])):se("",!0),E(cr,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!c.value||void 0},V(c.value),9,b5)],64)):(b(),x("div",p5,V(c.value),1))]),_:1},8,["disabled"]))}}),v5={class:"moonbase:confirm-email-change"},y5={key:0,class:"moonbase:loader"},_5={key:1,class:"moonbase:error","data-visible":""},w5=pe({__name:"ConfirmEmail",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=De(),{user:o,confirmEmail:s}=nt(),i=L(!0),a=L(null);return ze(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Yt(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>(b(),x("div",v5,[i.value?(b(),x("div",y5,[E(nn)])):a.value?(b(),x("div",_5,V(a.value),1)):(b(),x(ye,{key:2},[E(rt,null,{default:k(()=>u[0]||(u[0]=[A(" Success! ")])),_:1,__:[0]}),u[1]||(u[1]=j("p",null," Thanks for confirming your new email. ",-1)),v(o)?(b(),Z(Qe,{key:0,handler:()=>v(r).show(v(ue).Customer,v(J).ViewAccount,void 0,!0),label:"Continue"},null,8,["handler"])):se("",!0)],64))]))}}),E5={class:"moonbase:confirm-email-change"},k5={key:0,class:"moonbase:loader"},x5={key:1,class:"moonbase:error","data-visible":""},O5=pe({__name:"ConfirmEmailChange",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=De(),{user:o,confirmEmailChange:s}=nt(),i=L(!0),a=L(null);return ze(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Yt(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>{var c;return b(),x("div",E5,[i.value?(b(),x("div",k5,[E(nn)])):a.value?(b(),x("div",x5,V(a.value),1)):(b(),x(ye,{key:2},[j("h3",null," Hi "+V((c=v(o))==null?void 0:c.name)+", ",1),u[0]||(u[0]=j("p",null," Thanks for confirming your new email. You can now sign in using this new address. ",-1))],64))])}}}),S5=["data-visible"],C5=pe({__name:"ForgotPassword",setup(e){const t=De(),n=nt(),r=L(t.getParameter("email")??""),o=L(null),s=L(!1);async function i(){o.value=null;try{await n.forgotPassword(r.value),Yt(1500).then(()=>{s.value=!0})}catch(a){throw a instanceof _r?o.value="User not found":o.value=a.message,a}}return(a,l)=>(b(),Z(ur,{handler:i,class:"moonbase:sign-in","no-reset":""},{default:k(({disabled:u})=>[l[1]||(l[1]=j("p",null," Please enter your email address below. You will receive an email message with instructions on how to reset your password. ",-1)),E(At,{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"]),E(cr,{success:"Email sent",label:"Reset password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},V(o.value),9,S5)]),_:1,__:[1]}))}}),N5={key:0,class:"moonbase:password-validation"},P5=["data-visible"],T5=pe({__name:"ResetPassword",emits:["passwordReset"],setup(e,{emit:t}){const n=t,r=De(),o=nt(),s=me(ut),i=te(()=>r.getParameter("email")),a=L(""),l=L(!1),u=L(null),c=te(()=>uc[(s==null?void 0:s.value.auth.passwords)??"default"]),d=te(()=>c.value.some(h=>!h.test(a.value)));ze(()=>{(!r.getParameter("email")||!r.getParameter("code"))&&(u.value="Link broken, please try again")});async function f(){u.value=null;const h=r.getParameter("code");if(h)try{await o.resetPassword(i.value,a.value,h);const p=await o.signIn(i.value,a.value);Yt(1500).then(()=>n("passwordReset",p))}catch(p){throw u.value=p.message,p}}return(h,p)=>(b(),Z(ur,{handler:f,disabled:d.value,class:"moonbase:reset-password"},{default:k(()=>[j("h3",null," Hi "+V(i.value)+", ",1),p[2]||(p[2]=j("p",null," Please create a new password for your account: ",-1)),E(At,{"model-value":v(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),E(At,{modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=g=>a.value=g),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:p[1]||(p[1]=g=>l.value=!0)},null,8,["modelValue"]),l.value&&d.value?(b(),x("div",N5,[(b(!0),x(ye,null,ft(c.value.filter(g=>!g.test(a.value)),g=>(b(),Z(Me,{key:g.title,"data-error":""},{default:k(()=>[A(V(g.title),1)]),_:2},1024))),128))])):se("",!0),E(cr,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},V(u.value),9,P5)]),_:1,__:[2]},8,["disabled"]))}}),$5={class:"moonbase:checkbox"},A5={class:"moonbase:checkbox-container"},D5=["id","name","checked","disabled","aria-invalid","aria-describedby"],I5={class:"moonbase:checkbox-description"},M5=["for"],V5=["id"],R5=["id"],pm=pe({inheritAttrs:!1,__name:"MoonCheckbox",props:{name:{},label:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,n)=>(b(),x("div",$5,[j("div",A5,[j("input",cu({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,D5)]),j("div",I5,[j("label",{for:`mb-${t.name}`},V(t.label),9,M5),t.error?(b(),x("p",{key:0,id:`mb-${t.name}-error`,"data-type":"error"},V(t.error),9,V5)):t.hint?(b(),x("p",{key:1,id:`mb-${t.name}-hint`},V(t.hint),9,R5)):se("",!0)])]))}}),L5={key:0,class:"moonbase:password-validation"},j5=["href"],U5=["href"],B5=["data-visible"],F5=pe({__name:"SignUp",emits:["signedUp"],setup(e,{emit:t}){const n=t,r=De(),o=nt(),s=me(dc),i=me(jr),a=me(ut),l=L(""),u=L(r.getParameter("email")??""),c=L(""),d=L(!1),f=L(!1),h=L(null),p=te(()=>uc[(a==null?void 0:a.value.auth.passwords)??"default"]),g=te(()=>p.value.some(S=>!S.test(c.value)));async function _(){h.value=null;try{const S=await o.signUp(l.value,u.value,c.value,null,!0,!0,f.value);i==null||i(zt.SignedUp,{user:S}),Yt(1500).then(()=>n("signedUp",S))}catch(S){throw h.value=S.message,S}}return(S,R)=>(b(),Z(ur,{handler:_,disabled:g.value,class:"moonbase:sign-up"},{default:k(()=>[E(At,{modelValue:l.value,"onUpdate:modelValue":R[0]||(R[0]=H=>l.value=H),label:"Full name",name:"name",type:"text",placeholder:"Full name",autocomplete:"name",required:""},null,8,["modelValue"]),E(At,{modelValue:u.value,"onUpdate:modelValue":R[1]||(R[1]=H=>u.value=H),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),E(At,{modelValue:c.value,"onUpdate:modelValue":R[2]||(R[2]=H=>c.value=H),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:"",onBlur:R[3]||(R[3]=H=>d.value=!0)},null,8,["modelValue"]),d.value&&g.value?(b(),x("div",L5,[(b(!0),x(ye,null,ft(p.value.filter(H=>!H.test(c.value)),H=>(b(),Z(Me,{key:H.title,"data-error":""},{default:k(()=>[A(V(H.title),1)]),_:2},1024))),128))])):se("",!0),E(pm,{modelValue:f.value,"onUpdate:modelValue":R[4]||(R[4]=H=>f.value=H),label:"Receive updates and offers by email",name:"newsletter-opt-in"},null,8,["modelValue"]),E(Me,null,{default:k(()=>[R[5]||(R[5]=A(" By signing up, you accept our ")),j("a",{href:`${v(s)}/terms-of-use`,target:"_blank",rel:"noopener"},"terms",8,j5),R[6]||(R[6]=A(" and ")),j("a",{href:`${v(s)}/privacy-policy`,target:"_blank",rel:"noopener"},"privacy policy",8,U5),R[7]||(R[7]=A(". "))]),_:1,__:[5,6,7]}),E(cr,{success:"Signed up",label:"Sign up",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!h.value||void 0},V(h.value),9,B5),E(Qe,{label:"I already have an account",variant:"subtle",handler:()=>v(r).show(v(ue).Authentication,v(J).SignIn,{email:u.value})},null,8,["handler"])]),_:1},8,["disabled"]))}}),z5={class:"moonbase:authentication"},H5={key:0,class:"moonbase:loader"},q5=pe({__name:"Authentication",setup(e){const t=De(),{loaded:n}=nt();return(r,o)=>(b(),x("div",z5,[E(si,{name:v(t).direction===v(Su).Forward?"moonbase:slide-left":"moonbase:slide-right",mode:"out-in"},{default:k(()=>[v(n)?v(t).intent===v(J).SignIn?(b(),Z(f5,{key:1,onSignedIn:o[0]||(o[0]=s=>v(t).dequeue())})):v(t).intent===v(J).SignUp?(b(),Z(F5,{key:2,onSignedUp:o[1]||(o[1]=s=>v(t).next?v(t).dequeue():v(t).show(v(ue).Customer,v(J).ViewAccount,void 0,!0))})):v(t).intent===v(J).ConfirmAccount?(b(),Z(g5,{key:3,onConfirmedAccount:o[2]||(o[2]=s=>v(t).show(v(ue).Customer,v(J).ViewProducts,void 0,!0))})):v(t).intent===v(J).ConfirmEmail?(b(),Z(w5,{key:4})):v(t).intent===v(J).ConfirmEmailChange?(b(),Z(O5,{key:5})):v(t).intent===v(J).ForgotPassword?(b(),Z(C5,{key:6})):v(t).intent===v(J).ResetPassword?(b(),Z(T5,{key:7,onPasswordReset:o[3]||(o[3]=s=>v(t).show(v(ue).Customer,v(J).ViewAccount,void 0))})):se("",!0):(b(),x("div",H5,[E(nn)]))]),_:1},8,["name"])]))}}),W5={},Z5={class:"moonbase:text-subtext-bold"};function Y5(e,t){return b(),x("span",Z5,[Nt(e.$slots,"default")])}const it=or(W5,[["render",Y5]]);function Xa(){const e=me(Ut);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 G5=["data-corners","data-cards"],mm=pe({__name:"Counter",props:{modelValue:{}},emits:["update:modelValue"],setup(e){const t=me(ut);return(n,r)=>{var o,s;return b(),x("div",{class:"moonbase:counter","data-corners":(o=v(t))==null?void 0:o.theme.corners,"data-cards":(s=v(t))==null?void 0:s.theme.cards},[j("button",{onClick:r[0]||(r[0]=i=>n.$emit("update:modelValue",n.modelValue-1))},[E(v(P_))]),E(Me,null,{default:k(()=>[A(V(n.modelValue.toString().padStart(2,"0")),1)]),_:1}),j("button",{onClick:r[1]||(r[1]=i=>n.$emit("update:modelValue",n.modelValue+1))},[E(v(T_))])],8,G5)}}});function wi(e){switch(e){case vr.Daily:return"day";case vr.Weekly:return"week";case vr.Monthly:return"month";case vr.Quarterly:return"quarter";case vr.Yearly:return"year"}throw new Error("Unknown cycle length")}const K5={class:"moonbase:bundle-cart-item-content"},X5={key:0,class:"moonbase:bundle-cart-item-total"},J5={key:0,class:"moonbase:discount"},Q5={class:"moonbase:bundle-cart-item-summary"},ek=["data-open"],tk=["data-open"],nk={class:"moonbase:bundle-cart-item-product-list-item-content"},rk={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},ok=pe({__name:"BundleCartItem",props:{lineItem:{},currency:{}},setup(e){const n=Na(e.lineItem.bundleId),r=me(ut),o=nr(),s=L(!1),i=L(null);return Xe(s,a=>{i.value&&(i.value.style.height=a?`${i.value.scrollHeight}px`:"0px")}),(a,l)=>{var u;return b(),Z(cn,{class:"moonbase:bundle-cart-item"},ba({default:k(()=>{var c,d,f,h,p,g;return[E(Ht,{url:(c=a.lineItem.bundle)==null?void 0:c.iconUrl,size:72},null,8,["url"]),j("div",K5,[E(it,null,{default:k(()=>{var _;return[A(V((_=a.lineItem.bundle)==null?void 0:_.name),1)]}),_:1}),E(Me,{class:"moonbase:bundle-cart-item-tagline","data-truncate":a.lineItem.variation&&a.lineItem.variation.id!==((f=(d=v(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)||void 0},{default:k(()=>{var _;return[A(V((_=a.lineItem.bundle)==null?void 0:_.tagline),1)]}),_:1},8,["data-truncate"]),a.lineItem.variation&&a.lineItem.variation.id!==((p=(h=v(n))==null?void 0:h.defaultVariation)==null?void 0:p.id)?(b(),Z(Me,{key:0,class:"moonbase:bundle-cart-item-variation"},{default:k(()=>[A(V(a.lineItem.variation.name),1)]),_:1})):se("",!0)]),a.lineItem.variation?(b(),x("div",X5,[E(Go,null,{default:k(()=>{var _;return[a.lineItem.variation.hasDiscount?(b(),x("span",J5,V(v(Bt)(a.lineItem.variation.originalPrice[a.currency]*a.lineItem.quantity,a.currency)),1)):se("",!0),A(" "+V(v(Bt)(a.lineItem.variation.price[a.currency]*a.lineItem.quantity,a.currency))+" ",1),((_=a.lineItem.variation)==null?void 0:_.recurrence.type)==="Recurring"?(b(),Z(ot,{key:1},{default:k(()=>[A(" / "+V(v(wi)(a.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):se("",!0)]}),_:1}),((g=v(r))==null?void 0:g.cart.quantity)==="selectable"?(b(),Z(mm,{key:0,"model-value":a.lineItem.quantity,"onUpdate:modelValue":l[0]||(l[0]=_=>v(o).setQuantity(a.lineItem,_))},null,8,["model-value"])):(b(),Z(Qe,{key:1,label:"Remove",variant:"subtle-danger",size:"small",handler:()=>v(o).setQuantity(a.lineItem,0)},null,8,["handler"]))])):se("",!0)]}),_:2},[(u=v(r))!=null&&u.cart.bundles.showProducts?{name:"addon",fn:k(()=>{var c;return[j("div",Q5,[a.lineItem.bundle?(b(),x("button",{key:0,onClick:l[1]||(l[1]=d=>s.value=!s.value)},[E(it,null,{default:k(()=>{var d,f,h;return[A(V((d=a.lineItem.bundle)==null?void 0:d.products.filter(p=>p.included).length)+" ",1),(f=a.lineItem.bundle)!=null&&f.products.some(p=>!p.included)?(b(),x(ye,{key:0},[A(" of "+V((h=a.lineItem.bundle)==null?void 0:h.products.length),1)],64)):se("",!0),l[2]||(l[2]=A(" products "))]}),_:1,__:[2]}),E(Me,null,{default:k(()=>[A(V(s.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":s.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},l[3]||(l[3]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,ek))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:i,class:"moonbase:bundle-cart-item-product-list",style:{height:"0px"},"data-open":s.value||void 0},[(b(!0),x(ye,null,ft(((c=a.lineItem.bundle)==null?void 0:c.products)||[],d=>(b(),x("div",{key:d.id,class:"moonbase:bundle-cart-item-product-list-item"},[E(Ht,{url:d==null?void 0:d.iconUrl,size:48},null,8,["url"]),j("div",nk,[E(it,{"data-included":d.included||void 0},{default:k(()=>[d.included?(b(),x("svg",rk,l[4]||(l[4]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):se("",!0),A(" "+V(d==null?void 0:d.name),1)]),_:2},1032,["data-included"]),d.included?d!=null&&d.tagline?(b(),Z(Me,{key:1},{default:k(()=>[A(V(d.tagline),1)]),_:2},1024)):se("",!0):(b(),Z(Me,{key:0},{default:k(()=>l[5]||(l[5]=[A(" You already own this ")])),_:1,__:[5]}))])]))),128))],8,tk)]}),key:"0"}:void 0]),1024)}}}),sk={class:"moonbase:cart-offer-content"},ik=["href"],ak={class:"moonbase:cart-offer-cta"},lk={key:0,class:"moonbase:discount"},uk={class:"moonbase:cart-offer-bundle-summary"},ck=["data-open"],dk=["data-open"],fk={class:"moonbase:cart-offer-bundle-product-list-item-content"},hk={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},pk=["href"],mk=pe({__name:"OfferUpsell",props:{offer:{}},setup(e){const t=e,n=me(ut),{addToCart:r,currency:o}=nr(),s=L(!1),i=L(null);Xe(s,c=>{i.value&&(i.value.style.height=c?`${i.value.scrollHeight}px`:"0px")});const a=te(()=>{var c;return(c=t.offer.target.defaultVariation)==null?void 0:c.originalPrice}),l=te(()=>t.offer.target.defaultVariation?od.subtract(t.offer.target.defaultVariation.price,El.apply(t.offer.discount,t.offer.target.defaultVariation.price)):a.value),u=te(()=>!Kh(a.value,l.value));return(c,d)=>(b(),Z(cn,{class:"moonbase:cart-offer"},ba({default:k(()=>[E(Ht,{url:c.offer.target.iconUrl,href:c.offer.target.type==="Product"?c.offer.target.website:void 0,size:64},null,8,["url","href"]),j("div",sk,[E(it,{class:"moonbase:cart-offer-name"},{default:k(()=>[c.offer.target.type==="Product"&&c.offer.target.website?(b(),x("a",{key:0,href:c.offer.target.website},V(c.offer.discount.name),9,ik)):(b(),x(ye,{key:1},[A(V(c.offer.discount.name),1)],64))]),_:1}),c.offer.discount.description?(b(),Z(Me,{key:0,class:"moonbase:cart-offer-description"},{default:k(()=>[A(V(c.offer.discount.description),1)]),_:1})):se("",!0)]),j("div",ak,[l.value?(b(),Z(Go,{key:0},{default:k(()=>[u.value&&a.value?(b(),x("span",lk,V(v(Bt)(a.value[v(o)],v(o))),1)):se("",!0),A(" "+V(v(Bt)(l.value[v(o)],v(o))),1)]),_:1})):se("",!0),E(Qe,{label:"Add to cart",variant:"secondary",size:"small",handler:()=>{var f;return v(r)(c.offer.target,void 0,c.offer,{bundleBehaviour:(f=v(n))==null?void 0:f.cart.bundles.onAdd})}},null,8,["handler"])])]),_:2},[c.offer.target.type==="Bundle"?{name:"addon",fn:k(()=>{var f;return[j("div",uk,[c.offer.target?(b(),x("button",{key:0,onClick:d[0]||(d[0]=h=>s.value=!s.value)},[E(it,null,{default:k(()=>{var h,p,g;return[A(" Contains "+V((h=c.offer.target)==null?void 0:h.products.filter(_=>_.included).length)+" ",1),(p=c.offer.target)!=null&&p.products.some(_=>!_.included)?(b(),x(ye,{key:0},[A(" of "+V((g=c.offer.target)==null?void 0:g.products.length),1)],64)):se("",!0),d[1]||(d[1]=A(" products "))]}),_:1,__:[1]}),E(Me,null,{default:k(()=>[A(V(s.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":s.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},d[2]||(d[2]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,ck))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:i,class:"moonbase:cart-offer-bundle-product-list",style:{height:"0px"},"data-open":s.value||void 0},[(b(!0),x(ye,null,ft(((f=c.offer.target)==null?void 0:f.products)||[],h=>(b(),x("div",{key:h.id,class:"moonbase:cart-offer-bundle-product-list-item"},[E(Ht,{url:h.iconUrl,href:h.website,size:48},null,8,["url","href"]),j("div",fk,[E(it,{"data-included":h.included||void 0},{default:k(()=>[h.included?(b(),x("svg",hk,d[3]||(d[3]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):se("",!0),h.website?(b(),x("a",{key:1,href:h.website},V(h.name),9,pk)):(b(),x(ye,{key:2},[A(V(h.name),1)],64))]),_:2},1032,["data-included"]),h.included?h.tagline?(b(),Z(Me,{key:1},{default:k(()=>[A(V(h.tagline),1)]),_:2},1024)):se("",!0):(b(),Z(Me,{key:0},{default:k(()=>d[4]||(d[4]=[A(" You already own this ")])),_:1,__:[4]}))])]))),128))],8,dk)]}),key:"0"}:void 0]),1024))}}),bk={class:"moonbase:product-cart-item-content"},gk={class:"moonbase:product-cart-item-total"},vk={key:0,class:"moonbase:discount"},yk=pe({__name:"ProductCartItem",props:{lineItem:{},currency:{}},setup(e){const t=e,n=li(t.lineItem.productId),r=me(ut);function o(l){var c;if(!l.variation)throw new Error("No variation found");const u=i(l);return(u==null?void 0:u.price[t.currency])??((c=l.variation)==null?void 0:c.price[t.currency])}function s(l){return!!i(l)}function i(l){var c,d;const u=((d=(c=l.variation)==null?void 0:c.pricingTiers)==null?void 0:d.filter(f=>l.quantity>=f.minQuantity))??[];return u.length>0?u[u.length-1]:null}const a=nr();return(l,u)=>(b(),Z(cn,{class:"moonbase:product-cart-item"},{default:k(()=>{var c,d,f,h,p,g;return[E(Ht,{url:(c=l.lineItem.product)==null?void 0:c.iconUrl,size:72},null,8,["url"]),j("div",bk,[E(it,null,{default:k(()=>{var _;return[A(V((_=l.lineItem.product)==null?void 0:_.name),1)]}),_:1}),E(Me,{class:"moonbase:product-cart-item-tagline","data-truncate":l.lineItem.variation&&l.lineItem.variation.id!==((f=(d=v(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)||void 0},{default:k(()=>{var _;return[A(V((_=l.lineItem.product)==null?void 0:_.tagline),1)]}),_:1},8,["data-truncate"]),l.lineItem.variation&&l.lineItem.variation.id!==((p=(h=v(n))==null?void 0:h.defaultVariation)==null?void 0:p.id)?(b(),Z(Me,{key:0,class:"moonbase:product-cart-item-variation"},{default:k(()=>[A(V(l.lineItem.variation.name),1)]),_:1})):se("",!0)]),j("div",gk,[l.lineItem.variation?(b(),Z(Go,{key:0},{default:k(()=>{var _;return[l.lineItem.variation.hasDiscount||s(l.lineItem)?(b(),x("span",vk,V(v(Bt)(l.lineItem.variation.originalPrice[l.currency]*l.lineItem.quantity,l.currency)),1)):se("",!0),A(" "+V(v(Bt)(o(l.lineItem)*l.lineItem.quantity,l.currency))+" ",1),((_=l.lineItem.variation)==null?void 0:_.recurrence.type)==="Recurring"?(b(),Z(ot,{key:1},{default:k(()=>[A(" / "+V(v(wi)(l.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):se("",!0)]}),_:1})):se("",!0),((g=v(r))==null?void 0:g.cart.quantity)==="selectable"?(b(),Z(mm,{key:1,"model-value":l.lineItem.quantity,"onUpdate:modelValue":u[0]||(u[0]=_=>v(a).setQuantity(l.lineItem,_))},null,8,["model-value"])):(b(),Z(Qe,{key:2,label:"Remove",variant:"subtle-danger",size:"small",handler:()=>v(a).setQuantity(l.lineItem,0)},null,8,["handler"]))])]}),_:1}))}}),_k={class:"moonbase:cart"},wk=["data-background"],Ek=["data-corners"],kk={class:"moonbase:cart-total"},xk={"data-error":""},Ok=pe({__name:"Cart",setup(e){const t=Xa(),{items:n,total:r,currency:o,checkout:s}=nr(),i=me(ut),a=By(),l=te(()=>a.value.length===0?null:a.value.find(d=>!d.target.owned)||a.value[0]),u=L(null);async function c(){u.value=null;try{const d=await s({redirect:(i==null?void 0:i.value.checkout.redirect)??!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(!(d!=null&&d.completed))throw new ss}catch(d){if(u.value=d.message,!(d instanceof ss))if(d instanceof bn)t.reportProblem("error",{type:d.name,title:d.title,detail:d.detail,status:d.status,errors:d.errors?Object.fromEntries(Object.entries(d.errors).map(([f,h])=>[f,[h]])):void 0,instance:"Cart.vue:startCheckout"});else{const f=d;t.reportProblem("error",{type:f.name,title:f.message,instance:"Cart.vue:startCheckout"})}throw d}}return(d,f)=>{var h,p;return b(),x("div",_k,[v(n).length>0?(b(),x("ul",{key:0,role:"list",class:"moonbase:cart-items","data-background":(h=v(i))==null?void 0:h.theme.colors.background},[(b(!0),x(ye,null,ft(v(n),g=>(b(),x("li",{key:g.id},[g.type==="Product"?(b(),Z(yk,{key:0,"line-item":g,currency:v(o)},null,8,["line-item","currency"])):g.type==="Bundle"?(b(),Z(ok,{key:1,"line-item":g,currency:v(o)},null,8,["line-item","currency"])):se("",!0)]))),128)),l.value?(b(),x(ye,{key:0},[f[0]||(f[0]=j("li",{class:"moonbase:grow"},null,-1)),j("li",null,[E(it,null,{default:k(()=>{var g;return[A(V((g=v(i))==null?void 0:g.cart.offers.label),1)]}),_:1}),E(mk,{offer:l.value},null,8,["offer"])])],64)):se("",!0)],8,wk)):(b(),x("div",{key:1,class:"moonbase:cart-empty","data-corners":(p=v(i))==null?void 0:p.theme.corners},[E(v($_)),E(it,null,{default:k(()=>f[1]||(f[1]=[A(" Your cart is empty ")])),_:1,__:[1]})],8,Ek)),j("div",kk,[f[2]||(f[2]=j("label",null," Total ",-1)),j("span",null,V(v(Bt)(v(r).amount,v(r).currency)),1),f[3]||(f[3]=j("p",null," Sales tax to be calculated at checkout ",-1)),j("p",xk,V(u.value),1)]),E(Qe,{handler:c,disabled:v(n).length===0,label:"Checkout",error:u.value?"Error":"Cancelled",variant:"primary"},null,8,["disabled","error"])])}}}),Sk={class:"moonbase:account"},Ck={key:0,class:"moonbase:error"},Nk={key:1,class:"moonbase:notification"},Pk={key:0,class:"moonbase:error"},Tk=pe({__name:"Account",setup(e){var R,H,z;const t=De(),{user:n,update:r,setPassword:o,signOut:s}=nt(),i=me(jr),a=L(((R=n.value)==null?void 0:R.name)??""),l=L(((H=n.value)==null?void 0:H.email)??""),u=L(((z=n.value)==null?void 0:z.communicationPreferences)??{newsletterOptIn:!1}),c=L(null),d=L(!1),f=L(""),h=L(""),p=L(null);async function g(){c.value=null,d.value=!1;try{(await r(a.value,l.value,void 0,u.value)).needsEmailConfirmationToken&&(d.value=!0)}catch(B){throw c.value=B,B}}async function _(){p.value=null;try{await o(f.value,h.value),f.value="",h.value=""}catch(B){throw p.value=B,B}}async function S(){const B={...n.value};await s(),i==null||i(zt.SignedOut,{user:B}),t.reset()}return(B,I)=>(b(),x("div",Sk,[E(ur,{handler:g},{default:k(()=>[E(At,{modelValue:a.value,"onUpdate:modelValue":I[0]||(I[0]=y=>a.value=y),label:"Full name",name:"name",autocomplete:"name",required:""},null,8,["modelValue"]),E(At,{modelValue:l.value,"onUpdate:modelValue":I[1]||(I[1]=y=>l.value=y),label:"Email address",name:"email",type:"email",autocomplete:"email",required:""},null,8,["modelValue"]),E(pm,{modelValue:u.value.newsletterOptIn,"onUpdate:modelValue":I[2]||(I[2]=y=>u.value.newsletterOptIn=y),label:"Newsletter subscription",name:"newsletter-opt-in",hint:"Receive updates and offers by email"},null,8,["modelValue"]),E(cr,{label:"Update",error:"Error",success:"Updated"}),c.value?(b(),x("p",Ck,V(c.value.message),1)):d.value?(b(),x("p",Nk," You need to confirm your new email address, please check your inbox ")):se("",!0)]),_:1}),E(ur,{handler:_},{default:k(()=>[E(At,{modelValue:f.value,"onUpdate:modelValue":I[3]||(I[3]=y=>f.value=y),label:"Current password",name:"old-password",type:"password",autocomplete:"current-password",required:""},null,8,["modelValue"]),E(At,{modelValue:h.value,"onUpdate:modelValue":I[4]||(I[4]=y=>h.value=y),label:"New password",name:"new-password",type:"password",autocomplete:"new-password",required:""},null,8,["modelValue"]),E(cr,{label:"Change password",error:"Error",success:"Password changed"}),p.value?(b(),x("p",Pk,V(p.value.message),1)):se("",!0)]),_:1}),E(Qe,{label:"Log out",success:"Logged out",error:"Error",variant:"subtle",handler:S})]))}}),bm=e=>e.includes("."),$k={class:"moonbase:products"},Ak={key:0,class:"moonbase:loader"},Dk={key:1,class:"moonbase:loader"},Ik=["data-is-sub-product"],Mk={key:0,class:"moonbase:products-item-sub-product-icon"},Vk={class:"moonbase:products-item-content"},Rk=pe({__name:"Products",setup(e){const t=De(),{getProducts:n}=lo(),r=L(null);return ze(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)=>(b(),x("div",$k,[r.value?r.value.length===0?(b(),x("div",Dk," No products found ")):se("",!0):(b(),x("div",Ak,[E(nn),s[0]||(s[0]=A(" Loading products.. "))])),(b(!0),x(ye,null,ft(r.value||[],i=>(b(),x("div",{key:i.id,class:"moonbase:products-item","data-is-sub-product":v(bm)(i.id)||void 0},[v(bm)(i.id)?(b(),x("div",Mk,s[1]||(s[1]=[j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.49 12 3.75 3.75m0 0-3.75 3.75m3.75-3.75H3.74V4.499"})],-1)]))):se("",!0),E(Ht,{url:i.iconUrl,size:48},null,8,["url"]),j("div",Vk,[E(it,null,{default:k(()=>[A(V(i.name),1)]),_:2},1024),i.numberOfLicenses||i.subscriptionLicenses?(b(),Z(Me,{key:0},{default:k(()=>[A(V((i.numberOfLicenses??0)+(i.subscriptionLicenses??0))+" licenses ",1)]),_:2},1024)):se("",!0)]),j("div",null,[E(Yo,{variant:"subtle",onClick:a=>v(t).show(v(ue).Product,v(J).ViewProduct,{product_id:i.id})},{default:k(()=>[E(v(wp)),s[2]||(s[2]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2,__:[2]},1032,["onClick"])])],8,Ik))),128))]))}}),Lk={class:"moonbase:bundle-redemption-item-content"},jk={class:"moonbase:bundle-redemption-item-summary"},Uk=["data-open"],Bk=["data-open"],gm=pe({__name:"BundleRedemptionItem",props:{bundle:{},quantity:{}},setup(e){const t=L(!1),n=L(null);return Xe(t,r=>{n.value&&(n.value.style.height=r?`${n.value.scrollHeight}px`:"0px")}),(r,o)=>(b(),Z(cn,{class:"moonbase:bundle-redemption-item"},{addon:k(()=>{var s;return[j("div",jk,[r.bundle?(b(),x("button",{key:0,onClick:o[0]||(o[0]=i=>t.value=!t.value)},[E(it,null,{default:k(()=>{var i;return[A(V((i=r.bundle)==null?void 0:i.products.length)+" products ",1)]}),_:1}),E(Me,null,{default:k(()=>[A(V(t.value?"Hide":"Show")+" ",1),(b(),x("svg",{"data-open":t.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},o[1]||(o[1]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,Uk))]),_:1})])):se("",!0)]),j("div",{ref_key:"productListRef",ref:n,class:"moonbase:bundle-redemption-item-product-list",style:{height:"0px"},"data-open":t.value||void 0},[(b(!0),x(ye,null,ft(((s=r.bundle)==null?void 0:s.products)||[],i=>(b(),x("div",{key:i.id},[E(Ht,{url:i.iconUrl,size:48},null,8,["url"]),j("div",null,[E(it,null,{default:k(()=>[A(V(i.name),1)]),_:2},1024),i.tagline?(b(),Z(Me,{key:0},{default:k(()=>[A(V(i.tagline),1)]),_:2},1024)):se("",!0)])]))),128))],8,Bk)]}),default:k(()=>[E(Ht,{url:r.bundle.iconUrl,size:72},null,8,["url"]),j("div",Lk,[E(it,null,{default:k(()=>{var s;return[A(V((s=r.bundle)==null?void 0:s.name),1)]}),_:1}),E(Me,{class:"moonbase:bundle-redemption-item-tagline"},{default:k(()=>{var s;return[A(V((s=r.bundle)==null?void 0:s.tagline),1)]}),_:1})])]),_:1}))}}),Fk={class:"moonbase:product-redemption-item-content"},vm=pe({__name:"ProductRedemptionItem",props:{product:{},quantity:{}},setup(e){return(t,n)=>(b(),Z(cn,{class:"moonbase:product-redemption-item"},{default:k(()=>[E(Ht,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",Fk,[E(it,null,{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.name),1)]}),_:1}),E(Me,{class:"moonbase:product-redemption-item-tagline"},{default:k(()=>{var r;return[A(V((r=t.product)==null?void 0:r.tagline),1)]}),_:1})])]),_:1}))}}),zk={class:"moonbase:redeem"},Hk=["data-visible"],qk={key:1,class:"moonbase:redeem-voucher"},Wk={key:0,class:"moonbase:redeem-voucher-content"},Zk={key:1,class:"moonbase:redeem-voucher-return"},Yk=pe({__name:"Redeem",setup(e){const{redeem:t}=Ph(),n=De(),r=nt(),o=me(jr),s=L(null),i=L(null),a=L(n.getParameter("code")||"");async function l(){i.value=null;try{const u=await t(a.value);s.value=u,o==null||o(zt.RedeemedVoucher,{voucher:u,user:r.user.value})}catch(u){throw i.value=u,u}}return(u,c)=>(b(),x("div",zk,[E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[s.value?(b(),x("div",qk,[j("div",null,[E(is,null,{default:k(()=>[A(V(s.value.name),1)]),_:1}),s.value.description?(b(),Z(rt,{key:0},{default:k(()=>[A(' "'+V(s.value.description)+'" ',1)]),_:1})):se("",!0),E(Me,null,{default:k(()=>[E(v(E_)),c[2]||(c[2]=A(" Licenses have been added to your account. "))]),_:1,__:[2]}),E(Me,null,{default:k(()=>[c[3]||(c[3]=A(" Code: ")),j("strong",null,V(s.value.code),1)]),_:1,__:[3]})]),E(rt,null,{default:k(()=>c[4]||(c[4]=[A(" Voucher summary ")])),_:1,__:[4]}),s.value.redeemsProducts.length>0||s.value.redeemsBundles.length>0?(b(),x("div",Wk,[(b(!0),x(ye,null,ft(s.value.redeemsProducts,({value:d,quantity:f})=>(b(),Z(vm,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(b(!0),x(ye,null,ft(s.value.redeemsBundles,({value:d,quantity:f})=>(b(),Z(gm,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):se("",!0),v(n).next&&v(n).next[0]===v(ue).Activation&&(s.value.redeemsProducts.some(d=>{var f,h;return d.value.id===((h=(f=v(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=v(n).next)==null?void 0:h[2])==null?void 0:p.product_id)})))?(b(),x("div",Zk,[E(Qe,{label:"Return to activation",variant:"primary",icon:v(w_),handler:()=>v(n).dequeue()},null,8,["icon","handler"])])):se("",!0)])):(b(),Z(ur,{key:0,handler:l},{default:k(()=>{var d;return[E(ot,null,{default:k(()=>c[1]||(c[1]=[A(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),A(" Please enter the code below: ")])),_:1,__:[1]}),E(At,{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"]),E(cr,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!i.value||void 0},V((d=i.value)==null?void 0:d.message),9,Hk)]}),_:1}))]),_:1})]))}}),Gk=["data-status"],Kk=["data-fulfilled"],ym=pe({__name:"MilestoneProgressBar",props:{progress:{}},setup(e){return(t,n)=>(b(),x("div",{class:"moonbase:milestone-progress-bar",style:Ds({gridTemplateColumns:`repeat(${t.progress.toNormalizedCycleNumber-t.progress.fromNormalizedCycleNumber+1}, 1fr)`})},[(b(!0),x(ye,null,ft(Array(t.progress.toNormalizedCycleNumber-t.progress.fromNormalizedCycleNumber+1),(r,o)=>(b(),x("div",{key:o},[j("div",{"data-status":o+1<t.progress.currentNormalizedCycleNumber+(t.progress.currentCycleIsCompleted?1:0)?"done":o+1===t.progress.currentNormalizedCycleNumber+(t.progress.currentCycleIsCompleted?1:0)?"in-progress":"future"},null,8,Gk),t.progress.events[o+1]?(b(),x("span",{key:0,"data-fulfilled":t.progress.events[o+1].some(s=>s.fulfilled)||void 0},null,8,Kk)):se("",!0)]))),128))],4))}}),_m=6048e5,Xk=864e5,Ja=43200,wm=1440,Em=Symbol.for("constructDateFrom");function dr(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Em in e?e[Em](t):e instanceof Date?new e.constructor(t):new Date(t)}function wt(e,t){return dr(t||e,e)}let Jk={};function Ei(){return Jk}function ki(e,t){var a,l,u,c;const n=Ei(),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=wt(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 Qa(e,t){return ki(e,{...t,weekStartsOn:1})}function km(e,t){const n=wt(e,t==null?void 0:t.in),r=n.getFullYear(),o=dr(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Qa(o),i=dr(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Qa(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function el(e){const t=wt(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 tl(e,...t){const n=dr.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function xm(e,t){const n=wt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Qk(e,t,n){const[r,o]=tl(n==null?void 0:n.in,e,t),s=xm(r),i=xm(o),a=+s-el(s),l=+i-el(i);return Math.round((a-l)/Xk)}function ex(e,t){const n=km(e,t),r=dr(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Qa(r)}function nl(e,t){const n=+wt(e)-+wt(t);return n<0?-1:n>0?1:n}function tx(e){return dr(e,Date.now())}function nx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function rx(e){return!(!nx(e)&&typeof e!="number"||isNaN(+wt(e)))}function ox(e,t,n){const[r,o]=tl(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function sx(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function ix(e,t){return+wt(e)-+wt(t)}function ax(e,t){const n=wt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function lx(e,t){const n=wt(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 ux(e,t){const n=wt(e,t==null?void 0:t.in);return+ax(n,t)==+lx(n,t)}function cx(e,t,n){const[r,o,s]=tl(n==null?void 0:n.in,e,e,t),i=nl(o,s),a=Math.abs(ox(o,s));if(a<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-i*a);let l=nl(o,s)===-i;ux(r)&&a===1&&nl(r,s)===1&&(l=!1);const u=i*(a-+l);return u===0?0:u}function dx(e,t,n){const r=ix(e,t)/1e3;return sx(n==null?void 0:n.roundingMethod)(r)}function fx(e,t){const n=wt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const hx={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"}},px=(e,t,n)=>{let r;const o=hx[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 cc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const mx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vx={date:cc({formats:mx,defaultWidth:"full"}),time:cc({formats:bx,defaultWidth:"full"}),dateTime:cc({formats:gx,defaultWidth:"full"})},yx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_x=(e,t,n,r)=>yx[e];function xi(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 wx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ex={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},kx={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"]},xx={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"]},Ox={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"}},Sx={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"}},Cx={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:xi({values:wx,defaultWidth:"wide"}),quarter:xi({values:Ex,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xi({values:kx,defaultWidth:"wide"}),day:xi({values:xx,defaultWidth:"wide"}),dayPeriod:xi({values:Ox,defaultWidth:"wide",formattingValues:Sx,defaultFormattingWidth:"wide"})};function Oi(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)?Px(a,d=>d.test(i)):Nx(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 Nx(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Px(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Tx(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 $x=/^(\d+)(th|st|nd|rd)?/i,Ax=/\d+/i,Dx={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},Ix={any:[/^b/i,/^(a|c)/i]},Mx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vx={any:[/1/i,/2/i,/3/i,/4/i]},Rx={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},Lx={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]},jx={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},Ux={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]},Bx={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},Fx={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}},zx={ordinalNumber:Tx({matchPattern:$x,parsePattern:Ax,valueCallback:e=>parseInt(e,10)}),era:Oi({matchPatterns:Dx,defaultMatchWidth:"wide",parsePatterns:Ix,defaultParseWidth:"any"}),quarter:Oi({matchPatterns:Mx,defaultMatchWidth:"wide",parsePatterns:Vx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Oi({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Lx,defaultParseWidth:"any"}),day:Oi({matchPatterns:jx,defaultMatchWidth:"wide",parsePatterns:Ux,defaultParseWidth:"any"}),dayPeriod:Oi({matchPatterns:Bx,defaultMatchWidth:"any",parsePatterns:Fx,defaultParseWidth:"any"})},Om={code:"en-US",formatDistance:px,formatLong:vx,formatRelative:_x,localize:Cx,match:zx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Hx(e,t){const n=wt(e,t==null?void 0:t.in);return Qk(n,fx(n))+1}function qx(e,t){const n=wt(e,t==null?void 0:t.in),r=+Qa(n)-+ex(n);return Math.round(r/_m)+1}function Sm(e,t){var c,d,f,h;const n=wt(e,t==null?void 0:t.in),r=n.getFullYear(),o=Ei(),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=dr((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=ki(i,t),l=dr((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=ki(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function Wx(e,t){var a,l,u,c;const n=Ei(),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=Sm(e,t),s=dr((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),ki(s,t)}function Zx(e,t){const n=wt(e,t==null?void 0:t.in),r=+ki(n,t)-+Wx(n,t);return Math.round(r/_m)+1}function Ye(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Rr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ye(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ye(n+1,2)},d(e,t){return Ye(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 Ye(e.getHours()%12||12,t.length)},H(e,t){return Ye(e.getHours(),t.length)},m(e,t){return Ye(e.getMinutes(),t.length)},s(e,t){return Ye(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Ye(o,t.length)}},as={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cm={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 Rr.y(e,t)},Y:function(e,t,n,r){const o=Sm(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return Ye(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ye(s,t.length)},R:function(e,t){const n=km(e);return Ye(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ye(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 Ye(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 Ye(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 Rr.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 Ye(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=Zx(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Ye(o,t.length)},I:function(e,t,n){const r=qx(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ye(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Rr.d(e,t)},D:function(e,t,n){const r=Hx(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ye(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 Ye(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 Ye(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 Ye(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=as.noon:r===0?o=as.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=as.evening:r>=12?o=as.afternoon:r>=4?o=as.morning:o=as.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 Rr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Rr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ye(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ye(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Rr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Rr.s(e,t)},S:function(e,t){return Rr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Pm(r);case"XXXX":case"XX":return yo(r);case"XXXXX":case"XXX":default:return yo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Pm(r);case"xxxx":case"xx":return yo(r);case"xxxxx":case"xxx":default:return yo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nm(r,":");case"OOOO":default:return"GMT"+yo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nm(r,":");case"zzzz":default:return"GMT"+yo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Ye(r,t.length)},T:function(e,t,n){return Ye(+e,t.length)}};function Nm(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+Ye(s,2)}function Pm(e,t){return e%60===0?(e>0?"-":"+")+Ye(Math.abs(e)/60,2):yo(e,t)}function yo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ye(Math.trunc(r/60),2),s=Ye(r%60,2);return n+o+t+s}const Tm=(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"})}},$m=(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"})}},Yx={p:$m,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Tm(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}}",Tm(r,t)).replace("{{time}}",$m(o,t))}},Gx=/^D+$/,Kx=/^Y+$/,Xx=["D","DD","YY","YYYY"];function Jx(e){return Gx.test(e)}function Qx(e){return Kx.test(e)}function eO(e,t,n){const r=tO(e,t,n);if(console.warn(r),Xx.includes(e))throw new RangeError(r)}function tO(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 nO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,oO=/^'([^]*?)'?$/,sO=/''/g,iO=/[a-zA-Z]/;function aO(e,t,n){var c,d,f,h;const r=Ei(),o=r.locale??Om,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=wt(e,n==null?void 0:n.in);if(!rx(a))throw new RangeError("Invalid time value");let l=t.match(rO).map(p=>{const g=p[0];if(g==="p"||g==="P"){const _=Yx[g];return _(p,o.formatLong)}return p}).join("").match(nO).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:lO(p)};if(Cm[g])return{isToken:!0,value:p};if(g.match(iO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");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 g=p.value;(Qx(g)||Jx(g))&&eO(g,t,String(e));const _=Cm[g[0]];return _(a,g,o.localize,u)}).join("")}function lO(e){const t=e.match(oO);return t?t[1].replace(sO,"'"):e}function uO(e,t,n){const r=Ei(),o=(n==null?void 0:n.locale)??r.locale??Om,s=2520,i=nl(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]=tl(n==null?void 0:n.in,...i>0?[t,e]:[e,t]),c=dx(u,l),d=(el(u)-el(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<wm){const p=Math.round(f/60);return o.formatDistance("aboutXHours",p,a)}else{if(f<s)return o.formatDistance("xDays",1,a);if(f<Ja){const p=Math.round(f/wm);return o.formatDistance("xDays",p,a)}else if(f<Ja*2)return h=Math.round(f/Ja),o.formatDistance("aboutXMonths",h,a)}if(h=cx(u,l),h<12){const p=Math.round(f/Ja);return o.formatDistance("xMonths",p,a)}else{const p=h%12,g=Math.trunc(h/12);return p<3?o.formatDistance("aboutXYears",g,a):p<9?o.formatDistance("overXYears",g,a):o.formatDistance("almostXYears",g+1,a)}}function cO(e,t){return uO(e,tx(e),t)}function dO(e){return cO(e,{addSuffix:!0})}function ls(e,t){return aO(e,t||"PPP")}const fO={class:"moonbase:subscriptions"},hO={key:0,class:"moonbase:loader"},pO={key:1,class:"moonbase:loader"},mO=["data-subscription-status"],bO={class:"moonbase:subscriptions-item-content"},gO={class:"moonbase:subscriptions-item-content"},vO={key:0,class:"moonbase:subscriptions-item-milestone-progress"},yO={class:"moonbase:subscriptions-item-milestone-progress-title"},_O=pe({__name:"Subscriptions",setup(e){const t=De(),{getSubscriptions:n}=lo(),r=L(new Date),o=L(null);return ze(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)=>(b(),x("div",fO,[o.value?o.value.length===0?(b(),x("div",pO," No subscriptions found ")):se("",!0):(b(),x("div",hO,[E(nn),i[0]||(i[0]=A(" Loading subscriptions.. "))])),(b(!0),x(ye,null,ft(o.value||[],a=>(b(),x(ye,{key:a.id},[j("div",{"data-subscription-status":a.status,class:"moonbase:subscriptions-item"},[a.content.type==="Product"?(b(),x(ye,{key:0},[E(Ht,{url:a.content.product.iconUrl,size:48},null,8,["url"]),j("div",bO,[E(it,null,{default:k(()=>[A(V(a.content.quantity)+" x "+V(a.content.product.name),1)]),_:2},1024),E(Me,null,{default:k(()=>[A(V(a.status===v(wr).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+V(v(ls)(a.expiresAt)),1)]),_:2},1024)])],64)):(b(),x(ye,{key:1},[E(Ht,{url:a.content.bundle.iconUrl,size:48},null,8,["url"]),j("div",gO,[E(it,null,{default:k(()=>[A(V(a.content.quantity)+" x "+V(a.content.bundle.name),1)]),_:2},1024),E(Me,null,{default:k(()=>[A(V(a.status===v(wr).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+V(v(ls)(a.expiresAt)),1)]),_:2},1024)])],64)),j("div",null,[E(Yo,{variant:"subtle",onClick:l=>v(t).show(v(ue).Subscription,v(J).ManageSubscription,{subscription_id:a.id})},{default:k(()=>[E(v(wp)),i[1]||(i[1]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2,__:[1]},1032,["onClick"])])],8,mO),a.milestoneProgress?(b(),x("div",vO,[j("div",yO,[E(it,null,{default:k(()=>[A(V(a.milestoneProgress.title),1)]),_:2},1024),E(qt,null,{default:k(()=>[A(V(a.milestoneProgress.currentNormalizedCycleNumber-(a.milestoneProgress.currentCycleIsCompleted?0:1))+" / "+V(a.milestoneProgress.toNormalizedCycleNumber)+" "+V(v(wi)(a.cycleLength))+"s ",1)]),_:2},1024)]),E(ym,{progress:a.milestoneProgress},null,8,["progress"])])):se("",!0)],64))),128))]))}}),wO={class:"moonbase:customer"},EO=pe({__name:"Customer",setup(e){const t=De(),{user:n}=nt(),r=me(ut),o=te(()=>[{intent:J.ViewProducts,title:"Products",content:Rk},{intent:J.ViewSubscriptions,title:"Subscriptions",content:_O,predicate:()=>{var a;return((a=n.value)==null?void 0:a.hasSubscriptions)??!1}},{intent:J.ViewAccount,title:"Account",content:Tk},{intent:J.RedeemVoucher,title:"Redeem",content:Yk}].filter(a=>a.predicate===void 0||a.predicate())),s=te(()=>o.value.findIndex(a=>a.intent===t.intent));function i(a){t.intent=o.value[a].intent}return(a,l)=>(b(),x("div",wO,[E(v(a_),{"selected-index":s.value,onChange:i},{default:k(()=>{var u,c;return[E(v(l_),{"data-corners":(u=v(r))==null?void 0:u.theme.corners,"data-background":(c=v(r))==null?void 0:c.theme.colors.background},{default:k(()=>[(b(!0),x(ye,null,ft(o.value,d=>(b(),Z(v(u_),{key:d.intent},{default:k(()=>[A(V(d.title),1)]),_:2},1024))),128))]),_:1},8,["data-corners","data-background"]),E(v(c_),null,{default:k(()=>[(b(!0),x(ye,null,ft(o.value,d=>(b(),Z(v(d_),{key:d.intent},{default:k(()=>[(b(),Z(Gl(d.content)))]),_:2},1024))),128))]),_:1})]}),_:1},8,["selected-index"])]))}}),kO={class:"moonbase:product-card-content"},xO=["data-open"],OO=pe({__name:"ProductCard",props:{product:{}},setup(e){const t=L(!1),n=L(null),r=te(()=>n.value&&n.value.$el&&n.value.$el.scrollHeight>n.value.$el.clientHeight);return(o,s)=>(b(),Z(cn,{class:"moonbase:product-card"},{addon:k(()=>[j("div",{class:"moonbase:product-card-description","data-open":t.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:n},{default:k(()=>[A(V(o.product.description),1)]),_:1},512),!t.value&&r.value?(b(),x("button",{key:0,onClick:s[0]||(s[0]=i=>t.value=!0)},[E(it,null,{default:k(()=>s[1]||(s[1]=[A(" read more ")])),_:1,__:[1]})])):se("",!0)],8,xO)]),default:k(()=>[E(Ht,{url:o.product.iconUrl,size:72},null,8,["url"]),j("div",kO,[E(is,null,{default:k(()=>{var i;return[A(V((i=o.product)==null?void 0:i.name),1)]}),_:1}),E(Me,{class:"moonbase:product-card-tagline"},{default:k(()=>{var i;return[A(V((i=o.product)==null?void 0:i.tagline),1)]}),_:1})])]),_:1}))}});function SO(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 CO={class:"moonbase:product-downloads"},NO=["data-open"],PO={key:1,class:"moonbase:product-downloads-content"},TO={key:2,class:"moonbase:product-downloads-content"},$O={key:3,class:"moonbase:product-downloads-content"},AO={key:4,class:"moonbase:product-downloads-content"},DO={class:"moonbase:product-downloads-list"},IO={class:"moonbase:product-downloads-download-actions"},MO=pe({__name:"ProductDownloads",props:{product:{}},setup(e){const t=e,n=De(),r=nt(),o=Xa(),s=me(jr),{downloadProduct:i}=lo(),a=L(!1),l=L(null),u=te(()=>l.value&&l.value.$el&&l.value.$el.scrollHeight>l.value.$el.clientHeight);function c(){n.enqueue(ue.Product,J.DownloadProduct,n.parameters??void 0),n.show(ue.Authentication,J.SignIn)}const d=[An.Windows,An.Mac,An.Linux,An.Universal];function f(){var R;const S=(((R=navigator.userAgentData)==null?void 0:R.platform)??navigator.platform??"Unknown").toLowerCase();return/mac/.test(S)?An.Mac:/win/.test(S)?An.Windows:/linux/.test(S)?An.Linux:An.Universal}const h=f(),p=[h,...d.filter(S=>S!==h)],g=te(()=>p.flatMap(S=>[...(t.product.downloads??[]).filter(R=>R.platform===S)]));async function _(S){try{await i(S),s==null||s(zt.DownloadedProduct,{product:t.product,download:S,user:r.user.value})}catch(R){if(R instanceof bn)o.reportProblem("error",{type:R.name,title:R.title,detail:R.detail,status:R.status,errors:R.errors?Object.fromEntries(Object.entries(R.errors).map(([H,z])=>[H,[z]])):void 0,instance:"ProductDownloads.vue:startDownload"});else{const H=R;o.reportProblem("error",{type:H.name,title:H.message,instance:"ProductDownloads.vue:startDownload"})}throw R}}return(S,R)=>(b(),x("div",CO,[E(rt,null,{default:k(()=>[R[1]||(R[1]=A(" Downloads ")),E(Me,null,{default:k(()=>[A(" Version "+V(S.product.version),1)]),_:1})]),_:1,__:[1]}),S.product.releaseDescription?(b(),x("div",{key:0,class:"moonbase:product-downloads-description","data-open":a.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:l},{default:k(()=>[A(V(S.product.releaseDescription),1)]),_:1},512),!a.value&&u.value?(b(),x("button",{key:0,onClick:R[0]||(R[0]=H=>a.value=!0)},[E(it,null,{default:k(()=>R[2]||(R[2]=[A(" read more ")])),_:1,__:[2]})])):se("",!0)],8,NO)):se("",!0),S.product.downloadsNeedsUser&&S.product.downloadsNeedsOwnership&&!S.product.numberOfLicenses&&!S.product.subscriptionLicenses?(b(),x("div",PO,[E(ot,{"data-center":""},{default:k(()=>R[3]||(R[3]=[A(" This product requires ownership to download ")])),_:1,__:[3]}),E(Qe,{label:"Sign in",handler:c})])):S.product.downloadsNeedsUser&&!v(r).user?(b(),x("div",TO,[E(ot,{"data-center":""},{default:k(()=>R[4]||(R[4]=[A(" This product requires an account to download ")])),_:1,__:[4]}),E(Qe,{label:"Sign in",handler:c})])):S.product.downloadsNeedsOwnership&&!S.product.numberOfLicenses&&!S.product.subscriptionLicenses?(b(),x("div",$O,[E(ot,{"data-center":""},{default:k(()=>R[5]||(R[5]=[A(" This product requires ownership to download ")])),_:1,__:[5]})])):(b(),x("div",AO,[j("div",DO,[(b(!0),x(ye,null,ft(g.value,H=>(b(),Z(cn,{key:H.key,class:"moonbase:product-downloads-download"},{addon:k(()=>[j("div",IO,[E(Qe,{label:`Download for ${H.platform}`,variant:H.platform===v(h)?"primary":"secondary","no-reset":!0,handler:()=>_(H),icon:v(v_)},null,8,["label","variant","handler","icon"])])]),default:k(()=>[j("div",null,[E(rt,null,{default:k(()=>[A(V(H.name),1)]),_:2},1024),E(qt,null,{default:k(()=>[A(V(H.platform)+" - "+V(v(SO)(H.size)),1)]),_:2},1024)])]),_:2},1024))),128))]),g.value.length===0?(b(),Z(ot,{key:0,"data-center":""},{default:k(()=>R[6]||(R[6]=[A(" No downloadable files found ")])),_:1,__:[6]})):se("",!0)]))]))}}),VO={class:"moonbase:product-licenses"},RO={key:0,class:"moonbase:loader"},LO={key:1,class:"moonbase:empty"},jO={key:0,class:"moonbase:loader"},UO={key:1,class:"moonbase:product-licenses-activations"},BO={key:0},FO={class:"moonbase:product-licenses-activation-actions"},zO={key:2,class:"moonbase:loader"},HO={key:3,class:"moonbase:product-licenses-licenses"},qO=pe({__name:"ProductLicenses",props:{product:{}},emits:["revoked"],setup(e,{emit:t}){const n=e,r=t,{getProductActivations:o,getProductLicenses:s,revokeActivation:i}=lo(),a=Xa(),l=L(null),u=L(null),c=L(!0);ze(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&&Yt(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 bn)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,g])=>[p,[g]])):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)=>(b(),x("div",VO,[E(rt,null,{default:k(()=>[h[0]||(h[0]=A(" Licenses ")),f.product.maxActivations&&f.product.maxActivations>0?(b(),Z(Me,{key:0},{default:k(()=>[A(V(f.product.currentActivations??0)+" of "+V(f.product.maxActivations)+" seats used ",1)]),_:1})):se("",!0)]),_:1,__:[0]}),c.value?(b(),x("div",RO,[E(nn)])):!f.product.numberOfLicenses&&!f.product.subscriptionLicenses?(b(),x("div",LO,[E(ot,null,{default:k(()=>h[1]||(h[1]=[A(" You don't own any licenses for this product yet ")])),_:1,__:[1]}),f.product&&f.product.website?(b(),Z(lc,{key:0,type:"anchor",href:f.product.website,label:"Purchase",icon:v(__)},null,8,["href","icon"])):se("",!0)])):se("",!0),c.value?se("",!0):(b(),x(ye,{key:2},[f.product.maxActivations&&f.product.maxActivations>0&&!f.product.currentActivations?(b(),x("div",jO,[E(v(Ep)),E(rt,null,{default:k(()=>h[2]||(h[2]=[A(" No activations yet ")])),_:1,__:[2]})])):se("",!0),f.product.maxActivations&&l.value?(b(),x("div",UO,[(b(!0),x(ye,null,ft(l.value??[],p=>(b(),Z(cn,{key:p.id,class:"moonbase:product-licenses-activation"},ba({default:k(()=>[j("div",null,[E(qt,null,{default:k(()=>h[3]||(h[3]=[A(" Device ")])),_:1,__:[3]}),E(rt,null,{default:k(()=>[A(V(p.name),1)]),_:2},1024)]),j("div",null,[E(qt,null,{default:k(()=>h[4]||(h[4]=[A(" Activation ")])),_:1,__:[4]}),E(rt,null,{default:k(()=>[A(V(p.activationMethod),1)]),_:2},1024)]),p.lastValidatedAt?(b(),x("div",BO,[E(qt,null,{default:k(()=>h[5]||(h[5]=[A(" First activated ")])),_:1,__:[5]}),E(rt,null,{default:k(()=>[A(V(v(dO)(p.firstValidatedAt)),1)]),_:2},1024)])):se("",!0)]),_:2},[p.activationMethod===v(Fi).Online?{name:"addon",fn:k(()=>[j("div",FO,[E(Qe,{label:"Revoke",variant:"secondary","no-reset":!0,handler:()=>d(p)},null,8,["handler"])])]),key:"0"}:void 0]),1024))),128))])):se("",!0),(!u.value||u.value.length===0)&&!f.product.maxActivations&&(f.product.numberOfLicenses||f.product.subscriptionLicenses)?(b(),x("div",zO,[E(v(Ep)),f.product.numberOfLicenses?(b(),Z(rt,{key:0},{default:k(()=>[A(" You own "+V(f.product.numberOfLicenses)+" license"+V(f.product.numberOfLicenses!==1?"s":"")+" for this product ",1)]),_:1})):se("",!0),f.product.subscriptionLicenses?(b(),Z(rt,{key:1},{default:k(()=>[A(" You have "+V(f.product.subscriptionLicenses)+" subscription license"+V(f.product.subscriptionLicenses!==1?"s":"")+" for this product ",1)]),_:1})):se("",!0)])):f.product.externalLicenses&&u.value?(b(),x("div",HO,[(b(!0),x(ye,null,ft((u.value??[]).filter(p=>p.externalFulfillment),p=>(b(),Z(cn,{key:p.id,class:"moonbase:product-licenses-license"},ba({default:k(()=>[j("div",null,[E(qt,null,{default:k(()=>[A(V(f.product.name)+" license ",1)]),_:1}),E(rt,null,{default:k(()=>[A(V(p.id),1)]),_:2},1024)])]),_:2},[p.externalFulfillment?{name:"addon",fn:k(()=>[j("code",null,V(p.externalFulfillment),1)]),key:"0"}:void 0]),1024))),128))])):se("",!0)],64))]))}}),WO={class:"moonbase:download-product"},ZO={key:0,class:"moonbase:loader"},YO={key:1,class:"moonbase:loader"},GO={key:2,class:"moonbase:loader"},KO={key:3},XO=pe({__name:"Product",setup(e){const t=De(),n=nt(),{loaded:r}=nt(),{getProduct:o}=lo(),s=L(null),i=L(null),a=L(!0);return ze(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)=>(b(),x("div",WO,[a.value||!v(r)?(b(),x("div",ZO,[E(nn)])):i.value?(b(),x("div",YO,V(i.value),1)):s.value?(b(),x("div",KO,[E(OO,{product:s.value},null,8,["product"]),s.value.downloads?(b(),Z(MO,{key:0,product:s.value},null,8,["product"])):se("",!0),v(n).user.value?(b(),Z(qO,{key:1,product:s.value,onRevoked:u[0]||(u[0]=c=>s.value.currentActivations=(s.value.currentActivations??1)-1)},null,8,["product"])):se("",!0)])):(b(),x("div",GO," Could not find product "))]))}}),JO={class:"moonbase:peek"},QO=["data-visible"],e3={key:1,class:"moonbase:peek-voucher"},t3={key:0,class:"moonbase:peek-voucher-content"},n3={class:"moonbase:peek-voucher-auth"},r3=pe({__name:"Redeem",setup(e){const{peek:t}=Ph(),n=De(),r=L(null),o=L(null),s=L(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(ue.Customer,J.RedeemVoucher,{code:s.value}),n.show(ue.Authentication,J.SignIn)}function l(){n.enqueue(ue.Customer,J.RedeemVoucher,{code:s.value}),n.show(ue.Authentication,J.SignUp)}return(u,c)=>(b(),x("div",JO,[E(si,{mode:"out-in",name:"moonbase:slide-left"},{default:k(()=>[r.value?(b(),x("div",e3,[j("div",null,[E(is,null,{default:k(()=>[A(V(r.value.name),1)]),_:1}),r.value.description?(b(),Z(rt,{key:0},{default:k(()=>[A(' "'+V(r.value.description)+'" ',1)]),_:1})):se("",!0),E(Me,null,{default:k(()=>[c[2]||(c[2]=A(" Code: ")),j("strong",null,V(r.value.code),1)]),_:1,__:[2]})]),E(rt,null,{default:k(()=>c[3]||(c[3]=[A(" Voucher summary ")])),_:1,__:[3]}),r.value.redeemsProducts.length>0||r.value.redeemsBundles.length>0?(b(),x("div",t3,[(b(!0),x(ye,null,ft(r.value.redeemsProducts,({value:d,quantity:f})=>(b(),Z(vm,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(b(!0),x(ye,null,ft(r.value.redeemsBundles,({value:d,quantity:f})=>(b(),Z(gm,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):se("",!0),j("div",n3,[E(ot,null,{default:k(()=>c[4]||(c[4]=[A(" Sign in or create an account to redeem products ")])),_:1,__:[4]}),E(Qe,{label:"Sign in",variant:"primary",handler:a}),E(Qe,{label:"Create account",variant:"subtle",handler:l})])])):(b(),Z(ur,{key:0,handler:i},{default:k(()=>{var d;return[E(ot,null,{default:k(()=>c[1]||(c[1]=[A(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),A(" Please enter the code below: ")])),_:1,__:[1]}),E(At,{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"]),E(cr,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},V((d=o.value)==null?void 0:d.message),9,QO)]}),_:1}))]),_:1})]))}});function Am(e,t){return b(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[j("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z","clip-rule":"evenodd"})])}const o3={class:"moonbase:subscription-content-card-content"},s3=["data-open"],i3={class:"moonbase:subscription-content-card-content"},a3=["data-open"],l3=pe({__name:"ContentCard",props:{subscription:{}},setup(e){const t=L(new Date),n=L(!1),r=L(null),o=te(()=>r.value&&r.value.$el&&r.value.$el.scrollHeight>r.value.$el.clientHeight);return(s,i)=>s.subscription.content.type==="Product"?(b(),Z(cn,{key:0,class:"moonbase:subscription-content-card"},{addon:k(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:r},{default:k(()=>[A(V(s.subscription.content.product.description),1)]),_:1},512),!n.value&&o.value?(b(),x("button",{key:0,onClick:i[0]||(i[0]=a=>n.value=!0)},[E(it,null,{default:k(()=>i[2]||(i[2]=[A(" read more ")])),_:1,__:[2]})])):se("",!0)],8,s3)]),default:k(()=>[E(Ht,{url:s.subscription.content.product.iconUrl,size:72},null,8,["url"]),j("div",o3,[E(is,null,{default:k(()=>{var a;return[A(V((a=s.subscription.content.product)==null?void 0:a.name),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-tagline"},{default:k(()=>{var a;return[A(V((a=s.subscription.content.product)==null?void 0:a.tagline),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-expiry"},{default:k(()=>[A(V(s.subscription.status===v(wr).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,V(v(ls)(s.subscription.expiresAt)),1)]),_:1})])]),_:1})):(b(),Z(cn,{key:1,class:"moonbase:subscription-content-card"},{addon:k(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[E(Me,{ref_key:"descriptionRef",ref:r},{default:k(()=>[A(V(s.subscription.content.bundle.description),1)]),_:1},512),!n.value&&o.value?(b(),x("button",{key:0,onClick:i[1]||(i[1]=a=>n.value=!0)},[E(it,null,{default:k(()=>i[3]||(i[3]=[A(" read more ")])),_:1,__:[3]})])):se("",!0)],8,a3)]),default:k(()=>[E(Ht,{url:s.subscription.content.bundle.iconUrl,size:72},null,8,["url"]),j("div",i3,[E(is,null,{default:k(()=>{var a;return[A(V((a=s.subscription.content.bundle)==null?void 0:a.name),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-tagline"},{default:k(()=>{var a;return[A(V((a=s.subscription.content.bundle)==null?void 0:a.tagline),1)]}),_:1}),E(Me,{class:"moonbase:subscription-content-card-expiry"},{default:k(()=>[A(V(s.subscription.status===v(wr).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,V(v(ls)(s.subscription.expiresAt)),1)]),_:1})])]),_:1}))}}),u3={class:"moonbase:milestone-rewards"},c3={class:"moonbase:milestone-rewards-list"},d3={key:0},f3={key:1},h3=pe({__name:"MilestoneRewards",props:{progress:{}},setup(e){return(t,n)=>(b(),x("div",u3,[E(it,null,{default:k(()=>n[0]||(n[0]=[A(" Rewards: ")])),_:1,__:[0]}),j("div",c3,[(b(!0),x(ye,null,ft(Object.values(t.progress.events).flatMap(r=>r).filter(r=>r.fulfilled),r=>(b(),x("div",{key:r.milestoneId,class:"moonbase:milestone-rewards-item"},[E(Me,null,{default:k(()=>[A(V(r.message),1)]),_:2},1024),r.type==="CouponCodeMilestone"&&r.fulfilled&&r.code?(b(),x("div",d3,[E(qt,null,{default:k(()=>n[1]||(n[1]=[A(" Your coupon code: ")])),_:1,__:[1]}),n[2]||(n[2]=j("br",null,null,-1)),j("code",null,V(r.code),1)])):r.type==="PerpetualLicenseConversionMilestone"&&r.fulfilled?(b(),x("div",f3,[E(qt,null,{default:k(()=>[E(v(Am),{class:"moonbase:success-icon"}),n[3]||(n[3]=A(" Your licenses have been converted to perpetual licenses. "))]),_:1,__:[3]})])):se("",!0)]))),128))])]))}}),p3={class:"moonbase:subscription"},m3={key:0,class:"moonbase:loader"},b3={key:1,class:"moonbase:loader"},g3={key:2,class:"moonbase:loader"},v3={key:3},y3={key:0,class:"moonbase:subscription-milestones"},_3={class:"moonbase:subscription-milestone-progress-title"},w3={class:"moonbase:subscription-actions"},E3=pe({__name:"Subscription",setup(e){const t=De(),{loaded:n}=nt(),r=Xa(),{getSubscription:o,renewSubscription:s,cancelSubscription:i,updateSubscriptionPaymentMethod:a}=lo(),l=L(null),u=L(new Date),c=L(null),d=L(!0);ze(async()=>{const g=t.getParameter("subscription_id");if(!g){c.value="Link is broken";return}try{l.value=await o(g)}catch(_){c.value=_.message}d.value=!1});async function f(){if(!l.value)return;if((await s(l.value.id,{redirect:!1})).completed){const _=await o(l.value.id);Yt(1500).then(()=>l.value=_)}else throw new ss}async function h(){l.value&&(l.value=await i(l.value.id))}async function p(){if(l.value){c.value=null;try{const g=await a(l.value,{returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(g!=null&&g.completed)l.value=await o(l.value.id);else throw new ss}catch(g){if(c.value=g.message,!(g instanceof ss))if(g instanceof bn)r.reportProblem("error",{type:g.name,title:g.title,detail:g.detail,status:g.status,errors:g.errors?Object.fromEntries(Object.entries(g.errors).map(([_,S])=>[_,[S]])):void 0,instance:"Subscription.vue:startUpdate"});else{const _=g;r.reportProblem("error",{type:_.name,title:_.message,instance:"Subscription.vue:startUpdate"})}throw g}}}return(g,_)=>(b(),x("div",p3,[d.value||!v(n)?(b(),x("div",m3,[E(nn)])):c.value?(b(),x("div",b3,V(c.value),1)):l.value?(b(),x("div",v3,[E(l3,{subscription:l.value},null,8,["subscription"]),l.value.milestoneProgress?(b(),x("div",y3,[j("div",_3,[E(it,null,{default:k(()=>[A(V(l.value.milestoneProgress.title),1)]),_:1}),E(qt,null,{default:k(()=>[A(V(l.value.milestoneProgress.currentNormalizedCycleNumber-(l.value.milestoneProgress.currentCycleIsCompleted?0:1))+" / "+V(l.value.milestoneProgress.toNormalizedCycleNumber)+" "+V(v(wi)(l.value.cycleLength))+"s ",1)]),_:1})]),E(ym,{progress:l.value.milestoneProgress},null,8,["progress"]),l.value.milestoneProgress.description?(b(),Z(qt,{key:0},{default:k(()=>[A(V(l.value.milestoneProgress.description),1)]),_:1})):se("",!0),Object.values(l.value.milestoneProgress.events).flatMap(S=>S).some(S=>S.fulfilled)?(b(),Z(h3,{key:1,progress:l.value.milestoneProgress},null,8,["progress"])):se("",!0)])):se("",!0),j("div",w3,[l.value.status===v(wr).Active?(b(),x(ye,{key:0},[E(Qe,{label:"Update payment method",variant:"secondary",handler:p}),E(Qe,{label:"Cancel subscription",variant:"danger",handler:h}),E(qt,null,{default:k(()=>[_[1]||(_[1]=A(" 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 ")),j("strong",null,V(v(Bt)(l.value.total.due)),1),A(" per "+V(v(wi)(l.value.cycleLength))+" for this subscription",1),l.value.paymentMethod?(b(),x(ye,{key:0},[_[0]||(_[0]=A(" using payment method ")),j("strong",null,V(l.value.paymentMethod),1)],64)):se("",!0),_[2]||(_[2]=A(". "))]),_:1,__:[1,2]})],64)):l.value.status===v(wr).Completed?(b(),Z(qt,{key:1},{default:k(()=>[E(v(Am),{class:"moonbase:success-icon"}),_[3]||(_[3]=A(" This subscription has been completed, and cannot be renewed. "))]),_:1,__:[3]})):(b(),x(ye,{key:2},[l.value.nextPaymentScheduledAt&&l.value.cancellable?(b(),x(ye,{key:0},[E(Qe,{label:"Continue subscription",variant:"primary",handler:f}),E(Qe,{label:"Cancel subscription",variant:"danger",handler:h}),E(qt,null,{default:k(()=>[A(" We could not renew this subscription on the expiry date, the next attempt will be "+V(v(ls)(l.value.nextPaymentScheduledAt))+". To make sure you can use your products un-interrupted, continue the subscription, or cancel it if you do not wish to keep using these products. ",1)]),_:1})],64)):(b(),x(ye,{key:1},[E(Qe,{label:"Continue subscription",variant:"primary",handler:f}),E(qt,null,{default:k(()=>[A(" This subscription has been stopped, and "+V(l.value.expiresAt>u.value?"expires":"expired")+" "+V(v(ls)(l.value.expiresAt))+". If you want to continue using the products after this date, you may continue the subscription to regain access. ",1)]),_:1})],64))],64))])])):(b(),x("div",g3," Could not find subscription "))]))}}),k3=pe({__name:"App",setup(e){const t=me(ut),n=De();Xe(()=>[n.active,n.intent],([o,s])=>{Je("UI updated",{view:o,intent: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??"")}return Xe(()=>t==null?void 0:t.value.theme.colors.primary,o=>{if(!o)return;let s=o;typeof s=="string"&&(s=Object.fromEntries(eE(s).map(i=>[i.number<=100||i.number===950?i.number-50:i.number-100,i.hexcode]))),document.documentElement.style.setProperty("--moonbase-brand-50",s[50]??""),document.documentElement.style.setProperty("--moonbase-brand-100",s[100]??""),document.documentElement.style.setProperty("--moonbase-brand-200",s[200]??""),document.documentElement.style.setProperty("--moonbase-brand-300",s[300]??""),document.documentElement.style.setProperty("--moonbase-brand-400",s[400]??""),document.documentElement.style.setProperty("--moonbase-brand-500",s[500]??""),document.documentElement.style.setProperty("--moonbase-brand-600",s[600]??""),document.documentElement.style.setProperty("--moonbase-brand-700",s[700]??""),document.documentElement.style.setProperty("--moonbase-brand-800",s[800]??""),document.documentElement.style.setProperty("--moonbase-brand-900",s[900]??"")},{immediate:!0}),Xe(()=>t==null?void 0:t.value.theme.dark,o=>{o?document.documentElement.classList.add("moonbase:dark"):document.documentElement.classList.remove("moonbase:dark")},{immediate:!0}),tw(),nw(),(o,s)=>{var i;return b(),x(ye,null,[(i=v(t))!=null&&i.toolbar.enabled?(b(),Z(ew,{key:0})):se("",!0),E(W_,null,{default:k(()=>[v(n).active===v(ue).Cart?(b(),Z(Ok,{key:0})):v(n).active===v(ue).Authentication?(b(),Z(q5,{key:1})):v(n).active===v(ue).Activation?(b(),Z(n5,{key:2})):v(n).active===v(ue).Product?(b(),Z(XO,{key:3})):v(n).active===v(ue).Subscription?(b(),Z(E3,{key:4})):v(n).active===v(ue).Customer?(b(),Z(EO,{key:5})):v(n).active===v(ue).Redeem?(b(),Z(r3,{key:6})):v(n).active===v(ue).About?(b(),Z(fE,{key:7})):se("",!0)]),_:1})],64)}}});function rl(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof HTMLElement)}function ol(e,...t){if(t.length===0)return e;const n=t.shift();if(!n)return e;if(rl(e)&&rl(n)){for(const r in e)if(Object.prototype.hasOwnProperty.call(n,r)){const o=n[r];rl(o)&&rl(e[r])?e[r]=ol(e[r],o):o!==void 0&&(e[r]=o)}}return ol(e,...t)}function x3(e){const t=n=>Array.isArray(n)?n.map(r=>t(r)):Ke(n)||wn(n)||Io(n)?t(Oe(n)):n&&typeof n=="object"?Object.keys(n).reduce((r,o)=>(r[o]=t(n[o]),r),{}):n;return t(e)}const dc=Symbol("url"),Dm=Symbol("moonbase_instance"),Lr=(e,t)=>window.dispatchEvent(new CustomEvent(`moonbase-storefront-${e}`,{detail:x3(t)})),jr=Symbol("event-emitter");class O3{constructor(){_o(this,"initialized",!1);_o(this,"pinia");_o(this,"storefront");_o(this,"options")}async setup(t,n){var u,c;if(typeof window>"u")throw console.error("Moonbase setup must be done client-side"),new Error("Moonbase setup must be done client-side");if(globalThis.MoonbaseCSS&&globalThis.MoonbaseCSS.inject(),document.getElementById("moonbase")){console.warn("Moonbase has already been initialized!");return}Je("Given options:",n),this.options=L(ol(((u=this.options)==null?void 0:u.value)??Gh,n??{})),Je("Merged options:",this.options.value);const r=document.createElement("div");r.id="moonbase",r.classList.add("moonbase");const o=this.options.value.target??document.body;Je("Mounting to target element",o),o.append(r);let s=t;if(t.includes(".moonbase.sh")){const d=/^(https:\/\/[a-z\-]+\.(?:beta\.)?moonbase\.sh)(.+)/.exec(t);d&&d.length>1&&d[1]&&(s=d[1],console.warn(`Moonbase url set up incorrectly, should be ${s}, was ${t}`))}this.storefront=Hy(s),this.pinia=m1(),vy(k3).use(this.storefront).use(this.pinia).provide(ut,this.options).provide(dc,s.replace(/\/$/,"")).provide(jr,Lr).provide(Dm,this).mount("#moonbase"),this.initialized=!0,window&&window.location&&this.handleLocationIntent(window.location);const a=De(this.pinia),l=nt(this.storefront);(c=this.storefront)==null||c.onCheckoutInitiated((d,f)=>{Lr(zt.CheckoutInitiated,{order:d,total:f,user:l.user.value})}),this.storefront.onCheckoutClosed(d=>{Lr(zt.CheckoutClosed,{order:this.storefront.currentOrder.value,user:l.user.value}),d===J.ViewProducts&&(l.user?a.show(ue.Customer,J.ViewProducts):a.show(ue.Cart,J.ViewCart))}),this.storefront.onCheckoutCompleted(d=>{Lr(zt.CheckoutCompleted,{order:d,user:l.user.value})})}configure(t){var r;Je("Given options:",t);const n=ol(((r=this.options)==null?void 0:r.value)??Gh,t??{});Je("Merged options:",n),this.options?this.options.value=n:this.options=L(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(J).includes(r)){const o=Object.fromEntries([...n.entries()].filter(([i])=>i.startsWith("mb_")).map(([i,a])=>[i.substring(3),a]));if(r===J.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");De(this.pinia).show(ue.Authentication,J.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");De(this.pinia).show(ue.Authentication,J.SignUp,t)}forgot_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ForgotPassword,t)}reset_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ResetPassword,t)}confirm_account(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ConfirmAccount,t)}confirm_email(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Authentication,J.ConfirmEmail,t)}confirm_email_change(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);nt(this.storefront).user.value?n.show(ue.Authentication,J.ConfirmEmailChange,t):(n.enqueue(ue.Authentication,J.ConfirmEmailChange,t),n.show(ue.Authentication,J.SignIn))}view_account(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const t=De(this.pinia);nt(this.storefront).user.value?t.show(ue.Customer,J.ViewAccount):(t.enqueue(ue.Customer,J.ViewAccount),t.show(ue.Authentication,J.SignIn))}view_products(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Customer,J.ViewProducts)}view_subscriptions(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Customer,J.ViewSubscriptions)}redeem_voucher(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);nt(this.storefront).user.value?n.show(ue.Customer,J.RedeemVoucher,t):n.show(ue.Redeem,J.RedeemVoucher,t)}view_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Product,J.ViewProduct,t)}download_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Product,J.DownloadProduct,t)}activate_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia),r=nt(this.storefront);!(t!=null&&t.token)&&!r.user.value?(n.enqueue(ue.Activation,J.ActivateProduct,t),n.show(ue.Authentication,J.SignIn)):n.show(ue.Activation,J.ActivateProduct,t)}manage_subscription(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=De(this.pinia);nt(this.storefront).user.value?n.show(ue.Subscription,J.ManageSubscription,t):(n.enqueue(ue.Subscription,J.ManageSubscription,t),n.show(ue.Authentication,J.SignIn))}view_cart(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");De(this.pinia).show(ue.Cart,J.ViewCart)}async add_to_cart(t){var s,i,a,l,u,c,d,f,h,p;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=nr(this.storefront),r=nt(this.storefront),o=t.offer_id?Uy(t.offer_id):null;if(t!=null&&t.product_id){const g=li(t.product_id,this.storefront);if(g.value){let _=n.addToCart(g.value,(s=g.value.variations)==null?void 0:s.find(S=>S.id===t.variation_id),(o==null?void 0:o.value)||void 0);t!=null&&t.quantity&&(_=n.setQuantity(_,_.quantity+t.quantity-1)),((i=this.options)==null?void 0:i.value.cart.quantity)==="single"&&(_=n.setQuantity(_,1)),Lr(zt.AddedToCart,{item:_,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const _=li(t.product_id,this.storefront);if(_.value){let S=n.addToCart(_.value,(a=_.value.variations)==null?void 0:a.find(R=>R.id===t.variation_id),(o==null?void 0:o.value)||void 0);t!=null&&t.quantity&&(S=n.setQuantity(S,S.quantity+t.quantity-1)),((l=this.options)==null?void 0:l.value.cart.quantity)==="single"&&(S=n.setQuantity(S,1)),Lr(zt.AddedToCart,{item:S,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 g=Na(t.bundle_id,this.storefront);if(g.value){const _=(u=g.value.variations)==null?void 0:u.find(R=>R.id===t.variation_id);let S=n.addToCart(g.value,_,(o==null?void 0:o.value)||void 0,{bundleBehaviour:(c=this.options)==null?void 0:c.value.cart.bundles.onAdd});t!=null&&t.quantity&&(S=n.setQuantity(S,S.quantity+t.quantity-1)),((d=this.options)==null?void 0:d.value.cart.quantity)==="single"&&(S=n.setQuantity(S,1)),Lr(zt.AddedToCart,{item:S,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const _=Na(t.bundle_id,this.storefront);if(_.value){const S=(f=_.value.variations)==null?void 0:f.find(H=>H.id===t.variation_id);let R=n.addToCart(_.value,S,(o==null?void 0:o.value)||void 0,{bundleBehaviour:(h=this.options)==null?void 0:h.value.cart.bundles.onAdd});t!=null&&t.quantity&&(R=n.setQuantity(R,R.quantity+t.quantity-1)),((p=this.options)==null?void 0:p.value.cart.quantity)==="single"&&(R=n.setQuantity(R,1)),Lr(zt.AddedToCart,{item:R,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&&De(this.pinia).show(ue.Cart,J.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=li(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=Na(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 jy(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;nr(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");De(this.pinia).show(ue.About,J.ViewAbout)}}const sl=new O3;globalThis&&(globalThis.Moonbase?console.warn("Multiple instances of Moonbase detected, only one will be initialized"):globalThis.Moonbase=sl),kt.MoonbaseEvent=zt,kt.MoonbaseIntent=J,kt.default=sl,kt.eventEmitterKey=jr,kt.instanceKey=Dm,kt.urlKey=dc,Object.defineProperties(kt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});