@shipstatic/ship 0.4.2 → 0.4.3
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/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/package.json +3 -3
package/dist/browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Wm=Object.create;var ii=Object.defineProperty;var Xm=Object.getOwnPropertyDescriptor;var Hm=Object.getOwnPropertyNames;var Ym=Object.getPrototypeOf,Qm=Object.prototype.hasOwnProperty;var ef=(e,i,t)=>i in e?ii(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var S=(e,i)=>()=>(e&&(i=e(e=0)),i);var ti=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports),te=(e,i)=>{for(var t in i)ii(e,t,{get:i[t],enumerable:!0})},nf=(e,i,t,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of Hm(i))!Qm.call(e,n)&&n!==t&&ii(e,n,{get:()=>i[n],enumerable:!(r=Xm(i,n))||r.enumerable});return e};var Ae=(e,i,t)=>(t=e!=null?Wm(Ym(e)):{},nf(i||!e||!e.__esModule?ii(t,"default",{value:e,enumerable:!0}):t,e));var oi=(e,i,t)=>ef(e,typeof i!="symbol"?i+"":i,t);function gx(e){if(!e.startsWith(Re))throw P.validation(`API key must start with "${Re}"`);if(e.length!==Ep)throw P.validation(`API key must be ${Ep} characters total (${Re} + ${to} hex chars)`);let i=e.slice(Re.length);if(!/^[a-f0-9]{64}$/i.test(i))throw P.validation(`API key must contain ${to} hexadecimal characters after "${Re}" prefix`)}function xx(e){if(!e.startsWith(Ce))throw P.validation(`Deploy token must start with "${Ce}"`);if(e.length!==Np)throw P.validation(`Deploy token must be ${Np} characters total (${Ce} + ${oo} hex chars)`);let i=e.slice(Ce.length);if(!/^[a-f0-9]{64}$/i.test(i))throw P.validation(`Deploy token must contain ${oo} hexadecimal characters after "${Ce}" prefix`)}function hx(e){try{let i=new URL(e);if(!["http:","https:"].includes(i.protocol))throw P.validation("API URL must use http:// or https:// protocol");if(i.pathname!=="/"&&i.pathname!=="")throw P.validation("API URL must not contain a path");if(i.search||i.hash)throw P.validation("API URL must not contain query parameters or fragments")}catch(i){throw i instanceof P?i:P.validation("API URL must be a valid URL")}}function bx(e){return/^[a-z]+-[a-z]+-[a-z0-9]{7}$/i.test(e)}function yx(e,i){return`https://${e}.${i||"statichost.com"}`}function $x(e,i){return e.includes(".")?`https://${e}`:`https://${e}.${i||"statichost.dev"}`}var dx,mx,fx,F,io,P,Re,to,Ep,Ce,oo,Np,vx,ro,ri,V,K=S(()=>{"use strict";dx={PENDING:"pending",SUCCESS:"success",FAILED:"failed",DELETING:"deleting"},mx={PENDING:"pending",PARTIAL:"partial",SUCCESS:"success"},fx={FREE:"free",STANDARD:"standard",SPONSORED:"sponsored",ENTERPRISE:"enterprise",SUSPENDED:"suspended",TERMINATING:"terminating",TERMINATED:"terminated"};(function(e){e.Validation="validation_failed",e.NotFound="not_found",e.RateLimit="rate_limit_exceeded",e.Authentication="authentication_failed",e.Business="business_logic_error",e.Api="internal_server_error",e.Network="network_error",e.Cancelled="operation_cancelled",e.File="file_error",e.Config="config_error"})(F||(F={}));io={client:new Set([F.Business,F.Config,F.File,F.Validation]),network:new Set([F.Network]),auth:new Set([F.Authentication])},P=class e extends Error{constructor(t,r,n,o){super(r);oi(this,"type");oi(this,"status");oi(this,"details");this.type=t,this.status=n,this.details=o,this.name="ShipError"}toResponse(){let t=this.type===F.Authentication&&this.details?.internal?void 0:this.details;return{error:this.type,message:this.message,status:this.status,details:t}}static fromResponse(t){return new e(t.error,t.message,t.status,t.details)}static validation(t,r){return new e(F.Validation,t,400,r)}static notFound(t,r){let n=r?`${t} ${r} not found`:`${t} not found`;return new e(F.NotFound,n,404)}static rateLimit(t="Too many requests"){return new e(F.RateLimit,t,429)}static authentication(t="Authentication required",r){return new e(F.Authentication,t,401,r)}static business(t,r=400){return new e(F.Business,t,r)}static network(t,r){return new e(F.Network,t,void 0,{cause:r})}static cancelled(t){return new e(F.Cancelled,t)}static file(t,r){return new e(F.File,t,void 0,{filePath:r})}static config(t,r){return new e(F.Config,t,void 0,r)}static api(t,r=500,n,o){return new e(F.Api,t,r,{code:n,data:o})}static database(t,r=500){return new e(F.Api,t,r)}static storage(t,r=500){return new e(F.Api,t,r)}get filePath(){return this.details?.filePath}get code(){return this.details?.code}isClientError(){return io.client.has(this.type)}isNetworkError(){return io.network.has(this.type)}isAuthError(){return io.auth.has(this.type)}isValidationError(){return this.type===F.Validation}isFileError(){return this.type===F.File}isConfigError(){return this.type===F.Config}isType(t){return this.type===t}},Re="ship-",to=64,Ep=Re.length+to,Ce="token-",oo=64,Np=Ce.length+oo,vx={JWT:"jwt",API_KEY:"apiKey",TOKEN:"token",WEBHOOK:"webhook",SYSTEM:"system"},ro="ship.json";ri="https://api.shipstatic.com",V={PENDING:"pending",PROCESSING_ERROR:"processing_error",EMPTY_FILE:"empty_file",VALIDATION_FAILED:"validation_failed",READY:"ready"}});var Zp={};te(Zp,{__setTestEnvironment:()=>of,getENV:()=>xe});function of(e){po=e}function rf(){return typeof process<"u"&&process.versions&&process.versions.node?"node":typeof window<"u"||typeof self<"u"?"browser":"unknown"}function xe(){return po||rf()}var po,Fe=S(()=>{"use strict";po=null});function m(e,i,t){function r(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),i(s,c);let p=a.prototype,f=Object.keys(p);for(let x=0;x<f.length;x++){let w=f[x];w in s||(s[w]=p[w].bind(s))}}let n=t?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function a(s){var c;let p=t?.Parent?new o:this;r(p,s),(c=p._zod).deferred??(c.deferred=[]);for(let f of p._zod.deferred)f();return p}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>t?.Parent&&s instanceof t.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function M(e){return e&&Object.assign(bn,e),bn}var lo,ci,ae,he,bn,Le=S(()=>{"use strict";lo=Object.freeze({status:"aborted"});ci=Symbol("zod_brand"),ae=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},he=class extends Error{constructor(i){super(`Encountered unidirectional transform during encode: ${i}`),this.name="ZodEncodeError"}},bn={}});var _={};te(_,{BIGINT_FORMAT_RANGES:()=>$o,Class:()=>mo,NUMBER_FORMAT_RANGES:()=>yo,aborted:()=>_e,allowsEval:()=>go,assert:()=>lf,assertEqual:()=>af,assertIs:()=>cf,assertNever:()=>pf,assertNotEqual:()=>sf,assignProp:()=>ye,base64ToUint8Array:()=>Rp,base64urlToUint8Array:()=>If,cached:()=>Ve,captureStackTrace:()=>li,cleanEnum:()=>Sf,cleanRegex:()=>_n,clone:()=>G,cloneDef:()=>df,createTransparentProxy:()=>hf,defineLazy:()=>T,esc:()=>pi,escapeRegex:()=>oe,extend:()=>$f,finalizeIssue:()=>H,floatSafeRemainder:()=>fo,getElementAtPath:()=>mf,getEnumValues:()=>$n,getLengthableOrigin:()=>zn,getParsedType:()=>xf,getSizableOrigin:()=>wn,hexToUint8Array:()=>Pf,isObject:()=>Pe,isPlainObject:()=>$e,issue:()=>Je,joinValues:()=>g,jsonStringifyReplacer:()=>Me,merge:()=>kf,mergeDefs:()=>me,normalizeParams:()=>k,nullish:()=>be,numKeys:()=>gf,objectClone:()=>uf,omit:()=>yf,optionalKeys:()=>bo,parsedType:()=>$,partial:()=>wf,pick:()=>bf,prefixIssues:()=>ne,primitiveTypes:()=>ho,promiseAllObject:()=>ff,propertyKeyTypes:()=>kn,randomString:()=>vf,required:()=>zf,safeExtend:()=>_f,shallowClone:()=>xo,slugify:()=>vo,stringifyPrimitive:()=>y,uint8ArrayToBase64:()=>Cp,uint8ArrayToBase64url:()=>jf,uint8ArrayToHex:()=>Df,unwrapMessage:()=>yn});function af(e){return e}function sf(e){return e}function cf(e){}function pf(e){throw new Error("Unexpected value in exhaustive check")}function lf(e){}function $n(e){let i=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>i.indexOf(+r)===-1).map(([r,n])=>n)}function g(e,i="|"){return e.map(t=>y(t)).join(i)}function Me(e,i){return typeof i=="bigint"?i.toString():i}function Ve(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function be(e){return e==null}function _n(e){let i=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(i,t)}function fo(e,i){let t=(e.toString().split(".")[1]||"").length,r=i.toString(),n=(r.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(r)){let c=r.match(/\d?e-(\d?)/);c?.[1]&&(n=Number.parseInt(c[1]))}let o=t>n?t:n,a=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(i.toFixed(o).replace(".",""));return a%s/10**o}function T(e,i,t){let r;Object.defineProperty(e,i,{get(){if(r!==Ap)return r===void 0&&(r=Ap,r=t()),r},set(n){Object.defineProperty(e,i,{value:n})},configurable:!0})}function uf(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ye(e,i,t){Object.defineProperty(e,i,{value:t,writable:!0,enumerable:!0,configurable:!0})}function me(...e){let i={};for(let t of e){let r=Object.getOwnPropertyDescriptors(t);Object.assign(i,r)}return Object.defineProperties({},i)}function df(e){return me(e._zod.def)}function mf(e,i){return i?i.reduce((t,r)=>t?.[r],e):e}function ff(e){let i=Object.keys(e),t=i.map(r=>e[r]);return Promise.all(t).then(r=>{let n={};for(let o=0;o<i.length;o++)n[i[o]]=r[o];return n})}function vf(e=10){let i="abcdefghijklmnopqrstuvwxyz",t="";for(let r=0;r<e;r++)t+=i[Math.floor(Math.random()*i.length)];return t}function pi(e){return JSON.stringify(e)}function vo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Pe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function $e(e){if(Pe(e)===!1)return!1;let i=e.constructor;if(i===void 0||typeof i!="function")return!0;let t=i.prototype;return!(Pe(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function xo(e){return $e(e)?{...e}:Array.isArray(e)?[...e]:e}function gf(e){let i=0;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&i++;return i}function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function G(e,i,t){let r=new e._zod.constr(i??e._zod.def);return(!i||t?.parent)&&(r._zod.parent=e),r}function k(e){let i=e;if(!i)return{};if(typeof i=="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");i.error=i.message}return delete i.message,typeof i.error=="string"?{...i,error:()=>i.error}:i}function hf(e){let i;return new Proxy({},{get(t,r,n){return i??(i=e()),Reflect.get(i,r,n)},set(t,r,n,o){return i??(i=e()),Reflect.set(i,r,n,o)},has(t,r){return i??(i=e()),Reflect.has(i,r)},deleteProperty(t,r){return i??(i=e()),Reflect.deleteProperty(i,r)},ownKeys(t){return i??(i=e()),Reflect.ownKeys(i)},getOwnPropertyDescriptor(t,r){return i??(i=e()),Reflect.getOwnPropertyDescriptor(i,r)},defineProperty(t,r,n){return i??(i=e()),Reflect.defineProperty(i,r,n)}})}function y(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function bo(e){return Object.keys(e).filter(i=>e[i]._zod.optin==="optional"&&e[i]._zod.optout==="optional")}function bf(e,i){let t=e._zod.def,r=t.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=me(e._zod.def,{get shape(){let a={};for(let s in i){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);i[s]&&(a[s]=t.shape[s])}return ye(this,"shape",a),a},checks:[]});return G(e,o)}function yf(e,i){let t=e._zod.def,r=t.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=me(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in i){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);i[s]&&delete a[s]}return ye(this,"shape",a),a},checks:[]});return G(e,o)}function $f(e,i){if(!$e(i))throw new Error("Invalid input to extend: expected a plain object");let t=e._zod.def.checks;if(t&&t.length>0){let o=e._zod.def.shape;for(let a in i)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=me(e._zod.def,{get shape(){let o={...e._zod.def.shape,...i};return ye(this,"shape",o),o}});return G(e,n)}function _f(e,i){if(!$e(i))throw new Error("Invalid input to safeExtend: expected a plain object");let t=me(e._zod.def,{get shape(){let r={...e._zod.def.shape,...i};return ye(this,"shape",r),r}});return G(e,t)}function kf(e,i){let t=me(e._zod.def,{get shape(){let r={...e._zod.def.shape,...i._zod.def.shape};return ye(this,"shape",r),r},get catchall(){return i._zod.def.catchall},checks:[]});return G(e,t)}function wf(e,i,t){let n=i._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=me(i._zod.def,{get shape(){let s=i._zod.def.shape,c={...s};if(t)for(let p in t){if(!(p in s))throw new Error(`Unrecognized key: "${p}"`);t[p]&&(c[p]=e?new e({type:"optional",innerType:s[p]}):s[p])}else for(let p in s)c[p]=e?new e({type:"optional",innerType:s[p]}):s[p];return ye(this,"shape",c),c},checks:[]});return G(i,a)}function zf(e,i,t){let r=me(i._zod.def,{get shape(){let n=i._zod.def.shape,o={...n};if(t)for(let a in t){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new e({type:"nonoptional",innerType:n[a]});return ye(this,"shape",o),o}});return G(i,r)}function _e(e,i=0){if(e.aborted===!0)return!0;for(let t=i;t<e.issues.length;t++)if(e.issues[t]?.continue!==!0)return!0;return!1}function ne(e,i){return i.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function yn(e){return typeof e=="string"?e:e?.message}function H(e,i,t){let r={...e,path:e.path??[]};if(!e.message){let n=yn(e.inst?._zod.def?.error?.(e))??yn(i?.error?.(e))??yn(t.customError?.(e))??yn(t.localeError?.(e))??"Invalid input";r.message=n}return delete r.inst,delete r.continue,i?.reportInput||delete r.input,r}function wn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function zn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $(e){let i=typeof e;switch(i){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return i}function Je(...e){let[i,t,r]=e;return typeof i=="string"?{message:i,code:"custom",input:t,inst:r}:{...i}}function Sf(e){return Object.entries(e).filter(([i,t])=>Number.isNaN(Number.parseInt(i,10))).map(i=>i[1])}function Rp(e){let i=atob(e),t=new Uint8Array(i.length);for(let r=0;r<i.length;r++)t[r]=i.charCodeAt(r);return t}function Cp(e){let i="";for(let t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return btoa(i)}function If(e){let i=e.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-i.length%4)%4);return Rp(i+t)}function jf(e){return Cp(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Pf(e){let i=e.replace(/^0x/,"");if(i.length%2!==0)throw new Error("Invalid hex string length");let t=new Uint8Array(i.length/2);for(let r=0;r<i.length;r+=2)t[r/2]=Number.parseInt(i.slice(r,r+2),16);return t}function Df(e){return Array.from(e).map(i=>i.toString(16).padStart(2,"0")).join("")}var Ap,li,go,xf,kn,ho,yo,$o,mo,j=S(()=>{"use strict";Ap=Symbol("evaluating");li="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};go=Ve(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});xf=e=>{let i=typeof e;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${i}`)}},kn=new Set(["string","number","symbol"]),ho=new Set(["string","number","bigint","boolean","symbol","undefined"]);yo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$o={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};mo=class{constructor(...i){}}});function In(e,i=t=>t.message){let t={},r=[];for(let n of e.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(i(n))):r.push(i(n));return{formErrors:r,fieldErrors:t}}function jn(e,i=t=>t.message){let t={_errors:[]},r=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)t._errors.push(i(o));else{let a=t,s=0;for(;s<o.path.length;){let c=o.path[s];s===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(i(o))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return r(e),t}function _o(e,i=t=>t.message){let t={errors:[]},r=(n,o=[])=>{var a,s;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(p=>r({issues:p},c.path));else if(c.code==="invalid_key")r({issues:c.issues},c.path);else if(c.code==="invalid_element")r({issues:c.issues},c.path);else{let p=[...o,...c.path];if(p.length===0){t.errors.push(i(c));continue}let f=t,x=0;for(;x<p.length;){let w=p[x],z=x===p.length-1;typeof w=="string"?(f.properties??(f.properties={}),(a=f.properties)[w]??(a[w]={errors:[]}),f=f.properties[w]):(f.items??(f.items=[]),(s=f.items)[w]??(s[w]={errors:[]}),f=f.items[w]),z&&f.errors.push(i(c)),x++}}};return r(e),t}function Lp(e){let i=[],t=e.map(r=>typeof r=="object"?r.key:r);for(let r of t)typeof r=="number"?i.push(`[${r}]`):typeof r=="symbol"?i.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?i.push(`[${JSON.stringify(r)}]`):(i.length&&i.push("."),i.push(r));return i.join("")}function ko(e){let i=[],t=[...e.issues].sort((r,n)=>(r.path??[]).length-(n.path??[]).length);for(let r of t)i.push(`\u2716 ${r.message}`),r.path?.length&&i.push(` \u2192 at ${Lp(r.path)}`);return i.join(`
|
|
1
|
+
var Wm=Object.create;var ii=Object.defineProperty;var Xm=Object.getOwnPropertyDescriptor;var Hm=Object.getOwnPropertyNames;var Ym=Object.getPrototypeOf,Qm=Object.prototype.hasOwnProperty;var ef=(e,i,t)=>i in e?ii(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var S=(e,i)=>()=>(e&&(i=e(e=0)),i);var ti=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports),te=(e,i)=>{for(var t in i)ii(e,t,{get:i[t],enumerable:!0})},nf=(e,i,t,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of Hm(i))!Qm.call(e,n)&&n!==t&&ii(e,n,{get:()=>i[n],enumerable:!(r=Xm(i,n))||r.enumerable});return e};var Ae=(e,i,t)=>(t=e!=null?Wm(Ym(e)):{},nf(i||!e||!e.__esModule?ii(t,"default",{value:e,enumerable:!0}):t,e));var oi=(e,i,t)=>ef(e,typeof i!="symbol"?i+"":i,t);function gx(e){if(!e.startsWith(Re))throw P.validation(`API key must start with "${Re}"`);if(e.length!==Ep)throw P.validation(`API key must be ${Ep} characters total (${Re} + ${to} hex chars)`);let i=e.slice(Re.length);if(!/^[a-f0-9]{64}$/i.test(i))throw P.validation(`API key must contain ${to} hexadecimal characters after "${Re}" prefix`)}function xx(e){if(!e.startsWith(Ce))throw P.validation(`Deploy token must start with "${Ce}"`);if(e.length!==Np)throw P.validation(`Deploy token must be ${Np} characters total (${Ce} + ${oo} hex chars)`);let i=e.slice(Ce.length);if(!/^[a-f0-9]{64}$/i.test(i))throw P.validation(`Deploy token must contain ${oo} hexadecimal characters after "${Ce}" prefix`)}function hx(e){try{let i=new URL(e);if(!["http:","https:"].includes(i.protocol))throw P.validation("API URL must use http:// or https:// protocol");if(i.pathname!=="/"&&i.pathname!=="")throw P.validation("API URL must not contain a path");if(i.search||i.hash)throw P.validation("API URL must not contain query parameters or fragments")}catch(i){throw i instanceof P?i:P.validation("API URL must be a valid URL")}}function bx(e){return/^[a-z]+-[a-z]+-[a-z0-9]{7}$/i.test(e)}function yx(e,i){return`https://${e}.${i||"shipstatic.com"}`}function $x(e,i){return e.includes(".")?`https://${e}`:`https://${e}.${i||"shipstatic.com"}`}var dx,mx,fx,F,io,P,Re,to,Ep,Ce,oo,Np,vx,ro,ri,V,K=S(()=>{"use strict";dx={PENDING:"pending",SUCCESS:"success",FAILED:"failed",DELETING:"deleting"},mx={PENDING:"pending",PARTIAL:"partial",SUCCESS:"success"},fx={FREE:"free",STANDARD:"standard",SPONSORED:"sponsored",ENTERPRISE:"enterprise",SUSPENDED:"suspended",TERMINATING:"terminating",TERMINATED:"terminated"};(function(e){e.Validation="validation_failed",e.NotFound="not_found",e.RateLimit="rate_limit_exceeded",e.Authentication="authentication_failed",e.Business="business_logic_error",e.Api="internal_server_error",e.Network="network_error",e.Cancelled="operation_cancelled",e.File="file_error",e.Config="config_error"})(F||(F={}));io={client:new Set([F.Business,F.Config,F.File,F.Validation]),network:new Set([F.Network]),auth:new Set([F.Authentication])},P=class e extends Error{constructor(t,r,n,o){super(r);oi(this,"type");oi(this,"status");oi(this,"details");this.type=t,this.status=n,this.details=o,this.name="ShipError"}toResponse(){let t=this.type===F.Authentication&&this.details?.internal?void 0:this.details;return{error:this.type,message:this.message,status:this.status,details:t}}static fromResponse(t){return new e(t.error,t.message,t.status,t.details)}static validation(t,r){return new e(F.Validation,t,400,r)}static notFound(t,r){let n=r?`${t} ${r} not found`:`${t} not found`;return new e(F.NotFound,n,404)}static rateLimit(t="Too many requests"){return new e(F.RateLimit,t,429)}static authentication(t="Authentication required",r){return new e(F.Authentication,t,401,r)}static business(t,r=400){return new e(F.Business,t,r)}static network(t,r){return new e(F.Network,t,void 0,{cause:r})}static cancelled(t){return new e(F.Cancelled,t)}static file(t,r){return new e(F.File,t,void 0,{filePath:r})}static config(t,r){return new e(F.Config,t,void 0,r)}static api(t,r=500,n,o){return new e(F.Api,t,r,{code:n,data:o})}static database(t,r=500){return new e(F.Api,t,r)}static storage(t,r=500){return new e(F.Api,t,r)}get filePath(){return this.details?.filePath}get code(){return this.details?.code}isClientError(){return io.client.has(this.type)}isNetworkError(){return io.network.has(this.type)}isAuthError(){return io.auth.has(this.type)}isValidationError(){return this.type===F.Validation}isFileError(){return this.type===F.File}isConfigError(){return this.type===F.Config}isType(t){return this.type===t}},Re="ship-",to=64,Ep=Re.length+to,Ce="token-",oo=64,Np=Ce.length+oo,vx={JWT:"jwt",API_KEY:"apiKey",TOKEN:"token",WEBHOOK:"webhook",SYSTEM:"system"},ro="ship.json";ri="https://api.shipstatic.com",V={PENDING:"pending",PROCESSING_ERROR:"processing_error",EMPTY_FILE:"empty_file",VALIDATION_FAILED:"validation_failed",READY:"ready"}});var Zp={};te(Zp,{__setTestEnvironment:()=>of,getENV:()=>xe});function of(e){po=e}function rf(){return typeof process<"u"&&process.versions&&process.versions.node?"node":typeof window<"u"||typeof self<"u"?"browser":"unknown"}function xe(){return po||rf()}var po,Fe=S(()=>{"use strict";po=null});function m(e,i,t){function r(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),i(s,c);let p=a.prototype,f=Object.keys(p);for(let x=0;x<f.length;x++){let w=f[x];w in s||(s[w]=p[w].bind(s))}}let n=t?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function a(s){var c;let p=t?.Parent?new o:this;r(p,s),(c=p._zod).deferred??(c.deferred=[]);for(let f of p._zod.deferred)f();return p}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>t?.Parent&&s instanceof t.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function M(e){return e&&Object.assign(bn,e),bn}var lo,ci,ae,he,bn,Le=S(()=>{"use strict";lo=Object.freeze({status:"aborted"});ci=Symbol("zod_brand"),ae=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},he=class extends Error{constructor(i){super(`Encountered unidirectional transform during encode: ${i}`),this.name="ZodEncodeError"}},bn={}});var _={};te(_,{BIGINT_FORMAT_RANGES:()=>$o,Class:()=>mo,NUMBER_FORMAT_RANGES:()=>yo,aborted:()=>_e,allowsEval:()=>go,assert:()=>lf,assertEqual:()=>af,assertIs:()=>cf,assertNever:()=>pf,assertNotEqual:()=>sf,assignProp:()=>ye,base64ToUint8Array:()=>Rp,base64urlToUint8Array:()=>If,cached:()=>Ve,captureStackTrace:()=>li,cleanEnum:()=>Sf,cleanRegex:()=>_n,clone:()=>G,cloneDef:()=>df,createTransparentProxy:()=>hf,defineLazy:()=>T,esc:()=>pi,escapeRegex:()=>oe,extend:()=>$f,finalizeIssue:()=>H,floatSafeRemainder:()=>fo,getElementAtPath:()=>mf,getEnumValues:()=>$n,getLengthableOrigin:()=>zn,getParsedType:()=>xf,getSizableOrigin:()=>wn,hexToUint8Array:()=>Pf,isObject:()=>Pe,isPlainObject:()=>$e,issue:()=>Je,joinValues:()=>g,jsonStringifyReplacer:()=>Me,merge:()=>kf,mergeDefs:()=>me,normalizeParams:()=>k,nullish:()=>be,numKeys:()=>gf,objectClone:()=>uf,omit:()=>yf,optionalKeys:()=>bo,parsedType:()=>$,partial:()=>wf,pick:()=>bf,prefixIssues:()=>ne,primitiveTypes:()=>ho,promiseAllObject:()=>ff,propertyKeyTypes:()=>kn,randomString:()=>vf,required:()=>zf,safeExtend:()=>_f,shallowClone:()=>xo,slugify:()=>vo,stringifyPrimitive:()=>y,uint8ArrayToBase64:()=>Cp,uint8ArrayToBase64url:()=>jf,uint8ArrayToHex:()=>Df,unwrapMessage:()=>yn});function af(e){return e}function sf(e){return e}function cf(e){}function pf(e){throw new Error("Unexpected value in exhaustive check")}function lf(e){}function $n(e){let i=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>i.indexOf(+r)===-1).map(([r,n])=>n)}function g(e,i="|"){return e.map(t=>y(t)).join(i)}function Me(e,i){return typeof i=="bigint"?i.toString():i}function Ve(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function be(e){return e==null}function _n(e){let i=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(i,t)}function fo(e,i){let t=(e.toString().split(".")[1]||"").length,r=i.toString(),n=(r.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(r)){let c=r.match(/\d?e-(\d?)/);c?.[1]&&(n=Number.parseInt(c[1]))}let o=t>n?t:n,a=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(i.toFixed(o).replace(".",""));return a%s/10**o}function T(e,i,t){let r;Object.defineProperty(e,i,{get(){if(r!==Ap)return r===void 0&&(r=Ap,r=t()),r},set(n){Object.defineProperty(e,i,{value:n})},configurable:!0})}function uf(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ye(e,i,t){Object.defineProperty(e,i,{value:t,writable:!0,enumerable:!0,configurable:!0})}function me(...e){let i={};for(let t of e){let r=Object.getOwnPropertyDescriptors(t);Object.assign(i,r)}return Object.defineProperties({},i)}function df(e){return me(e._zod.def)}function mf(e,i){return i?i.reduce((t,r)=>t?.[r],e):e}function ff(e){let i=Object.keys(e),t=i.map(r=>e[r]);return Promise.all(t).then(r=>{let n={};for(let o=0;o<i.length;o++)n[i[o]]=r[o];return n})}function vf(e=10){let i="abcdefghijklmnopqrstuvwxyz",t="";for(let r=0;r<e;r++)t+=i[Math.floor(Math.random()*i.length)];return t}function pi(e){return JSON.stringify(e)}function vo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Pe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function $e(e){if(Pe(e)===!1)return!1;let i=e.constructor;if(i===void 0||typeof i!="function")return!0;let t=i.prototype;return!(Pe(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function xo(e){return $e(e)?{...e}:Array.isArray(e)?[...e]:e}function gf(e){let i=0;for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&i++;return i}function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function G(e,i,t){let r=new e._zod.constr(i??e._zod.def);return(!i||t?.parent)&&(r._zod.parent=e),r}function k(e){let i=e;if(!i)return{};if(typeof i=="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");i.error=i.message}return delete i.message,typeof i.error=="string"?{...i,error:()=>i.error}:i}function hf(e){let i;return new Proxy({},{get(t,r,n){return i??(i=e()),Reflect.get(i,r,n)},set(t,r,n,o){return i??(i=e()),Reflect.set(i,r,n,o)},has(t,r){return i??(i=e()),Reflect.has(i,r)},deleteProperty(t,r){return i??(i=e()),Reflect.deleteProperty(i,r)},ownKeys(t){return i??(i=e()),Reflect.ownKeys(i)},getOwnPropertyDescriptor(t,r){return i??(i=e()),Reflect.getOwnPropertyDescriptor(i,r)},defineProperty(t,r,n){return i??(i=e()),Reflect.defineProperty(i,r,n)}})}function y(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function bo(e){return Object.keys(e).filter(i=>e[i]._zod.optin==="optional"&&e[i]._zod.optout==="optional")}function bf(e,i){let t=e._zod.def,r=t.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=me(e._zod.def,{get shape(){let a={};for(let s in i){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);i[s]&&(a[s]=t.shape[s])}return ye(this,"shape",a),a},checks:[]});return G(e,o)}function yf(e,i){let t=e._zod.def,r=t.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=me(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in i){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);i[s]&&delete a[s]}return ye(this,"shape",a),a},checks:[]});return G(e,o)}function $f(e,i){if(!$e(i))throw new Error("Invalid input to extend: expected a plain object");let t=e._zod.def.checks;if(t&&t.length>0){let o=e._zod.def.shape;for(let a in i)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=me(e._zod.def,{get shape(){let o={...e._zod.def.shape,...i};return ye(this,"shape",o),o}});return G(e,n)}function _f(e,i){if(!$e(i))throw new Error("Invalid input to safeExtend: expected a plain object");let t=me(e._zod.def,{get shape(){let r={...e._zod.def.shape,...i};return ye(this,"shape",r),r}});return G(e,t)}function kf(e,i){let t=me(e._zod.def,{get shape(){let r={...e._zod.def.shape,...i._zod.def.shape};return ye(this,"shape",r),r},get catchall(){return i._zod.def.catchall},checks:[]});return G(e,t)}function wf(e,i,t){let n=i._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=me(i._zod.def,{get shape(){let s=i._zod.def.shape,c={...s};if(t)for(let p in t){if(!(p in s))throw new Error(`Unrecognized key: "${p}"`);t[p]&&(c[p]=e?new e({type:"optional",innerType:s[p]}):s[p])}else for(let p in s)c[p]=e?new e({type:"optional",innerType:s[p]}):s[p];return ye(this,"shape",c),c},checks:[]});return G(i,a)}function zf(e,i,t){let r=me(i._zod.def,{get shape(){let n=i._zod.def.shape,o={...n};if(t)for(let a in t){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new e({type:"nonoptional",innerType:n[a]});return ye(this,"shape",o),o}});return G(i,r)}function _e(e,i=0){if(e.aborted===!0)return!0;for(let t=i;t<e.issues.length;t++)if(e.issues[t]?.continue!==!0)return!0;return!1}function ne(e,i){return i.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function yn(e){return typeof e=="string"?e:e?.message}function H(e,i,t){let r={...e,path:e.path??[]};if(!e.message){let n=yn(e.inst?._zod.def?.error?.(e))??yn(i?.error?.(e))??yn(t.customError?.(e))??yn(t.localeError?.(e))??"Invalid input";r.message=n}return delete r.inst,delete r.continue,i?.reportInput||delete r.input,r}function wn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function zn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $(e){let i=typeof e;switch(i){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return i}function Je(...e){let[i,t,r]=e;return typeof i=="string"?{message:i,code:"custom",input:t,inst:r}:{...i}}function Sf(e){return Object.entries(e).filter(([i,t])=>Number.isNaN(Number.parseInt(i,10))).map(i=>i[1])}function Rp(e){let i=atob(e),t=new Uint8Array(i.length);for(let r=0;r<i.length;r++)t[r]=i.charCodeAt(r);return t}function Cp(e){let i="";for(let t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return btoa(i)}function If(e){let i=e.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-i.length%4)%4);return Rp(i+t)}function jf(e){return Cp(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Pf(e){let i=e.replace(/^0x/,"");if(i.length%2!==0)throw new Error("Invalid hex string length");let t=new Uint8Array(i.length/2);for(let r=0;r<i.length;r+=2)t[r/2]=Number.parseInt(i.slice(r,r+2),16);return t}function Df(e){return Array.from(e).map(i=>i.toString(16).padStart(2,"0")).join("")}var Ap,li,go,xf,kn,ho,yo,$o,mo,j=S(()=>{"use strict";Ap=Symbol("evaluating");li="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};go=Ve(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});xf=e=>{let i=typeof e;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${i}`)}},kn=new Set(["string","number","symbol"]),ho=new Set(["string","number","bigint","boolean","symbol","undefined"]);yo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$o={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};mo=class{constructor(...i){}}});function In(e,i=t=>t.message){let t={},r=[];for(let n of e.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(i(n))):r.push(i(n));return{formErrors:r,fieldErrors:t}}function jn(e,i=t=>t.message){let t={_errors:[]},r=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)t._errors.push(i(o));else{let a=t,s=0;for(;s<o.path.length;){let c=o.path[s];s===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(i(o))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return r(e),t}function _o(e,i=t=>t.message){let t={errors:[]},r=(n,o=[])=>{var a,s;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(p=>r({issues:p},c.path));else if(c.code==="invalid_key")r({issues:c.issues},c.path);else if(c.code==="invalid_element")r({issues:c.issues},c.path);else{let p=[...o,...c.path];if(p.length===0){t.errors.push(i(c));continue}let f=t,x=0;for(;x<p.length;){let w=p[x],z=x===p.length-1;typeof w=="string"?(f.properties??(f.properties={}),(a=f.properties)[w]??(a[w]={errors:[]}),f=f.properties[w]):(f.items??(f.items=[]),(s=f.items)[w]??(s[w]={errors:[]}),f=f.items[w]),z&&f.errors.push(i(c)),x++}}};return r(e),t}function Lp(e){let i=[],t=e.map(r=>typeof r=="object"?r.key:r);for(let r of t)typeof r=="number"?i.push(`[${r}]`):typeof r=="symbol"?i.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?i.push(`[${JSON.stringify(r)}]`):(i.length&&i.push("."),i.push(r));return i.join("")}function ko(e){let i=[],t=[...e.issues].sort((r,n)=>(r.path??[]).length-(n.path??[]).length);for(let r of t)i.push(`\u2716 ${r.message}`),r.path?.length&&i.push(` \u2192 at ${Lp(r.path)}`);return i.join(`
|
|
2
2
|
`)}var Fp,Sn,Y,wo=S(()=>{"use strict";Le();j();Fp=(e,i)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:i,enumerable:!1}),e.message=JSON.stringify(i,Me,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sn=m("$ZodError",Fp),Y=m("$ZodError",Fp,{Parent:Error})});var qe,ui,Be,di,Ke,zo,Ge,So,mi,Tf,fi,Of,vi,Ef,gi,Nf,xi,Zf,hi,Af,bi,Rf,yi,Cf,Io=S(()=>{"use strict";Le();wo();j();qe=e=>(i,t,r,n)=>{let o=r?Object.assign(r,{async:!1}):{async:!1},a=i._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new ae;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>H(c,o,M())));throw li(s,n?.callee),s}return a.value},ui=qe(Y),Be=e=>async(i,t,r,n)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},a=i._zod.run({value:t,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>H(c,o,M())));throw li(s,n?.callee),s}return a.value},di=Be(Y),Ke=e=>(i,t,r)=>{let n=r?{...r,async:!1}:{async:!1},o=i._zod.run({value:t,issues:[]},n);if(o instanceof Promise)throw new ae;return o.issues.length?{success:!1,error:new(e??Sn)(o.issues.map(a=>H(a,n,M())))}:{success:!0,data:o.value}},zo=Ke(Y),Ge=e=>async(i,t,r)=>{let n=r?Object.assign(r,{async:!0}):{async:!0},o=i._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>H(a,n,M())))}:{success:!0,data:o.value}},So=Ge(Y),mi=e=>(i,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return qe(e)(i,t,n)},Tf=mi(Y),fi=e=>(i,t,r)=>qe(e)(i,t,r),Of=fi(Y),vi=e=>async(i,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Be(e)(i,t,n)},Ef=vi(Y),gi=e=>async(i,t,r)=>Be(e)(i,t,r),Nf=gi(Y),xi=e=>(i,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ke(e)(i,t,n)},Zf=xi(Y),hi=e=>(i,t,r)=>Ke(e)(i,t,r),Af=hi(Y),bi=e=>async(i,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ge(e)(i,t,n)},Rf=bi(Y),yi=e=>async(i,t,r)=>Ge(e)(i,t,r),Cf=yi(Y)});var re={};te(re,{base64:()=>Vo,base64url:()=>$i,bigint:()=>Wo,boolean:()=>Ho,browserEmail:()=>Kf,cidrv4:()=>Lo,cidrv6:()=>Mo,cuid:()=>jo,cuid2:()=>Po,date:()=>qo,datetime:()=>Ko,domain:()=>Xf,duration:()=>Eo,e164:()=>Jo,email:()=>Zo,emoji:()=>Ao,extendedDuration:()=>Ff,guid:()=>No,hex:()=>Hf,hostname:()=>Wf,html5Email:()=>Jf,idnEmail:()=>Bf,integer:()=>Xo,ipv4:()=>Ro,ipv6:()=>Co,ksuid:()=>To,lowercase:()=>er,mac:()=>Fo,md5_base64:()=>Qf,md5_base64url:()=>ev,md5_hex:()=>Yf,nanoid:()=>Oo,null:()=>Yo,number:()=>_i,rfc5322Email:()=>qf,sha1_base64:()=>iv,sha1_base64url:()=>tv,sha1_hex:()=>nv,sha256_base64:()=>rv,sha256_base64url:()=>av,sha256_hex:()=>ov,sha384_base64:()=>cv,sha384_base64url:()=>pv,sha384_hex:()=>sv,sha512_base64:()=>uv,sha512_base64url:()=>dv,sha512_hex:()=>lv,string:()=>Go,time:()=>Bo,ulid:()=>Do,undefined:()=>Qo,unicodeEmail:()=>Mp,uppercase:()=>nr,uuid:()=>De,uuid4:()=>Lf,uuid6:()=>Mf,uuid7:()=>Vf,xid:()=>Uo});function Ao(){return new RegExp(Gf,"u")}function Jp(e){let i="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${i}`:e.precision===0?`${i}:[0-5]\\d`:`${i}:[0-5]\\d\\.\\d{${e.precision}}`:`${i}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Bo(e){return new RegExp(`^${Jp(e)}$`)}function Ko(e){let i=Jp({precision:e.precision}),t=["Z"];e.local&&t.push(""),e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${i}(?:${t.join("|")})`;return new RegExp(`^${Vp}T(?:${r})$`)}function Pn(e,i){return new RegExp(`^[A-Za-z0-9+/]{${e}}${i}$`)}function Dn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var jo,Po,Do,Uo,To,Oo,Eo,Ff,No,De,Lf,Mf,Vf,Zo,Jf,qf,Mp,Bf,Kf,Gf,Ro,Co,Fo,Lo,Mo,Vo,$i,Wf,Xf,Jo,Vp,qo,Go,Wo,Xo,_i,Ho,Yo,Qo,er,nr,Hf,Yf,Qf,ev,nv,iv,tv,ov,rv,av,sv,cv,pv,lv,uv,dv,ki=S(()=>{"use strict";j();jo=/^[cC][^\s-]{8,}$/,Po=/^[0-9a-z]+$/,Do=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Uo=/^[0-9a-vA-V]{20}$/,To=/^[A-Za-z0-9]{27}$/,Oo=/^[a-zA-Z0-9_-]{21}$/,Eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ff=/^[-+]?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)?)??$/,No=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,De=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Lf=De(4),Mf=De(6),Vf=De(7),Zo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Jf=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qf=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Mp=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Bf=Mp,Kf=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Gf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Ro=/^(?:(?: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])$/,Co=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Fo=e=>{let i=oe(e??":");return new RegExp(`^(?:[0-9A-F]{2}${i}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${i}){5}[0-9a-f]{2}$`)},Lo=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Mo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$i=/^[A-Za-z0-9_-]*$/,Wf=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Xf=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Jo=/^\+[1-9]\d{6,14}$/,Vp="(?:(?:\\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])))",qo=new RegExp(`^${Vp}$`);Go=e=>{let i=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${i}$`)},Wo=/^-?\d+n?$/,Xo=/^-?\d+$/,_i=/^-?\d+(?:\.\d+)?$/,Ho=/^(?:true|false)$/i,Yo=/^null$/i,Qo=/^undefined$/i,er=/^[^A-Z]*$/,nr=/^[^a-z]*$/,Hf=/^[0-9a-fA-F]*$/;Yf=/^[0-9a-fA-F]{32}$/,Qf=Pn(22,"=="),ev=Dn(22),nv=/^[0-9a-fA-F]{40}$/,iv=Pn(27,"="),tv=Dn(27),ov=/^[0-9a-fA-F]{64}$/,rv=Pn(43,"="),av=Dn(43),sv=/^[0-9a-fA-F]{96}$/,cv=Pn(64,""),pv=Dn(64),lv=/^[0-9a-fA-F]{128}$/,uv=Pn(86,"=="),dv=Dn(86)});function qp(e,i,t){e.issues.length&&i.issues.push(...ne(t,e.issues))}var C,Bp,wi,zi,ir,tr,or,rr,ar,sr,cr,pr,lr,We,ur,dr,mr,fr,vr,gr,xr,hr,br,Si=S(()=>{"use strict";Le();ki();j();C=m("$ZodCheck",(e,i)=>{var t;e._zod??(e._zod={}),e._zod.def=i,(t=e._zod).onattach??(t.onattach=[])}),Bp={number:"number",bigint:"bigint",object:"date"},wi=m("$ZodCheckLessThan",(e,i)=>{C.init(e,i);let t=Bp[typeof i.value];e._zod.onattach.push(r=>{let n=r._zod.bag,o=(i.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;i.value<o&&(i.inclusive?n.maximum=i.value:n.exclusiveMaximum=i.value)}),e._zod.check=r=>{(i.inclusive?r.value<=i.value:r.value<i.value)||r.issues.push({origin:t,code:"too_big",maximum:typeof i.value=="object"?i.value.getTime():i.value,input:r.value,inclusive:i.inclusive,inst:e,continue:!i.abort})}}),zi=m("$ZodCheckGreaterThan",(e,i)=>{C.init(e,i);let t=Bp[typeof i.value];e._zod.onattach.push(r=>{let n=r._zod.bag,o=(i.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;i.value>o&&(i.inclusive?n.minimum=i.value:n.exclusiveMinimum=i.value)}),e._zod.check=r=>{(i.inclusive?r.value>=i.value:r.value>i.value)||r.issues.push({origin:t,code:"too_small",minimum:typeof i.value=="object"?i.value.getTime():i.value,input:r.value,inclusive:i.inclusive,inst:e,continue:!i.abort})}}),ir=m("$ZodCheckMultipleOf",(e,i)=>{C.init(e,i),e._zod.onattach.push(t=>{var r;(r=t._zod.bag).multipleOf??(r.multipleOf=i.value)}),e._zod.check=t=>{if(typeof t.value!=typeof i.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%i.value===BigInt(0):fo(t.value,i.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:i.value,input:t.value,inst:e,continue:!i.abort})}}),tr=m("$ZodCheckNumberFormat",(e,i)=>{C.init(e,i),i.format=i.format||"float64";let t=i.format?.includes("int"),r=t?"int":"number",[n,o]=yo[i.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=i.format,s.minimum=n,s.maximum=o,t&&(s.pattern=Xo)}),e._zod.check=a=>{let s=a.value;if(t){if(!Number.isInteger(s)){a.issues.push({expected:r,format:i.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!i.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!i.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!i.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!i.abort})}}),or=m("$ZodCheckBigIntFormat",(e,i)=>{C.init(e,i);let[t,r]=$o[i.format];e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=i.format,o.minimum=t,o.maximum=r}),e._zod.check=n=>{let o=n.value;o<t&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!i.abort}),o>r&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!i.abort})}}),rr=m("$ZodCheckMaxSize",(e,i)=>{var t;C.init(e,i),(t=e._zod.def).when??(t.when=r=>{let n=r.value;return!be(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;i.maximum<n&&(r._zod.bag.maximum=i.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=i.maximum||r.issues.push({origin:wn(n),code:"too_big",maximum:i.maximum,inclusive:!0,input:n,inst:e,continue:!i.abort})}}),ar=m("$ZodCheckMinSize",(e,i)=>{var t;C.init(e,i),(t=e._zod.def).when??(t.when=r=>{let n=r.value;return!be(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;i.minimum>n&&(r._zod.bag.minimum=i.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=i.minimum||r.issues.push({origin:wn(n),code:"too_small",minimum:i.minimum,inclusive:!0,input:n,inst:e,continue:!i.abort})}}),sr=m("$ZodCheckSizeEquals",(e,i)=>{var t;C.init(e,i),(t=e._zod.def).when??(t.when=r=>{let n=r.value;return!be(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=i.size,n.maximum=i.size,n.size=i.size}),e._zod.check=r=>{let n=r.value,o=n.size;if(o===i.size)return;let a=o>i.size;r.issues.push({origin:wn(n),...a?{code:"too_big",maximum:i.size}:{code:"too_small",minimum:i.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!i.abort})}}),cr=m("$ZodCheckMaxLength",(e,i)=>{var t;C.init(e,i),(t=e._zod.def).when??(t.when=r=>{let n=r.value;return!be(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;i.maximum<n&&(r._zod.bag.maximum=i.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=i.maximum)return;let a=zn(n);r.issues.push({origin:a,code:"too_big",maximum:i.maximum,inclusive:!0,input:n,inst:e,continue:!i.abort})}}),pr=m("$ZodCheckMinLength",(e,i)=>{var t;C.init(e,i),(t=e._zod.def).when??(t.when=r=>{let n=r.value;return!be(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;i.minimum>n&&(r._zod.bag.minimum=i.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=i.minimum)return;let a=zn(n);r.issues.push({origin:a,code:"too_small",minimum:i.minimum,inclusive:!0,input:n,inst:e,continue:!i.abort})}}),lr=m("$ZodCheckLengthEquals",(e,i)=>{var t;C.init(e,i),(t=e._zod.def).when??(t.when=r=>{let n=r.value;return!be(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=i.length,n.maximum=i.length,n.length=i.length}),e._zod.check=r=>{let n=r.value,o=n.length;if(o===i.length)return;let a=zn(n),s=o>i.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!i.abort})}}),We=m("$ZodCheckStringFormat",(e,i)=>{var t,r;C.init(e,i),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=i.format,i.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(i.pattern))}),i.pattern?(t=e._zod).check??(t.check=n=>{i.pattern.lastIndex=0,!i.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:i.format,input:n.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:e,continue:!i.abort})}):(r=e._zod).check??(r.check=()=>{})}),ur=m("$ZodCheckRegex",(e,i)=>{We.init(e,i),e._zod.check=t=>{i.pattern.lastIndex=0,!i.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:i.pattern.toString(),inst:e,continue:!i.abort})}}),dr=m("$ZodCheckLowerCase",(e,i)=>{i.pattern??(i.pattern=er),We.init(e,i)}),mr=m("$ZodCheckUpperCase",(e,i)=>{i.pattern??(i.pattern=nr),We.init(e,i)}),fr=m("$ZodCheckIncludes",(e,i)=>{C.init(e,i);let t=oe(i.includes),r=new RegExp(typeof i.position=="number"?`^.{${i.position}}${t}`:t);i.pattern=r,e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.includes(i.includes,i.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:n.value,inst:e,continue:!i.abort})}}),vr=m("$ZodCheckStartsWith",(e,i)=>{C.init(e,i);let t=new RegExp(`^${oe(i.prefix)}.*`);i.pattern??(i.pattern=t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),e._zod.check=r=>{r.value.startsWith(i.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:r.value,inst:e,continue:!i.abort})}}),gr=m("$ZodCheckEndsWith",(e,i)=>{C.init(e,i);let t=new RegExp(`.*${oe(i.suffix)}$`);i.pattern??(i.pattern=t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),e._zod.check=r=>{r.value.endsWith(i.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:r.value,inst:e,continue:!i.abort})}});xr=m("$ZodCheckProperty",(e,i)=>{C.init(e,i),e._zod.check=t=>{let r=i.schema._zod.run({value:t.value[i.property],issues:[]},{});if(r instanceof Promise)return r.then(n=>qp(n,t,i.property));qp(r,t,i.property)}}),hr=m("$ZodCheckMimeType",(e,i)=>{C.init(e,i);let t=new Set(i.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=i.mime}),e._zod.check=r=>{t.has(r.value.type)||r.issues.push({code:"invalid_value",values:i.mime,input:r.value.type,inst:e,continue:!i.abort})}}),br=m("$ZodCheckOverwrite",(e,i)=>{C.init(e,i),e._zod.check=t=>{t.value=i.tx(t.value)}})});var Un,yr=S(()=>{"use strict";Un=class{constructor(i=[]){this.content=[],this.indent=0,this&&(this.args=i)}indented(i){this.indent+=1,i(this),this.indent-=1}write(i){if(typeof i=="function"){i(this,{execution:"sync"}),i(this,{execution:"async"});return}let r=i.split(`
|
|
3
3
|
`).filter(a=>a),n=Math.min(...r.map(a=>a.length-a.trimStart().length)),o=r.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let i=Function,t=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new i(...t,n.join(`
|
|
4
4
|
`))}}});var $r,_r=S(()=>{"use strict";$r={major:4,minor:3,patch:5}});function Jr(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function rl(e){if(!$i.test(e))return!1;let i=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),t=i.padEnd(Math.ceil(i.length/4)*4,"=");return Jr(t)}function al(e,i=null){try{let t=e.split(".");if(t.length!==3)return!1;let[r]=t;if(!r)return!1;let n=JSON.parse(atob(r));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||i&&(!("alg"in n)||n.alg!==i))}catch{return!1}}function Gp(e,i,t){e.issues.length&&i.issues.push(...ne(t,e.issues)),i.value[t]=e.value}function Ui(e,i,t,r,n){if(e.issues.length){if(n&&!(t in r))return;i.issues.push(...ne(t,e.issues))}e.value===void 0?t in r&&(i.value[t]=void 0):i.value[t]=e.value}function sl(e){let i=Object.keys(e.shape);for(let r of i)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);let t=bo(e.shape);return{...e,keys:i,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(t)}}function cl(e,i,t,r,n,o){let a=[],s=n.keySet,c=n.catchall._zod,p=c.def.type,f=c.optout==="optional";for(let x in i){if(s.has(x))continue;if(p==="never"){a.push(x);continue}let w=c.run({value:i[x],issues:[]},r);w instanceof Promise?e.push(w.then(z=>Ui(z,t,x,i,f))):Ui(w,t,x,i,f)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:i,inst:o}),e.length?Promise.all(e).then(()=>t):t}function Wp(e,i,t,r){for(let o of e)if(o.issues.length===0)return i.value=o.value,i;let n=e.filter(o=>!_e(o));return n.length===1?(i.value=n[0].value,n[0]):(i.issues.push({code:"invalid_union",input:i.value,inst:t,errors:e.map(o=>o.issues.map(a=>H(a,r,M())))}),i)}function Xp(e,i,t,r){let n=e.filter(o=>o.issues.length===0);return n.length===1?(i.value=n[0].value,i):(n.length===0?i.issues.push({code:"invalid_union",input:i.value,inst:t,errors:e.map(o=>o.issues.map(a=>H(a,r,M())))}):i.issues.push({code:"invalid_union",input:i.value,inst:t,errors:[],inclusive:!1}),i)}function kr(e,i){if(e===i)return{valid:!0,data:e};if(e instanceof Date&&i instanceof Date&&+e==+i)return{valid:!0,data:e};if($e(e)&&$e(i)){let t=Object.keys(i),r=Object.keys(e).filter(o=>t.indexOf(o)!==-1),n={...e,...i};for(let o of r){let a=kr(e[o],i[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(i)){if(e.length!==i.length)return{valid:!1,mergeErrorPath:[]};let t=[];for(let r=0;r<e.length;r++){let n=e[r],o=i[r],a=kr(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};t.push(a.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function Hp(e,i,t){let r=new Map,n;for(let s of i.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let c of s.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(s);for(let s of t.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(s);let o=[...r].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&n&&e.issues.push({...n,keys:o}),_e(e))return e;let a=kr(i.value,t.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}function Ii(e,i,t){e.issues.length&&i.issues.push(...ne(t,e.issues)),i.value[t]=e.value}function Yp(e,i,t,r,n,o,a){e.issues.length&&(kn.has(typeof r)?t.issues.push(...ne(r,e.issues)):t.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:e.issues.map(s=>H(s,a,M()))})),i.issues.length&&(kn.has(typeof r)?t.issues.push(...ne(r,i.issues)):t.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:r,issues:i.issues.map(s=>H(s,a,M()))})),t.value.set(e.value,i.value)}function Qp(e,i){e.issues.length&&i.issues.push(...e.issues),i.value.add(e.value)}function el(e,i){return e.issues.length&&i===void 0?{issues:[],value:void 0}:e}function nl(e,i){return e.value===void 0&&(e.value=i.defaultValue),e}function il(e,i){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:i}),e}function ji(e,i,t){return e.issues.length?(e.aborted=!0,e):i._zod.run({value:e.value,issues:e.issues},t)}function Pi(e,i,t){if(e.issues.length)return e.aborted=!0,e;if((t.direction||"forward")==="forward"){let n=i.transform(e.value,e);return n instanceof Promise?n.then(o=>Di(e,o,i.out,t)):Di(e,n,i.out,t)}else{let n=i.reverseTransform(e.value,e);return n instanceof Promise?n.then(o=>Di(e,o,i.in,t)):Di(e,n,i.in,t)}}function Di(e,i,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:i,issues:e.issues},r)}function tl(e){return e.value=Object.freeze(e.value),e}function ol(e,i,t,r){if(!e){let n={code:"custom",input:t,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),i.issues.push(Je(n))}}var D,Ue,A,wr,zr,Sr,Ir,jr,Pr,Dr,Ur,Tr,Or,Er,Nr,Zr,Ar,Rr,Cr,Fr,Lr,Mr,Vr,qr,Br,Kr,Gr,Wr,Ti,Xr,Tn,Oi,Hr,Yr,Qr,ea,na,ia,ta,oa,ra,aa,pl,sa,On,ca,pa,la,Ei,ua,da,ma,fa,va,ga,xa,Ni,ha,ba,ya,$a,_a,ka,wa,za,Sa,En,Ia,ja,Pa,Da,Ua,Ta,Oa=S(()=>{"use strict";Si();Le();yr();Io();ki();j();_r();j();D=m("$ZodType",(e,i)=>{var t;e??(e={}),e._zod.def=i,e._zod.bag=e._zod.bag||{},e._zod.version=$r;let r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(let n of r)for(let o of n._zod.onattach)o(e);if(r.length===0)(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,c)=>{let p=_e(a),f;for(let x of s){if(x._zod.def.when){if(!x._zod.def.when(a))continue}else if(p)continue;let w=a.issues.length,z=x._zod.check(a);if(z instanceof Promise&&c?.async===!1)throw new ae;if(f||z instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await z,a.issues.length!==w&&(p||(p=_e(a,w)))});else{if(a.issues.length===w)continue;p||(p=_e(a,w))}}return f?f.then(()=>a):a},o=(a,s,c)=>{if(_e(a))return a.aborted=!0,a;let p=n(s,r,c);if(p instanceof Promise){if(c.async===!1)throw new ae;return p.then(f=>e._zod.parse(f,c))}return e._zod.parse(p,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let p=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return p instanceof Promise?p.then(f=>o(f,a,s)):o(p,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new ae;return c.then(p=>n(p,r,s))}return n(c,r,s)}}T(e,"~standard",()=>({validate:n=>{try{let o=zo(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return So(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Ue=m("$ZodString",(e,i)=>{D.init(e,i),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Go(e._zod.bag),e._zod.parse=(t,r)=>{if(i.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:e}),t}}),A=m("$ZodStringFormat",(e,i)=>{We.init(e,i),Ue.init(e,i)}),wr=m("$ZodGUID",(e,i)=>{i.pattern??(i.pattern=No),A.init(e,i)}),zr=m("$ZodUUID",(e,i)=>{if(i.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(r===void 0)throw new Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=De(r))}else i.pattern??(i.pattern=De());A.init(e,i)}),Sr=m("$ZodEmail",(e,i)=>{i.pattern??(i.pattern=Zo),A.init(e,i)}),Ir=m("$ZodURL",(e,i)=>{A.init(e,i),e._zod.check=t=>{try{let r=t.value.trim(),n=new URL(r);i.hostname&&(i.hostname.lastIndex=0,i.hostname.test(n.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:t.value,inst:e,continue:!i.abort})),i.protocol&&(i.protocol.lastIndex=0,i.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:t.value,inst:e,continue:!i.abort})),i.normalize?t.value=n.href:t.value=r;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:e,continue:!i.abort})}}}),jr=m("$ZodEmoji",(e,i)=>{i.pattern??(i.pattern=Ao()),A.init(e,i)}),Pr=m("$ZodNanoID",(e,i)=>{i.pattern??(i.pattern=Oo),A.init(e,i)}),Dr=m("$ZodCUID",(e,i)=>{i.pattern??(i.pattern=jo),A.init(e,i)}),Ur=m("$ZodCUID2",(e,i)=>{i.pattern??(i.pattern=Po),A.init(e,i)}),Tr=m("$ZodULID",(e,i)=>{i.pattern??(i.pattern=Do),A.init(e,i)}),Or=m("$ZodXID",(e,i)=>{i.pattern??(i.pattern=Uo),A.init(e,i)}),Er=m("$ZodKSUID",(e,i)=>{i.pattern??(i.pattern=To),A.init(e,i)}),Nr=m("$ZodISODateTime",(e,i)=>{i.pattern??(i.pattern=Ko(i)),A.init(e,i)}),Zr=m("$ZodISODate",(e,i)=>{i.pattern??(i.pattern=qo),A.init(e,i)}),Ar=m("$ZodISOTime",(e,i)=>{i.pattern??(i.pattern=Bo(i)),A.init(e,i)}),Rr=m("$ZodISODuration",(e,i)=>{i.pattern??(i.pattern=Eo),A.init(e,i)}),Cr=m("$ZodIPv4",(e,i)=>{i.pattern??(i.pattern=Ro),A.init(e,i),e._zod.bag.format="ipv4"}),Fr=m("$ZodIPv6",(e,i)=>{i.pattern??(i.pattern=Co),A.init(e,i),e._zod.bag.format="ipv6",e._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:e,continue:!i.abort})}}}),Lr=m("$ZodMAC",(e,i)=>{i.pattern??(i.pattern=Fo(i.delimiter)),A.init(e,i),e._zod.bag.format="mac"}),Mr=m("$ZodCIDRv4",(e,i)=>{i.pattern??(i.pattern=Lo),A.init(e,i)}),Vr=m("$ZodCIDRv6",(e,i)=>{i.pattern??(i.pattern=Mo),A.init(e,i),e._zod.check=t=>{let r=t.value.split("/");try{if(r.length!==2)throw new Error;let[n,o]=r;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:e,continue:!i.abort})}}});qr=m("$ZodBase64",(e,i)=>{i.pattern??(i.pattern=Vo),A.init(e,i),e._zod.bag.contentEncoding="base64",e._zod.check=t=>{Jr(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:e,continue:!i.abort})}});Br=m("$ZodBase64URL",(e,i)=>{i.pattern??(i.pattern=$i),A.init(e,i),e._zod.bag.contentEncoding="base64url",e._zod.check=t=>{rl(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:e,continue:!i.abort})}}),Kr=m("$ZodE164",(e,i)=>{i.pattern??(i.pattern=Jo),A.init(e,i)});Gr=m("$ZodJWT",(e,i)=>{A.init(e,i),e._zod.check=t=>{al(t.value,i.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:e,continue:!i.abort})}}),Wr=m("$ZodCustomStringFormat",(e,i)=>{A.init(e,i),e._zod.check=t=>{i.fn(t.value)||t.issues.push({code:"invalid_format",format:i.format,input:t.value,inst:e,continue:!i.abort})}}),Ti=m("$ZodNumber",(e,i)=>{D.init(e,i),e._zod.pattern=e._zod.bag.pattern??_i,e._zod.parse=(t,r)=>{if(i.coerce)try{t.value=Number(t.value)}catch{}let n=t.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return t;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),t}}),Xr=m("$ZodNumberFormat",(e,i)=>{tr.init(e,i),Ti.init(e,i)}),Tn=m("$ZodBoolean",(e,i)=>{D.init(e,i),e._zod.pattern=Ho,e._zod.parse=(t,r)=>{if(i.coerce)try{t.value=!!t.value}catch{}let n=t.value;return typeof n=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),t}}),Oi=m("$ZodBigInt",(e,i)=>{D.init(e,i),e._zod.pattern=Wo,e._zod.parse=(t,r)=>{if(i.coerce)try{t.value=BigInt(t.value)}catch{}return typeof t.value=="bigint"||t.issues.push({expected:"bigint",code:"invalid_type",input:t.value,inst:e}),t}}),Hr=m("$ZodBigIntFormat",(e,i)=>{or.init(e,i),Oi.init(e,i)}),Yr=m("$ZodSymbol",(e,i)=>{D.init(e,i),e._zod.parse=(t,r)=>{let n=t.value;return typeof n=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),t}}),Qr=m("$ZodUndefined",(e,i)=>{D.init(e,i),e._zod.pattern=Qo,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,r)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),t}}),ea=m("$ZodNull",(e,i)=>{D.init(e,i),e._zod.pattern=Yo,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let n=t.value;return n===null||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),na=m("$ZodAny",(e,i)=>{D.init(e,i),e._zod.parse=t=>t}),ia=m("$ZodUnknown",(e,i)=>{D.init(e,i),e._zod.parse=t=>t}),ta=m("$ZodNever",(e,i)=>{D.init(e,i),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),oa=m("$ZodVoid",(e,i)=>{D.init(e,i),e._zod.parse=(t,r)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}}),ra=m("$ZodDate",(e,i)=>{D.init(e,i),e._zod.parse=(t,r)=>{if(i.coerce)try{t.value=new Date(t.value)}catch{}let n=t.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),t}});aa=m("$ZodArray",(e,i)=>{D.init(e,i),e._zod.parse=(t,r)=>{let n=t.value;if(!Array.isArray(n))return t.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),t;t.value=Array(n.length);let o=[];for(let a=0;a<n.length;a++){let s=n[a],c=i.element._zod.run({value:s,issues:[]},r);c instanceof Promise?o.push(c.then(p=>Gp(p,t,a))):Gp(c,t,a)}return o.length?Promise.all(o).then(()=>t):t}});pl=m("$ZodObject",(e,i)=>{if(D.init(e,i),!Object.getOwnPropertyDescriptor(i,"shape")?.get){let s=i.shape;Object.defineProperty(i,"shape",{get:()=>{let c={...s};return Object.defineProperty(i,"shape",{value:c}),c}})}let r=Ve(()=>sl(i));T(e._zod,"propValues",()=>{let s=i.shape,c={};for(let p in s){let f=s[p]._zod;if(f.values){c[p]??(c[p]=new Set);for(let x of f.values)c[p].add(x)}}return c});let n=Pe,o=i.catchall,a;e._zod.parse=(s,c)=>{a??(a=r.value);let p=s.value;if(!n(p))return s.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),s;s.value={};let f=[],x=a.shape;for(let w of a.keys){let z=x[w],O=z._zod.optout==="optional",N=z._zod.run({value:p[w],issues:[]},c);N instanceof Promise?f.push(N.then(E=>Ui(E,s,w,p,O))):Ui(N,s,w,p,O)}return o?cl(f,p,s,c,r.value,e):f.length?Promise.all(f).then(()=>s):s}}),sa=m("$ZodObjectJIT",(e,i)=>{pl.init(e,i);let t=e._zod.parse,r=Ve(()=>sl(i)),n=w=>{let z=new Un(["shape","payload","ctx"]),O=r.value,N=u=>{let l=pi(u);return`shape[${l}]._zod.run({ value: input[${l}], issues: [] }, ctx)`};z.write("const input = payload.value;");let E=Object.create(null),b=0;for(let u of O.keys)E[u]=`key_${b++}`;z.write("const newResult = {};");for(let u of O.keys){let l=E[u],v=pi(u),J=w[u]?._zod?.optout==="optional";z.write(`const ${l} = ${N(u)};`),J?z.write(`
|