@jsfsi-core/ts-crossplatform 1.1.43 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e={})=>e,t=e=>[e,void 0],n=e=>[void 0,e],r=class{name;constructor(){this.name=this.constructor.name}},i=e=>t=>!(t instanceof e),a=e=>t=>t instanceof e,o=(e,t=process.env)=>{let n=e.safeParse(t);if(!n.success)throw Error(`Invalid environment variables: ${JSON.stringify(n.error.issues)}`);return n.data};function s(e){return new Promise(t=>setTimeout(t,e))}function c(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`2-digit`,day:`2-digit`})}function l(e,t){return new Date(e).toLocaleTimeString(t,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function u(e,t){return`${c(e,t)} ${l(e,t)}`}function d({allDay:e,startDate:t,startTime:n,endTime:r}){let i={startDate:new Date(new Date(t).setHours(0,0,0,0)),endDate:new Date(new Date(t).setHours(23,59,59,999))};if(e)return i;if(n){let e=new Date(t);e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),i.startDate=e}if(r){let e=new Date(t);e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),i.endDate=e}return i}var f=`00000000-0000-0000-0000-000000000000`,p=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function ee(e){return typeof e==`string`&&p.test(e)}function te(e){if(!ee(e))throw TypeError(`Invalid UUID`);let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));function ne(e,t=0){return(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+`-`+m[e[t+4]]+m[e[t+5]]+`-`+m[e[t+6]]+m[e[t+7]]+`-`+m[e[t+8]]+m[e[t+9]]+`-`+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase()}var re=new Uint8Array(16);function ie(){return crypto.getRandomValues(re)}function ae(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():oe(e,t,n)}function oe(e,t,n){e||={};let r=e.random??e.rng?.()??ie();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return ne(r)}var se=class e{uuid;constructor(e){te(e),this.uuid=e}toString(){return this.uuid}equals(e){return this.uuid===e.toString()}static new(){return new e(ae())}static empty(){return new e(f)}static isValid(e){return!!(e&&ee(e))}static parse(t){return t&&e.isValid(t)?new e(t):void 0}};Object.freeze({status:`aborted`});function h(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var g=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ce=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},le={};function _(e){return e&&Object.assign(le,e),le}function ue(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function de(e,t){return typeof t==`bigint`?t.toString():t}function v(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function y(e){return e==null}function b(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function fe(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var pe=Symbol(`evaluating`);function x(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==pe)return r===void 0&&(r=pe,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function S(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function C(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function me(e){return JSON.stringify(e)}function he(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ge=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var _e=v(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function T(e){if(w(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(w(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ve(e){return T(e)?{...e}:Array.isArray(e)?[...e]:e}var ye=new Set([`string`,`number`,`symbol`]);function E(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function D(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function O(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function be(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var xe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Se(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return D(e,C(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return S(this,`shape`,e),e},checks:[]}))}function Ce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return D(e,C(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return S(this,`shape`,r),r},checks:[]}))}function we(e,t){if(!T(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return D(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function Te(e,t){if(!T(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return D(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function Ee(e,t){return D(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return S(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function De(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return D(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return S(this,`shape`,i),i},checks:[]}))}function Oe(e,t,n){return D(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return S(this,`shape`,i),i}}))}function k(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ke(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function A(e){return typeof e==`string`?e:e?.message}function j(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=A(e.inst?._zod.def?.error?.(e))??A(t?.error?.(e))??A(n.customError?.(e))??A(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ae(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function M(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var je=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,de,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Me=h(`$ZodError`,je),Ne=h(`$ZodError`,je,{Parent:Error});function Pe(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Fe(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var Ie=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new g;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>j(e,a,_())));throw ge(t,i?.callee),t}return o.value},Le=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>j(e,a,_())));throw ge(t,i?.callee),t}return o.value},N=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new g;return a.issues.length?{success:!1,error:new(e??Me)(a.issues.map(e=>j(e,i,_())))}:{success:!0,data:a.value}},Re=N(Ne),P=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>j(e,i,_())))}:{success:!0,data:a.value}},ze=P(Ne),Be=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ie(e)(t,n,i)},Ve=e=>(t,n,r)=>Ie(e)(t,n,r),He=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Le(e)(t,n,i)},Ue=e=>async(t,n,r)=>Le(e)(t,n,r),We=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return N(e)(t,n,i)},Ge=e=>(t,n,r)=>N(e)(t,n,r),Ke=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return P(e)(t,n,i)},qe=e=>async(t,n,r)=>P(e)(t,n,r),Je=/^[cC][^\s-]{8,}$/,Ye=/^[0-9a-z]+$/,Xe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ze=/^[0-9a-vA-V]{20}$/,Qe=/^[A-Za-z0-9]{27}$/,$e=/^[a-zA-Z0-9_-]{21}$/,et=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tt=/^([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})$/,nt=e=>e?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)$/,rt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,it=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function at(){return new RegExp(it,`u`)}var ot=/^(?:(?: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])$/,st=/^(([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}|:))$/,ct=/^((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])$/,lt=/^(([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])$/,ut=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dt=/^[A-Za-z0-9_-]*$/,ft=/^\+[1-9]\d{6,14}$/,pt=`(?:(?:\\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])))`,mt=RegExp(`^${pt}$`);function ht(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function gt(e){return RegExp(`^${ht(e)}$`)}function _t(e){let t=ht({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${pt}T(?:${r})$`)}var vt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},yt=/^-?\d+$/,bt=/^-?\d+(?:\.\d+)?$/,xt=/^[^A-Z]*$/,St=/^[^a-z]*$/,F=h(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ct={number:`number`,bigint:`bigint`,object:`date`},wt=h(`$ZodCheckLessThan`,(e,t)=>{F.init(e,t);let n=Ct[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tt=h(`$ZodCheckGreaterThan`,(e,t)=>{F.init(e,t);let n=Ct[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Et=h(`$ZodCheckMultipleOf`,(e,t)=>{F.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):fe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Dt=h(`$ZodCheckNumberFormat`,(e,t)=>{F.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xe[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=yt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Ot=h(`$ZodCheckMaxLength`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!y(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ae(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),kt=h(`$ZodCheckMinLength`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!y(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ae(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),At=h(`$ZodCheckLengthEquals`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!y(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ae(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),I=h(`$ZodCheckStringFormat`,(e,t)=>{var n,r;F.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jt=h(`$ZodCheckRegex`,(e,t)=>{I.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Mt=h(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=xt,I.init(e,t)}),Nt=h(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=St,I.init(e,t)}),Pt=h(`$ZodCheckIncludes`,(e,t)=>{F.init(e,t);let n=E(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ft=h(`$ZodCheckStartsWith`,(e,t)=>{F.init(e,t);let n=RegExp(`^${E(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),It=h(`$ZodCheckEndsWith`,(e,t)=>{F.init(e,t);let n=RegExp(`.*${E(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Lt=h(`$ZodCheckOverwrite`,(e,t)=>{F.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Rt=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e,t=process.env)=>{let n=e.safeParse(t);if(!n.success)throw Error(`Invalid environment variables: ${JSON.stringify(n.error.issues)}`);return n.data};function t(e){return new Promise(t=>setTimeout(t,e))}function n(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`2-digit`,day:`2-digit`})}function r(e,t){return new Date(e).toLocaleTimeString(t,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function i(e,t){return`${n(e,t)} ${r(e,t)}`}function a({allDay:e,startDate:t,startTime:n,endTime:r}){let i={startDate:new Date(new Date(t).setHours(0,0,0,0)),endDate:new Date(new Date(t).setHours(23,59,59,999))};if(e)return i;if(n){let e=new Date(t);e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),i.startDate=e}if(r){let e=new Date(t);e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),i.endDate=e}return i}var o=class{name;constructor(){this.name=this.constructor.name}},s=e=>t=>!(t instanceof e),c=e=>t=>t instanceof e,l=`00000000-0000-0000-0000-000000000000`,u=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function d(e){return typeof e==`string`&&u.test(e)}function f(e){if(!d(e))throw TypeError(`Invalid UUID`);let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var p=[];for(let e=0;e<256;++e)p.push((e+256).toString(16).slice(1));function ee(e,t=0){return(p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+`-`+p[e[t+4]]+p[e[t+5]]+`-`+p[e[t+6]]+p[e[t+7]]+`-`+p[e[t+8]]+p[e[t+9]]+`-`+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]).toLowerCase()}var te=new Uint8Array(16);function ne(){return crypto.getRandomValues(te)}function re(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():ie(e,t,n)}function ie(e,t,n){e||={};let r=e.random??e.rng?.()??ne();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return ee(r)}var ae=class e{uuid;constructor(e){f(e),this.uuid=e}toString(){return this.uuid}equals(e){return this.uuid===e.toString()}static new(){return new e(re())}static empty(){return new e(l)}static isValid(e){return!!(e&&d(e))}static parse(t){return t&&e.isValid(t)?new e(t):void 0}},oe=class extends o{error;constructor(e){super(),this.error=e}},se=class extends o{error;constructor(e){super(),this.error=e}},ce=class extends o{constructor(){super()}},m=e=>[e,void 0],h=e=>[void 0,e],le=class{baseUrl;constructor(e){this.baseUrl=e}async fetch(e,t,n,r={}){try{let i=await this.mergeHeaders(r.headers),a=await fetch(`${this.baseUrl}${e}`,{...r,headers:i});if(a.status===409)return h(new oe({status:a.status,statusText:a.statusText,body:await a.json().catch(()=>a.text())}));if(a.status===404)return h(new ce);if(!a.ok)return h(new n({error:await a.json().catch(()=>({message:a.statusText})),metadata:{status:a.status,statusText:a.statusText}}));let o=(await a.text()).trim(),s=a.status===204?void 0:o?JSON.parse(o):void 0,c=t.safeParse(s);return c.success?m(c.data):h(new n(Error(`Invalid response body`),s))}catch(e){return h(new se(e))}}async fetchBlob(e,t,n={}){try{let r=await this.mergeHeaders(n.headers),i=await fetch(`${this.baseUrl}${e}`,{...n,headers:r});return i.status===404?h(new ce):i.ok?m(await i.blob()):h(new t(await i.json().catch(()=>({message:i.statusText})),{status:i.status,statusText:i.statusText}))}catch(e){return h(new se(e))}}async mergeHeaders(e){let t=new Headers([...await this.getHeaders()]);return new Headers(e).forEach((e,n)=>{t.set(n,e)}),t}},ue;function g(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var _=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},de=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ue=globalThis).__zod_globalConfig??(ue.__zod_globalConfig={});var v=globalThis.__zod_globalConfig;function y(e){return e&&Object.assign(v,e),v}function fe(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function pe(e,t){return typeof t==`bigint`?t.toString():t}function me(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function he(e){return e==null}function ge(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function _e(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var ve=Symbol(`evaluating`);function b(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ve)return r===void 0&&(r=ve,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function x(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function S(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ye(e){return JSON.stringify(e)}function be(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var xe=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Se=me(()=>{if(v.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function w(e){if(C(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(C(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Ce(e){return w(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var we=new Set([`string`,`number`,`symbol`]);function T(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Te(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Ee={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function De(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return E(e,S(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return x(this,`shape`,e),e},checks:[]}))}function Oe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return E(e,S(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return x(this,`shape`,r),r},checks:[]}))}function ke(e,t){if(!w(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return x(this,`shape`,n),n}}))}function Ae(e,t){if(!w(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return x(this,`shape`,n),n}}))}function je(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return E(e,S(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return x(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Me(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return E(t,S(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return x(this,`shape`,i),i},checks:[]}))}function Ne(e,t,n){return E(t,S(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return x(this,`shape`,i),i}}))}function O(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Pe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Fe(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function k(e){return typeof e==`string`?e:e?.message}function A(e,t,n){let r=e.message?e.message:k(e.inst?._zod.def?.error?.(e))??k(t?.error?.(e))??k(n.customError?.(e))??k(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function j(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function M(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ie=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,pe,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Le=g(`$ZodError`,Ie),Re=g(`$ZodError`,Ie,{Parent:Error});function ze(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Be(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var N=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new _;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>A(e,a,y())));throw xe(t,i?.callee),t}return o.value},Ve=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>A(e,a,y())));throw xe(t,i?.callee),t}return o.value},P=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new _;return a.issues.length?{success:!1,error:new(e??Le)(a.issues.map(e=>A(e,i,y())))}:{success:!0,data:a.value}},He=P(Re),F=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>A(e,i,y())))}:{success:!0,data:a.value}},Ue=F(Re),We=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return N(e)(t,n,i)},Ge=e=>(t,n,r)=>N(e)(t,n,r),Ke=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ve(e)(t,n,i)},qe=e=>async(t,n,r)=>Ve(e)(t,n,r),Je=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return P(e)(t,n,i)},Ye=e=>(t,n,r)=>P(e)(t,n,r),Xe=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return F(e)(t,n,i)},Ze=e=>async(t,n,r)=>F(e)(t,n,r),Qe=/^[cC][0-9a-z]{6,}$/,$e=/^[0-9a-z]+$/,et=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tt=/^[0-9a-vA-V]{20}$/,nt=/^[A-Za-z0-9]{27}$/,rt=/^[a-zA-Z0-9_-]{21}$/,it=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,at=/^([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})$/,ot=e=>e?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)$/,st=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ct=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function lt(){return new RegExp(ct,`u`)}var ut=/^(?:(?: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])$/,dt=/^(([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}|:))$/,ft=/^((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])$/,pt=/^(([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])$/,mt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ht=/^[A-Za-z0-9_-]*$/,gt=/^https?$/,_t=/^\+[1-9]\d{6,14}$/,vt=`(?:(?:\\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])))`,yt=RegExp(`^${vt}$`);function bt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xt(e){return RegExp(`^${bt(e)}$`)}function St(e){let t=bt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${vt}T(?:${r})$`)}var Ct=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},wt=/^-?\d+$/,Tt=/^-?\d+(?:\.\d+)?$/,Et=/^[^A-Z]*$/,Dt=/^[^a-z]*$/,I=g(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ot={number:`number`,bigint:`bigint`,object:`date`},kt=g(`$ZodCheckLessThan`,(e,t)=>{I.init(e,t);let n=Ot[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),At=g(`$ZodCheckGreaterThan`,(e,t)=>{I.init(e,t);let n=Ot[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),jt=g(`$ZodCheckMultipleOf`,(e,t)=>{I.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):_e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Mt=g(`$ZodCheckNumberFormat`,(e,t)=>{I.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ee[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=wt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Nt=g(`$ZodCheckMaxLength`,(e,t)=>{var n;I.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!he(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=j(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Pt=g(`$ZodCheckMinLength`,(e,t)=>{var n;I.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!he(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=j(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ft=g(`$ZodCheckLengthEquals`,(e,t)=>{var n;I.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!he(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=j(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),L=g(`$ZodCheckStringFormat`,(e,t)=>{var n,r;I.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),It=g(`$ZodCheckRegex`,(e,t)=>{L.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Lt=g(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Et,L.init(e,t)}),Rt=g(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Dt,L.init(e,t)}),zt=g(`$ZodCheckIncludes`,(e,t)=>{I.init(e,t);let n=T(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Bt=g(`$ZodCheckStartsWith`,(e,t)=>{I.init(e,t);let n=RegExp(`^${T(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Vt=g(`$ZodCheckEndsWith`,(e,t)=>{I.init(e,t);let n=RegExp(`.*${T(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Ht=g(`$ZodCheckOverwrite`,(e,t)=>{I.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Ut=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
2
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
3
- `))}},zt={major:4,minor:3,patch:6},L=h(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zt;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=k(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new g;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=k(e,t))});else{if(e.issues.length===t)continue;r||=k(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(k(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new g;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new g;return o.then(e=>t(e,r,a))}return t(o,r,a)}}x(e,`~standard`,()=>({validate:t=>{try{let n=Re(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ze(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),R=h(`$ZodString`,(e,t)=>{L.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),z=h(`$ZodStringFormat`,(e,t)=>{I.init(e,t),R.init(e,t)}),Bt=h(`$ZodGUID`,(e,t)=>{t.pattern??=tt,z.init(e,t)}),Vt=h(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=nt(e)}else t.pattern??=nt();z.init(e,t)}),Ht=h(`$ZodEmail`,(e,t)=>{t.pattern??=rt,z.init(e,t)}),Ut=h(`$ZodURL`,(e,t)=>{z.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Wt=h(`$ZodEmoji`,(e,t)=>{t.pattern??=at(),z.init(e,t)}),Gt=h(`$ZodNanoID`,(e,t)=>{t.pattern??=$e,z.init(e,t)}),Kt=h(`$ZodCUID`,(e,t)=>{t.pattern??=Je,z.init(e,t)}),qt=h(`$ZodCUID2`,(e,t)=>{t.pattern??=Ye,z.init(e,t)}),Jt=h(`$ZodULID`,(e,t)=>{t.pattern??=Xe,z.init(e,t)}),Yt=h(`$ZodXID`,(e,t)=>{t.pattern??=Ze,z.init(e,t)}),Xt=h(`$ZodKSUID`,(e,t)=>{t.pattern??=Qe,z.init(e,t)}),Zt=h(`$ZodISODateTime`,(e,t)=>{t.pattern??=_t(t),z.init(e,t)}),Qt=h(`$ZodISODate`,(e,t)=>{t.pattern??=mt,z.init(e,t)}),$t=h(`$ZodISOTime`,(e,t)=>{t.pattern??=gt(t),z.init(e,t)}),en=h(`$ZodISODuration`,(e,t)=>{t.pattern??=et,z.init(e,t)}),tn=h(`$ZodIPv4`,(e,t)=>{t.pattern??=ot,z.init(e,t),e._zod.bag.format=`ipv4`}),nn=h(`$ZodIPv6`,(e,t)=>{t.pattern??=st,z.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),rn=h(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ct,z.init(e,t)}),an=h(`$ZodCIDRv6`,(e,t)=>{t.pattern??=lt,z.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function on(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var sn=h(`$ZodBase64`,(e,t)=>{t.pattern??=ut,z.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{on(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function cn(e){if(!dt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return on(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var ln=h(`$ZodBase64URL`,(e,t)=>{t.pattern??=dt,z.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{cn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),un=h(`$ZodE164`,(e,t)=>{t.pattern??=ft,z.init(e,t)});function dn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var fn=h(`$ZodJWT`,(e,t)=>{z.init(e,t),e._zod.check=n=>{dn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),pn=h(`$ZodNumber`,(e,t)=>{L.init(e,t),e._zod.pattern=e._zod.bag.pattern??bt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),mn=h(`$ZodNumberFormat`,(e,t)=>{Dt.init(e,t),pn.init(e,t)}),hn=h(`$ZodUnknown`,(e,t)=>{L.init(e,t),e._zod.parse=e=>e}),gn=h(`$ZodNever`,(e,t)=>{L.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),_n=h(`$ZodVoid`,(e,t)=>{L.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}});function vn(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}var yn=h(`$ZodArray`,(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>vn(t,n,e))):vn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function B(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...ke(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function bn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=be(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function xn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>B(e,n,i,t,u))):B(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Sn=h(`$ZodObject`,(e,t)=>{if(L.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=v(()=>bn(t));x(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=w,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>B(n,t,e,s,r))):B(i,t,e,s,r)}return i?xn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Cn=h(`$ZodObjectJIT`,(e,t)=>{Sn.init(e,t);let n=e._zod.parse,r=v(()=>bn(t)),i=e=>{let t=new Rt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=me(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=me(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
3
+ `))}},Wt={major:4,minor:4,patch:3},R=g(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Wt;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=O(e),i;for(let a of t){if(a._zod.def.when){if(Pe(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new _;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=O(e,t))});else{if(e.issues.length===t)continue;r||=O(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(O(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new _;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new _;return o.then(e=>t(e,r,a))}return t(o,r,a)}}b(e,`~standard`,()=>({validate:t=>{try{let n=He(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ue(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Gt=g(`$ZodString`,(e,t)=>{R.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ct(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),z=g(`$ZodStringFormat`,(e,t)=>{L.init(e,t),Gt.init(e,t)}),Kt=g(`$ZodGUID`,(e,t)=>{t.pattern??=at,z.init(e,t)}),qt=g(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ot(e)}else t.pattern??=ot();z.init(e,t)}),Jt=g(`$ZodEmail`,(e,t)=>{t.pattern??=st,z.init(e,t)}),Yt=g(`$ZodURL`,(e,t)=>{z.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===gt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Xt=g(`$ZodEmoji`,(e,t)=>{t.pattern??=lt(),z.init(e,t)}),Zt=g(`$ZodNanoID`,(e,t)=>{t.pattern??=rt,z.init(e,t)}),Qt=g(`$ZodCUID`,(e,t)=>{t.pattern??=Qe,z.init(e,t)}),$t=g(`$ZodCUID2`,(e,t)=>{t.pattern??=$e,z.init(e,t)}),en=g(`$ZodULID`,(e,t)=>{t.pattern??=et,z.init(e,t)}),tn=g(`$ZodXID`,(e,t)=>{t.pattern??=tt,z.init(e,t)}),nn=g(`$ZodKSUID`,(e,t)=>{t.pattern??=nt,z.init(e,t)}),rn=g(`$ZodISODateTime`,(e,t)=>{t.pattern??=St(t),z.init(e,t)}),an=g(`$ZodISODate`,(e,t)=>{t.pattern??=yt,z.init(e,t)}),on=g(`$ZodISOTime`,(e,t)=>{t.pattern??=xt(t),z.init(e,t)}),sn=g(`$ZodISODuration`,(e,t)=>{t.pattern??=it,z.init(e,t)}),cn=g(`$ZodIPv4`,(e,t)=>{t.pattern??=ut,z.init(e,t),e._zod.bag.format=`ipv4`}),ln=g(`$ZodIPv6`,(e,t)=>{t.pattern??=dt,z.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),un=g(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ft,z.init(e,t)}),dn=g(`$ZodCIDRv6`,(e,t)=>{t.pattern??=pt,z.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function fn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var pn=g(`$ZodBase64`,(e,t)=>{t.pattern??=mt,z.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{fn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function mn(e){if(!ht.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return fn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var hn=g(`$ZodBase64URL`,(e,t)=>{t.pattern??=ht,z.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{mn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),gn=g(`$ZodE164`,(e,t)=>{t.pattern??=_t,z.init(e,t)});function _n(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var vn=g(`$ZodJWT`,(e,t)=>{z.init(e,t),e._zod.check=n=>{_n(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),yn=g(`$ZodNumber`,(e,t)=>{R.init(e,t),e._zod.pattern=e._zod.bag.pattern??Tt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),bn=g(`$ZodNumberFormat`,(e,t)=>{Mt.init(e,t),yn.init(e,t)}),xn=g(`$ZodUnknown`,(e,t)=>{R.init(e,t),e._zod.parse=e=>e}),Sn=g(`$ZodNever`,(e,t)=>{R.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Cn=g(`$ZodVoid`,(e,t)=>{R.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}});function wn(e,t,n){e.issues.length&&t.issues.push(...Fe(n,e.issues)),t.value[n]=e.value}var Tn=g(`$ZodArray`,(e,t)=>{R.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>wn(t,n,e))):wn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function B(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Fe(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function En(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Te(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Dn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>B(e,n,i,t,u,d))):B(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var On=g(`$ZodObject`,(e,t)=>{if(R.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=me(()=>En(t));b(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=C,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>B(n,t,e,s,r,i))):B(a,t,e,s,r,i)}return i?Dn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),kn=g(`$ZodObjectJIT`,(e,t)=>{On.init(e,t);let n=e._zod.parse,r=me(()=>En(t)),i=e=>{let t=new Ut([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ye(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ye(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
4
4
  if (${n}.issues.length) {
5
5
  if (${o} in input) {
6
6
  payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
@@ -18,7 +18,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e={})=
18
18
  newResult[${o}] = ${n}.value;
19
19
  }
20
20
 
21
- `):t.write(`
21
+ `):c?t.write(`
22
22
  if (${n}.issues.length) {
23
23
  payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
24
24
  ...iss,
@@ -34,6 +34,31 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e={})=
34
34
  newResult[${o}] = ${n}.value;
35
35
  }
36
36
 
37
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=w,s=!le.jitless,c=s&&_e.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?xn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function wn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!k(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>j(e,r,_())))}),t)}var Tn=h(`$ZodUnion`,(e,t)=>{L.init(e,t),x(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),x(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),x(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),x(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>b(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>wn(t,i,e,a)):wn(s,i,e,a)}}),En=h(`$ZodIntersection`,(e,t)=>{L.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Dn(e,t,n)):Dn(e,i,a)}});function V(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(T(e)&&T(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=V(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=V(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Dn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),k(e))return e;let o=V(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var On=h(`$ZodEnum`,(e,t)=>{L.init(e,t);let n=ue(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ye.has(typeof e)).map(e=>typeof e==`string`?E(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),kn=h(`$ZodTransform`,(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ce(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new g;return n.value=i,n}});function An(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var jn=h(`$ZodOptional`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,x(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),x(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${b(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>An(t,e.value)):An(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Mn=h(`$ZodExactOptional`,(e,t)=>{jn.init(e,t),x(e._zod,`values`,()=>t.innerType._zod.values),x(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Nn=h(`$ZodNullable`,(e,t)=>{L.init(e,t),x(e._zod,`optin`,()=>t.innerType._zod.optin),x(e._zod,`optout`,()=>t.innerType._zod.optout),x(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${b(e.source)}|null)$`):void 0}),x(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Pn=h(`$ZodDefault`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,x(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Fn(e,t)):Fn(r,t)}});function Fn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var In=h(`$ZodPrefault`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,x(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ln=h(`$ZodNonOptional`,(e,t)=>{L.init(e,t),x(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Rn(t,e)):Rn(i,e)}});function Rn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var zn=h(`$ZodCatch`,(e,t)=>{L.init(e,t),x(e._zod,`optin`,()=>t.innerType._zod.optin),x(e._zod,`optout`,()=>t.innerType._zod.optout),x(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>j(e,n,_()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>j(e,n,_()))},input:e.value}),e.issues=[]),e)}}),Bn=h(`$ZodPipe`,(e,t)=>{L.init(e,t),x(e._zod,`values`,()=>t.in._zod.values),x(e._zod,`optin`,()=>t.in._zod.optin),x(e._zod,`optout`,()=>t.out._zod.optout),x(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.in,n)):H(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.out,n)):H(r,t.out,n)}});function H(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Vn=h(`$ZodReadonly`,(e,t)=>{L.init(e,t),x(e._zod,`propValues`,()=>t.innerType._zod.propValues),x(e._zod,`values`,()=>t.innerType._zod.values),x(e._zod,`optin`,()=>t.innerType?._zod?.optin),x(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Hn):Hn(r)}});function Hn(e){return e.value=Object.freeze(e.value),e}var Un=h(`$ZodCustom`,(e,t)=>{F.init(e,t),L.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Wn(t,n,r,e));Wn(i,n,r,e)}});function Wn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(M(e))}}var Gn,Kn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function qn(){return new Kn}(Gn=globalThis).__zod_globalRegistry??(Gn.__zod_globalRegistry=qn());var U=globalThis.__zod_globalRegistry;function Jn(e,t){return new e({type:`string`,...O(t)})}function Yn(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...O(t)})}function Xn(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...O(t)})}function Zn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...O(t)})}function Qn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...O(t)})}function $n(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...O(t)})}function er(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...O(t)})}function tr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...O(t)})}function nr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...O(t)})}function rr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...O(t)})}function ir(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...O(t)})}function ar(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...O(t)})}function or(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...O(t)})}function sr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...O(t)})}function cr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...O(t)})}function lr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...O(t)})}function ur(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...O(t)})}function dr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...O(t)})}function fr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...O(t)})}function pr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...O(t)})}function mr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...O(t)})}function hr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...O(t)})}function gr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...O(t)})}function _r(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...O(t)})}function vr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...O(t)})}function yr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...O(t)})}function br(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...O(t)})}function xr(e,t){return new e({type:`number`,checks:[],...O(t)})}function Sr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...O(t)})}function Cr(e){return new e({type:`unknown`})}function wr(e,t){return new e({type:`never`,...O(t)})}function Tr(e,t){return new e({type:`void`,...O(t)})}function Er(e,t){return new wt({check:`less_than`,...O(t),value:e,inclusive:!1})}function Dr(e,t){return new wt({check:`less_than`,...O(t),value:e,inclusive:!0})}function Or(e,t){return new Tt({check:`greater_than`,...O(t),value:e,inclusive:!1})}function kr(e,t){return new Tt({check:`greater_than`,...O(t),value:e,inclusive:!0})}function Ar(e,t){return new Et({check:`multiple_of`,...O(t),value:e})}function jr(e,t){return new Ot({check:`max_length`,...O(t),maximum:e})}function W(e,t){return new kt({check:`min_length`,...O(t),minimum:e})}function Mr(e,t){return new At({check:`length_equals`,...O(t),length:e})}function Nr(e,t){return new jt({check:`string_format`,format:`regex`,...O(t),pattern:e})}function Pr(e){return new Mt({check:`string_format`,format:`lowercase`,...O(e)})}function Fr(e){return new Nt({check:`string_format`,format:`uppercase`,...O(e)})}function Ir(e,t){return new Pt({check:`string_format`,format:`includes`,...O(t),includes:e})}function Lr(e,t){return new Ft({check:`string_format`,format:`starts_with`,...O(t),prefix:e})}function Rr(e,t){return new It({check:`string_format`,format:`ends_with`,...O(t),suffix:e})}function G(e){return new Lt({check:`overwrite`,tx:e})}function zr(e){return G(t=>t.normalize(e))}function Br(){return G(e=>e.trim())}function Vr(){return G(e=>e.toLowerCase())}function Hr(){return G(e=>e.toUpperCase())}function Ur(){return G(e=>he(e))}function Wr(e,t,n){return new e({type:`array`,element:t,...O(n)})}function Gr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...O(n)})}function Kr(e){let t=qr(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(M(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(M(r))}},e(n.value,n)));return t}function qr(e,t){let n=new F({check:`custom`,...O(t)});return n._zod.check=e,n}function Jr(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??U,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function K(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,K(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&q(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Yr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
37
+ `):t.write(`
38
+ const ${n}_present = ${o} in input;
39
+ if (${n}.issues.length) {
40
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
41
+ ...iss,
42
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
43
+ })));
44
+ }
45
+ if (!${n}_present && !${n}.issues.length) {
46
+ payload.issues.push({
47
+ code: "invalid_type",
48
+ expected: "nonoptional",
49
+ input: undefined,
50
+ path: [${o}]
51
+ });
52
+ }
53
+
54
+ if (${n}_present) {
55
+ if (${n}.value === undefined) {
56
+ newResult[${o}] = undefined;
57
+ } else {
58
+ newResult[${o}] = ${n}.value;
59
+ }
60
+ }
61
+
62
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=C,s=!v.jitless,c=s&&Se.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Dn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function An(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!O(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>A(e,r,y())))}),t)}var jn=g(`$ZodUnion`,(e,t)=>{R.init(e,t),b(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),b(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),b(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),b(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ge(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>An(t,r,e,i)):An(o,r,e,i)}}),Mn=g(`$ZodIntersection`,(e,t)=>{R.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Pn(e,t,n)):Pn(e,i,a)}});function Nn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(w(e)&&w(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Nn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Nn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Pn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),O(e))return e;let o=Nn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Fn=g(`$ZodEnum`,(e,t)=>{R.init(e,t);let n=fe(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>we.has(typeof e)).map(e=>typeof e==`string`?T(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),In=g(`$ZodTransform`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new de(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new _;return n.value=i,n.fallback=!0,n}});function Ln(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Rn=g(`$ZodOptional`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),b(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ge(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Ln(e,r)):Ln(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),zn=g(`$ZodExactOptional`,(e,t)=>{Rn.init(e,t),b(e._zod,`values`,()=>t.innerType._zod.values),b(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Bn=g(`$ZodNullable`,(e,t)=>{R.init(e,t),b(e._zod,`optin`,()=>t.innerType._zod.optin),b(e._zod,`optout`,()=>t.innerType._zod.optout),b(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ge(e.source)}|null)$`):void 0}),b(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Vn=g(`$ZodDefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Hn(e,t)):Hn(r,t)}});function Hn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Un=g(`$ZodPrefault`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Wn=g(`$ZodNonOptional`,(e,t)=>{R.init(e,t),b(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Gn(t,e)):Gn(i,e)}});function Gn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Kn=g(`$ZodCatch`,(e,t)=>{R.init(e,t),e._zod.optin=`optional`,b(e._zod,`optout`,()=>t.innerType._zod.optout),b(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>A(e,n,y()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>A(e,n,y()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),qn=g(`$ZodPipe`,(e,t)=>{R.init(e,t),b(e._zod,`values`,()=>t.in._zod.values),b(e._zod,`optin`,()=>t.in._zod.optin),b(e._zod,`optout`,()=>t.out._zod.optout),b(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t.in,n)):V(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t.out,n)):V(r,t.out,n)}});function V(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Jn=g(`$ZodReadonly`,(e,t)=>{R.init(e,t),b(e._zod,`propValues`,()=>t.innerType._zod.propValues),b(e._zod,`values`,()=>t.innerType._zod.values),b(e._zod,`optin`,()=>t.innerType?._zod?.optin),b(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Yn):Yn(r)}});function Yn(e){return e.value=Object.freeze(e.value),e}var Xn=g(`$ZodCustom`,(e,t)=>{I.init(e,t),R.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Zn(t,n,r,e));Zn(i,n,r,e)}});function Zn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(M(e))}}var Qn,$n=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function er(){return new $n}(Qn=globalThis).__zod_globalRegistry??(Qn.__zod_globalRegistry=er());var H=globalThis.__zod_globalRegistry;function tr(e,t){return new e({type:`string`,...D(t)})}function nr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...D(t)})}function rr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...D(t)})}function ir(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...D(t)})}function ar(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...D(t)})}function or(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...D(t)})}function sr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...D(t)})}function cr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...D(t)})}function lr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...D(t)})}function ur(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...D(t)})}function dr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...D(t)})}function fr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...D(t)})}function pr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...D(t)})}function mr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...D(t)})}function hr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...D(t)})}function gr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...D(t)})}function _r(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...D(t)})}function vr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...D(t)})}function yr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...D(t)})}function br(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...D(t)})}function xr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...D(t)})}function Sr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...D(t)})}function Cr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...D(t)})}function wr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...D(t)})}function Tr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...D(t)})}function Er(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...D(t)})}function Dr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...D(t)})}function Or(e,t){return new e({type:`number`,checks:[],...D(t)})}function kr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...D(t)})}function Ar(e){return new e({type:`unknown`})}function jr(e,t){return new e({type:`never`,...D(t)})}function Mr(e,t){return new e({type:`void`,...D(t)})}function Nr(e,t){return new kt({check:`less_than`,...D(t),value:e,inclusive:!1})}function Pr(e,t){return new kt({check:`less_than`,...D(t),value:e,inclusive:!0})}function Fr(e,t){return new At({check:`greater_than`,...D(t),value:e,inclusive:!1})}function Ir(e,t){return new At({check:`greater_than`,...D(t),value:e,inclusive:!0})}function Lr(e,t){return new jt({check:`multiple_of`,...D(t),value:e})}function Rr(e,t){return new Nt({check:`max_length`,...D(t),maximum:e})}function U(e,t){return new Pt({check:`min_length`,...D(t),minimum:e})}function zr(e,t){return new Ft({check:`length_equals`,...D(t),length:e})}function Br(e,t){return new It({check:`string_format`,format:`regex`,...D(t),pattern:e})}function Vr(e){return new Lt({check:`string_format`,format:`lowercase`,...D(e)})}function Hr(e){return new Rt({check:`string_format`,format:`uppercase`,...D(e)})}function Ur(e,t){return new zt({check:`string_format`,format:`includes`,...D(t),includes:e})}function Wr(e,t){return new Bt({check:`string_format`,format:`starts_with`,...D(t),prefix:e})}function Gr(e,t){return new Vt({check:`string_format`,format:`ends_with`,...D(t),suffix:e})}function W(e){return new Ht({check:`overwrite`,tx:e})}function Kr(e){return W(t=>t.normalize(e))}function qr(){return W(e=>e.trim())}function Jr(){return W(e=>e.toLowerCase())}function Yr(){return W(e=>e.toUpperCase())}function Xr(){return W(e=>be(e))}function Zr(e,t,n){return new e({type:`array`,element:t,...D(n)})}function Qr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...D(n)})}function $r(e,t){let n=ei(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(M(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(M(r))}},e(t.value,t)),t);return n}function ei(e,t){let n=new I({check:`custom`,...D(t)});return n._zod.check=e,n}function ti(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??H,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function G(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,G(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&K(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ni(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
38
63
 
39
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Xr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:J(t,`input`,e.processors),output:J(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function q(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return q(r.element,n);if(r.type===`set`)return q(r.valueType,n);if(r.type===`lazy`)return q(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return q(r.innerType,n);if(r.type===`intersection`)return q(r.left,n)||q(r.right,n);if(r.type===`record`||r.type===`map`)return q(r.keyType,n)||q(r.valueType,n);if(r.type===`pipe`)return q(r.in,n)||q(r.out,n);if(r.type===`object`){for(let e in r.shape)if(q(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(q(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(q(e,n))return!0;return!!(r.rest&&q(r.rest,n))}return!1}var Zr=(e,t={})=>n=>{let r=Jr({...n,processors:t});return K(e,r),Yr(r,e),Xr(r,e)},J=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Jr({...i??{},target:a,io:t,processors:n});return K(e,o),Yr(o,e),Xr(o,e)},Qr={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},$r=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Qr[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ei=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},ti=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},ni=(e,t,n,r)=>{n.not={}},ri=(e,t,n,r)=>{let i=e._zod.def,a=ue(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ii=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ai=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},oi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=K(a.element,t,{...r,path:[...r.path,`items`]})},si=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=K(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=K(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ci=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>K(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},li=(e,t,n,r)=>{let i=e._zod.def,a=K(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=K(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},ui=(e,t,n,r)=>{let i=e._zod.def,a=K(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},di=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},fi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},pi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},mi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},hi=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;K(a,t,r);let o=t.seen.get(e);o.ref=a},gi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},_i=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},vi=h(`ZodISODateTime`,(e,t)=>{Zt.init(e,t),Z.init(e,t)});function yi(e){return _r(vi,e)}var bi=h(`ZodISODate`,(e,t)=>{Qt.init(e,t),Z.init(e,t)});function xi(e){return vr(bi,e)}var Si=h(`ZodISOTime`,(e,t)=>{$t.init(e,t),Z.init(e,t)});function Ci(e){return yr(Si,e)}var wi=h(`ZodISODuration`,(e,t)=>{en.init(e,t),Z.init(e,t)});function Ti(e){return br(wi,e)}var Ei=(e,t)=>{Me.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Fe(e,t)},flatten:{value:t=>Pe(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,de,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,de,2)}},isEmpty:{get(){return e.issues.length===0}}})};h(`ZodError`,Ei);var Y=h(`ZodError`,Ei,{Parent:Error}),Di=Ie(Y),Oi=Le(Y),ki=N(Y),Ai=P(Y),ji=Be(Y),Mi=Ve(Y),Ni=He(Y),Pi=Ue(Y),Fi=We(Y),Ii=Ge(Y),Li=Ke(Y),Ri=qe(Y),X=h(`ZodType`,(e,t)=>(L.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:J(e,`input`),output:J(e,`output`)}}),e.toJSONSchema=Zr(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(C(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>D(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Di(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ki(e,t,n),e.parseAsync=async(t,n)=>Oi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ai(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ji(e,t,n),e.decode=(t,n)=>Mi(e,t,n),e.encodeAsync=async(t,n)=>Ni(e,t,n),e.decodeAsync=async(t,n)=>Pi(e,t,n),e.safeEncode=(t,n)=>Fi(e,t,n),e.safeDecode=(t,n)=>Ii(e,t,n),e.safeEncodeAsync=async(t,n)=>Li(e,t,n),e.safeDecodeAsync=async(t,n)=>Ri(e,t,n),e.refine=(t,n)=>e.check(Ka(t,n)),e.superRefine=t=>e.check(qa(t)),e.overwrite=t=>e.check(G(t)),e.optional=()=>Oa(e),e.exactOptional=()=>Aa(e),e.nullable=()=>Ma(e),e.nullish=()=>Oa(Ma(e)),e.nonoptional=t=>Ra(e,t),e.array=()=>ga(e),e.or=t=>ba([e,t]),e.and=t=>Sa(e,t),e.transform=t=>Ha(e,Ea(t)),e.default=t=>Pa(e,t),e.prefault=t=>Ia(e,t),e.catch=t=>Ba(e,t),e.pipe=t=>Ha(e,t),e.readonly=()=>Wa(e),e.describe=t=>{let n=e.clone();return U.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return U.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return U.get(e);let n=e.clone();return U.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),zi=h(`_ZodString`,(e,t)=>{R.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$r(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Nr(...t)),e.includes=(...t)=>e.check(Ir(...t)),e.startsWith=(...t)=>e.check(Lr(...t)),e.endsWith=(...t)=>e.check(Rr(...t)),e.min=(...t)=>e.check(W(...t)),e.max=(...t)=>e.check(jr(...t)),e.length=(...t)=>e.check(Mr(...t)),e.nonempty=(...t)=>e.check(W(1,...t)),e.lowercase=t=>e.check(Pr(t)),e.uppercase=t=>e.check(Fr(t)),e.trim=()=>e.check(Br()),e.normalize=(...t)=>e.check(zr(...t)),e.toLowerCase=()=>e.check(Vr()),e.toUpperCase=()=>e.check(Hr()),e.slugify=()=>e.check(Ur())}),Bi=h(`ZodString`,(e,t)=>{R.init(e,t),zi.init(e,t),e.email=t=>e.check(Yn(Hi,t)),e.url=t=>e.check(tr(Wi,t)),e.jwt=t=>e.check(gr(aa,t)),e.emoji=t=>e.check(nr(Gi,t)),e.guid=t=>e.check(Xn(Ui,t)),e.uuid=t=>e.check(Zn(Q,t)),e.uuidv4=t=>e.check(Qn(Q,t)),e.uuidv6=t=>e.check($n(Q,t)),e.uuidv7=t=>e.check(er(Q,t)),e.nanoid=t=>e.check(rr(Ki,t)),e.guid=t=>e.check(Xn(Ui,t)),e.cuid=t=>e.check(ir(qi,t)),e.cuid2=t=>e.check(ar(Ji,t)),e.ulid=t=>e.check(or(Yi,t)),e.base64=t=>e.check(pr(na,t)),e.base64url=t=>e.check(mr(ra,t)),e.xid=t=>e.check(sr(Xi,t)),e.ksuid=t=>e.check(cr(Zi,t)),e.ipv4=t=>e.check(lr(Qi,t)),e.ipv6=t=>e.check(ur($i,t)),e.cidrv4=t=>e.check(dr(ea,t)),e.cidrv6=t=>e.check(fr(ta,t)),e.e164=t=>e.check(hr(ia,t)),e.datetime=t=>e.check(yi(t)),e.date=t=>e.check(xi(t)),e.time=t=>e.check(Ci(t)),e.duration=t=>e.check(Ti(t))});function Vi(e){return Jn(Bi,e)}var Z=h(`ZodStringFormat`,(e,t)=>{z.init(e,t),zi.init(e,t)}),Hi=h(`ZodEmail`,(e,t)=>{Ht.init(e,t),Z.init(e,t)}),Ui=h(`ZodGUID`,(e,t)=>{Bt.init(e,t),Z.init(e,t)}),Q=h(`ZodUUID`,(e,t)=>{Vt.init(e,t),Z.init(e,t)}),Wi=h(`ZodURL`,(e,t)=>{Ut.init(e,t),Z.init(e,t)}),Gi=h(`ZodEmoji`,(e,t)=>{Wt.init(e,t),Z.init(e,t)}),Ki=h(`ZodNanoID`,(e,t)=>{Gt.init(e,t),Z.init(e,t)}),qi=h(`ZodCUID`,(e,t)=>{Kt.init(e,t),Z.init(e,t)}),Ji=h(`ZodCUID2`,(e,t)=>{qt.init(e,t),Z.init(e,t)}),Yi=h(`ZodULID`,(e,t)=>{Jt.init(e,t),Z.init(e,t)}),Xi=h(`ZodXID`,(e,t)=>{Yt.init(e,t),Z.init(e,t)}),Zi=h(`ZodKSUID`,(e,t)=>{Xt.init(e,t),Z.init(e,t)}),Qi=h(`ZodIPv4`,(e,t)=>{tn.init(e,t),Z.init(e,t)}),$i=h(`ZodIPv6`,(e,t)=>{nn.init(e,t),Z.init(e,t)}),ea=h(`ZodCIDRv4`,(e,t)=>{rn.init(e,t),Z.init(e,t)}),ta=h(`ZodCIDRv6`,(e,t)=>{an.init(e,t),Z.init(e,t)}),na=h(`ZodBase64`,(e,t)=>{sn.init(e,t),Z.init(e,t)}),ra=h(`ZodBase64URL`,(e,t)=>{ln.init(e,t),Z.init(e,t)}),ia=h(`ZodE164`,(e,t)=>{un.init(e,t),Z.init(e,t)}),aa=h(`ZodJWT`,(e,t)=>{fn.init(e,t),Z.init(e,t)}),oa=h(`ZodNumber`,(e,t)=>{pn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ei(e,t,n,r),e.gt=(t,n)=>e.check(Or(t,n)),e.gte=(t,n)=>e.check(kr(t,n)),e.min=(t,n)=>e.check(kr(t,n)),e.lt=(t,n)=>e.check(Er(t,n)),e.lte=(t,n)=>e.check(Dr(t,n)),e.max=(t,n)=>e.check(Dr(t,n)),e.int=t=>e.check(ca(t)),e.safe=t=>e.check(ca(t)),e.positive=t=>e.check(Or(0,t)),e.nonnegative=t=>e.check(kr(0,t)),e.negative=t=>e.check(Er(0,t)),e.nonpositive=t=>e.check(Dr(0,t)),e.multipleOf=(t,n)=>e.check(Ar(t,n)),e.step=(t,n)=>e.check(Ar(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function $(e){return xr(oa,e)}var sa=h(`ZodNumberFormat`,(e,t)=>{mn.init(e,t),oa.init(e,t)});function ca(e){return Sr(sa,e)}var la=h(`ZodUnknown`,(e,t)=>{hn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ua(){return Cr(la)}var da=h(`ZodNever`,(e,t)=>{gn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r)});function fa(e){return wr(da,e)}var pa=h(`ZodVoid`,(e,t)=>{_n.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ti(e,t,n,r)});function ma(e){return Tr(pa,e)}var ha=h(`ZodArray`,(e,t)=>{yn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(W(t,n)),e.nonempty=t=>e.check(W(1,t)),e.max=(t,n)=>e.check(jr(t,n)),e.length=(t,n)=>e.check(Mr(t,n)),e.unwrap=()=>e.element});function ga(e,t){return Wr(ha,e,t)}var _a=h(`ZodObject`,(e,t)=>{Cn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r),x(e,`shape`,()=>t.shape),e.keyof=()=>wa(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ua()}),e.loose=()=>e.clone({...e._zod.def,catchall:ua()}),e.strict=()=>e.clone({...e._zod.def,catchall:fa()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>we(e,t),e.safeExtend=t=>Te(e,t),e.merge=t=>Ee(e,t),e.pick=t=>Se(e,t),e.omit=t=>Ce(e,t),e.partial=(...t)=>De(Da,e,t[0]),e.required=(...t)=>Oe(La,e,t[0])});function va(e,t){return new _a({type:`object`,shape:e??{},...O(t)})}var ya=h(`ZodUnion`,(e,t)=>{Tn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r),e.options=t.options});function ba(e,t){return new ya({type:`union`,options:e,...O(t)})}var xa=h(`ZodIntersection`,(e,t)=>{En.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r)});function Sa(e,t){return new xa({type:`intersection`,left:e,right:t})}var Ca=h(`ZodEnum`,(e,t)=>{On.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ri(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ca({...t,checks:[],...O(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ca({...t,checks:[],...O(r),entries:i})}});function wa(e,t){return new Ca({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...O(t)})}var Ta=h(`ZodTransform`,(e,t)=>{kn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ai(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ce(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(M(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(M(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ea(e){return new Ta({type:`transform`,transform:e})}var Da=h(`ZodOptional`,(e,t)=>{jn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oa(e){return new Da({type:`optional`,innerType:e})}var ka=h(`ZodExactOptional`,(e,t)=>{Mn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Aa(e){return new ka({type:`optional`,innerType:e})}var ja=h(`ZodNullable`,(e,t)=>{Nn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ma(e){return new ja({type:`nullable`,innerType:e})}var Na=h(`ZodDefault`,(e,t)=>{Pn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Pa(e,t){return new Na({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ve(t)}})}var Fa=h(`ZodPrefault`,(e,t)=>{In.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ia(e,t){return new Fa({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ve(t)}})}var La=h(`ZodNonOptional`,(e,t)=>{Ln.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ra(e,t){return new La({type:`nonoptional`,innerType:e,...O(t)})}var za=h(`ZodCatch`,(e,t)=>{zn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ba(e,t){return new za({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Va=h(`ZodPipe`,(e,t)=>{Bn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.in=t.in,e.out=t.out});function Ha(e,t){return new Va({type:`pipe`,in:e,out:t})}var Ua=h(`ZodReadonly`,(e,t)=>{Vn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wa(e){return new Ua({type:`readonly`,innerType:e})}var Ga=h(`ZodCustom`,(e,t)=>{Un.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(e,t,n,r)});function Ka(e,t={}){return Gr(Ga,e,t)}function qa(e){return Kr(e)}var Ja=e=>va({pages:$(),nextPage:$().optional(),totalElements:$(),currentPage:$(),pageSize:$(),elements:ga(e)});function Ya(){return{pages:0,nextPage:void 0,totalElements:0,currentPage:0,pageSize:0,elements:[]}}var Xa=ba([$(),Vi()]).optional().transform(e=>e===void 0||e===``?void 0:Number(e)).refine(e=>e===void 0||!Number.isNaN(e),{message:`Must be a valid number`}),Za=va({page:Xa,pageSize:Xa}),Qa=class extends r{constructor(e){super(),this.error=e}},$a=class extends r{constructor(e){super(),this.error=e}},eo=class extends r{constructor(){super()}},to=class{constructor(e){this.baseUrl=e}async fetch(e,r,i,a={}){try{let o=await this.mergeHeaders(a.headers),s=await fetch(`${this.baseUrl}${e}`,{...a,headers:o});if(s.status===409)return n(new Qa({status:s.status,statusText:s.statusText,body:await s.json().catch(()=>s.text())}));if(s.status===404)return n(new eo);if(!s.ok)return n(new i({error:await s.json().catch(()=>({message:s.statusText})),metadata:{status:s.status,statusText:s.statusText}}));let c=(await s.text()).trim(),l=s.status===204?void 0:c?JSON.parse(c):void 0,u=r.safeParse(l);return u.success?t(u.data):n(new i(Error(`Invalid response body`),l))}catch(e){return n(new $a(e))}}async fetchBlob(e,r,i={}){try{let a=await this.mergeHeaders(i.headers),o=await fetch(`${this.baseUrl}${e}`,{...i,headers:a});return o.status===404?n(new eo):o.ok?t(await o.blob()):n(new r(await o.json().catch(()=>({message:o.statusText})),{status:o.status,statusText:o.statusText}))}catch(e){return n(new $a(e))}}async mergeHeaders(e){let t=new Headers([...await this.getHeaders()]);return new Headers(e).forEach((e,n)=>t.set(n,e)),t}},no=ma(),ro=/^(?!-)[A-Za-z0-9-]+([-.]{1}[a-z0-9]+)*\.[A-Za-z]{2,63}$/i;function io(e){let t=e?.message??`Please enter a valid domain`;return Vi().min(3,{message:t}).max(253).refine(e=>ro.test(e),{message:t})}exports.EmptyPage=Ya,exports.EmptyResponse=no,exports.Fail=n,exports.Failure=r,exports.Guid=se,exports.HttpSafeClient=to,exports.NetworkConflictFailure=Qa,exports.NetworkFailure=$a,exports.NotFoundFailure=eo,exports.Ok=t,exports.PageQuery=Za,exports.SafeDomain=io,exports.convertDateInfoToDateRange=d,exports.createPageSchema=Ja,exports.formatDate=c,exports.formatDateTime=u,exports.formatTime=l,exports.isFailure=a,exports.mock=e,exports.notFailure=i,exports.parseConfig=o,exports.sleep=s;
64
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ri(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:q(t,`input`,e.processors),output:q(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function K(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return K(r.element,n);if(r.type===`set`)return K(r.valueType,n);if(r.type===`lazy`)return K(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return K(r.innerType,n);if(r.type===`intersection`)return K(r.left,n)||K(r.right,n);if(r.type===`record`||r.type===`map`)return K(r.keyType,n)||K(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:K(r.in,n)||K(r.out,n);if(r.type===`object`){for(let e in r.shape)if(K(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(K(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(K(e,n))return!0;return!!(r.rest&&K(r.rest,n))}return!1}var ii=(e,t={})=>n=>{let r=ti({...n,processors:t});return G(e,r),ni(r,e),ri(r,e)},q=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ti({...i??{},target:a,io:t,processors:n});return G(e,o),ni(o,e),ri(o,e)},ai={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},oi=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ai[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},si=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},ci=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},li=(e,t,n,r)=>{n.not={}},ui=(e,t,n,r)=>{let i=e._zod.def,a=fe(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},fi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},pi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=G(a.element,t,{...r,path:[...r.path,`items`]})},mi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=G(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=G(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},hi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>G(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},gi=(e,t,n,r)=>{let i=e._zod.def,a=G(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=G(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},_i=(e,t,n,r)=>{let i=e._zod.def,a=G(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},vi=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},yi=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},bi=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},xi=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Si=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;G(o,t,r);let s=t.seen.get(e);s.ref=o},Ci=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},wi=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ti=g(`ZodISODateTime`,(e,t)=>{rn.init(e,t),Z.init(e,t)});function Ei(e){return wr(Ti,e)}var Di=g(`ZodISODate`,(e,t)=>{an.init(e,t),Z.init(e,t)});function Oi(e){return Tr(Di,e)}var ki=g(`ZodISOTime`,(e,t)=>{on.init(e,t),Z.init(e,t)});function Ai(e){return Er(ki,e)}var ji=g(`ZodISODuration`,(e,t)=>{sn.init(e,t),Z.init(e,t)});function Mi(e){return Dr(ji,e)}var J=g(`ZodError`,(e,t)=>{Le.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Be(e,t)},flatten:{value:t=>ze(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,pe,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,pe,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ni=N(J),Pi=Ve(J),Fi=P(J),Ii=F(J),Li=We(J),Ri=Ge(J),zi=Ke(J),Bi=qe(J),Vi=Je(J),Hi=Ye(J),Ui=Xe(J),Wi=Ze(J),Gi=new WeakMap;function Y(e,t,n){let r=Object.getPrototypeOf(e),i=Gi.get(r);if(i||(i=new Set,Gi.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var X=g(`ZodType`,(e,t)=>(R.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:q(e,`input`),output:q(e,`output`)}}),e.toJSONSchema=ii(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Ni(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Fi(e,t,n),e.parseAsync=async(t,n)=>Pi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ii(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Li(e,t,n),e.decode=(t,n)=>Ri(e,t,n),e.encodeAsync=async(t,n)=>zi(e,t,n),e.decodeAsync=async(t,n)=>Bi(e,t,n),e.safeEncode=(t,n)=>Vi(e,t,n),e.safeDecode=(t,n)=>Hi(e,t,n),e.safeEncodeAsync=async(t,n)=>Ui(e,t,n),e.safeDecodeAsync=async(t,n)=>Wi(e,t,n),Y(e,`ZodType`,{check(...e){let t=this.def;return this.clone(S(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return E(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check($a(e,t))},superRefine(e,t){return this.check(eo(e,t))},overwrite(e){return this.check(W(e))},optional(){return Fa(this)},exactOptional(){return La(this)},nullable(){return za(this)},nullish(){return Fa(za(this))},nonoptional(e){return Ga(this,e)},array(){return Ca(this)},or(e){return Da([this,e])},and(e){return ka(this,e)},transform(e){return Ya(this,Na(e))},default(e){return Va(this,e)},prefault(e){return Ua(this,e)},catch(e){return qa(this,e)},pipe(e){return Ya(this,e)},readonly(){return Za(this)},describe(e){let t=this.clone();return H.add(t,{description:e}),t},meta(...e){if(e.length===0)return H.get(this);let t=this.clone();return H.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return H.get(e)?.description},configurable:!0}),e)),Ki=g(`_ZodString`,(e,t)=>{Gt.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Y(e,`_ZodString`,{regex(...e){return this.check(Br(...e))},includes(...e){return this.check(Ur(...e))},startsWith(...e){return this.check(Wr(...e))},endsWith(...e){return this.check(Gr(...e))},min(...e){return this.check(U(...e))},max(...e){return this.check(Rr(...e))},length(...e){return this.check(zr(...e))},nonempty(...e){return this.check(U(1,...e))},lowercase(e){return this.check(Vr(e))},uppercase(e){return this.check(Hr(e))},trim(){return this.check(qr())},normalize(...e){return this.check(Kr(...e))},toLowerCase(){return this.check(Jr())},toUpperCase(){return this.check(Yr())},slugify(){return this.check(Xr())}})}),qi=g(`ZodString`,(e,t)=>{Gt.init(e,t),Ki.init(e,t),e.email=t=>e.check(nr(Yi,t)),e.url=t=>e.check(cr(Zi,t)),e.jwt=t=>e.check(Cr(fa,t)),e.emoji=t=>e.check(lr(Qi,t)),e.guid=t=>e.check(rr(Xi,t)),e.uuid=t=>e.check(ir(Q,t)),e.uuidv4=t=>e.check(ar(Q,t)),e.uuidv6=t=>e.check(or(Q,t)),e.uuidv7=t=>e.check(sr(Q,t)),e.nanoid=t=>e.check(ur($i,t)),e.guid=t=>e.check(rr(Xi,t)),e.cuid=t=>e.check(dr(ea,t)),e.cuid2=t=>e.check(fr(ta,t)),e.ulid=t=>e.check(pr(na,t)),e.base64=t=>e.check(br(la,t)),e.base64url=t=>e.check(xr(ua,t)),e.xid=t=>e.check(mr(ra,t)),e.ksuid=t=>e.check(hr(ia,t)),e.ipv4=t=>e.check(gr(aa,t)),e.ipv6=t=>e.check(_r(oa,t)),e.cidrv4=t=>e.check(vr(sa,t)),e.cidrv6=t=>e.check(yr(ca,t)),e.e164=t=>e.check(Sr(da,t)),e.datetime=t=>e.check(Ei(t)),e.date=t=>e.check(Oi(t)),e.time=t=>e.check(Ai(t)),e.duration=t=>e.check(Mi(t))});function Ji(e){return tr(qi,e)}var Z=g(`ZodStringFormat`,(e,t)=>{z.init(e,t),Ki.init(e,t)}),Yi=g(`ZodEmail`,(e,t)=>{Jt.init(e,t),Z.init(e,t)}),Xi=g(`ZodGUID`,(e,t)=>{Kt.init(e,t),Z.init(e,t)}),Q=g(`ZodUUID`,(e,t)=>{qt.init(e,t),Z.init(e,t)}),Zi=g(`ZodURL`,(e,t)=>{Yt.init(e,t),Z.init(e,t)}),Qi=g(`ZodEmoji`,(e,t)=>{Xt.init(e,t),Z.init(e,t)}),$i=g(`ZodNanoID`,(e,t)=>{Zt.init(e,t),Z.init(e,t)}),ea=g(`ZodCUID`,(e,t)=>{Qt.init(e,t),Z.init(e,t)}),ta=g(`ZodCUID2`,(e,t)=>{$t.init(e,t),Z.init(e,t)}),na=g(`ZodULID`,(e,t)=>{en.init(e,t),Z.init(e,t)}),ra=g(`ZodXID`,(e,t)=>{tn.init(e,t),Z.init(e,t)}),ia=g(`ZodKSUID`,(e,t)=>{nn.init(e,t),Z.init(e,t)}),aa=g(`ZodIPv4`,(e,t)=>{cn.init(e,t),Z.init(e,t)}),oa=g(`ZodIPv6`,(e,t)=>{ln.init(e,t),Z.init(e,t)}),sa=g(`ZodCIDRv4`,(e,t)=>{un.init(e,t),Z.init(e,t)}),ca=g(`ZodCIDRv6`,(e,t)=>{dn.init(e,t),Z.init(e,t)}),la=g(`ZodBase64`,(e,t)=>{pn.init(e,t),Z.init(e,t)}),ua=g(`ZodBase64URL`,(e,t)=>{hn.init(e,t),Z.init(e,t)}),da=g(`ZodE164`,(e,t)=>{gn.init(e,t),Z.init(e,t)}),fa=g(`ZodJWT`,(e,t)=>{vn.init(e,t),Z.init(e,t)}),pa=g(`ZodNumber`,(e,t)=>{yn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r),Y(e,`ZodNumber`,{gt(e,t){return this.check(Fr(e,t))},gte(e,t){return this.check(Ir(e,t))},min(e,t){return this.check(Ir(e,t))},lt(e,t){return this.check(Nr(e,t))},lte(e,t){return this.check(Pr(e,t))},max(e,t){return this.check(Pr(e,t))},int(e){return this.check(ha(e))},safe(e){return this.check(ha(e))},positive(e){return this.check(Fr(0,e))},nonnegative(e){return this.check(Ir(0,e))},negative(e){return this.check(Nr(0,e))},nonpositive(e){return this.check(Pr(0,e))},multipleOf(e,t){return this.check(Lr(e,t))},step(e,t){return this.check(Lr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function $(e){return Or(pa,e)}var ma=g(`ZodNumberFormat`,(e,t)=>{bn.init(e,t),pa.init(e,t)});function ha(e){return kr(ma,e)}var ga=g(`ZodUnknown`,(e,t)=>{xn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function _a(){return Ar(ga)}var va=g(`ZodNever`,(e,t)=>{Sn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r)});function ya(e){return jr(va,e)}var ba=g(`ZodVoid`,(e,t)=>{Cn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r)});function xa(e){return Mr(ba,e)}var Sa=g(`ZodArray`,(e,t)=>{Tn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),e.element=t.element,Y(e,`ZodArray`,{min(e,t){return this.check(U(e,t))},nonempty(e){return this.check(U(1,e))},max(e,t){return this.check(Rr(e,t))},length(e,t){return this.check(zr(e,t))},unwrap(){return this.element}})});function Ca(e,t){return Zr(Sa,e,t)}var wa=g(`ZodObject`,(e,t)=>{kn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),b(e,`shape`,()=>t.shape),Y(e,`ZodObject`,{keyof(){return ja(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:_a()})},loose(){return this.clone({...this._zod.def,catchall:_a()})},strict(){return this.clone({...this._zod.def,catchall:ya()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ke(this,e)},safeExtend(e){return Ae(this,e)},merge(e){return je(this,e)},pick(e){return De(this,e)},omit(e){return Oe(this,e)},partial(...e){return Me(Pa,this,e[0])},required(...e){return Ne(Wa,this,e[0])}})});function Ta(e,t){return new wa({type:`object`,shape:e??{},...D(t)})}var Ea=g(`ZodUnion`,(e,t)=>{jn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.options=t.options});function Da(e,t){return new Ea({type:`union`,options:e,...D(t)})}var Oa=g(`ZodIntersection`,(e,t)=>{Mn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r)});function ka(e,t){return new Oa({type:`intersection`,left:e,right:t})}var Aa=g(`ZodEnum`,(e,t)=>{Fn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Aa({...t,checks:[],...D(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Aa({...t,checks:[],...D(r),entries:i})}});function ja(e,t){return new Aa({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...D(t)})}var Ma=g(`ZodTransform`,(e,t)=>{In.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new de(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(M(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(M(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Na(e){return new Ma({type:`transform`,transform:e})}var Pa=g(`ZodOptional`,(e,t)=>{Rn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fa(e){return new Pa({type:`optional`,innerType:e})}var Ia=g(`ZodExactOptional`,(e,t)=>{zn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function La(e){return new Ia({type:`optional`,innerType:e})}var Ra=g(`ZodNullable`,(e,t)=>{Bn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function za(e){return new Ra({type:`nullable`,innerType:e})}var Ba=g(`ZodDefault`,(e,t)=>{Vn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Va(e,t){return new Ba({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ce(t)}})}var Ha=g(`ZodPrefault`,(e,t)=>{Un.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ua(e,t){return new Ha({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ce(t)}})}var Wa=g(`ZodNonOptional`,(e,t)=>{Wn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ga(e,t){return new Wa({type:`nonoptional`,innerType:e,...D(t)})}var Ka=g(`ZodCatch`,(e,t)=>{Kn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qa(e,t){return new Ka({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Ja=g(`ZodPipe`,(e,t)=>{qn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),e.in=t.in,e.out=t.out});function Ya(e,t){return new Ja({type:`pipe`,in:e,out:t})}var Xa=g(`ZodReadonly`,(e,t)=>{Jn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Za(e){return new Xa({type:`readonly`,innerType:e})}var Qa=g(`ZodCustom`,(e,t)=>{Xn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r)});function $a(e,t={}){return Qr(Qa,e,t)}function eo(e,t){return $r(e,t)}var to=xa(),no=(e={})=>e,ro=e=>Ta({pages:$(),nextPage:$().optional(),totalElements:$(),currentPage:$(),pageSize:$(),elements:Ca(e)});function io(){return{pages:0,nextPage:void 0,totalElements:0,currentPage:0,pageSize:0,elements:[]}}var ao=Da([$(),Ji()]).optional().transform(e=>e===void 0||e===``?void 0:Number(e)).refine(e=>e===void 0||!Number.isNaN(e),{message:`Must be a valid number`}),oo=Ta({page:ao,pageSize:ao}),so=/^(?!-)[A-Za-z0-9-]+([-.]{1}[a-z0-9]+)*\.[A-Za-z]{2,63}$/i;function co(e){let t=e?.message??`Please enter a valid domain`;return Ji().min(3,{message:t}).max(253).refine(e=>so.test(e),{message:t})}exports.EmptyPage=io,exports.EmptyResponse=to,exports.Fail=h,exports.Failure=o,exports.Guid=ae,exports.HttpSafeClient=le,exports.NetworkConflictFailure=oe,exports.NetworkFailure=se,exports.NotFoundFailure=ce,exports.Ok=m,exports.PageQuery=oo,exports.SafeDomain=co,exports.convertDateInfoToDateRange=a,exports.createPageSchema=ro,exports.formatDate=n,exports.formatDateTime=i,exports.formatTime=r,exports.isFailure=c,exports.mock=no,exports.notFailure=s,exports.parseConfig=e,exports.sleep=t;