@moonbase.sh/storefront 0.2.51 → 0.2.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/moonbase.js +1 -1
- package/dist/moonbase.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/moonbase.js
CHANGED
|
@@ -3513,7 +3513,6 @@ var ao = /* @__PURE__ */ ((e) => (e.Open = "Open", e.PaymentProcessing = "Paymen
|
|
|
3513
3513
|
name: v.string(),
|
|
3514
3514
|
tagline: v.string(),
|
|
3515
3515
|
iconUrl: v.string().nullable(),
|
|
3516
|
-
partial: v.boolean(),
|
|
3517
3516
|
products: Ju.and(v.object({
|
|
3518
3517
|
included: v.boolean().optional()
|
|
3519
3518
|
})).array()
|
|
@@ -3523,6 +3522,7 @@ var ao = /* @__PURE__ */ ((e) => (e.Open = "Open", e.PaymentProcessing = "Paymen
|
|
|
3523
3522
|
bundleId: v.string(),
|
|
3524
3523
|
quantity: v.number(),
|
|
3525
3524
|
variationId: v.string(),
|
|
3525
|
+
partial: v.boolean().optional(),
|
|
3526
3526
|
price: Br.optional(),
|
|
3527
3527
|
variation: Hr.optional(),
|
|
3528
3528
|
bundle: zp.optional(),
|
package/dist/moonbase.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('#moonbase .moonbase\\:toolbar{position:fixed;bottom:32px;border-radius:16px;background-color:#1a1a1a;color:#f9f9f9;display:flex;transition-duration:.1s;transition-property:all;transition-timing-function:ease-out;transform:translateY(8px);opacity:0}#moonbase .moonbase\\:toolbar[data-location=bottom-right]{right:32px}#moonbase .moonbase\\:toolbar[data-location=bottom-left]{left:32px}#moonbase .moonbase\\:toolbar[data-visible=true]{transform:translateY(0);opacity:1;transition-duration:.5s}#moonbase .moonbase\\:toolbar-action{padding:12px 16px;transition:background-color .25s ease-out;cursor:pointer;display:flex;align-items:center}#moonbase .moonbase\\:toolbar-action:nth-child(1){border-top-left-radius:16px;border-bottom-left-radius:16px}#moonbase .moonbase\\:toolbar-action:last-child{border-top-right-radius:16px;border-bottom-right-radius:16px}#moonbase .moonbase\\:toolbar-action:hover{background-color:#ffffff1a}#moonbase .moonbase\\:toolbar-action[data-action-width=narrow]{padding:12px}#moonbase .moonbase\\:input label{display:block;font-size:14px;font-weight:500;line-height:20px;color:#374151}#moonbase .moonbase\\:input input{display:block;width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:calc(var(--moonbase-input-border-radius) * .5);border-width:1px;border-color:#d1d5db;background-color:var(--moonbase-input-background-color);font-size:.875rem;line-height:1.25rem;padding:8px 12px;margin-top:4px;box-shadow:0 1px 2px 0 var(--moonbase-input-shadow-color);transition:all .25s ease-in-out}#moonbase .moonbase\\:input input:focus{outline:2px solid transparent;outline-offset:2px;box-shadow:#fff 0 0 0 2px,var(--moonbase-input-active-color) 0 0 0 4px,0 1px 2px 0 var(--moonbase-input-shadow-color)}#moonbase .moonbase\\:input input:disabled{opacity:.75}#moonbase .moonbase\\:input .moonbase\\:input-hint{margin-top:8px;font-size:14px;line-height:20px}#moonbase .moonbase\\:input .moonbase\\:input-hint[data-type=error]{color:var(--moonbase-input-error-color)}@keyframes moonbase\\:spin-687bcaf0{to{transform:rotate(360deg)}}#moonbase svg[data-v-687bcaf0]{animation:moonbase\\:spin-687bcaf0 1s linear infinite}#moonbase .moonbase\\:submit-button[data-v-1440b0cf]{position:relative;display:flex;justify-content:center;overflow:hidden;transition-property:color,background-color,border-color,box-shadow;transition-timing-function:ease-in-out;transition-duration:.2s;box-shadow:0 1px 2px 0 var(--moonbase-button-shadow-color)}#moonbase .moonbase\\:submit-button[data-v-1440b0cf][data-v-1440b0cf],#moonbase .moonbase\\:submit-button[data-v-1440b0cf][data-v-1440b0cf]:hover,#moonbase .moonbase\\:submit-button[data-v-1440b0cf][data-v-1440b0cf]:focus,#moonbase .moonbase\\:submit-button[data-v-1440b0cf][data-v-1440b0cf]:active{font-size:.875rem;font-weight:500;line-height:1.25rem;border-radius:var(--moonbase-button-border-radius);border-width:1px;border-color:transparent;border-style:solid;color:var(--moonbase-button-text-color);background-color:var(--moonbase-button-background-color);padding:var(--moonbase-button-padding);height:unset;width:unset}#moonbase .moonbase\\:submit-button[data-v-1440b0cf][data-v-1440b0cf]:hover{background-color:hsl(from var(--moonbase-button-background-color) h s calc(l - 5))}#moonbase .moonbase\\:submit-button[data-v-1440b0cf][data-v-1440b0cf]:focus{transition-duration:.1s;outline:2px solid transparent;outline-offset:2px;box-shadow:#fff 0 0 0 2px,var(--moonbase-button-background-color) 0 0 0 4px,0 1px 2px 0 var(--moonbase-button-shadow-color)}#moonbase .moonbase\\:submit-button[data-v-1440b0cf][data-success][data-v-1440b0cf]{background-color:var(--moonbase-button-success-color)}#moonbase .moonbase\\:submit-button[data-v-1440b0cf][data-error][data-v-1440b0cf]{background-color:var(--moonbase-button-error-color)}#moonbase .moonbase\\:submit-button[data-v-1440b0cf] div[data-v-1440b0cf]{margin-left:-12px;margin-right:12px;height:20px;width:0px;opacity:0;transition-property:opacity,width;transition-duration:.2s;transition-timing-function:ease-in-out}#moonbase .moonbase\\:submit-button[data-v-1440b0cf] div[data-v-1440b0cf][data-visible][data-v-1440b0cf]{width:20px;opacity:1}#moonbase .moonbase\\:submit-button[data-v-1440b0cf] div[data-v-1440b0cf] svg[data-v-1440b0cf]{height:20px;width:20px}#moonbase .moonbase\\:checkbox{display:flex;align-items:flex-start}#moonbase .moonbase\\:checkbox label{font-size:14px;font-weight:500;line-height:20px;color:#374151}#moonbase .moonbase\\:checkbox .moonbase\\:checkbox-container{display:flex;height:24px;align-items:center}#moonbase .moonbase\\:checkbox input{height:16px;width:16px;border-radius:var(--moonbase-input-border-radius);border-width:1px;border-color:#d1d5db;background-color:var(--moonbase-input-background-color);font-size:.875rem;line-height:1.25rem;padding:8px 12px;margin-top:4px;box-shadow:0 1px 2px 0 var(--moonbase-input-shadow-color)}#moonbase .moonbase\\:checkbox input:focus{outline:2px solid transparent;outline-offset:2px;box-shadow:#fff 0 0 0 2px,var(--moonbase-input-active-color) 0 0 0 4px,0 1px 2px 0 var(--moonbase-input-shadow-color)}#moonbase .moonbase\\:checkbox .moonbase\\:checkbox-description{margin-left:12px}#moonbase .moonbase\\:checkbox .moonbase\\:checkbox-description label{font-size:14px;line-height:24px;font-weight:500;color:hsl(from var(--moonbase-text-color) h s calc(l + 5))}#moonbase .moonbase\\:checkbox .moonbase\\:checkbox-description p{font-size:14px;line-height:24px;color:hsl(from var(--moonbase-text-color) h s calc(l + 15))}#moonbase .moonbase\\:checkbox .moonbase\\:checkbox-description p[data-type=error]{color:var(--moonbase-input-error-color)}#moonbase .moonbase\\:sign-up{display:flex;flex-direction:column}#moonbase .moonbase\\:sign-up>*:not(:first-child){margin-top:16px}#moonbase .moonbase\\:sign-up .moonbase\\:error{text-align:center;color:var(--moonbase-error-color, rgb(167, 33, 33));font-weight:600;font-size:14px;line-height:16px;min-height:16px;opacity:0;transition:opacity .2s ease-in}#moonbase .moonbase\\:sign-up .moonbase\\:error[data-visible]{transition:opacity .3s ease-in;opacity:1}#moonbase .moonbase\\:confirm-account{display:flex;flex-direction:column}#moonbase .moonbase\\:confirm-account>*:not(:first-child){margin-top:16px}#moonbase .moonbase\\:confirm-account>.moonbase\\:loader{display:flex;justify-content:center;padding:36px 16px}#moonbase .moonbase\\:confirm-account>.moonbase\\:loader svg{height:24px;width:24px}#moonbase .moonbase\\:confirm-account .moonbase\\:error{text-align:center;color:var(--moonbase-error-color);font-weight:600;font-size:14px;line-height:16px;min-height:16px;opacity:0;transition:opacity .2s ease-in}#moonbase .moonbase\\:confirm-account .moonbase\\:error[data-visible]{transition:opacity .3s ease-in;opacity:1}#moonbase .moonbase\\:reset-password{display:flex;flex-direction:column}#moonbase .moonbase\\:reset-password>*:not(:first-child){margin-top:16px}#moonbase .moonbase\\:reset-password .moonbase\\:error{text-align:center;color:var(--moonbase-error-color, rgb(167, 33, 33));font-weight:600;font-size:14px;line-height:16px;min-height:16px;opacity:0;transition:opacity .2s ease-in}#moonbase .moonbase\\:reset-password .moonbase\\:error[data-visible]{transition:opacity .3s ease-in;opacity:1}#moonbase .moonbase\\:confirm-email-change{display:flex;flex-direction:column}#moonbase .moonbase\\:confirm-email-change>*:not(:first-child){margin-top:16px}#moonbase .moonbase\\:confirm-email-change>.moonbase\\:loader{display:flex;justify-content:center;padding:36px 16px}#moonbase .moonbase\\:confirm-email-change>.moonbase\\:loader svg{height:24px;width:24px}#moonbase .moonbase\\:confirm-email-change .moonbase\\:error{text-align:center;color:var(--moonbase-error-color);font-weight:600;font-size:14px;line-height:16px;min-height:16px;opacity:0;transition:opacity .2s ease-in}#moonbase .moonbase\\:confirm-email-change .moonbase\\:error[data-visible]{transition:opacity .3s ease-in;opacity:1}#moonbase .moonbase\\:modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;overflow-y:auto}#moonbase .moonbase\\:modal-container{display:flex;min-height:100svh;align-items:flex-end;justify-content:center;padding:16px 16px 90px;text-align:center}@media (min-width: 640px){#moonbase .moonbase\\:modal-container{display:block;padding:0}}#moonbase .moonbase\\:modal-center{display:none}@media (min-width: 640px){#moonbase .moonbase\\:modal-center{display:inline-block;height:100svh;vertical-align:middle}}#moonbase .moonbase\\:modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;transition-property:opacity}#moonbase .moonbase\\:modal-overlay[data-transition~=enter]{transition-timing-function:ease-out;transition-duration:.3s}#moonbase .moonbase\\:modal-overlay[data-transition~=enter-from],#moonbase .moonbase\\:modal-overlay[data-transition~=leave-to]{opacity:0}#moonbase .moonbase\\:modal-overlay[data-transition~=enter-to],#moonbase .moonbase\\:modal-overlay[data-transition~=leave-from]{opacity:1}#moonbase .moonbase\\:modal-overlay[data-transition~=leave]{transition-timing-function:ease-in;transition-duration:.2s}#moonbase .moonbase\\:modal-content{position:relative;display:inline-block;margin:80px auto 16px;background-color:var(--moonbase-background-color, white);box-shadow:#64646f33 0 8px 32px;border-radius:calc(var(--moonbase-border-radius, 6px) * 2);vertical-align:bottom;transition-property:all;text-align:left}@media (min-width: 640px){#moonbase .moonbase\\:modal-content{vertical-align:middle}}#moonbase .moonbase\\:modal-content[data-transition~=enter]{transition-timing-function:ease-out;transition-duration:.3s}#moonbase .moonbase\\:modal-content[data-transition~=enter-from]{opacity:0;transform:translateY(16px)}@media (min-width: 640px){#moonbase .moonbase\\:modal-content[data-transition~=enter-from]{transform:scale(.95)}}#moonbase .moonbase\\:modal-content[data-transition~=enter-to]{opacity:1;transform:translateY(0)}@media (min-width: 640px){#moonbase .moonbase\\:modal-content[data-transition~=enter-to]{transform:scale(1)}}#moonbase .moonbase\\:modal-content[data-transition~=leave]{transition-timing-function:ease-in;transition-duration:.2s}#moonbase .moonbase\\:modal-content[data-transition~=leave-from]{opacity:1;transform:translateY(0)}@media (min-width: 640px){#moonbase .moonbase\\:modal-content[data-transition~=leave-from]{transform:scale(1)}}#moonbase .moonbase\\:modal-content[data-transition~=leave-to]{opacity:0;transform:translateY(16px)}@media (min-width: 640px){#moonbase .moonbase\\:modal-content[data-transition~=leave-to]{transform:scale(.95)}}#moonbase .moonbase\\:sign-in{display:flex;flex-direction:column}#moonbase .moonbase\\:sign-in>*:not(:first-child){margin-top:16px}#moonbase .moonbase\\:sign-in .moonbase\\:error{text-align:center;color:var(--moonbase-error-color, rgb(167, 33, 33));font-weight:600;font-size:14px;line-height:16px;min-height:16px;opacity:0;transition:opacity .2s ease-in}#moonbase .moonbase\\:sign-in .moonbase\\:error[data-visible]{transition:opacity .3s ease-in;opacity:1}#moonbase .moonbase\\:authentication{display:inline-block;color:var(--moonbase-text-color, black);padding:32px 64px}@media (min-width: 640px){#moonbase .moonbase\\:authentication{width:100vw;max-width:26rem}}#moonbase .moonbase\\:authentication>h3{font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;margin-bottom:1.5rem}#moonbase .moonbase\\:authentication>.moonbase\\:loader{display:flex;justify-content:center;padding:36px 16px}#moonbase .moonbase\\:authentication>.moonbase\\:loader svg{height:24px;width:24px}#moonbase .moonbase\\:product-cart-item{display:flex;align-items:center}#moonbase .moonbase\\:product-cart-item>:not(:first-child){margin-left:24px}#moonbase .moonbase\\:product-cart-item>img{height:80px;width:80px;flex:none;border-radius:6px;object-fit:cover;object-position:center}#moonbase .moonbase\\:product-cart-item>.moonbase\\:image-placeholder{height:80px;width:80px;flex:none;border-radius:6px;background:var(--moonbase-primary-color, rgb(30 64 175))}#moonbase .moonbase\\:product-cart-item>.moonbase\\:product-cart-item-content{display:flex;flex:1 1 auto;flex-direction:column;align-items:flex-start}#moonbase .moonbase\\:product-cart-item>.moonbase\\:product-cart-item-content>:not(:first-child){margin-top:4px}#moonbase .moonbase\\:product-cart-item>.moonbase\\:product-cart-item-content h3{font-weight:600}#moonbase .moonbase\\:product-cart-item>.moonbase\\:product-cart-item-content .moonbase\\:cart-item-discount{color:hsl(from var(--moonbase-success-color, rgb(22 163 74)) h s calc(l - 10))}#moonbase .moonbase\\:product-cart-item>.moonbase\\:product-cart-item-total{flex:none;text-align:right;font-weight:500;font-size:16px;line-height:21px}#moonbase .moonbase\\:product-cart-item>.moonbase\\:product-cart-item-total>span{display:block;font-size:14px;line-height:20px;opacity:.75}#moonbase .moonbase\\:product-cart-item>.moonbase\\:product-cart-item-total>span.moonbase\\:discount{text-decoration:line-through}#moonbase .moonbase\\:bundle-cart-item{display:flex;align-items:center}#moonbase .moonbase\\:bundle-cart-item>:not(:first-child){margin-left:24px}#moonbase .moonbase\\:bundle-cart-item>img{height:80px;width:80px;flex:none;border-radius:6px;object-fit:cover;object-position:center}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:image-placeholder{height:80px;width:80px;flex:none;border-radius:6px;background:var(--moonbase-primary-color, rgb(30 64 175))}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:bundle-cart-item-content{display:flex;flex:1 1 auto;flex-direction:column;align-items:flex-start}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:bundle-cart-item-content>:not(:first-child){margin-top:4px}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:bundle-cart-item-content h3{font-weight:600}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:bundle-cart-item-content .moonbase\\:cart-item-discount{color:hsl(from var(--moonbase-success-color, rgb(22 163 74)) h s calc(l - 10))}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:bundle-cart-item-content .moonbase\\:bundle-cart-item-summary{display:flex;align-items:flex-start;flex-direction:column}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:bundle-cart-item-content .moonbase\\:bundle-cart-item-summary>:not(:first-child){margin-top:2px}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:bundle-cart-item-content .moonbase\\:bundle-cart-item-summary button{display:flex;align-items:center}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:bundle-cart-item-content .moonbase\\:bundle-cart-item-summary button svg{margin-left:4px;margin-top:4px;height:16px;width:16px;transition:transform .2s ease-in-out;transform:rotate(0)}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:bundle-cart-item-content .moonbase\\:bundle-cart-item-summary button svg[data-open]{transform:rotate(180deg)}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:product-cart-item-total{flex:none;text-align:right;font-weight:500;font-size:16px;line-height:21px}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:product-cart-item-total>span{display:block;font-size:14px;line-height:20px;opacity:.75}#moonbase .moonbase\\:bundle-cart-item>.moonbase\\:product-cart-item-total>span.moonbase\\:discount{text-decoration:line-through}#moonbase .moonbase\\:bundle-cart-item-product-list{overflow:hidden;padding-left:24px;transition-property:height;transition-duration:.3s;transition-timing-function:ease-in-out}#moonbase .moonbase\\:bundle-cart-item-product-list>:not(:first-child){border-top-width:1px;border-color:#0000001a}#moonbase .moonbase\\:bundle-cart-item-product-list>div{display:flex;align-items:center;padding:8px 0}#moonbase .moonbase\\:bundle-cart-item-product-list>div>:not(:first-child){margin-left:16px}#moonbase .moonbase\\:bundle-cart-item-product-list>div>img{height:64px;width:64px;flex:none;border-radius:6px;object-fit:cover;object-position:center}#moonbase .moonbase\\:bundle-cart-item-product-list>div>.moonbase\\:image-placeholder{height:64px;width:64px;flex:none;border-radius:6px;background:var(--moonbase-primary-color, rgb(30 64 175))}#moonbase .moonbase\\:bundle-cart-item-product-list>div>div{display:flex;flex:auto;flex-direction:column;align-items:flex-start}#moonbase .moonbase\\:bundle-cart-item-product-list>div>div>:not(:first-child){margin-top:4px}#moonbase .moonbase\\:bundle-cart-item-product-list>div>div h3{display:flex;align-items:center}#moonbase .moonbase\\:bundle-cart-item-product-list>div>div h3:not([data-included]){text-decoration:line-through;opacity:.75}#moonbase .moonbase\\:bundle-cart-item-product-list>div>div h3 svg{margin-right:4px;height:16px;width:16px}#moonbase .moonbase\\:cart-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;overflow-y:auto}#moonbase .moonbase\\:cart-modal-container{display:flex;height:100svh;align-items:flex-end;justify-content:center;padding:16px 16px 90px}@media (min-width: 640px){#moonbase .moonbase\\:cart-modal-container{display:block;padding:0}}#moonbase .moonbase\\:cart-modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;transition-property:opacity}#moonbase .moonbase\\:cart-modal-overlay[data-transition~=enter]{transition-timing-function:ease-out;transition-duration:.3s}#moonbase .moonbase\\:cart-modal-overlay[data-transition~=enter-from],#moonbase .moonbase\\:cart-modal-overlay[data-transition~=leave-to]{opacity:0}#moonbase .moonbase\\:cart-modal-overlay[data-transition~=enter-to],#moonbase .moonbase\\:cart-modal-overlay[data-transition~=leave-from]{opacity:1}#moonbase .moonbase\\:cart-modal-overlay[data-transition~=leave]{transition-timing-function:ease-in;transition-duration:.2s}#moonbase .moonbase\\:cart-modal-content{position:fixed;top:0;right:0;bottom:0;display:inline-block;background-color:var(--moonbase-background-color, white);box-shadow:#64646f33 0 8px 32px;transition-property:all}#moonbase .moonbase\\:cart-modal-content[data-transition~=enter]{transition-timing-function:ease-out;transition-duration:.3s}#moonbase .moonbase\\:cart-modal-content[data-transition~=enter-from]{opacity:0;transform:translateY(16px)}@media (min-width: 640px){#moonbase .moonbase\\:cart-modal-content[data-transition~=enter-from]{transform:translate(48px)}}#moonbase .moonbase\\:cart-modal-content[data-transition~=enter-to]{opacity:1;transform:translateY(0)}@media (min-width: 640px){#moonbase .moonbase\\:cart-modal-content[data-transition~=enter-to]{transform:translate(0)}}#moonbase .moonbase\\:cart-modal-content[data-transition~=leave]{transition-timing-function:ease-in;transition-duration:.3s}#moonbase .moonbase\\:cart-modal-content[data-transition~=leave-from]{opacity:1;transform:translateY(0)}@media (min-width: 640px){#moonbase .moonbase\\:cart-modal-content[data-transition~=leave-from]{transform:translate(0)}}#moonbase .moonbase\\:cart-modal-content[data-transition~=leave-to]{opacity:0;transform:translateY(16px)}@media (min-width: 640px){#moonbase .moonbase\\:cart-modal-content[data-transition~=leave-to]{transform:translate(48px)}}#moonbase .moonbase\\:button{position:relative;display:flex;justify-content:center;overflow:hidden;transition-property:color,background-color,border-color,box-shadow;transition-timing-function:ease-in-out;transition-duration:.2s;box-shadow:0 1px 2px 0 var(--moonbase-button-shadow-color)}#moonbase .moonbase\\:button[data-variant=secondary]{--moonbase-button-background-color: rgb(107 114 128);--moonbase-button-text-color: white}#moonbase .moonbase\\:button,#moonbase .moonbase\\:button:hover,#moonbase .moonbase\\:button:focus,#moonbase .moonbase\\:button:active{font-size:.875rem;font-weight:500;line-height:1.25rem;border-radius:var(--moonbase-button-border-radius);border-width:1px;border-color:transparent;border-style:solid;color:var(--moonbase-button-text-color);background-color:var(--moonbase-button-background-color);padding:var(--moonbase-button-padding);height:unset;width:unset}#moonbase .moonbase\\:button:hover{background-color:hsl(from var(--moonbase-button-background-color) h s calc(l - 5))}#moonbase .moonbase\\:button:focus{transition-duration:.1s;outline:2px solid transparent;outline-offset:2px;box-shadow:#fff 0 0 0 2px,var(--moonbase-button-background-color) 0 0 0 4px,0 1px 2px 0 var(--moonbase-button-shadow-color)}#moonbase .moonbase\\:button[data-success]{background-color:var(--moonbase-button-success-color)}#moonbase .moonbase\\:button[data-error]{background-color:var(--moonbase-button-error-color)}#moonbase .moonbase\\:button div{margin-left:-12px;margin-right:12px;height:20px;width:0px;opacity:0;transition-property:opacity,width;transition-duration:.2s;transition-timing-function:ease-in-out}#moonbase .moonbase\\:button div[data-visible]{width:20px;opacity:1}#moonbase .moonbase\\:button div svg{height:20px;width:20px}#moonbase .moonbase\\:cart{display:inline-block;color:var(--moonbase-text-color, black);padding:32px}@media (min-width: 640px){#moonbase .moonbase\\:cart{width:100vw;max-width:26rem}}#moonbase .moonbase\\:cart>h3{font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;margin-bottom:1.5rem}#moonbase .moonbase\\:cart>.moonbase\\:cart-items{font-size:14px;line-height:20px;font-weight:500}#moonbase .moonbase\\:cart>.moonbase\\:cart-items>:not(:first-child){border-top-width:1px;border-color:#00000026}#moonbase .moonbase\\:cart>.moonbase\\:cart-items>li{padding:24px 0}#moonbase .moonbase\\:cart>.moonbase\\:cart-items>li>:not(:first-child){margin-left:16px}#moonbase .moonbase\\:cart>.moonbase\\:cart-empty{padding:32px 0;font-size:1.1rem;line-height:1.3rem;font-weight:500}#moonbase .moonbase\\:cart>.moonbase\\:cart-total{width:100%;margin-top:16px;padding:8px;border-radius:4px;background:#0000001a;display:grid;grid-template-columns:repeat(2,1fr);justify-content:space-between}#moonbase .moonbase\\:cart>.moonbase\\:cart-total>label{font-weight:500}#moonbase .moonbase\\:cart>.moonbase\\:cart-total>span{font-weight:600;text-align:right}#moonbase .moonbase\\:cart>.moonbase\\:cart-total>p{grid-column:-1 / 1;padding-top:8px;text-align:center}#moonbase .moonbase\\:cart>button{--moonbase-button-padding: 12px 32px;margin:32px auto 16px;min-width:164px}#moonbase .moonbase\\:account{padding-bottom:32px}#moonbase .moonbase\\:account>*:not(:last-child){margin-bottom:16px}#moonbase .moonbase\\:account form{margin:auto;max-width:420px}#moonbase .moonbase\\:account form>*:not(:first-child){margin-top:8px}#moonbase .moonbase\\:account form .moonbase\\:error{font-size:14px;line-height:20px;font-weight:600;color:var(--moonbase-error-color)}#moonbase .moonbase\\:account form .moonbase\\:notification{font-size:14px;line-height:20px;font-weight:600}#moonbase .moonbase\\:account>button{margin:32px auto 0}#moonbase .moonbase\\:product-downloads{display:flex;border-radius:var(--moonbase-border-radius);box-shadow:0 1px 2px 0 var(--moonbase-button-shadow-color)}#moonbase .moonbase\\:product-downloads button{position:relative;display:inline-flex;align-items:center;transition-property:color,background-color,border-color,box-shadow;transition-timing-function:ease-in-out;transition-duration:.2s;box-shadow:0 1px 2px 0 var(--moonbase-button-shadow-color)}#moonbase .moonbase\\:product-downloads button,#moonbase .moonbase\\:product-downloads button:hover,#moonbase .moonbase\\:product-downloads button:focus,#moonbase .moonbase\\:product-downloads button:active{font-size:.875rem;font-weight:500;line-height:1.25rem;border-radius:0;border-width:1px;border-color:transparent;border-style:solid;color:var(--moonbase-button-text-color);background-color:var(--moonbase-button-background-color);margin:0 -1px;padding:8px;height:unset;width:unset}#moonbase .moonbase\\:product-downloads button:hover{background-color:hsl(from var(--moonbase-button-background-color) h s calc(l - 5))}#moonbase .moonbase\\:product-downloads button:focus{transition-duration:.1s;outline:2px solid transparent;outline-offset:2px;box-shadow:inset #fff 0 0 0 2px,inset var(--moonbase-button-background-color) 0 0 0 4px,0 1px 2px 0 var(--moonbase-button-shadow-color)}#moonbase .moonbase\\:product-downloads>button{border-radius:0}#moonbase .moonbase\\:product-downloads>button:first-child{border-top-left-radius:var(--moonbase-border-radius);border-bottom-left-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-downloads>button[data-last]{border-top-right-radius:var(--moonbase-border-radius);border-bottom-right-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-group{position:relative;margin:0 -1px;display:block}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-group:first-child>button{border-top-left-radius:var(--moonbase-border-radius);border-bottom-left-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-group[data-last]>button{border-top-right-radius:var(--moonbase-border-radius);border-bottom-right-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-group button>:last-child{margin-left:8px}#moonbase .moonbase\\:product-downloads svg{height:20px;width:20px;color:#fff}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list{position:absolute;display:flex;flex-direction:column;right:0;margin-right:-4px;margin-top:8px;max-width:256px;transform-origin:top right;background-color:var(--moonbase-background-color);box-shadow:#0000001a 0 10px 15px -3px,#0000001a 0 4px 6px -4px,#00000040 0 0 0 1px;z-index:999999;border-radius:var(--moonbase-border-radius);overflow:hidden}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list:focus{outline:none}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button{border-radius:0}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button>span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%;display:block;margin:0!important}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button:first-child{border-top-right-radius:var(--moonbase-border-radius);border-top-left-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button:last-child{border-bottom-right-radius:var(--moonbase-border-radius);border-bottom-left-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button,#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button:hover,#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button:focus,#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button:active{color:var(--moonbase-text-color);background-color:transparent;margin:0;padding:8px;height:unset;width:unset}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button:hover,#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button:focus,#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button[data-active]{background-color:hsl(from var(--moonbase-background-color) h s calc(l - 5))}#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button:focus,#moonbase .moonbase\\:product-downloads .moonbase\\:product-downloads-list button[data-active]{box-shadow:none}#moonbase .moonbase\\:product-activations{position:absolute;right:8px;margin-top:8px;transform-origin:top right;background-color:var(--moonbase-background-color);box-shadow:#0000001a 0 10px 15px -3px,#0000001a 0 4px 6px -4px,#00000040 0 0 0 1px;z-index:999999;border-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-activations>thead{border-bottom:1px solid rgb(from var(--moonbase-text-color) r g b / .25)}#moonbase .moonbase\\:product-activations>thead>tr>th{white-space:nowrap;font-size:14px;font-weight:600;line-height:20px;color:hsl(from var(--moonbase-text-color) h s calc(l + 10))}#moonbase .moonbase\\:product-activations>thead>tr>th:first-child{width:100%;padding:8px 12px 8px 16px;border-top-left-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-activations>thead>tr>th:not(:first-child,:last-child){text-align:center;padding:8px 12px}#moonbase .moonbase\\:product-activations>thead>tr>th:last-child{text-align:right;padding:8px 16px 8px 12px;border-top-right-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-activations>tbody>:not(:first-child){border-top-width:1px;border-color:#0000001a}#moonbase .moonbase\\:product-activations>tbody>tr>td{white-space:nowrap;text-overflow:ellipsis;position:relative;font-size:14px;font-weight:600;line-height:20px}#moonbase .moonbase\\:product-activations>tbody>tr>td:first-child{width:100%;padding:8px 12px 8px 16px;border-top-left-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-activations>tbody>tr>td:first-child>svg{height:16px;width:16px;display:inline;margin-right:8px}#moonbase .moonbase\\:product-activations>tbody>tr>td:first-child>div{display:flex;align-items:center}#moonbase .moonbase\\:product-activations>tbody>tr>td:first-child>div>img{height:42px;width:42px;flex:none;border-radius:6px;object-fit:cover;object-position:center}#moonbase .moonbase\\:product-activations>tbody>tr>td:first-child>div>.moonbase\\:image-placeholder{height:42px;width:42px;flex:none;border-radius:6px;background:var(--moonbase-primary-color, rgb(30 64 175))}#moonbase .moonbase\\:product-activations>tbody>tr>td:first-child>div>span{margin-left:8px;font-size:14px;font-weight:500;line-height:20px}#moonbase .moonbase\\:product-activations>tbody>tr>td:not(:first-child,:last-child){text-align:center;padding:14px 12px}#moonbase .moonbase\\:product-activations>tbody>tr>td:last-child{text-align:right;padding:14px 16px 14px 12px;border-top-right-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:product-activations>tbody>tr>td:last-child>div{display:flex;align-items:center;justify-content:flex-end}#moonbase .moonbase\\:product-activations>tbody>tr>td:last-child>div>:not(:first-child){margin-left:8px}#moonbase .moonbase\\:product-activations>tbody>tr>td>button{margin:auto}#moonbase .moonbase\\:product-activations>tbody>tr>td>button,#moonbase .moonbase\\:product-activations>tbody>tr>td>button:hover,#moonbase .moonbase\\:product-activations>tbody>tr>td>button:focus,#moonbase .moonbase\\:product-activations>tbody>tr>td>button:active{width:100%}#moonbase .moonbase\\:products{min-width:calc(100% + 128px);margin:0 -64px}#moonbase .moonbase\\:products>thead{border-bottom:1px solid rgb(from var(--moonbase-text-color) r g b / .25)}#moonbase .moonbase\\:products>thead>tr>th{white-space:nowrap;font-size:14px;font-weight:600;line-height:20px;color:hsl(from var(--moonbase-text-color) h s calc(l + 10))}#moonbase .moonbase\\:products>thead>tr>th:last-child{text-align:right;padding:14px 16px 14px 12px}#moonbase .moonbase\\:products>thead>tr>th:first-child{text-align:left;width:100%;padding:14px 12px 14px 16px}#moonbase .moonbase\\:products>thead>tr>th:not(:first-child,:last-child){text-align:center;padding:14px 12px}#moonbase .moonbase\\:products>tbody>:not(:first-child){border-top-width:1px;border-color:#0000001a}#moonbase .moonbase\\:products>tbody>tr>td{white-space:nowrap;text-overflow:ellipsis;position:relative}#moonbase .moonbase\\:products>tbody>tr>td:first-child{width:100%;padding:14px 12px 14px 16px}#moonbase .moonbase\\:products>tbody>tr>td:first-child>svg{height:16px;width:16px;display:inline;margin-right:8px}#moonbase .moonbase\\:products>tbody>tr>td:first-child>div{display:flex;align-items:center}#moonbase .moonbase\\:products>tbody>tr>td:first-child>div>img{height:42px;width:42px;flex:none;border-radius:6px;object-fit:cover;object-position:center}#moonbase .moonbase\\:products>tbody>tr>td:first-child>div>.moonbase\\:image-placeholder{height:42px;width:42px;flex:none;border-radius:6px;background:var(--moonbase-primary-color)}#moonbase .moonbase\\:products>tbody>tr>td:first-child>div>span{margin-left:8px;font-size:14px;font-weight:500;line-height:20px}#moonbase .moonbase\\:products>tbody>tr>td:not(:first-child,:last-child){text-align:center;padding:14px 12px}#moonbase .moonbase\\:products>tbody>tr>td:last-child{text-align:right;padding:14px 16px 14px 12px}#moonbase .moonbase\\:products>tbody>tr>td:last-child>div{display:flex;align-items:center;justify-content:flex-end}#moonbase .moonbase\\:products>tbody>tr>td:last-child>div>:not(:first-child){margin-left:8px}#moonbase .moonbase\\:products>tbody>tr>td>button{margin:auto}#moonbase .moonbase\\:products>tbody>tr>td>button,#moonbase .moonbase\\:products>tbody>tr>td>button:hover,#moonbase .moonbase\\:products>tbody>tr>td>button:focus,#moonbase .moonbase\\:products>tbody>tr>td>button:active{width:100%}#moonbase .moonbase\\:redeem>form{display:flex;flex-direction:column;max-width:240px;margin:64px auto 32px}#moonbase .moonbase\\:redeem>form>*:not(:first-child){margin-top:16px}#moonbase .moonbase\\:redeem>form>button{margin:auto}#moonbase .moonbase\\:redeem>form .moonbase\\:error{text-align:center;color:var(--moonbase-error-color, rgb(167, 33, 33));font-weight:600;font-size:14px;line-height:16px;min-height:16px;opacity:0;transition:opacity .2s ease-in}#moonbase .moonbase\\:redeem>form .moonbase\\:error[data-visible]{transition:opacity .3s ease-in;opacity:1}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher{max-width:320px;margin:16px auto;padding:16px;box-shadow:0 0 0 2px var(--moonbase-button-shadow-color);border-radius:var(--moonbase-border-radius)}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-products>*:not(:first-child){border-top:1px solid rgb(from var(--moonbase-text-color) r g b / .3)}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-product,#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-bundle{display:flex;align-items:center;padding:8px 0}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-product>*:not(:first-child),#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-bundle>*:not(:first-child){margin-left:12px}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-product>:first-child,#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-bundle>:first-child{flex-shrink:0}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-product>:first-child>img,#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-bundle>:first-child>img{height:42px;width:42px;flex:none;border-radius:6px;object-fit:cover;object-position:center}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-product>:first-child>.moonbase\\:image-placeholder,#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-bundle>:first-child>.moonbase\\:image-placeholder{height:42px;width:42px;flex:none;border-radius:6px;background:var(--moonbase-primary-color)}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-product>:last-child,#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-bundle>:last-child{flex:1;min-width:0}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-product>:last-child>:first-child,#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-bundle>:last-child>:first-child{font-size:14px;font-weight:500;line-height:20px}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-product>:last-child>:last-child,#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-bundle>:last-child>:last-child{font-size:14px;line-height:20px;text-overflow:ellipsis}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-bundle-products{padding-left:32px}#moonbase .moonbase\\:redeem .moonbase\\:redeem-voucher-bundle-products>*:not(:first-child){border-top:1px solid rgb(from var(--moonbase-text-color) r g b / .3)}#moonbase .moonbase\\:customer{display:inline-block;color:var(--moonbase-text-color);padding:32px 64px 16px}@media (min-width: 640px){#moonbase .moonbase\\:customer{width:100vw;max-width:32rem}}#moonbase .moonbase\\:customer>[role=tablist]{margin:0 -32px 16px;padding:0 32px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(from var(--moonbase-button-background-color) r g b / .25);display:flex}#moonbase .moonbase\\:customer>[role=tablist]>[role=tab]{margin-bottom:-1px;width:33%;padding:8px 4px;text-align:center;font-size:14px;font-weight:500;line-height:20px;border-bottom-width:2px;border-bottom-style:solid;border-bottom-color:transparent;color:hsl(from var(--moonbase-text-color) h s calc(l + 15));transition-property:border-bottom-color,color;transition-duration:.25s;transition-timing-function:ease-out}#moonbase .moonbase\\:customer>[role=tablist]>[role=tab]:hover{color:hsl(from var(--moonbase-text-color) h s calc(l + 5));border-bottom-color:hsl(from var(--moonbase-text-color) h s calc(l + 15))}#moonbase .moonbase\\:customer>[role=tablist]>[role=tab][aria-selected=true]{color:hsl(from var(--moonbase-primary-color) h s calc(l - 15));border-bottom-color:hsl(from var(--moonbase-primary-color) h s calc(l - 10))}#moonbase .moonbase\\:auto-activate .moonbase\\:loader{display:flex;align-items:center;flex-direction:column;padding:36px 16px;text-align:center}#moonbase .moonbase\\:auto-activate .moonbase\\:loader svg{height:24px;width:24px}#moonbase .moonbase\\:auto-activate .moonbase\\:loader h3{color:var(--moonbase-text-color);font-size:18px;font-weight:500;line-height:24px}#moonbase .moonbase\\:auto-activate .moonbase\\:loader p{margin-top:4px;color:hsl(from var(--moonbase-text-color) h s calc(l + 10));font-size:14px;font-weight:500;line-height:18px}#moonbase .moonbase\\:auto-activate .moonbase\\:auto-activate-product{display:flex;align-items:center}#moonbase .moonbase\\:auto-activate .moonbase\\:auto-activate-product>img{height:42px;width:42px;flex:none;border-radius:6px;object-fit:cover;object-position:center}#moonbase .moonbase\\:auto-activate .moonbase\\:auto-activate-product>.moonbase\\:image-placeholder{height:42px;width:42px;flex:none;border-radius:6px;background:var(--moonbase-primary-color)}#moonbase .moonbase\\:auto-activate .moonbase\\:auto-activate-product div{margin-left:8px}#moonbase .moonbase\\:auto-activate .moonbase\\:auto-activate-product div h2{color:var(--moonbase-text-color);font-size:16px;font-weight:500;line-height:20px}#moonbase .moonbase\\:auto-activate .moonbase\\:auto-activate-product div h3{margin-top:2px;color:hsl(from var(--moonbase-text-color) h s calc(l + 10));font-size:14px;font-weight:500;line-height:18px}#moonbase .moonbase\\:auto-activate .moonbase\\:auto-activate-content{margin-top:16px;text-align:center;color:hsl(from var(--moonbase-text-color) h s calc(l + 10));font-size:16px;font-weight:500;line-height:20px}#moonbase .moonbase\\:auto-activate .moonbase\\:auto-activate-content .moonbase\\:auto-activate-cta{margin:16px auto 0;display:flex;justify-content:center;text-align:center}#moonbase .moonbase\\:auto-activate .moonbase\\:auto-activate-content .moonbase\\:auto-activate-cta>:not(:first-child){margin-left:8px}#moonbase .moonbase\\:auto-activate .moonbase\\:auto-activate-content .moonbase\\:auto-activate-trial{margin-top:16px;padding-top:16px;border-top-width:1px;border-color:rgb(from var(--moonbase-text-color) r g b / .2);border-style:solid}#moonbase .moonbase\\:activation{display:inline-block;color:var(--moonbase-text-color, black);padding:32px 64px}@media (min-width: 640px){#moonbase .moonbase\\:activation{width:100vw;max-width:26rem}}#moonbase .moonbase\\:activation>h3{font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;margin-bottom:1.5rem}#moonbase .moonbase\\:download-product .moonbase\\:loader{display:flex;align-items:center;flex-direction:column;padding:36px 16px;text-align:center}#moonbase .moonbase\\:download-product .moonbase\\:loader svg{height:24px;width:24px}#moonbase .moonbase\\:download-product .moonbase\\:loader h3{color:var(--moonbase-text-color);font-size:18px;font-weight:500;line-height:24px}#moonbase .moonbase\\:download-product .moonbase\\:loader p{margin-top:4px;color:hsl(from var(--moonbase-text-color) h s calc(l + 10));font-size:14px;font-weight:500;line-height:18px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-product{display:flex;align-items:center}#moonbase .moonbase\\:download-product .moonbase\\:download-product-product>img{height:42px;width:42px;flex:none;border-radius:6px;object-fit:cover;object-position:center}#moonbase .moonbase\\:download-product .moonbase\\:download-product-product>.moonbase\\:image-placeholder{height:42px;width:42px;flex:none;border-radius:6px;background:var(--moonbase-primary-color)}#moonbase .moonbase\\:download-product .moonbase\\:download-product-product div{margin-left:8px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-product div h2{color:var(--moonbase-text-color);font-size:16px;font-weight:500;line-height:20px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-product div h2 span{opacity:.75;font-size:14px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-product div h3{margin-top:2px;color:hsl(from var(--moonbase-text-color) h s calc(l + 10));font-size:14px;font-weight:500;line-height:18px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content{margin-top:16px;text-align:left;color:hsl(from var(--moonbase-text-color) h calc(s - 25) calc(l + 10));font-size:16px;font-weight:500;line-height:20px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content>:not(:first-child){margin-top:16px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content .moonbase\\:download-product-cta{margin:16px auto 0;display:flex;justify-content:center;text-align:center}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content .moonbase\\:download-product-cta>:not(:first-child){margin-left:8px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul{border-radius:6px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul>:not(:first-child){border-top:1px solid rgb(from var(--moonbase-text-color) r g b / .25)}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li{position:relative;display:flex;justify-content:space-between;transition:background-color .25s ease-in-out;padding:12px 16px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li:hover{background-color:#0000001a}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li:first-child{border-top-left-radius:6px;border-top-right-radius:6px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li:last-child{border-bottom-left-radius:6px;border-bottom-right-radius:6px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li>:not(:first-child){margin-left:20px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li>div:first-child{min-width:0}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li>div:first-child .moonbase\\:download-product-download-name{font-weight:600;line-height:24px;font-size:14px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li>div:first-child .moonbase\\:download-product-download-description{display:flex;align-items:center;line-height:24px;font-size:14px;color:hsl(from var(--moonbase-text-color) h calc(s - 25) calc(l + 20))}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li>div:first-child .moonbase\\:download-product-download-description svg{height:16px;width:16px;margin-right:6px;color:hsl(from var(--moonbase-text-color) h calc(s - 25) calc(l + 20))}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li>div:first-child .moonbase\\:download-product-download-description span{opacity:.5;margin:0 6px}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li>div:last-child{display:flex;align-items:center;flex-shrink:0}#moonbase .moonbase\\:download-product .moonbase\\:download-product-content ul li>div:last-child svg{flex:none;height:20px;width:20px;color:hsl(from var(--moonbase-text-color) h calc(s - 25) calc(l + 20))}#moonbase .moonbase\\:download-product .moonbase\\:download-product-clicker{position:absolute;top:0;right:0;left:0;padding:-1px 0;bottom:0}#moonbase .moonbase\\:download{display:inline-block;color:var(--moonbase-text-color, black);padding:32px 64px}@media (min-width: 640px){#moonbase .moonbase\\:download{width:100vw;max-width:26rem}}#moonbase .moonbase\\:download>h3{font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;margin-bottom:1.5rem}#moonbase,#moonbase *:not(svg,path),#moonbase :before,#moonbase :after{all:revert;box-sizing:border-box;border-width:0;border-style:solid}#moonbase *:not(svg,path){margin:0;padding:0;font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"}#moonbase{--moonbase-text-color: rgb(17 24 39);--moonbase-primary-color: rgb(79 70 229);--moonbase-error-color: rgb(167, 33, 33);--moonbase-background-color: white;--moonbase-button-padding: 8px 32px;--moonbase-button-text-color: rgb(255 255 255);--moonbase-button-background-color: var(--moonbase-primary-color);--moonbase-button-shadow-color: rgb(0 0 0 / .05);--moonbase-button-success-color: rgb(22 163 74);--moonbase-button-error-color: rgb(167, 33, 33);--moonbase-button-border-radius: var(--moonbase-border-radius, 6px);--moonbase-input-active-color: var(--moonbase-primary-color);--moonbase-input-shadow-color: rgb(0 0 0 / .05);--moonbase-input-error-color: rgb(167, 33, 33);--moonbase-input-background-color: transparent;--moonbase-input-text-color:var(--moonbase-text-color);--moonbase-input-border-radius: var(--moonbase-border-radius, 6px);--moonbase-modal-padding: 8px 32px;--moonbase-modal-text-color: var(--moonbase-text-color);--moonbase-modal-background-color: rgb(255 255 255);--moonbase-modal-shadow-color: rgb(0 0 0 / .05);--moonbase-modal-border-radius: var(--moonbase-border-radius, 6px)}#moonbase .moonbase\\:scale-enter-active{transition-property:transform,opacity;transition-timing-function:ease-out;transition-duration:.2s}#moonbase .moonbase\\:scale-enter-from{opacity:0;transform:scale(.95)}#moonbase .moonbase\\:scale-enter-to{opacity:1;transform:scale(1)}#moonbase .moonbase\\:scale-leave-active{transition-property:transform,opacity;transition-timing-function:ease-in;transition-duration:.15s}#moonbase .moonbase\\:scale-leave-from{opacity:1;transform:scale(1)}#moonbase .moonbase\\:scale-leave-to{opacity:0;transform:scale(.95)}#moonbase .moonbase\\:slide-left-enter-active{transition-property:transform,opacity;transition-timing-function:ease-out;transition-duration:.2s}#moonbase .moonbase\\:slide-left-enter-from{opacity:0;transform:translate(1rem)}#moonbase .moonbase\\:slide-left-enter-to{opacity:1;transform:translate(0)}#moonbase .moonbase\\:slide-left-leave-active{transition-property:transform,opacity;transition-timing-function:ease-in;transition-duration:.15s}#moonbase .moonbase\\:slide-left-leave-from{opacity:1;transform:translate(0)}#moonbase .moonbase\\:slide-left-leave-to{opacity:0;transform:translate(-1rem)}#moonbase .moonbase\\:sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}#moonbase a{color:inherit;text-decoration:inherit}#moonbase input,#moonbase button,#moonbase textarea,#moonbase select{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;letter-spacing:inherit;background:none;font-size:100%;line-height:1.15;margin:0;padding:0;color:inherit}#moonbase button,#moonbase select{text-transform:none}#moonbase button,#moonbase [role=button]{cursor:pointer}#moonbase button,#moonbase [type=button],#moonbase [type=reset],#moonbase [type=submit]{-webkit-appearance:button}#moonbase h1,#moonbase h2,#moonbase h3,#moonbase h4,#moonbase h5,#moonbase h6{font-size:inherit;font-weight:inherit}#moonbase b,#moonbase strong{font-weight:bolder}#moonbase svg,.moonbase svg *{color:inherit}#moonbase table{text-indent:0;border-color:inherit;border-collapse:collapse}#moonbase img,#moonbase svg,#moonbase video,#moonbase canvas,#moonbase audio,#moonbase iframe,#moonbase embed,#moonbase object{display:block;vertical-align:middle}#moonbase ol,#moonbase ul,#moonbase menu{list-style:none;margin:0;padding:0}#moonbase img,#moonbase video{max-width:100%;height:auto}#moonbase :disabled{cursor:default}#moonbase [hidden]{display:none}#moonbase ::-moz-focus-inner{border-style:none;padding:0}#moonbase :-moz-focusring{outline:none}#moonbase :-moz-ui-invalid{box-shadow:none}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
(function(kt,be){typeof exports=="object"&&typeof module<"u"?be(exports):typeof define=="function"&&define.amd?define(["exports"],be):(kt=typeof globalThis<"u"?globalThis:kt||self,be(kt.Moonbase={}))})(this,function(kt){"use strict";var Nw=Object.defineProperty;var xw=(kt,be,Tn)=>be in kt?Nw(kt,be,{enumerable:!0,configurable:!0,writable:!0,value:Tn}):kt[be]=Tn;var Tr=(kt,be,Tn)=>xw(kt,typeof be!="symbol"?be+"":be,Tn);var be;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(const i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(be||(be={}));var Tn;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Tn||(Tn={}));const ne=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Cn=e=>{switch(typeof e){case"undefined":return ne.undefined;case"string":return ne.string;case"number":return isNaN(e)?ne.nan:ne.number;case"boolean":return ne.boolean;case"function":return ne.function;case"bigint":return ne.bigint;case"symbol":return ne.symbol;case"object":return Array.isArray(e)?ne.array:e===null?ne.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ne.promise:typeof Map<"u"&&e instanceof Map?ne.map:typeof Set<"u"&&e instanceof Set?ne.set:typeof Date<"u"&&e instanceof Date?ne.date:ne.object;default:return ne.unknown}},B=be.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),$f=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Tt extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(i))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return o(this),r}static assert(t){if(!(t instanceof Tt))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Tt.create=e=>new Tt(e);const Cr=(e,t)=>{let n;switch(e.code){case B.invalid_type:e.received===ne.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case B.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,be.jsonStringifyReplacer)}`;break;case B.unrecognized_keys:n=`Unrecognized key(s) in object: ${be.joinValues(e.keys,", ")}`;break;case B.invalid_union:n="Invalid input";break;case B.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${be.joinValues(e.options)}`;break;case B.invalid_enum_value:n=`Invalid enum value. Expected ${be.joinValues(e.options)}, received '${e.received}'`;break;case B.invalid_arguments:n="Invalid function arguments";break;case B.invalid_return_type:n="Invalid function return type";break;case B.invalid_date:n="Invalid date";break;case B.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:be.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case B.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case B.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case B.custom:n="Invalid input";break;case B.invalid_intersection_types:n="Intersection results could not be merged";break;case B.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case B.not_finite:n="Number must be finite";break;default:n=t.defaultError,be.assertNever(e)}return{message:n}};let vl=Cr;function If(e){vl=e}function os(){return vl}const ss=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}},Af=[];function ee(e,t){const n=os(),r=ss({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Cr?void 0:Cr].filter(o=>!!o)});e.common.issues.push(r)}class ut{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return ve;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return ut.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return ve;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:t.value,value:r}}}const ve=Object.freeze({status:"aborted"}),Pr=e=>({status:"dirty",value:e}),vt=e=>({status:"valid",value:e}),wi=e=>e.status==="aborted",Ei=e=>e.status==="dirty",Jr=e=>e.status==="valid",Yr=e=>typeof Promise<"u"&&e instanceof Promise;function is(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function gl(e,t,n,r,o){if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}typeof SuppressedError=="function"&&SuppressedError;var se;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(se||(se={}));var Xr,Qr;class Gt{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const yl=(e,t)=>{if(Jr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Tt(e.common.issues);return this._error=n,this._error}}};function Ee(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,a)=>{var l,u;const{message:c}=e;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(l=c??r)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(u=c??n)!==null&&u!==void 0?u:a.defaultError}},description:o}}class Ne{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Cn(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Cn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ut,ctx:{common:t.parent.common,data:t.data,parsedType:Cn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Yr(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Cn(t)},s=this._parseSync({data:t,path:o.path,parent:o});return yl(o,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Cn(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(Yr(o)?o:Promise.resolve(o));return yl(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=t(o),a=()=>s.addIssue({code:B.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Ft({schema:this,typeName:pe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Yt.create(this,this._def)}nullable(){return In.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ut.create(this,this._def)}promise(){return Ar.create(this,this._def)}or(t){return ro.create([this,t],this._def)}and(t){return oo.create(this,t,this._def)}transform(t){return new Ft({...Ee(this._def),schema:this,typeName:pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new uo({...Ee(this._def),innerType:this,defaultValue:n,typeName:pe.ZodDefault})}brand(){return new xi({typeName:pe.ZodBranded,type:this,...Ee(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new co({...Ee(this._def),innerType:this,catchValue:n,typeName:pe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return fo.create(this,t)}readonly(){return po.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Vf=/^c[^\s-]{8,}$/i,Rf=/^[0-9a-z]+$/,jf=/^[0-9A-HJKMNP-TV-Z]{26}$/,Lf=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Mf=/^[a-z0-9_-]{21}$/i,Uf=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ff=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oi;const Hf=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zf=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,qf=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bl="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Wf=new RegExp(`^${bl}$`);function _l(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function zf(e){return new RegExp(`^${_l(e)}$`)}function wl(e){let t=`${bl}T${_l(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Kf(e,t){return!!((t==="v4"||!t)&&Hf.test(e)||(t==="v6"||!t)&&Zf.test(e))}class Mt extends Ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ne.string){const s=this._getOrReturnCtx(t);return ee(s,{code:B.invalid_type,expected:ne.string,received:s.parsedType}),ve}const r=new ut;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:B.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:B.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=t.data.length>s.value,a=t.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(t,o),i?ee(o,{code:B.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ee(o,{code:B.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Ff.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"email",code:B.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Oi||(Oi=new RegExp(Bf,"u")),Oi.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"emoji",code:B.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Lf.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"uuid",code:B.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")Mf.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"nanoid",code:B.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Vf.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid",code:B.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Rf.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid2",code:B.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")jf.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ulid",code:B.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ee(o,{validation:"url",code:B.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"regex",code:B.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),ee(o,{code:B.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:B.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:B.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?wl(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:B.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?Wf.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:B.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?zf(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:B.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?Uf.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"duration",code:B.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Kf(t.data,s.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ip",code:B.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?qf.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64",code:B.invalid_string,message:s.message}),r.dirty()):be.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:B.invalid_string,...se.errToObj(r)})}_addCheck(t){return new Mt({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...se.errToObj(t)})}url(t){return this._addCheck({kind:"url",...se.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...se.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...se.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...se.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...se.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...se.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...se.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...se.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...se.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...se.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...se.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...se.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...se.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...se.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...se.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...se.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...se.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...se.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...se.errToObj(n)})}nonempty(t){return this.min(1,se.errToObj(t))}trim(){return new Mt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Mt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Mt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Mt.create=e=>{var t;return new Mt({checks:[],typeName:pe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ee(e)})};function Gf(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=parseInt(e.toFixed(o).replace(".","")),i=parseInt(t.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}class Pn extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ne.number){const s=this._getOrReturnCtx(t);return ee(s,{code:B.invalid_type,expected:ne.number,received:s.parsedType}),ve}let r;const o=new ut;for(const s of this._def.checks)s.kind==="int"?be.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:B.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:B.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:B.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?Gf(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),ee(r,{code:B.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:B.not_finite,message:s.message}),o.dirty()):be.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,se.toString(n))}gt(t,n){return this.setLimit("min",t,!1,se.toString(n))}lte(t,n){return this.setLimit("max",t,!0,se.toString(n))}lt(t,n){return this.setLimit("max",t,!1,se.toString(n))}setLimit(t,n,r,o){return new Pn({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:se.toString(o)}]})}_addCheck(t){return new Pn({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:se.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:se.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:se.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:se.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:se.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:se.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:se.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:se.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:se.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&be.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Pn.create=e=>new Pn({checks:[],typeName:pe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ee(e)});class Dn extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ne.bigint){const s=this._getOrReturnCtx(t);return ee(s,{code:B.invalid_type,expected:ne.bigint,received:s.parsedType}),ve}let r;const o=new ut;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:B.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:B.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:B.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):be.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,se.toString(n))}gt(t,n){return this.setLimit("min",t,!1,se.toString(n))}lte(t,n){return this.setLimit("max",t,!0,se.toString(n))}lt(t,n){return this.setLimit("max",t,!1,se.toString(n))}setLimit(t,n,r,o){return new Dn({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:se.toString(o)}]})}_addCheck(t){return new Dn({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:se.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:se.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:se.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:se.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:se.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Dn.create=e=>{var t;return new Dn({checks:[],typeName:pe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ee(e)})};class eo extends Ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ne.boolean){const r=this._getOrReturnCtx(t);return ee(r,{code:B.invalid_type,expected:ne.boolean,received:r.parsedType}),ve}return vt(t.data)}}eo.create=e=>new eo({typeName:pe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ee(e)});class rr extends Ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ne.date){const s=this._getOrReturnCtx(t);return ee(s,{code:B.invalid_type,expected:ne.date,received:s.parsedType}),ve}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ee(s,{code:B.invalid_date}),ve}const r=new ut;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:B.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:B.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):be.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new rr({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:se.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:se.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}rr.create=e=>new rr({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:pe.ZodDate,...Ee(e)});class as extends Ne{_parse(t){if(this._getType(t)!==ne.symbol){const r=this._getOrReturnCtx(t);return ee(r,{code:B.invalid_type,expected:ne.symbol,received:r.parsedType}),ve}return vt(t.data)}}as.create=e=>new as({typeName:pe.ZodSymbol,...Ee(e)});class to extends Ne{_parse(t){if(this._getType(t)!==ne.undefined){const r=this._getOrReturnCtx(t);return ee(r,{code:B.invalid_type,expected:ne.undefined,received:r.parsedType}),ve}return vt(t.data)}}to.create=e=>new to({typeName:pe.ZodUndefined,...Ee(e)});class no extends Ne{_parse(t){if(this._getType(t)!==ne.null){const r=this._getOrReturnCtx(t);return ee(r,{code:B.invalid_type,expected:ne.null,received:r.parsedType}),ve}return vt(t.data)}}no.create=e=>new no({typeName:pe.ZodNull,...Ee(e)});class Dr extends Ne{constructor(){super(...arguments),this._any=!0}_parse(t){return vt(t.data)}}Dr.create=e=>new Dr({typeName:pe.ZodAny,...Ee(e)});class or extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return vt(t.data)}}or.create=e=>new or({typeName:pe.ZodUnknown,...Ee(e)});class fn extends Ne{_parse(t){const n=this._getOrReturnCtx(t);return ee(n,{code:B.invalid_type,expected:ne.never,received:n.parsedType}),ve}}fn.create=e=>new fn({typeName:pe.ZodNever,...Ee(e)});class ls extends Ne{_parse(t){if(this._getType(t)!==ne.undefined){const r=this._getOrReturnCtx(t);return ee(r,{code:B.invalid_type,expected:ne.void,received:r.parsedType}),ve}return vt(t.data)}}ls.create=e=>new ls({typeName:pe.ZodVoid,...Ee(e)});class Ut extends Ne{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==ne.array)return ee(n,{code:B.invalid_type,expected:ne.array,received:n.parsedType}),ve;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(ee(n,{code:i?B.too_big:B.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(ee(n,{code:B.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(ee(n,{code:B.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Gt(n,i,n.path,a)))).then(i=>ut.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new Gt(n,i,n.path,a)));return ut.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Ut({...this._def,minLength:{value:t,message:se.toString(n)}})}max(t,n){return new Ut({...this._def,maxLength:{value:t,message:se.toString(n)}})}length(t,n){return new Ut({...this._def,exactLength:{value:t,message:se.toString(n)}})}nonempty(t){return this.min(1,t)}}Ut.create=(e,t)=>new Ut({type:e,minLength:null,maxLength:null,exactLength:null,typeName:pe.ZodArray,...Ee(t)});function $r(e){if(e instanceof ze){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Yt.create($r(r))}return new ze({...e._def,shape:()=>t})}else return e instanceof Ut?new Ut({...e._def,type:$r(e.element)}):e instanceof Yt?Yt.create($r(e.unwrap())):e instanceof In?In.create($r(e.unwrap())):e instanceof Jt?Jt.create(e.items.map(t=>$r(t))):e}class ze extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=be.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ne.object){const u=this._getOrReturnCtx(t);return ee(u,{code:B.invalid_type,expected:ne.object,received:u.parsedType}),ve}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof fn&&this._def.unknownKeys==="strip"))for(const u in o.data)i.includes(u)||a.push(u);const l=[];for(const u of i){const c=s[u],d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Gt(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof fn){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:o.data[c]}});else if(u==="strict")a.length>0&&(ee(o,{code:B.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Gt(o,d,o.path,c)),alwaysSet:c in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>ut.mergeObjectSync(r,u)):ut.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return se.errToObj,new ze({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s,i,a;const l=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=se.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new ze({...this._def,unknownKeys:"strip"})}passthrough(){return new ze({...this._def,unknownKeys:"passthrough"})}extend(t){return new ze({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ze({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:pe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ze({...this._def,catchall:t})}pick(t){const n={};return be.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ze({...this._def,shape:()=>n})}omit(t){const n={};return be.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new ze({...this._def,shape:()=>n})}deepPartial(){return $r(this)}partial(t){const n={};return be.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new ze({...this._def,shape:()=>n})}required(t){const n={};return be.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Yt;)s=s._def.innerType;n[r]=s}}),new ze({...this._def,shape:()=>n})}keyof(){return El(be.objectKeys(this.shape))}}ze.create=(e,t)=>new ze({shape:()=>e,unknownKeys:"strip",catchall:fn.create(),typeName:pe.ZodObject,...Ee(t)}),ze.strictCreate=(e,t)=>new ze({shape:()=>e,unknownKeys:"strict",catchall:fn.create(),typeName:pe.ZodObject,...Ee(t)}),ze.lazycreate=(e,t)=>new ze({shape:e,unknownKeys:"strip",catchall:fn.create(),typeName:pe.ZodObject,...Ee(t)});class ro extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new Tt(a.ctx.common.issues));return ee(n,{code:B.invalid_union,unionErrors:i}),ve}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(l=>new Tt(l));return ee(n,{code:B.invalid_union,unionErrors:a}),ve}}get options(){return this._def.options}}ro.create=(e,t)=>new ro({options:e,typeName:pe.ZodUnion,...Ee(t)});const pn=e=>e instanceof io?pn(e.schema):e instanceof Ft?pn(e.innerType()):e instanceof ao?[e.value]:e instanceof $n?e.options:e instanceof lo?be.objectValues(e.enum):e instanceof uo?pn(e._def.innerType):e instanceof to?[void 0]:e instanceof no?[null]:e instanceof Yt?[void 0,...pn(e.unwrap())]:e instanceof In?[null,...pn(e.unwrap())]:e instanceof xi||e instanceof po?pn(e.unwrap()):e instanceof co?pn(e._def.innerType):[];class us extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.object)return ee(n,{code:B.invalid_type,expected:ne.object,received:n.parsedType}),ve;const r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ee(n,{code:B.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const s of n){const i=pn(s.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,s)}}return new us({typeName:pe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...Ee(r)})}}function Ni(e,t){const n=Cn(e),r=Cn(t);if(e===t)return{valid:!0,data:e};if(n===ne.object&&r===ne.object){const o=be.objectKeys(t),s=be.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(const a of s){const l=Ni(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===ne.array&&r===ne.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],l=Ni(i,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===ne.date&&r===ne.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class oo extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(s,i)=>{if(wi(s)||wi(i))return ve;const a=Ni(s.value,i.value);return a.valid?((Ei(s)||Ei(i))&&n.dirty(),{status:n.value,value:a.data}):(ee(r,{code:B.invalid_intersection_types}),ve)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}oo.create=(e,t,n)=>new oo({left:e,right:t,typeName:pe.ZodIntersection,...Ee(n)});class Jt extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.array)return ee(r,{code:B.invalid_type,expected:ne.array,received:r.parsedType}),ve;if(r.data.length<this._def.items.length)return ee(r,{code:B.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ve;!this._def.rest&&r.data.length>this._def.items.length&&(ee(r,{code:B.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Gt(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>ut.mergeArray(n,i)):ut.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Jt({...this._def,rest:t})}}Jt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Jt({items:e,typeName:pe.ZodTuple,rest:null,...Ee(t)})};class so extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.object)return ee(r,{code:B.invalid_type,expected:ne.object,received:r.parsedType}),ve;const o=[],s=this._def.keyType,i=this._def.valueType;for(const a in r.data)o.push({key:s._parse(new Gt(r,a,r.path,a)),value:i._parse(new Gt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?ut.mergeObjectAsync(n,o):ut.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ne?new so({keyType:t,valueType:n,typeName:pe.ZodRecord,...Ee(r)}):new so({keyType:Mt.create(),valueType:t,typeName:pe.ZodRecord,...Ee(n)})}}class cs extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.map)return ee(r,{code:B.invalid_type,expected:ne.map,received:r.parsedType}),ve;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,l],u)=>({key:o._parse(new Gt(r,a,r.path,[u,"key"])),value:s._parse(new Gt(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return ve;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of i){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return ve;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}}cs.create=(e,t,n)=>new cs({valueType:t,keyType:e,typeName:pe.ZodMap,...Ee(n)});class sr extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ne.set)return ee(r,{code:B.invalid_type,expected:ne.set,received:r.parsedType}),ve;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ee(r,{code:B.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(ee(r,{code:B.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(l){const u=new Set;for(const c of l){if(c.status==="aborted")return ve;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>s._parse(new Gt(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,n){return new sr({...this._def,minSize:{value:t,message:se.toString(n)}})}max(t,n){return new sr({...this._def,maxSize:{value:t,message:se.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}sr.create=(e,t)=>new sr({valueType:e,minSize:null,maxSize:null,typeName:pe.ZodSet,...Ee(t)});class Ir extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.function)return ee(n,{code:B.invalid_type,expected:ne.function,received:n.parsedType}),ve;function r(a,l){return ss({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,os(),Cr].filter(u=>!!u),issueData:{code:B.invalid_arguments,argumentsError:l}})}function o(a,l){return ss({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,os(),Cr].filter(u=>!!u),issueData:{code:B.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Ar){const a=this;return vt(async function(...l){const u=new Tt([]),c=await a._def.args.parseAsync(l,s).catch(m=>{throw u.addIssue(r(l,m)),u}),d=await Reflect.apply(i,this,c);return await a._def.returns._def.type.parseAsync(d,s).catch(m=>{throw u.addIssue(o(d,m)),u})})}else{const a=this;return vt(function(...l){const u=a._def.args.safeParse(l,s);if(!u.success)throw new Tt([r(l,u.error)]);const c=Reflect.apply(i,this,u.data),d=a._def.returns.safeParse(c,s);if(!d.success)throw new Tt([o(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ir({...this._def,args:Jt.create(t).rest(or.create())})}returns(t){return new Ir({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Ir({args:t||Jt.create([]).rest(or.create()),returns:n||or.create(),typeName:pe.ZodFunction,...Ee(r)})}}class io extends Ne{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}io.create=(e,t)=>new io({getter:e,typeName:pe.ZodLazy,...Ee(t)});class ao extends Ne{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ee(n,{received:n.data,code:B.invalid_literal,expected:this._def.value}),ve}return{status:"valid",value:t.data}}get value(){return this._def.value}}ao.create=(e,t)=>new ao({value:e,typeName:pe.ZodLiteral,...Ee(t)});function El(e,t){return new $n({values:e,typeName:pe.ZodEnum,...Ee(t)})}class $n extends Ne{constructor(){super(...arguments),Xr.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ee(n,{expected:be.joinValues(r),received:n.parsedType,code:B.invalid_type}),ve}if(is(this,Xr)||gl(this,Xr,new Set(this._def.values)),!is(this,Xr).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ee(n,{received:n.data,code:B.invalid_enum_value,options:r}),ve}return vt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return $n.create(t,{...this._def,...n})}exclude(t,n=this._def){return $n.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Xr=new WeakMap,$n.create=El;class lo extends Ne{constructor(){super(...arguments),Qr.set(this,void 0)}_parse(t){const n=be.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ne.string&&r.parsedType!==ne.number){const o=be.objectValues(n);return ee(r,{expected:be.joinValues(o),received:r.parsedType,code:B.invalid_type}),ve}if(is(this,Qr)||gl(this,Qr,new Set(be.getValidEnumValues(this._def.values))),!is(this,Qr).has(t.data)){const o=be.objectValues(n);return ee(r,{received:r.data,code:B.invalid_enum_value,options:o}),ve}return vt(t.data)}get enum(){return this._def.values}}Qr=new WeakMap,lo.create=(e,t)=>new lo({values:e,typeName:pe.ZodNativeEnum,...Ee(t)});class Ar extends Ne{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ne.promise&&n.common.async===!1)return ee(n,{code:B.invalid_type,expected:ne.promise,received:n.parsedType}),ve;const r=n.parsedType===ne.promise?n.data:Promise.resolve(n.data);return vt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ar.create=(e,t)=>new Ar({type:e,typeName:pe.ZodPromise,...Ee(t)});class Ft extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{ee(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return ve;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?ve:l.status==="dirty"||n.value==="dirty"?Pr(l.value):l});{if(n.value==="aborted")return ve;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?ve:a.status==="dirty"||n.value==="dirty"?Pr(a.value):a}}if(o.type==="refinement"){const i=a=>{const l=o.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?ve:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?ve:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Jr(i))return i;const a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Jr(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):i);be.assertNever(o)}}Ft.create=(e,t,n)=>new Ft({schema:e,typeName:pe.ZodEffects,effect:t,...Ee(n)}),Ft.createWithPreprocess=(e,t,n)=>new Ft({schema:t,effect:{type:"preprocess",transform:e},typeName:pe.ZodEffects,...Ee(n)});class Yt extends Ne{_parse(t){return this._getType(t)===ne.undefined?vt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Yt.create=(e,t)=>new Yt({innerType:e,typeName:pe.ZodOptional,...Ee(t)});class In extends Ne{_parse(t){return this._getType(t)===ne.null?vt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}In.create=(e,t)=>new In({innerType:e,typeName:pe.ZodNullable,...Ee(t)});class uo extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ne.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}uo.create=(e,t)=>new uo({innerType:e,typeName:pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ee(t)});class co extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Yr(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Tt(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Tt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}co.create=(e,t)=>new co({innerType:e,typeName:pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ee(t)});class ds extends Ne{_parse(t){if(this._getType(t)!==ne.nan){const r=this._getOrReturnCtx(t);return ee(r,{code:B.invalid_type,expected:ne.nan,received:r.parsedType}),ve}return{status:"valid",value:t.data}}}ds.create=e=>new ds({typeName:pe.ZodNaN,...Ee(e)});const Jf=Symbol("zod_brand");class xi extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class fo extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ve:s.status==="dirty"?(n.dirty(),Pr(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ve:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new fo({in:t,out:n,typeName:pe.ZodPipeline})}}class po extends Ne{_parse(t){const n=this._def.innerType._parse(t),r=o=>(Jr(o)&&(o.value=Object.freeze(o.value)),o);return Yr(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}po.create=(e,t)=>new po({innerType:e,typeName:pe.ZodReadonly,...Ee(t)});function Ol(e,t={},n){return e?Dr.create().superRefine((r,o)=>{var s,i;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(i=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...u,fatal:l})}}):Dr.create()}const Yf={object:ze.lazycreate};var pe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(pe||(pe={}));const Xf=(e,t={message:`Input not instance of ${e.name}`})=>Ol(n=>n instanceof e,t),Nl=Mt.create,xl=Pn.create,Qf=ds.create,ep=Dn.create,Sl=eo.create,tp=rr.create,np=as.create,rp=to.create,op=no.create,sp=Dr.create,ip=or.create,ap=fn.create,lp=ls.create,up=Ut.create,cp=ze.create,dp=ze.strictCreate,fp=ro.create,pp=us.create,hp=oo.create,mp=Jt.create,vp=so.create,gp=cs.create,yp=sr.create,bp=Ir.create,_p=io.create,wp=ao.create,Ep=$n.create,Op=lo.create,Np=Ar.create,kl=Ft.create,xp=Yt.create,Sp=In.create,kp=Ft.createWithPreprocess,Tp=fo.create;var v=Object.freeze({__proto__:null,defaultErrorMap:Cr,setErrorMap:If,getErrorMap:os,makeIssue:ss,EMPTY_PATH:Af,addIssueToContext:ee,ParseStatus:ut,INVALID:ve,DIRTY:Pr,OK:vt,isAborted:wi,isDirty:Ei,isValid:Jr,isAsync:Yr,get util(){return be},get objectUtil(){return Tn},ZodParsedType:ne,getParsedType:Cn,ZodType:Ne,datetimeRegex:wl,ZodString:Mt,ZodNumber:Pn,ZodBigInt:Dn,ZodBoolean:eo,ZodDate:rr,ZodSymbol:as,ZodUndefined:to,ZodNull:no,ZodAny:Dr,ZodUnknown:or,ZodNever:fn,ZodVoid:ls,ZodArray:Ut,ZodObject:ze,ZodUnion:ro,ZodDiscriminatedUnion:us,ZodIntersection:oo,ZodTuple:Jt,ZodRecord:so,ZodMap:cs,ZodSet:sr,ZodFunction:Ir,ZodLazy:io,ZodLiteral:ao,ZodEnum:$n,ZodNativeEnum:lo,ZodPromise:Ar,ZodEffects:Ft,ZodTransformer:Ft,ZodOptional:Yt,ZodNullable:In,ZodDefault:uo,ZodCatch:co,ZodNaN:ds,BRAND:Jf,ZodBranded:xi,ZodPipeline:fo,ZodReadonly:po,custom:Ol,Schema:Ne,ZodSchema:Ne,late:Yf,get ZodFirstPartyTypeKind(){return pe},coerce:{string:e=>Mt.create({...e,coerce:!0}),number:e=>Pn.create({...e,coerce:!0}),boolean:e=>eo.create({...e,coerce:!0}),bigint:e=>Dn.create({...e,coerce:!0}),date:e=>rr.create({...e,coerce:!0})},any:sp,array:up,bigint:ep,boolean:Sl,date:tp,discriminatedUnion:pp,effect:kl,enum:Ep,function:bp,instanceof:Xf,intersection:hp,lazy:_p,literal:wp,map:gp,nan:Qf,nativeEnum:Op,never:ap,null:op,nullable:Sp,number:xl,object:cp,oboolean:()=>Sl().optional(),onumber:()=>xl().optional(),optional:xp,ostring:()=>Nl().optional(),pipeline:Tp,preprocess:kp,promise:Np,record:vp,set:yp,strictObject:dp,string:Nl,symbol:np,transformer:kl,tuple:mp,undefined:rp,union:fp,unknown:ip,void:lp,NEVER:ve,ZodIssueCode:B,quotelessJson:$f,ZodError:Tt}),Tl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Si={exports:{}};(function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Tl<"u"&&Tl,r=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(i){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof a<"u"&&a,l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function u(E){return E&&DataView.prototype.isPrototypeOf(E)}if(l.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(E){return E&&c.indexOf(Object.prototype.toString.call(E))>-1};function f(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(E)||E==="")throw new TypeError('Invalid character in header field name: "'+E+'"');return E.toLowerCase()}function m(E){return typeof E!="string"&&(E=String(E)),E}function b(E){var P={next:function(){var Y=E.shift();return{done:Y===void 0,value:Y}}};return l.iterable&&(P[Symbol.iterator]=function(){return P}),P}function O(E){this.map={},E instanceof O?E.forEach(function(P,Y){this.append(Y,P)},this):Array.isArray(E)?E.forEach(function(P){this.append(P[0],P[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(P){this.append(P,E[P])},this)}O.prototype.append=function(E,P){E=f(E),P=m(P);var Y=this.map[E];this.map[E]=Y?Y+", "+P:P},O.prototype.delete=function(E){delete this.map[f(E)]},O.prototype.get=function(E){return E=f(E),this.has(E)?this.map[E]:null},O.prototype.has=function(E){return this.map.hasOwnProperty(f(E))},O.prototype.set=function(E,P){this.map[f(E)]=m(P)},O.prototype.forEach=function(E,P){for(var Y in this.map)this.map.hasOwnProperty(Y)&&E.call(P,this.map[Y],Y,this)},O.prototype.keys=function(){var E=[];return this.forEach(function(P,Y){E.push(Y)}),b(E)},O.prototype.values=function(){var E=[];return this.forEach(function(P){E.push(P)}),b(E)},O.prototype.entries=function(){var E=[];return this.forEach(function(P,Y){E.push([Y,P])}),b(E)},l.iterable&&(O.prototype[Symbol.iterator]=O.prototype.entries);function w(E){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}function $(E){return new Promise(function(P,Y){E.onload=function(){P(E.result)},E.onerror=function(){Y(E.error)}})}function H(E){var P=new FileReader,Y=$(P);return P.readAsArrayBuffer(E),Y}function T(E){var P=new FileReader,Y=$(P);return P.readAsText(E),Y}function te(E){for(var P=new Uint8Array(E),Y=new Array(P.length),re=0;re<P.length;re++)Y[re]=String.fromCharCode(P[re]);return Y.join("")}function S(E){if(E.slice)return E.slice(0);var P=new Uint8Array(E.byteLength);return P.set(new Uint8Array(E)),P.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(E){this.bodyUsed=this.bodyUsed,this._bodyInit=E,E?typeof E=="string"?this._bodyText=E:l.blob&&Blob.prototype.isPrototypeOf(E)?this._bodyBlob=E:l.formData&&FormData.prototype.isPrototypeOf(E)?this._bodyFormData=E:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)?this._bodyText=E.toString():l.arrayBuffer&&l.blob&&u(E)?(this._bodyArrayBuffer=S(E.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(E)||d(E))?this._bodyArrayBuffer=S(E):this._bodyText=E=Object.prototype.toString.call(E):this._bodyText="",this.headers.get("content-type")||(typeof E=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var E=w(this);if(E)return E;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var E=w(this);return E||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(H)}),this.text=function(){var E=w(this);if(E)return E;if(this._bodyBlob)return T(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(te(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}var j=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ge(E){var P=E.toUpperCase();return j.indexOf(P)>-1?P:E}function q(E,P){if(!(this instanceof q))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P=P||{};var Y=P.body;if(E instanceof q){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,P.headers||(this.headers=new O(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!Y&&E._bodyInit!=null&&(Y=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new O(P.headers)),this.method=ge(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Y)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(Y),(this.method==="GET"||this.method==="HEAD")&&(P.cache==="no-store"||P.cache==="no-cache")){var re=/([?&])_=[^&]*/;if(re.test(this.url))this.url=this.url.replace(re,"$1_="+new Date().getTime());else{var he=/\?/;this.url+=(he.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}q.prototype.clone=function(){return new q(this,{body:this._bodyInit})};function A(E){var P=new FormData;return E.trim().split("&").forEach(function(Y){if(Y){var re=Y.split("="),he=re.shift().replace(/\+/g," "),oe=re.join("=").replace(/\+/g," ");P.append(decodeURIComponent(he),decodeURIComponent(oe))}}),P}function V(E){var P=new O,Y=E.replace(/\r?\n[\t ]+/g," ");return Y.split("\r").map(function(re){return re.indexOf(`
|
|
3
|
-
`)===0?re.substr(1,re.length):re}).forEach(function(re){var he=re.split(":"),oe=he.shift().trim();if(oe){var Fe=he.join(":").trim();P.append(oe,Fe)}}),P}U.call(q.prototype);function D(E,P){if(!(this instanceof D))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P||(P={}),this.type="default",this.status=P.status===void 0?200:P.status,this.ok=this.status>=200&&this.status<300,this.statusText=P.statusText===void 0?"":""+P.statusText,this.headers=new O(P.headers),this.url=P.url||"",this._initBody(E)}U.call(D.prototype),D.prototype.clone=function(){return new D(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new O(this.headers),url:this.url})},D.error=function(){var E=new D(null,{status:0,statusText:""});return E.type="error",E};var ae=[301,302,303,307,308];D.redirect=function(E,P){if(ae.indexOf(P)===-1)throw new RangeError("Invalid status code");return new D(null,{status:P,headers:{location:E}})},i.DOMException=a.DOMException;try{new i.DOMException}catch{i.DOMException=function(P,Y){this.message=P,this.name=Y;var re=Error(P);this.stack=re.stack},i.DOMException.prototype=Object.create(Error.prototype),i.DOMException.prototype.constructor=i.DOMException}function $e(E,P){return new Promise(function(Y,re){var he=new q(E,P);if(he.signal&&he.signal.aborted)return re(new i.DOMException("Aborted","AbortError"));var oe=new XMLHttpRequest;function Fe(){oe.abort()}oe.onload=function(){var Be={status:oe.status,statusText:oe.statusText,headers:V(oe.getAllResponseHeaders()||"")};Be.url="responseURL"in oe?oe.responseURL:Be.headers.get("X-Request-URL");var St="response"in oe?oe.response:oe.responseText;setTimeout(function(){Y(new D(St,Be))},0)},oe.onerror=function(){setTimeout(function(){re(new TypeError("Network request failed"))},0)},oe.ontimeout=function(){setTimeout(function(){re(new TypeError("Network request failed"))},0)},oe.onabort=function(){setTimeout(function(){re(new i.DOMException("Aborted","AbortError"))},0)};function ht(Be){try{return Be===""&&a.location.href?a.location.href:Be}catch{return Be}}oe.open(he.method,ht(he.url),!0),he.credentials==="include"?oe.withCredentials=!0:he.credentials==="omit"&&(oe.withCredentials=!1),"responseType"in oe&&(l.blob?oe.responseType="blob":l.arrayBuffer&&he.headers.get("Content-Type")&&he.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(oe.responseType="arraybuffer")),P&&typeof P.headers=="object"&&!(P.headers instanceof O)?Object.getOwnPropertyNames(P.headers).forEach(function(Be){oe.setRequestHeader(Be,m(P.headers[Be]))}):he.headers.forEach(function(Be,St){oe.setRequestHeader(St,Be)}),he.signal&&(he.signal.addEventListener("abort",Fe),oe.onreadystatechange=function(){oe.readyState===4&&he.signal.removeEventListener("abort",Fe)}),oe.send(typeof he._bodyInit>"u"?null:he._bodyInit)})}return $e.polyfill=!0,a.fetch||(a.fetch=$e,a.Headers=O,a.Request=q,a.Response=D),i.Headers=O,i.Request=q,i.Response=D,i.fetch=$e,i})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=n.fetch?n:r;t=o.fetch,t.default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t})(Si,Si.exports);var Pp=Si.exports;const fs=Cp(Pp);var Dp=Object.defineProperty,Cl=(e,t)=>{for(var n in t)Dp(e,n,{get:t[n],enumerable:!0})},Vr=v.record(v.number()),$p=v.object({type:v.literal("PercentageOffDiscount"),name:v.string(),description:v.string().optional(),percentage:v.number(),total:Vr.optional(),isExclusive:v.boolean()}),Ip=v.object({type:v.literal("FlatAmountOffDiscount"),name:v.string(),description:v.string().optional(),total:Vr.optional(),isExclusive:v.boolean()}),ki=v.discriminatedUnion("type",[$p,Ip]),Rr=v.object({id:v.string(),name:v.string(),originalPrice:Vr,price:Vr,hasDiscount:v.boolean(),discount:ki.optional()});function ho(e){return v.object({items:v.array(e),hasMore:v.boolean(),next:v.string().nullable()})}function Pl(e){return v.object({value:e,quantity:v.number()})}var Xt=(e=>(e.Universal="Universal",e.Windows="Windows",e.Linux="Linux",e.Mac="Mac",e))(Xt||{}),Dl=v.object({name:v.string(),key:v.string(),platform:v.nativeEnum(Xt),size:v.number(),path:v.string().nullable()}),Ti=v.object({id:v.string(),name:v.string(),tagline:v.string(),website:v.string().optional(),iconUrl:v.string().optional(),numberOfLicenses:v.number().optional(),numberOfTrials:v.number().optional(),currentActivations:v.number().optional(),maxActivations:v.number().optional(),currentVersion:v.string().nullable(),version:v.string().optional(),prerelease:v.boolean().optional(),downloadsNeedsUser:v.boolean(),downloadsNeedsOwnership:v.boolean(),downloads:v.array(Dl).optional()}),ps=v.object({id:v.string(),name:v.string(),tagline:v.string(),iconUrl:v.string().nullable(),website:v.string().nullish(),owned:v.boolean(),currentVersion:v.string().optional(),downloads:Dl.array().optional(),defaultVariation:Rr.optional(),variations:Rr.array().optional(),type:v.void().transform(()=>"product").pipe(v.literal("product"))}),$l=v.object({id:v.string(),name:v.string(),tagline:v.string(),iconUrl:v.string().nullable(),owned:v.boolean(),partial:v.boolean(),products:ps.and(v.object({included:v.boolean().optional()})).array(),defaultVariation:Rr.optional(),variations:Rr.array().optional(),type:v.void().transform(()=>"bundle").pipe(v.literal("bundle"))}),Ap=v.object({suggestedCurrency:v.string(),products:ps.array(),bundles:$l.array()}),Qt=(e=>(e.Requested="Requested",e.Fulfilled="Fulfilled",e.Completed="Completed",e.Cancelled="Cancelled",e))(Qt||{}),hs=v.object({id:v.string(),status:v.nativeEnum(Qt),product:ps,trialEligibility:v.object({eligible:v.boolean(),existing:v.boolean(),requiresAccount:v.boolean(),numberOfDaysPerProduct:v.number(),numberOfDaysRemaining:v.number()}).optional(),licenseEligibility:v.object({eligible:v.boolean()}).optional()}),Vp=class{constructor(e){this.api=e}async get(e){return(await this.api.fetch(`/api/customer/activations/${e}`,hs)).data}async isCompleted(e){const t=await this.api.fetch(`/api/customer/activations/${e}/completed`,v.boolean());return v.boolean().parse(t.data)}async fulfillLicense(e){return(await this.api.authenticatedFetch(`/api/customer/activations/${e}/license`,hs,{method:"POST"})).data}async fulfillTrial(e){return(await this.api.fetch(`/api/customer/activations/${e}/trial`,hs,{method:"POST"})).data}async cancel(e){return(await this.api.fetch(`/api/customer/activations/${e}/cancel`,hs,{method:"POST"})).data}},Rp=class extends Error{constructor(){super(),this.name="NotAuthorizedError",this.message="Not allowed"}},Ci=class extends Error{constructor(){super(),this.name="NotAuthenticatedError",this.message="Not authenticated"}},An=class extends Error{constructor(e){super(),this.name="NotFoundError",this.message=e??"Not found"}},jr=class extends Error{constructor(e,t,n,r){super(),this.title=e,this.detail=t,this.status=n,this.errors=r,this.name="MoonbaseError",r&&Object.values(r).length===1?this.message=Object.values(r)[0]:this.message=t??e}},jp=v.object({type:v.string(),title:v.string(),detail:v.string().optional(),status:v.number(),errors:v.record(v.string(),v.string().array()).optional()});function Lp(e){return e.split(".").map((t,n)=>{let[r,...o]=t;return r=n!==0?r.toUpperCase():r.toLowerCase(),o=[o.join("").toLowerCase()],r+o[0]}).join("")}async function Pi(e){if(e.status===404)throw new An;if(e.status===401)throw new Ci;if(e.status===403)throw new Rp;let t;try{const n=await e.json();t=jp.parse(n)}catch(n){throw console.warn("Could not handle response",{response:e,err:n,content:await e.text()}),new Error("An unknown problem occurred")}throw new jr(t.title,t.detail,t.status,t.errors?Object.fromEntries(Object.entries(t.errors).map(([n,r])=>[Lp(n),r.join(", ")])):void 0)}var Il=v.object({countryCode:v.string(),streetAddress1:v.string(),streetAddress2:v.string().nullable(),locality:v.string().nullable(),region:v.string().nullable(),postCode:v.string()}),Mp=v.object({newsletterOptIn:v.boolean()}),Al=v.object({id:v.string(),email:v.string(),name:v.string(),tenantId:v.string(),address:Il.optional(),communicationPreferences:Mp,ownedProducts:v.string().array().optional()}),Di=Al.and(v.object({accessToken:v.string(),refreshToken:v.string()})),Vl=v.object({id:v.string(),name:v.string(),email:v.string(),resetPasswordToken:v.string().nullable()}),Up=class{constructor(e,t){this.api=e,this.tokenStore=t}async get(){return(await this.api.authenticatedFetch("/api/customer/meta/user",Al)).data}async signIn(e,t){const n=await fs(`${this.api.baseUrl}/api/customer/identity/sign-in?email=${encodeURIComponent(e)}&scheme=JWT`,{method:"POST",headers:{Accept:"application/json","Content-Type":"text/plain","x-mb-cors":"1"},body:t});if(n.status===404)throw new An("User not found");n.status>=400&&await Pi(n);try{const r=await n.json(),o=Di.parse(r);return this.tokenStore.setUser(o),o}catch(r){throw console.warn("Could not sign in user",{email:e,response:n,err:r}),new jr("Bad response","Could not sign in user",n.status)}}async signUp(e,t,n,r,o,s,i){const a=await this.api.fetch(`/api/customer/identity/sign-up?scheme=JWT&communicationOptIn=${i?"true":"false"}`,Di,{method:"POST",body:{name:e,email:t,password:n,address:r,acceptedPrivacyPolicy:o,acceptedTermsAndConditions:s}});return this.tokenStore.setUser(a.data),a.data}async update(e,t,n,r){return{needsEmailConfirmationToken:(await this.api.authenticatedFetch("/api/customer/identity",null,{method:"PATCH",body:{name:e,email:t,emailConfirmationToken:n,communicationPreferences:r}})).status===201}}async setPassword(e,t){await this.api.authenticatedFetch("/api/customer/identity/set-password",null,{method:"POST",body:{currentPassword:e,newPassword:t}})}async forgotPassword(e){await this.api.fetch(`/api/customer/identity/forgot-password?email=${encodeURIComponent(e)}`,null,{method:"POST"})}async resetPassword(e,t,n){const r=await fs(`${this.api.baseUrl}/api/customer/identity/reset-password?email=${encodeURIComponent(e)}&code=${encodeURIComponent(n.replaceAll(" ","+"))}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"text/plain","x-mb-cors":"1"},body:t});r.status>=400&&await Pi(r)}async confirmAccount(e,t){const n=await this.api.fetch(`/api/customer/identity/confirm-account?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ","+"))}`,Vl,{method:"POST"});try{return Vl.parse(n.data)}catch(r){throw console.warn("Could not confirm user account",{email:e,code:t,response:n,err:r}),new jr("Bad response","Could not confirm user account",n.status)}}async confirmEmail(e,t){await this.api.fetch(`/api/customer/identity/confirm-email?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ","+"))}`,null,{method:"POST"})}async confirmEmailChange(e,t){await this.api.authenticatedFetch(`/api/customer/identity/confirm-email-change?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ","+"))}`,null,{method:"POST"})}},Rl={};Cl(Rl,{completedOrderSchema:()=>Fl,openBundleLineItem:()=>Ul,openOrderLineItem:()=>$i,openOrderSchema:()=>ms,openProductLineItem:()=>Ml,orderSchema:()=>Bl});var mo=(e=>(e.Open="Open",e.PaymentProcessing="PaymentProcessing",e.Completed="Completed",e.Failed="Failed",e))(mo||{}),jl=v.object({code:v.string(),name:v.string(),description:v.string()}),Ll=v.object({id:v.string(),name:v.string(),tagline:v.string(),iconUrl:v.string().nullable()}),Ml=v.object({id:v.string(),type:v.literal("Product"),productId:v.string(),quantity:v.number(),variationId:v.string(),price:Vr.optional(),variation:Rr.optional(),product:Ll.optional(),appliedDiscount:ki.optional()}),Fp=v.object({id:v.string(),name:v.string(),tagline:v.string(),iconUrl:v.string().nullable(),partial:v.boolean(),products:Ll.and(v.object({included:v.boolean().optional()})).array()}),Ul=v.object({id:v.string(),type:v.literal("Bundle"),bundleId:v.string(),quantity:v.number(),variationId:v.string(),price:Vr.optional(),variation:Rr.optional(),bundle:Fp.optional(),appliedDiscount:ki.optional()}),$i=v.discriminatedUnion("type",[Ml,Ul]),ms=v.object({id:v.string(),status:v.literal("Open"),currency:v.string(),items:$i.array(),couponsApplied:jl.array(),checkoutUrl:v.string().optional(),embeddedCheckoutUrl:v.string().optional()}),vo=v.object({currency:v.string(),amount:v.number()}),Bp=v.object({original:vo,discount:vo,subtotal:vo,taxes:vo,due:vo}),Hp=v.object({name:v.string().nullable(),businessName:v.string().nullable(),taxId:v.string().nullable(),email:v.string().nullable(),address:Il.nullable()}),Fl=v.object({id:v.string(),status:v.literal("Completed"),currency:v.string(),customer:Hp,total:Bp,items:$i.array(),couponsApplied:jl.array()}),Bl=v.discriminatedUnion("status",[ms,Fl]),Zp=class{constructor(e){this.api=e}async get(e){return(await this.api.fetch(`/api/customer/orders/${e}`,Bl)).data}async pushContent(e,t,n){const r={...Hl(n)};return t&&(r.checkout="true",r.returnUrl=t.returnUrl),(await this.api.fetch(`/api/customer/orders/${e.id}?${new URLSearchParams(r).toString()}`,ms,{method:"PATCH",body:{currency:e.currency||void 0,items:e.items}})).data}async removeBillingDetails(e){return(await this.api.fetch(`/api/customer/orders/${e}/billing-details`,ms,{method:"DELETE"})).data}};function Hl(e){return Object.entries({utm_source:e==null?void 0:e.source,utm_medium:e==null?void 0:e.medium,utm_campaign:e==null?void 0:e.campaign,utm_term:e==null?void 0:e.term,utm_content:e==null?void 0:e.content,utm_referrer:e==null?void 0:e.referrer}).filter(([t,n])=>n!==void 0).reduce((t,[n,r])=>({...t,[n]:r}),{})}var qp=class{constructor(e){this.api=e}async get(e){const t=new URLSearchParams(Hl(e));return(await this.api.fetch(`/api/customer/storefront?${t.toString()}`,Ap)).data}},Wp=class{constructor(e,t){this.baseUrl=e,this.tokenStore=t}async authenticatedFetch(e,t,n){if(!this.tokenStore.hasAccessToken)throw new Ci;return await this.fetch(e,t,n)}async fetch(e,t,n){var r;const o=await this.tokenStore.getAccessToken(),s=(r=n==null?void 0:n.contentType)!=null?r:"application/json",i=await fs(this.baseUrl+e,{method:(n==null?void 0:n.method)||"GET",mode:"cors",headers:{Accept:"application/json","Content-Type":s,...o?{Authorization:`Bearer ${o}`}:{},"x-mb-cors":"1"},body:n!=null&&n.body?s!=="application/json"?n.body:JSON.stringify(n.body):void 0});i.status>=400&&await Pi(i);let a;try{return a=t?await i.json():null,{data:t?t.parse(a):null,headers:Object.fromEntries(i.headers.entries()),status:i.status}}catch(l){throw console.warn("Could not parse response",{status:i.status,path:e,content:a||(i.bodyUsed?"unknown":await i.text()),headers:Object.fromEntries(i.headers.entries()),userAgent:window&&window.navigator&&window.navigator.userAgent,err:l}),new jr("Bad response","Could not parse server response",i.status)}}},Zl=class rs{constructor(t){if(this.configuration=t,this.tokens=null,this.refreshTimeoutId=null,this.refreshPromise=null,typeof window<"u"){window.addEventListener("storage",r=>this.handleStorageUpdate(r));const n=localStorage.getItem(rs.storageKey);n&&(this.tokens=JSON.parse(n),this.tokens.expiresAt=new Date(this.tokens.expiresAt))}}get user(){return this.tokens?this.tokens:null}get hasAccessToken(){return!!this.tokens}async getAccessToken(){var t,n,r;if(this.isExpired){if(this.refreshPromise){const s=await this.refreshPromise;return(t=s==null?void 0:s.accessToken)!=null?t:null}this.refreshPromise=this.refreshTokens();const o=await this.refreshPromise;return(n=o==null?void 0:o.accessToken)!=null?n:null}return((r=this.tokens)==null?void 0:r.accessToken)||null}setUser(t){return t===null?(this.tokens=null,typeof window<"u"&&localStorage&&localStorage.removeItem(rs.storageKey),this.refreshTimeoutId!=null&&window.clearTimeout(this.refreshTimeoutId),null):(this.tokens={...t,expiresAt:new Date(new Date().getTime()+15*60*1e3)},typeof window<"u"&&localStorage&&localStorage.setItem(rs.storageKey,JSON.stringify(this.tokens)),this.refreshTimeoutId!=null&&window.clearTimeout(this.refreshTimeoutId),this.refreshTimeoutId=window.setTimeout(()=>{this.refreshPromise=this.refreshTokens()},10*60*1e3),this.tokens)}get isExpired(){return this.tokens!=null&&this.tokens.expiresAt<new Date}async refreshTokens(){if(!this.tokens)throw new Error("No tokens found to refresh");const t=await fs(`${this.configuration.endpoint}/api/customer/identity/refresh?token=${this.tokens.refreshToken}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"text/plain","x-mb-cors":"1"},body:this.tokens.accessToken});if(t.status!==200){if(t.status===403||t.status===404)return this.setUser(null),null;throw new jr("Unexpected result",`Could not refresh access token, status code ${t.status}`,t.status)}const n=Di.parse(await t.json());return this.setUser(n)}handleStorageUpdate(t){switch(t.key){case rs.storageKey:this.tokens=t.newValue?JSON.parse(t.newValue):null,this.refreshTimeoutId!=null&&window.clearTimeout(this.refreshTimeoutId),this.tokens&&(this.tokens.expiresAt=new Date(this.tokens.expiresAt));break}}};Zl.storageKey="moonbase_auth";var zp=Zl,ql=v.object({id:v.string(),name:v.string(),description:v.string(),code:v.string(),redeemed:v.boolean(),redeemsProducts:Pl(ps).array(),redeemsBundles:Pl($l).array()}),Kp=class{constructor(e){this.api=e}async peek(e){return(await this.api.fetch(`/api/customer/vouchers?code=${encodeURIComponent(e)}`,ql)).data}async redeem(e){return(await this.api.authenticatedFetch(`/api/customer/vouchers/redeem?code=${encodeURIComponent(e)}`,ql,{method:"POST"})).data}},Wl=(e=>(e.Active="Active",e.Revoked="Revoked",e))(Wl||{}),zl=(e=>(e.Active="Active",e.Revoked="Revoked",e))(zl||{}),Ii=(e=>(e.Online="Online",e.Offline="Offline",e))(Ii||{}),Ai=v.object({id:v.string(),status:v.nativeEnum(Wl),product:Ti,activeNumberOfActivations:v.number(),maxNumberOfActivations:v.number(),createdAt:v.coerce.date()}),Kl=v.object({id:v.string(),licenseId:v.string(),name:v.string(),status:v.nativeEnum(zl),activationMethod:v.nativeEnum(Ii),lastValidatedAt:v.coerce.date().nullable()}),Gp=class{constructor(e){this.api=e}async activate(e,t){const n=await this.api.authenticatedFetch(`/api/customer/inventory/activate?method=${t}`,Ai,{method:"POST",body:e,contentType:"text/plain"});return{license:n.data,url:v.string().parse(n.headers.location)}}},Jp=class{constructor(e){this.api=e}async get(e){return(await this.api.authenticatedFetch(e||"/api/customer/inventory/licenses",ho(Ai))).data}async getActivations(e,t){return(await this.api.authenticatedFetch(t||`/api/customer/inventory/licenses/${e}/activations`,ho(Kl))).data}async revokeActivation(e,t){await this.api.authenticatedFetch(`/api/customer/inventory/licenses/${e}/activations/${t}/revoke`,null,{method:"POST"})}},Yp=class{constructor(e){this.api=e}async get(e,t){return(await this.api.fetch(`/api/customer/inventory/products/${e}${t?`?version=${t}`:""}`,Ti)).data}async getOwned(e){return(await this.api.authenticatedFetch(e||"/api/customer/inventory/products",ho(Ti))).data}async getLicenses(e,t){return(await this.api.authenticatedFetch(t||`/api/customer/inventory/products/${e}/licenses`,ho(Ai))).data}async getActivations(e,t){return(await this.api.authenticatedFetch(t||`/api/customer/inventory/products/${e}/licenses/activations`,ho(Kl))).data}async getDownloadUrl(e){const t=new URL(e);return t.searchParams.append("redirect","false"),(await this.api.fetch(t.pathname+t.search,v.object({location:v.string()}))).data.location}},Xp=class{constructor(e){this.licenses=new Jp(e),this.products=new Yp(e),this.activation=new Gp(e)}},Gl={};Cl(Gl,{orders:()=>Rl});var Qp=class{constructor(e){this.configuration=e,this.configuration.endpoint=this.configuration.endpoint.replace(/\/$/,""),this.tokenStore=new zp(e);const t=new Wp(this.configuration.endpoint,this.tokenStore);this.storefront=new qp(t),this.identity=new Up(t,this.tokenStore),this.vouchers=new Kp(t),this.orders=new Zp(t),this.inventory=new Xp(t),this.activationRequests=new Vp(t)}},Jl={};/**
|
|
3
|
+
`)===0?re.substr(1,re.length):re}).forEach(function(re){var he=re.split(":"),oe=he.shift().trim();if(oe){var Fe=he.join(":").trim();P.append(oe,Fe)}}),P}U.call(q.prototype);function D(E,P){if(!(this instanceof D))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P||(P={}),this.type="default",this.status=P.status===void 0?200:P.status,this.ok=this.status>=200&&this.status<300,this.statusText=P.statusText===void 0?"":""+P.statusText,this.headers=new O(P.headers),this.url=P.url||"",this._initBody(E)}U.call(D.prototype),D.prototype.clone=function(){return new D(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new O(this.headers),url:this.url})},D.error=function(){var E=new D(null,{status:0,statusText:""});return E.type="error",E};var ae=[301,302,303,307,308];D.redirect=function(E,P){if(ae.indexOf(P)===-1)throw new RangeError("Invalid status code");return new D(null,{status:P,headers:{location:E}})},i.DOMException=a.DOMException;try{new i.DOMException}catch{i.DOMException=function(P,Y){this.message=P,this.name=Y;var re=Error(P);this.stack=re.stack},i.DOMException.prototype=Object.create(Error.prototype),i.DOMException.prototype.constructor=i.DOMException}function $e(E,P){return new Promise(function(Y,re){var he=new q(E,P);if(he.signal&&he.signal.aborted)return re(new i.DOMException("Aborted","AbortError"));var oe=new XMLHttpRequest;function Fe(){oe.abort()}oe.onload=function(){var Be={status:oe.status,statusText:oe.statusText,headers:V(oe.getAllResponseHeaders()||"")};Be.url="responseURL"in oe?oe.responseURL:Be.headers.get("X-Request-URL");var St="response"in oe?oe.response:oe.responseText;setTimeout(function(){Y(new D(St,Be))},0)},oe.onerror=function(){setTimeout(function(){re(new TypeError("Network request failed"))},0)},oe.ontimeout=function(){setTimeout(function(){re(new TypeError("Network request failed"))},0)},oe.onabort=function(){setTimeout(function(){re(new i.DOMException("Aborted","AbortError"))},0)};function ht(Be){try{return Be===""&&a.location.href?a.location.href:Be}catch{return Be}}oe.open(he.method,ht(he.url),!0),he.credentials==="include"?oe.withCredentials=!0:he.credentials==="omit"&&(oe.withCredentials=!1),"responseType"in oe&&(l.blob?oe.responseType="blob":l.arrayBuffer&&he.headers.get("Content-Type")&&he.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(oe.responseType="arraybuffer")),P&&typeof P.headers=="object"&&!(P.headers instanceof O)?Object.getOwnPropertyNames(P.headers).forEach(function(Be){oe.setRequestHeader(Be,m(P.headers[Be]))}):he.headers.forEach(function(Be,St){oe.setRequestHeader(St,Be)}),he.signal&&(he.signal.addEventListener("abort",Fe),oe.onreadystatechange=function(){oe.readyState===4&&he.signal.removeEventListener("abort",Fe)}),oe.send(typeof he._bodyInit>"u"?null:he._bodyInit)})}return $e.polyfill=!0,a.fetch||(a.fetch=$e,a.Headers=O,a.Request=q,a.Response=D),i.Headers=O,i.Request=q,i.Response=D,i.fetch=$e,i})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=n.fetch?n:r;t=o.fetch,t.default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t})(Si,Si.exports);var Pp=Si.exports;const fs=Cp(Pp);var Dp=Object.defineProperty,Cl=(e,t)=>{for(var n in t)Dp(e,n,{get:t[n],enumerable:!0})},Vr=v.record(v.number()),$p=v.object({type:v.literal("PercentageOffDiscount"),name:v.string(),description:v.string().optional(),percentage:v.number(),total:Vr.optional(),isExclusive:v.boolean()}),Ip=v.object({type:v.literal("FlatAmountOffDiscount"),name:v.string(),description:v.string().optional(),total:Vr.optional(),isExclusive:v.boolean()}),ki=v.discriminatedUnion("type",[$p,Ip]),Rr=v.object({id:v.string(),name:v.string(),originalPrice:Vr,price:Vr,hasDiscount:v.boolean(),discount:ki.optional()});function ho(e){return v.object({items:v.array(e),hasMore:v.boolean(),next:v.string().nullable()})}function Pl(e){return v.object({value:e,quantity:v.number()})}var Xt=(e=>(e.Universal="Universal",e.Windows="Windows",e.Linux="Linux",e.Mac="Mac",e))(Xt||{}),Dl=v.object({name:v.string(),key:v.string(),platform:v.nativeEnum(Xt),size:v.number(),path:v.string().nullable()}),Ti=v.object({id:v.string(),name:v.string(),tagline:v.string(),website:v.string().optional(),iconUrl:v.string().optional(),numberOfLicenses:v.number().optional(),numberOfTrials:v.number().optional(),currentActivations:v.number().optional(),maxActivations:v.number().optional(),currentVersion:v.string().nullable(),version:v.string().optional(),prerelease:v.boolean().optional(),downloadsNeedsUser:v.boolean(),downloadsNeedsOwnership:v.boolean(),downloads:v.array(Dl).optional()}),ps=v.object({id:v.string(),name:v.string(),tagline:v.string(),iconUrl:v.string().nullable(),website:v.string().nullish(),owned:v.boolean(),currentVersion:v.string().optional(),downloads:Dl.array().optional(),defaultVariation:Rr.optional(),variations:Rr.array().optional(),type:v.void().transform(()=>"product").pipe(v.literal("product"))}),$l=v.object({id:v.string(),name:v.string(),tagline:v.string(),iconUrl:v.string().nullable(),owned:v.boolean(),partial:v.boolean(),products:ps.and(v.object({included:v.boolean().optional()})).array(),defaultVariation:Rr.optional(),variations:Rr.array().optional(),type:v.void().transform(()=>"bundle").pipe(v.literal("bundle"))}),Ap=v.object({suggestedCurrency:v.string(),products:ps.array(),bundles:$l.array()}),Qt=(e=>(e.Requested="Requested",e.Fulfilled="Fulfilled",e.Completed="Completed",e.Cancelled="Cancelled",e))(Qt||{}),hs=v.object({id:v.string(),status:v.nativeEnum(Qt),product:ps,trialEligibility:v.object({eligible:v.boolean(),existing:v.boolean(),requiresAccount:v.boolean(),numberOfDaysPerProduct:v.number(),numberOfDaysRemaining:v.number()}).optional(),licenseEligibility:v.object({eligible:v.boolean()}).optional()}),Vp=class{constructor(e){this.api=e}async get(e){return(await this.api.fetch(`/api/customer/activations/${e}`,hs)).data}async isCompleted(e){const t=await this.api.fetch(`/api/customer/activations/${e}/completed`,v.boolean());return v.boolean().parse(t.data)}async fulfillLicense(e){return(await this.api.authenticatedFetch(`/api/customer/activations/${e}/license`,hs,{method:"POST"})).data}async fulfillTrial(e){return(await this.api.fetch(`/api/customer/activations/${e}/trial`,hs,{method:"POST"})).data}async cancel(e){return(await this.api.fetch(`/api/customer/activations/${e}/cancel`,hs,{method:"POST"})).data}},Rp=class extends Error{constructor(){super(),this.name="NotAuthorizedError",this.message="Not allowed"}},Ci=class extends Error{constructor(){super(),this.name="NotAuthenticatedError",this.message="Not authenticated"}},An=class extends Error{constructor(e){super(),this.name="NotFoundError",this.message=e??"Not found"}},jr=class extends Error{constructor(e,t,n,r){super(),this.title=e,this.detail=t,this.status=n,this.errors=r,this.name="MoonbaseError",r&&Object.values(r).length===1?this.message=Object.values(r)[0]:this.message=t??e}},jp=v.object({type:v.string(),title:v.string(),detail:v.string().optional(),status:v.number(),errors:v.record(v.string(),v.string().array()).optional()});function Lp(e){return e.split(".").map((t,n)=>{let[r,...o]=t;return r=n!==0?r.toUpperCase():r.toLowerCase(),o=[o.join("").toLowerCase()],r+o[0]}).join("")}async function Pi(e){if(e.status===404)throw new An;if(e.status===401)throw new Ci;if(e.status===403)throw new Rp;let t;try{const n=await e.json();t=jp.parse(n)}catch(n){throw console.warn("Could not handle response",{response:e,err:n,content:await e.text()}),new Error("An unknown problem occurred")}throw new jr(t.title,t.detail,t.status,t.errors?Object.fromEntries(Object.entries(t.errors).map(([n,r])=>[Lp(n),r.join(", ")])):void 0)}var Il=v.object({countryCode:v.string(),streetAddress1:v.string(),streetAddress2:v.string().nullable(),locality:v.string().nullable(),region:v.string().nullable(),postCode:v.string()}),Mp=v.object({newsletterOptIn:v.boolean()}),Al=v.object({id:v.string(),email:v.string(),name:v.string(),tenantId:v.string(),address:Il.optional(),communicationPreferences:Mp,ownedProducts:v.string().array().optional()}),Di=Al.and(v.object({accessToken:v.string(),refreshToken:v.string()})),Vl=v.object({id:v.string(),name:v.string(),email:v.string(),resetPasswordToken:v.string().nullable()}),Up=class{constructor(e,t){this.api=e,this.tokenStore=t}async get(){return(await this.api.authenticatedFetch("/api/customer/meta/user",Al)).data}async signIn(e,t){const n=await fs(`${this.api.baseUrl}/api/customer/identity/sign-in?email=${encodeURIComponent(e)}&scheme=JWT`,{method:"POST",headers:{Accept:"application/json","Content-Type":"text/plain","x-mb-cors":"1"},body:t});if(n.status===404)throw new An("User not found");n.status>=400&&await Pi(n);try{const r=await n.json(),o=Di.parse(r);return this.tokenStore.setUser(o),o}catch(r){throw console.warn("Could not sign in user",{email:e,response:n,err:r}),new jr("Bad response","Could not sign in user",n.status)}}async signUp(e,t,n,r,o,s,i){const a=await this.api.fetch(`/api/customer/identity/sign-up?scheme=JWT&communicationOptIn=${i?"true":"false"}`,Di,{method:"POST",body:{name:e,email:t,password:n,address:r,acceptedPrivacyPolicy:o,acceptedTermsAndConditions:s}});return this.tokenStore.setUser(a.data),a.data}async update(e,t,n,r){return{needsEmailConfirmationToken:(await this.api.authenticatedFetch("/api/customer/identity",null,{method:"PATCH",body:{name:e,email:t,emailConfirmationToken:n,communicationPreferences:r}})).status===201}}async setPassword(e,t){await this.api.authenticatedFetch("/api/customer/identity/set-password",null,{method:"POST",body:{currentPassword:e,newPassword:t}})}async forgotPassword(e){await this.api.fetch(`/api/customer/identity/forgot-password?email=${encodeURIComponent(e)}`,null,{method:"POST"})}async resetPassword(e,t,n){const r=await fs(`${this.api.baseUrl}/api/customer/identity/reset-password?email=${encodeURIComponent(e)}&code=${encodeURIComponent(n.replaceAll(" ","+"))}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"text/plain","x-mb-cors":"1"},body:t});r.status>=400&&await Pi(r)}async confirmAccount(e,t){const n=await this.api.fetch(`/api/customer/identity/confirm-account?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ","+"))}`,Vl,{method:"POST"});try{return Vl.parse(n.data)}catch(r){throw console.warn("Could not confirm user account",{email:e,code:t,response:n,err:r}),new jr("Bad response","Could not confirm user account",n.status)}}async confirmEmail(e,t){await this.api.fetch(`/api/customer/identity/confirm-email?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ","+"))}`,null,{method:"POST"})}async confirmEmailChange(e,t){await this.api.authenticatedFetch(`/api/customer/identity/confirm-email-change?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ","+"))}`,null,{method:"POST"})}},Rl={};Cl(Rl,{completedOrderSchema:()=>Fl,openBundleLineItem:()=>Ul,openOrderLineItem:()=>$i,openOrderSchema:()=>ms,openProductLineItem:()=>Ml,orderSchema:()=>Bl});var mo=(e=>(e.Open="Open",e.PaymentProcessing="PaymentProcessing",e.Completed="Completed",e.Failed="Failed",e))(mo||{}),jl=v.object({code:v.string(),name:v.string(),description:v.string()}),Ll=v.object({id:v.string(),name:v.string(),tagline:v.string(),iconUrl:v.string().nullable()}),Ml=v.object({id:v.string(),type:v.literal("Product"),productId:v.string(),quantity:v.number(),variationId:v.string(),price:Vr.optional(),variation:Rr.optional(),product:Ll.optional(),appliedDiscount:ki.optional()}),Fp=v.object({id:v.string(),name:v.string(),tagline:v.string(),iconUrl:v.string().nullable(),products:Ll.and(v.object({included:v.boolean().optional()})).array()}),Ul=v.object({id:v.string(),type:v.literal("Bundle"),bundleId:v.string(),quantity:v.number(),variationId:v.string(),partial:v.boolean().optional(),price:Vr.optional(),variation:Rr.optional(),bundle:Fp.optional(),appliedDiscount:ki.optional()}),$i=v.discriminatedUnion("type",[Ml,Ul]),ms=v.object({id:v.string(),status:v.literal("Open"),currency:v.string(),items:$i.array(),couponsApplied:jl.array(),checkoutUrl:v.string().optional(),embeddedCheckoutUrl:v.string().optional()}),vo=v.object({currency:v.string(),amount:v.number()}),Bp=v.object({original:vo,discount:vo,subtotal:vo,taxes:vo,due:vo}),Hp=v.object({name:v.string().nullable(),businessName:v.string().nullable(),taxId:v.string().nullable(),email:v.string().nullable(),address:Il.nullable()}),Fl=v.object({id:v.string(),status:v.literal("Completed"),currency:v.string(),customer:Hp,total:Bp,items:$i.array(),couponsApplied:jl.array()}),Bl=v.discriminatedUnion("status",[ms,Fl]),Zp=class{constructor(e){this.api=e}async get(e){return(await this.api.fetch(`/api/customer/orders/${e}`,Bl)).data}async pushContent(e,t,n){const r={...Hl(n)};return t&&(r.checkout="true",r.returnUrl=t.returnUrl),(await this.api.fetch(`/api/customer/orders/${e.id}?${new URLSearchParams(r).toString()}`,ms,{method:"PATCH",body:{currency:e.currency||void 0,items:e.items}})).data}async removeBillingDetails(e){return(await this.api.fetch(`/api/customer/orders/${e}/billing-details`,ms,{method:"DELETE"})).data}};function Hl(e){return Object.entries({utm_source:e==null?void 0:e.source,utm_medium:e==null?void 0:e.medium,utm_campaign:e==null?void 0:e.campaign,utm_term:e==null?void 0:e.term,utm_content:e==null?void 0:e.content,utm_referrer:e==null?void 0:e.referrer}).filter(([t,n])=>n!==void 0).reduce((t,[n,r])=>({...t,[n]:r}),{})}var qp=class{constructor(e){this.api=e}async get(e){const t=new URLSearchParams(Hl(e));return(await this.api.fetch(`/api/customer/storefront?${t.toString()}`,Ap)).data}},Wp=class{constructor(e,t){this.baseUrl=e,this.tokenStore=t}async authenticatedFetch(e,t,n){if(!this.tokenStore.hasAccessToken)throw new Ci;return await this.fetch(e,t,n)}async fetch(e,t,n){var r;const o=await this.tokenStore.getAccessToken(),s=(r=n==null?void 0:n.contentType)!=null?r:"application/json",i=await fs(this.baseUrl+e,{method:(n==null?void 0:n.method)||"GET",mode:"cors",headers:{Accept:"application/json","Content-Type":s,...o?{Authorization:`Bearer ${o}`}:{},"x-mb-cors":"1"},body:n!=null&&n.body?s!=="application/json"?n.body:JSON.stringify(n.body):void 0});i.status>=400&&await Pi(i);let a;try{return a=t?await i.json():null,{data:t?t.parse(a):null,headers:Object.fromEntries(i.headers.entries()),status:i.status}}catch(l){throw console.warn("Could not parse response",{status:i.status,path:e,content:a||(i.bodyUsed?"unknown":await i.text()),headers:Object.fromEntries(i.headers.entries()),userAgent:window&&window.navigator&&window.navigator.userAgent,err:l}),new jr("Bad response","Could not parse server response",i.status)}}},Zl=class rs{constructor(t){if(this.configuration=t,this.tokens=null,this.refreshTimeoutId=null,this.refreshPromise=null,typeof window<"u"){window.addEventListener("storage",r=>this.handleStorageUpdate(r));const n=localStorage.getItem(rs.storageKey);n&&(this.tokens=JSON.parse(n),this.tokens.expiresAt=new Date(this.tokens.expiresAt))}}get user(){return this.tokens?this.tokens:null}get hasAccessToken(){return!!this.tokens}async getAccessToken(){var t,n,r;if(this.isExpired){if(this.refreshPromise){const s=await this.refreshPromise;return(t=s==null?void 0:s.accessToken)!=null?t:null}this.refreshPromise=this.refreshTokens();const o=await this.refreshPromise;return(n=o==null?void 0:o.accessToken)!=null?n:null}return((r=this.tokens)==null?void 0:r.accessToken)||null}setUser(t){return t===null?(this.tokens=null,typeof window<"u"&&localStorage&&localStorage.removeItem(rs.storageKey),this.refreshTimeoutId!=null&&window.clearTimeout(this.refreshTimeoutId),null):(this.tokens={...t,expiresAt:new Date(new Date().getTime()+15*60*1e3)},typeof window<"u"&&localStorage&&localStorage.setItem(rs.storageKey,JSON.stringify(this.tokens)),this.refreshTimeoutId!=null&&window.clearTimeout(this.refreshTimeoutId),this.refreshTimeoutId=window.setTimeout(()=>{this.refreshPromise=this.refreshTokens()},10*60*1e3),this.tokens)}get isExpired(){return this.tokens!=null&&this.tokens.expiresAt<new Date}async refreshTokens(){if(!this.tokens)throw new Error("No tokens found to refresh");const t=await fs(`${this.configuration.endpoint}/api/customer/identity/refresh?token=${this.tokens.refreshToken}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"text/plain","x-mb-cors":"1"},body:this.tokens.accessToken});if(t.status!==200){if(t.status===403||t.status===404)return this.setUser(null),null;throw new jr("Unexpected result",`Could not refresh access token, status code ${t.status}`,t.status)}const n=Di.parse(await t.json());return this.setUser(n)}handleStorageUpdate(t){switch(t.key){case rs.storageKey:this.tokens=t.newValue?JSON.parse(t.newValue):null,this.refreshTimeoutId!=null&&window.clearTimeout(this.refreshTimeoutId),this.tokens&&(this.tokens.expiresAt=new Date(this.tokens.expiresAt));break}}};Zl.storageKey="moonbase_auth";var zp=Zl,ql=v.object({id:v.string(),name:v.string(),description:v.string(),code:v.string(),redeemed:v.boolean(),redeemsProducts:Pl(ps).array(),redeemsBundles:Pl($l).array()}),Kp=class{constructor(e){this.api=e}async peek(e){return(await this.api.fetch(`/api/customer/vouchers?code=${encodeURIComponent(e)}`,ql)).data}async redeem(e){return(await this.api.authenticatedFetch(`/api/customer/vouchers/redeem?code=${encodeURIComponent(e)}`,ql,{method:"POST"})).data}},Wl=(e=>(e.Active="Active",e.Revoked="Revoked",e))(Wl||{}),zl=(e=>(e.Active="Active",e.Revoked="Revoked",e))(zl||{}),Ii=(e=>(e.Online="Online",e.Offline="Offline",e))(Ii||{}),Ai=v.object({id:v.string(),status:v.nativeEnum(Wl),product:Ti,activeNumberOfActivations:v.number(),maxNumberOfActivations:v.number(),createdAt:v.coerce.date()}),Kl=v.object({id:v.string(),licenseId:v.string(),name:v.string(),status:v.nativeEnum(zl),activationMethod:v.nativeEnum(Ii),lastValidatedAt:v.coerce.date().nullable()}),Gp=class{constructor(e){this.api=e}async activate(e,t){const n=await this.api.authenticatedFetch(`/api/customer/inventory/activate?method=${t}`,Ai,{method:"POST",body:e,contentType:"text/plain"});return{license:n.data,url:v.string().parse(n.headers.location)}}},Jp=class{constructor(e){this.api=e}async get(e){return(await this.api.authenticatedFetch(e||"/api/customer/inventory/licenses",ho(Ai))).data}async getActivations(e,t){return(await this.api.authenticatedFetch(t||`/api/customer/inventory/licenses/${e}/activations`,ho(Kl))).data}async revokeActivation(e,t){await this.api.authenticatedFetch(`/api/customer/inventory/licenses/${e}/activations/${t}/revoke`,null,{method:"POST"})}},Yp=class{constructor(e){this.api=e}async get(e,t){return(await this.api.fetch(`/api/customer/inventory/products/${e}${t?`?version=${t}`:""}`,Ti)).data}async getOwned(e){return(await this.api.authenticatedFetch(e||"/api/customer/inventory/products",ho(Ti))).data}async getLicenses(e,t){return(await this.api.authenticatedFetch(t||`/api/customer/inventory/products/${e}/licenses`,ho(Ai))).data}async getActivations(e,t){return(await this.api.authenticatedFetch(t||`/api/customer/inventory/products/${e}/licenses/activations`,ho(Kl))).data}async getDownloadUrl(e){const t=new URL(e);return t.searchParams.append("redirect","false"),(await this.api.fetch(t.pathname+t.search,v.object({location:v.string()}))).data.location}},Xp=class{constructor(e){this.licenses=new Jp(e),this.products=new Yp(e),this.activation=new Gp(e)}},Gl={};Cl(Gl,{orders:()=>Rl});var Qp=class{constructor(e){this.configuration=e,this.configuration.endpoint=this.configuration.endpoint.replace(/\/$/,""),this.tokenStore=new zp(e);const t=new Wp(this.configuration.endpoint,this.tokenStore);this.storefront=new qp(t),this.identity=new Up(t,this.tokenStore),this.vouchers=new Kp(t),this.orders=new Zp(t),this.inventory=new Xp(t),this.activationRequests=new Vp(t)}},Jl={};/**
|
|
4
4
|
* @vue/shared v3.5.3
|
|
5
5
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
6
6
|
* @license MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.53",
|
|
5
5
|
"description": "Package to let you embed Moonbase.sh into your storefront as a payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"pinia": "^2.1.7",
|
|
23
23
|
"vite-plugin-css-injected-by-js": "^3.5.1",
|
|
24
24
|
"vue": "^3.5.3",
|
|
25
|
-
"@moonbase.sh/vue": "0.2.
|
|
25
|
+
"@moonbase.sh/vue": "0.2.53"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^18.19.50",
|