← Back
Editing: setup-wizard.js
(()=>{"use strict";var e,t;let n,r,i,o,a,s,u,l,c,d,f={};function p(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function h(e,t="|"){return e.map(e=>I(e)).join(t)}function m(e,t){return"bigint"==typeof t?t.toString():t}f.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");t&&(t.writable||!t.configurable)||Object.defineProperty(e,"name",{value:"default",configurable:!0})};class g{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function y(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function v(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function _(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function b(e){return _(e._zod.def)??e._zod.def.shape}function w(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return v(this,t,e),e},enumerable:!0,configurable:!0})}function z(e,t,n){t in e?v(e,t,n):e[t]=n}function k(e,t,n,r){let i=b(t);for(let o of n){let n=Object.getOwnPropertyDescriptor(i,o);n.enumerable&&(n.get?w(e,o,()=>{let e=t._zod.def.shape[o];return r?r(e,o):e}):z(e,o,r?r(n.value,o):n.value))}}function $(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}let O="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function x(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let S=new g(()=>{if(eo.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch{return!1}});function P(e){if(!1===x(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==x(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function j(e){return P(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let E=new Set(["string","number","symbol"]);function Z(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function A(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function T(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function I(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let N={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},F={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function C(e,t){let n=b(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function R(e,t){let n={};k(n,e,Reflect.ownKeys(b(e)));for(let e of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,e);r.enumerable&&(r.get?w(n,e,()=>t[e]):z(n,e,r.value))}return n}function D(e,t,n,r="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let o=n?new Set(C(t,n)):void 0,a={};return k(a,t,Reflect.ownKeys(b(t)),e&&((t,n)=>o&&!o.has(n)?t:new e({type:"optional",innerType:t}))),A(t,$(t._zod.def,{shape:a,checks:[]}))}function U(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function J(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function M(e){return"string"==typeof e?e:e?.message}function L(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function W(e,t,n){let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,o=e.message?e.message:M(e.inst?._zod.def?.error?.(e))??M(i?.(e))??M(t?.error?.(e))??M(n.customError?.(e))??M(n.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=e.input),a}let K=/[\uD800-\uDBFF]/;function V(e){let t=e.length;if(!K.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(64512&e.charCodeAt(r))==55296&&(64512&e.charCodeAt(r+1))==56320&&(n--,r++);return n}function B(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function q(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}function G(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function X(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return G(this,n,r(this))},set(e){G(this,n,e)}})}return t}let H=!1,Y={configurable:!0,get(){H=!0}};function Q(e,t,r){let i=Object.getPrototypeOf(e._zod);if(t in i&&n!==e._zod){n=void 0;return}n=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,Y);let e=H;H=!1;try{let n=r(this);return H?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n}),H=H||e,n}catch(n){throw delete this[t],H=H||e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}let ee={value:void 0,enumerable:!1},et="captureStackTrace"in Error?Error:null;function en(e,t,n,r){function i(e){this.def=e,this.constr=l,this.traits=new Set}i.prototype={};let o=n&&new WeakSet;function a(r,a){if(r._zod){if(r._zod.traits.has(e))return}else{ee.value=new i(a);try{Object.defineProperty(r,"_zod",ee)}finally{ee.value=void 0}}if(r._zod.traits.add(e),t(r,a),o){let e=Object.getPrototypeOf(r),t=r._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let a=i??e;if(!o.has(a)){o.add(a);for(let e in n){let t=Object.getOwnPropertyDescriptor(n,e);t.get?Object.defineProperty(a,e,{...t,enumerable:!1}):function(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:G(this,t,n.bind(this))},set(e){G(this,t,e)}})}(a,e,t.value)}}}let s=l.prototype;for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(e in r||(r[e]=s[e].bind(r)))}let s=r?.Parent??Object;class u extends s{}function l(e){let t=r?.Parent?function(e){let t=et;if(t){let n=t.stackTraceLimit;if("number"==typeof n){try{t.stackTraceLimit=0}catch{return et=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}(u):this;a(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(u,"name",{value:e}),Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class er extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ei extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(e=globalThis).__zod_globalConfig??(e.__zod_globalConfig={});let eo=globalThis.__zod_globalConfig;function ea(e){return e&&Object.assign(eo,e),eo}class es extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let eu="~memo",el=[];function ec(e){return null!==e&&"object"==typeof e}function ed(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let ef=new WeakMap,ep=[],eh={alloc(e,t,n){let i=r;if(!i)return n;r=void 0;let o={value:n,issues:null};return i.set(t.value,o),ep.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{var r,i;let o;if("backward"!==n.direction&&(r=n,i=e.value,void 0!==(o=r[eu]?.backEdges)&&ec(i)&&o.has(i)))throw new es;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,i,o,a=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,s=(u,l)=>{let c;if(void 0===n){let r=function e(t,n,r){var i,o;let a=ef.get(t);if(void 0!==a)return 2*!!a;if(n.has(t))return 2;n.add(t);let s=0,u=t=>{if(2!==s&&t?._zod){let i=e(t,n,r);i>s&&(s=i)}},l=e=>{e>s&&(s=e)},c=t._zod.def;switch(c.type){case"object":{let t=_(c);l(t?((t,i)=>{let o=0;for(let a of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,a);if(i&&!s.enumerable)continue;let u=s.get?1:s.value?._zod?e(s.value,n,r):0;u>o&&(o=u)}return o})(t,!0):1),u(c.catchall);break}case"array":u(c.element);break;case"tuple":for(let e of c.items)u(e);u(c.rest);break;case"record":case"map":u(c.keyType),u(c.valueType);break;case"set":u(c.valueType);break;case"union":for(let e of c.options)u(e);break;case"intersection":u(c.left),u(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":u(c.innerType);break;case"pipe":u(c.in),u(c.out);break;case"function":u(c.input),u(c.output);break;case"lazy":{let i=c._cachedInner??(r?t._zod.innerType:void 0);l(i?e(i,n,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&"object"==typeof n){if(n._zod)u(n);else if(Array.isArray(n))for(let e of n)u(e)}}}return n.delete(t),i=t,1!==(o=s)&&ef.set(i,2===o),o}(e,new Set,!1);if(0===r)return e._zod.parse=t,e._zod.run===s&&(e._zod.run=t),t(u,l);2===r||a?n=!0:a=!0}let d=u.value;if(!ec(d))return t(u,l);let f=l[eu];if(f||(f={buckets:new WeakMap,backEdges:void 0},l[eu]=f),i===l)c=o;else{var p;let t;(t=(p=f).buckets.get(e))||(t=new WeakMap,p.buckets.set(e,t)),c=t,i=l,o=c}let h=c.get(d);if(h)return u.value=h.value,h.issues?h.issues.length&&u.issues.push(...ed(h.issues)):(u.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(h.value)),u;r=c;let m=ep.length,g=t(u,l);r=void 0;let y=ep.length>m?ep.pop():void 0;return g instanceof Promise?g.then(e=>(y&&(y.issues=e.issues.length?ed(e.issues):el),e)):(y&&(y.issues=g.issues.length?ed(g.issues):el),g)};e._zod.parse=s,e._zod.run===t&&(e._zod.run=s)})}},em=/^[cC][0-9a-z]{6,}$/,eg=/^[0-9a-z]+$/,ey=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ev=/^[0-9a-vA-V]{20}$/,e_=/^[A-Za-z0-9]{27}$/,eb=/^[a-zA-Z0-9_-]{21}$/,ew=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ez=/^([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})$/,ek=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)$/,e$=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eO=/^(?:(?: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])$/,ex=/^(([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}|:))$/,eS=/^((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])$/,eP=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ej=/^https?$/,eE=/^\+[1-9]\d{6,14}$/,eZ="(?:(?:\\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])))",eA=RegExp(`^${eZ}$`);function eT(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let eI=/^[\s\S]{0,}$/,eN=/^-?\d+(?:\.\d+)?$/,eF=/^(?:true|false)$/i,eC=/^[^A-Z]*$/,eR=/^[^a-z]*$/,eD=en("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),eU=e=>{let t=e.value;return null!=t&&void 0!==t.length},eJ={number:"number",bigint:"bigint",object:"date"},eM=en("$ZodCheckLessThan",(e,t)=>{eD.init(e,t);let n=eJ[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:eJ[typeof r.value]??n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eL=en("$ZodCheckGreaterThan",(e,t)=>{eD.init(e,t);let n=eJ[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:eJ[typeof r.value]??n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eW=en("$ZodCheckMultipleOf",(e,t)=>{eD.init(e,t),e._zod.check=n=>{let r,i,o;if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):0==(i=Math.round(r=n.value/t.value),o=4*Number.EPSILON*Math.max(Math.abs(r),1),Math.abs(r-i)<o?0:r-i))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),eK=en("$ZodCheckNumberFormat",(e,t)=>{eD.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,o]=N[t.format];e._zod.check=a=>{let s=a.value;if(n){if(!Number.isInteger(s))return void a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}s<i&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),eV=en("$ZodCheckMaxLength",(e,t)=>{var n;eD.init(e,t),(n=e._zod.def).when??(n.when=eU),e._zod.check=n=>{let r=n.value,i=r.length;if(("string"==typeof r&&i>t.maximum?V(r):i)<=t.maximum)return;let o=B(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eB=en("$ZodCheckMinLength",(e,t)=>{var n;eD.init(e,t),(n=e._zod.def).when??(n.when=eU),e._zod.check=n=>{let r=n.value,i=r.length;if(("string"==typeof r&&i>=t.minimum&&i<2*t.minimum?V(r):i)>=t.minimum)return;let o=B(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eq=en("$ZodCheckLengthEquals",(e,t)=>{var n;eD.init(e,t),(n=e._zod.def).when??(n.when=eU),e._zod.check=n=>{let r=n.value,i=r.length,o="string"==typeof r&&i>=t.length&&i<=2*t.length?V(r):i;if(o===t.length)return;let a=B(r),s=o>t.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),eG=en("$ZodCheckStringFormat",(e,t)=>{var n,r;eD.init(e,t),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=()=>{})}),eX=en("$ZodCheckRegex",(e,t)=>{eG.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})}}),eH=en("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=eC),eG.init(e,t)}),eY=en("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=eR),eG.init(e,t)}),eQ=en("$ZodCheckIncludes",(e,t)=>{eD.init(e,t);let n=Z(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position},}${n}`:n);t.pattern=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})}}),e0=en("$ZodCheckStartsWith",(e,t)=>{eD.init(e,t);let n=RegExp(`^${Z(t.prefix)}.*`);t.pattern??(t.pattern=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})}}),e1=en("$ZodCheckEndsWith",(e,t)=>{eD.init(e,t);let n=RegExp(`.*${Z(t.suffix)}$`);t.pattern??(t.pattern=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})}}),e4=en("$ZodCheckOverwrite",(e,t)=>{eD.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class e9{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split(` `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { ${t.join(` `)} };`)(...Object.values(this.closed))}}let e2={major:4,minor:6,patch:5},e6=en("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=e2;let r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{let i;if(t.memo)return t;let o=U(t);for(let a of n){if(a._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}(t)||!a._zod.def.when(t))continue}else if(o)continue;let n=t.issues.length,s=a._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new er;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(L(t.issues,n,e),o||(o=U(t,n)))});else{if(t.issues.length===n)continue;L(t.issues,n,e),o||(o=U(t,n))}}return i?i.then(()=>t):t},n=(n,r,o)=>{if(U(n))return n.aborted=!0,n;let a=t(r,i,o);if(a instanceof Promise){if(!1===o.async)throw new er;return a.then(t=>e._zod.parse(t,o))}return e._zod.parse(a,o)};e._zod.run=(r,o)=>{if(o.skipChecks)return e._zod.parse(r,o);if("backward"===o.direction){let t=e._zod.parse({value:r.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,o)):n(t,r,o)}let a=e._zod.parse(r,o);if(a instanceof Promise){if(!1===o.async)throw new er;return a.then(e=>t(e,i,o))}return t(a,i,o)}}},{get"~standard"(){return G(this,"~standard",e5(this),!1)},set"~standard"(e){G(this,"~standard",e)}}),e3=(e,t)=>e.issues.length?{issues:e.issues.map(e=>W(e,t,ea()))}:{value:e.value};function e5(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return e3(r,n)}catch{}return async function(e,t){let n={async:!0};return e3(await e._zod.run({value:t,issues:[]},n),n)}(e,t)},vendor:"zod",version:1}}let e8=en("$ZodString",(e,t)=>{e6.init(e,t),e._zod.pattern=t.pattern??eI,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),e7=en("$ZodStringFormat",(e,t)=>{eG.init(e,t),e8.init(e,t)}),te=en("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ez),e7.init(e,t)}),tt=en("$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(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ek(e))}else t.pattern??(t.pattern=ek());e7.init(e,t)}),tn=en("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=e$),e7.init(e,t)});function tr(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let ti=/[\t\n\r]/g;function to(e){return e.replace(ti,"")}let ta=en("$ZodURL",(e,t)=>{e7.init(e,t),e._zod.check=n=>{try{var r,i;let o=n.value.trim(),a="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===ej.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(o,t):tr(o)||2;if(1===a)return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});if(2===a)return void n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});if(!0===a){n.value=to(o);return}t.hostname&&((r=t.hostname).lastIndex=0,!r.test(a.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&&((i=t.protocol).lastIndex=0,!i.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?a.href:to(o);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ts=en("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),e7.init(e,t)}),tu=en("$ZodNanoID",(e,t)=>{var n;if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?eb:(n=t.length,RegExp(`^[a-zA-Z0-9_-]{${n}}$`))),e7.init(e,t)}),tl=en("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=em),e7.init(e,t)}),tc=en("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eg),e7.init(e,t)}),td=en("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ey),e7.init(e,t)}),tf=en("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ev),e7.init(e,t)}),tp=en("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=e_),e7.init(e,t)}),th=en("$ZodISODateTime",(e,t)=>{let n,r,i;t.pattern??(n=["Z"],t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),r=`${eT({precision:t.precision,seconds:!0})}(?:${n.join("|")})`,i=t.local?`${r}|${eT({precision:t.precision})}`:r,t.pattern=RegExp(`^${eZ}T(?:${i})$`)),e7.init(e,t)}),tm=en("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=eA),e7.init(e,t)}),tg=en("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${eT(t)}$`)),e7.init(e,t)}),ty=en("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ew),e7.init(e,t)}),tv=en("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=eO),e7.init(e,t)}),t_=/^[0-9a-fA-F:.]+$/;function tb(e){return!!t_.test(e)&&tr(`http://[${e}]`)}let tw=en("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ex),e7.init(e,t),e._zod.check=n=>{tb(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),tz=en("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=eS),e7.init(e,t)}),tk=en("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eP),e7.init(e,t),e._zod.check=n=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`===r&&!(i<0)&&!(i>128)&&tb(n)}(n.value)&&n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function t$(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let tO=/^[0-9a-zA-Z+/]*={0,2}$/,tx=en("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tO),e7.init(e,t),e._zod.check=n=>{t$(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),tS=/^[A-Za-z0-9_-]*$/,tP=en("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=tS),e7.init(e,t),e._zod.check=n=>{!function(e){if(!tS.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return t$(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),tj=en("$ZodE164",(e,t)=>{t.pattern??(t.pattern=eE),e7.init(e,t)}),tE=en("$ZodJWT",(e,t)=>{e7.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),tZ=en("$ZodNumber",(e,t)=>{e6.init(e,t),e._zod.pattern=eN,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;let o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),tA=en("$ZodNumberFormat",(e,t)=>{eK.init(e,t),tZ.init(e,t)}),tT=en("$ZodBoolean",(e,t)=>{e6.init(e,t),e._zod.pattern=eF,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),tI=en("$ZodUnknown",(e,t)=>{e6.init(e,t),e._zod.parse=e=>e}),tN=en("$ZodNever",(e,t)=>{e6.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function tF(e,t,n){e.issues.length&&t.issues.push(...J(n,e.issues)),t.value[n]=e.value}let tC=en("$ZodArray",(e,t)=>{e6.init(e,t);let n=eo.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=n?n.alloc(e,r,Array(o.length),i):Array(o.length);let a=[],s=i?.abortEarly;for(let e=0;e<o.length;e++){let n=o[e],u=t.element._zod.run({value:n,issues:[]},i);if(u instanceof Promise)a.push(u.then(t=>tF(t,r,e)));else if(tF(u,r,e),s&&0!==u.issues.length&&U(u))break}return a.length?Promise.all(a).then(()=>r):r}});function tR(e,t,n,r,i,o){let a=n in r,s="optional"===o;if(a||!s||"optional"!==i){if(e.issues.length){if(void 0!==i&&s&&!a)return;t.issues.push(...J(n,e.issues))}if(!a&&void 0===i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}void 0===e.value?(a||"defaulted"===i&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}let tD=[];function tU(e){var t;let n=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),i=r.length?r:tD,o=i.length?[...n,...i]:n;for(let t of o)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Object.keys(t=e.shape).filter(e=>void 0!==t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,allKeys:o,symbolKeys:i,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(a)}}function tJ(e,t,n,r,i,o,a){let s=[],u=i.keySet,l=i.catchall._zod,c=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(a&&n.issues.length!==p){if(U(n,p))break;p=n.issues.length}if(u.has(i))continue;if("__proto__"===i){"never"===c&&s.push(i);continue}if("never"===c){s.push(i);continue}let o=l.run({value:t[i],issues:[]},r);o instanceof Promise?e.push(o.then(e=>tR(e,n,i,t,d,f))):tR(o,n,i,t,d,f)}return(s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o,continue:!0}),e.length)?Promise.all(e).then(()=>n):n}let tM=en("$ZodObject",(e,t)=>{let n;e6.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),i=r?.get?r.get.raw:t.shape??{};if(i){let e=()=>{let n={...i};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=i,Object.defineProperty(t,"shape",{get:e})}let o=new g(()=>tU(t));Q(e,"propValues",e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){for(let t of(Object.prototype.hasOwnProperty.call(n,e)||v(n,e,new Set),r.values))n[e].add(t);void 0!==r.optin&&n[e].add(void 0)}}return n});let a=t.catchall,s=eo.memoizer;s?.attach(e),e._zod.parse=(t,r)=>{n??(n=o.value);let i=t.value;if(!x(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value=s?s.alloc(e,t,{},r):{};let u=[],l=n.shape,c=r?.abortEarly,d=t.issues.length;for(let e of n.allKeys){if(c&&t.issues.length!==d){if(U(t,d))break;d=t.issues.length}if("__proto__"===e)continue;let n=l[e],o=n._zod.optin,a=n._zod.optout,s=n._zod.run({value:i[e],issues:[]},r);s instanceof Promise?u.push(s.then(n=>tR(n,t,e,i,o,a))):tR(s,t,e,i,o,a)}return a?tJ(u,i,t,r,o.value,e,!0===c):u.length?Promise.all(u).then(()=>t):t}}),tL=en("$ZodObjectJIT",(e,t)=>{let n,r;tM.init(e,t);let i=e._zod.parse,o=new g(()=>tU(t)),a=eo.memoizer,s=!eo.jitless,u=s&&S.value,l=t.catchall;e._zod.parse=(c,d)=>{r??(r=o.value);let f=c.value;return x(f)?s&&u&&d?.async===!1&&!0!==d.jitless?(n||(n=(t=>{let n=o.value,r=n.symbolKeys,i=new e9(["payload","ctx"],{shape:t,inst:e,memo:a,syms:r}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,u=(e,t)=>` let ${e}_ab = false; for (let i = 0; i < ${e}.issues.length; i++) { const iss = ${e}.issues[i]; iss.path = iss.path ? [${t}, ...iss.path] : [${t}]; payload.issues.push(iss); if (iss.continue !== true) ${e}_ab = true; } if (${e}_ab && ctx && ctx.abortEarly) { payload.value = newResult; return payload; }`;i.write("const input = payload.value;");let l=Object.create(null),c=0;for(let e of n.allKeys)l[e]=`key_${c++}`;for(let e of(i.write(a?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};"),n.allKeys)){if("__proto__"===e)continue;let n=l[e],o="symbol"==typeof e?`syms[${r.indexOf(e)}]`:JSON.stringify(e),a=`${o} in input`,c=t[e],d=c?._zod?.optin,f=void 0!==d,p=c?._zod?.optout==="optional";if(i.write(`const ${n} = ${s(o)};`),f&&p){let e="optional"===d?`${n}_present`:`${n}.value !== undefined || ${n}_present`;i.write(` const ${n}_present = ${a}; if (!${n}.issues.length || ${n}_present) { if (${n}.issues.length) {${u(n,o)} } if (${e}) { newResult[${o}] = ${n}.value; } } `)}else f?(i.write(` if (${n}.issues.length) {${u(n,o)} } `),"defaulted"===d?i.write(`newResult[${o}] = ${n}.value;`):i.write(` if (${n}.value !== undefined || ${a}) { newResult[${o}] = ${n}.value; } `)):i.write(` const ${n}_present = ${a}; if (${n}.issues.length) {${u(n,o)} } if (!${n}_present && !${n}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: undefined, path: [${o}] }); if (ctx && ctx.abortEarly) { payload.value = newResult; return payload; } } if (${n}_present) { newResult[${o}] = ${n}.value; } `)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),c=n(c,d),l)?tJ([],f,c,d,r,e,d?.abortEarly===!0):c:i(c,d):(c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c)}});function tW(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let i=e.filter(e=>!U(e));return 1===i.length?(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=>W(e,r,ea())))}),t)}let tK=en("$ZodUnion",(e,t)=>{e6.init(e,t),Q(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),Q(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Q(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Q(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>y(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,a=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>tW(t,r,e,i)):tW(a,r,e,i)}}),tV=en("$ZodIntersection",(e,t)=>{e6.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,n])=>tB(e,t,n)):tB(e,i,o)}});function tB(e,t,n){let r,i=new Map,o=new Map,a=(e,t)=>{let n;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);o.has(t)||o.set(t,e),n=[t]}else r??(r=e),n=e.keys;for(let e of n)i.has(e)||i.set(e,{}),i.get(e)[t]=!0;return!0};for(let n of t.issues)a(n,"l")||e.issues.push(n);for(let t of n.issues)a(t,"r")||e.issues.push(t);let s=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=r?s.filter(e=>r.keys.includes(e)):[];for(let n of(t.length&&e.issues.push({...r,keys:t}),s))!t.includes(n)&&o.has(n)&&e.issues.push(o.get(n))}let u=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(P(t)&&P(n)){let r=Object.keys(n),i=Object.keys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...n};for(let r of(Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__,i)){if("__proto__"===r)continue;let i=e(t[r],n[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};o[r]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let o=e(t[i],n[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!u.valid){if(U(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}let tq=en("$ZodEnum",(e,t)=>{e6.init(e,t);let n=p(t.entries),r=new Set(n);e._zod.values=r,Q(e,"pattern",e=>{let t=p(e.def.entries).filter(e=>E.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>Z(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,i)=>{let o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),tG=en("$ZodTransform",(e,t)=>{e6.init(e,t),e._zod.optin="optional",eo.memoizer?.guard(e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ei(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 er;return n.value=i,n}});function tX(e,t){return e.value=t.issues.length?void 0:t.value,e}let tH=en("$ZodOptional",(e,t)=>{e6.init(e,t),Q(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",Q(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Q(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${y(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>tX(e,t)):tX(e,r)}return t.innerType._zod.run(e,n)}}),tY=en("$ZodExactOptional",(e,t)=>{tH.init(e,t),Q(e,"values",e=>e.def.innerType._zod.values),Q(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),tQ=en("$ZodNullable",(e,t)=>{e6.init(e,t),Q(e,"optin",e=>e.def.innerType._zod.optin),Q(e,"optout",e=>e.def.innerType._zod.optout),Q(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${y(t.source)}|null)$`):void 0}),Q(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),t0=en("$ZodDefault",(e,t)=>{e6.init(e,t),e._zod.optin="defaulted",Q(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>t1(e,t)):t1(r,t)}});function t1(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let t4=en("$ZodPrefault",(e,t)=>{e6.init(e,t),e._zod.optin="defaulted",Q(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),t9=en("$ZodNonOptional",(e,t)=>{e6.init(e,t),Q(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>t2(t,e)):t2(i,e)}});function t2(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function t6(e,t,n,r){return t.issues.length?e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>W(e,r,ea()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}let t3=en("$ZodCatch",(e,t)=>{e6.init(e,t),Q(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),Q(e,"optout",e=>e.def.innerType._zod.optout),Q(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>t6(e,r,t,n)):t6(e,r,t,n)}}),t5=en("$ZodPipe",(e,t)=>{e6.init(e,t),Q(e,"values",e=>e.def.in._zod.values),Q(e,"optin",e=>e.def.in._zod.optin),Q(e,"optout",e=>e.def.out._zod.optout),Q(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>t8(e,t.in,n)):t8(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>t8(e,t.out,n)):t8(r,t.out,n)}});function t8(e,t,n){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}let t7=en("$ZodReadonly",(e,t)=>{e6.init(e,t),Q(e,"propValues",e=>e.def.innerType._zod.propValues),Q(e,"values",e=>e.def.innerType._zod.values),Q(e,"optin",e=>e.def.innerType?._zod?.optin),Q(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ne):ne(r)}});function ne(e){return e.memo||(e.value=Object.freeze(e.value)),e}let nt=en("$ZodCustom",(e,t)=>{eD.init(e,t),e6.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=>nn(t,n,r,e));nn(i,n,r,e)}});function nn(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(q(e))}}(t=globalThis).__zod_globalRegistry??(t.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"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&&"object"==typeof t&&"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)}});let nr=globalThis.__zod_globalRegistry;function ni(e){return e.checks&&(e.checks=[...e.checks]),e}function no(e,t){return new eM({check:"less_than",...T(t),value:e,inclusive:!1})}function na(e,t){return new eM({check:"less_than",...T(t),value:e,inclusive:!0})}function ns(e,t){return new eL({check:"greater_than",...T(t),value:e,inclusive:!1})}function nu(e,t){return new eL({check:"greater_than",...T(t),value:e,inclusive:!0})}function nl(e,t){return new eW({check:"multiple_of",...T(t),value:e})}function nc(e,t){return new eV({check:"max_length",...T(t),maximum:e})}function nd(e,t){return new eB({check:"min_length",...T(t),minimum:e})}function nf(e,t){return new eq({check:"length_equals",...T(t),length:e})}function np(e){return new e4({check:"overwrite",tx:e})}function nh(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&v(e,t,n[t]);return e}function nm(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??nr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ng(e,t,n,r,i){let o="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if("any"===o)return!1;if(void 0===o||"throw"===o)throw Error(i);return Object.assign(n,o),!0}function ny(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{let n=a.schema,o=t.processors[i.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,n,r)}let o=e._zod.parent;o&&(a.ref||(a.ref=o),ny(o,t,r),t.seen.get(o).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&nh(a.schema,u),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function nv(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function n_(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;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=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:o}=(t=>{let r="draft-2020-12"===e.target?"$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 o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${r}/${nv(o)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:"#"};let o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:i+nv(o)}})(t);r.def={...r.schema},o&&(r.defId=o);let a=r.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root> 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]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle){i(n);continue}r.count>1&&"ref"===e.reused&&i(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}let nb=new Set(["type","properties","required","additionalProperties"]),nw=["oneOf","anyOf"];function nz(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function nk(e){let t=[];for(let n of e){if("object"!=typeof n||"object"!==n.type)return null;for(let e in n)if(!nb.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??nz(n);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}v(n,r,1===e.length?e[0]:nk(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=nz(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function n$(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(null===n.ref)return;let i=n.def??n.schema,o={...i},a=n.ref;if(n.ref=null,a){r(a);let n=e.seen.get(a),s=n.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(s)):nh(i,s),nh(i,o),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(s.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==a){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&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??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let n=t.anyOf;if(!Array.isArray(n)||0===n.length||void 0!==t.type)return;let r=[];for(let t of n){if(!t||"object"!=typeof t)return;e(t);let n=Object.keys(t);if(1!==n.length||"type"!==n[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;r.includes(e)||r.push(e)}}delete t.anyOf,t.type=1===r.length?r[0]:r}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of nb)if(t in e)return;let n=t.filter(e=>nw.some(t=>Array.isArray(e[t]))),r=null;if(n.length){let e=n[0],i=nw.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let o=t.filter(t=>t!==e),a=e[i].map(e=>nk([...o,e]));if(a.some(e=>!e))return;r={[i]:a}}else r=nk(t);r&&(delete e.allOf,nh(e,r))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?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)}nh(i,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&i.id===o&&delete i.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,v(a,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:nO(t,"input",e.processors),output:nO(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error("Error converting schema to JSON.")}}let nO=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r??{},a=nm({...i??{},target:o,io:t,processors:n});return ny(e,a),n_(a,e),n$(a,e)},nx=(e,t,n)=>{(void 0===e[t]||n>e[t])&&(e[t]=n)},nS=(e,t,n)=>{(void 0===e[t]||n<e[t])&&(e[t]=n)},nP=(e,t)=>{nx(e,"minimum",t),nS(e,"maximum",t)},nj=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},nE=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},nZ=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},nA=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},nT=(e,t)=>nx(e,"minimum",t.minimum),nI=(e,t)=>nS(e,"maximum",t.maximum),nN=e=>(t,n)=>{nA(t,n.format);let[r,i]=e[n.format];nx(t,"minimum",r),nS(t,"maximum",i)},nF={greater_than:(e,t)=>nx(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>nS(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>nj(e,t.value),number_format:nN(N),bigint_format:nN(F),min_length:nT,max_length:nI,length_equals:(e,t)=>nP(e,t.length),min_size:nT,max_size:nI,size_equals:(e,t)=>nP(e,t.size),string_format:(e,t)=>{nA(e,t.format),t.pattern&&nE(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>nZ(e,t.mime)};function nC(e){let t={},n=e._zod.def;for(let r of e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[])nF[r._zod.def.check]?.(t,r._zod.def);let r=e._zod.bag;for(let e of(void 0!==r.minimum&&nx(t,"minimum",r.minimum),void 0!==r.exclusiveMinimum&&nx(t,"exclusiveMinimum",r.exclusiveMinimum),void 0!==r.maximum&&nS(t,"maximum",r.maximum),void 0!==r.exclusiveMaximum&&nS(t,"exclusiveMaximum",r.exclusiveMaximum),void 0!==r.multipleOf&&nj(t,r.multipleOf),void 0!==r.format&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&nZ(t,r.mime),r.patterns??[]))nE(t,e);return t}let nR={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nD=new Map([[tO,/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/],[tS,/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/]]),nU=e=>nD.get(e)??e;new WeakMap;let nJ=Symbol();function nM(e,t,n,r,i){let o=!1,a=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(o=!0,null));return o?(ng(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),nJ):JSON.parse(a)}let nL=(e,t,n,r)=>{let i=e._zod.def;ny(i.innerType,t,r),t.seen.get(e).ref=i.innerType};function nW(){return{localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function r(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?n[e]??e:String(t)}return n=>{switch(n.code){case"invalid_type":{let e=r(n.expected),t=r(function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}(n.input),n.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${I(n.values[0])}`;return`Invalid option: expected one of ${h(n.values,"|")}`;case"too_big":{let t=n.exact?"exactly ":n.inclusive?"<=":"<",r=e[n.origin]??null;if(r)return`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{let t=n.exact?"exactly ":n.inclusive?">=":">",r=e[n.origin]??null;if(r)return`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${r.unit}`;return`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${t[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${h(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0){let e=n.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===n.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}})()}}f.dn(nW);let nK={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,m,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},nV={value:void 0,enumerable:!1},nB=new WeakSet([Object.prototype,Error.prototype]),nq=(e,t)=>{e.name="$ZodError",nV.value=t,Object.defineProperty(e,"issues",nV),nV.value=void 0,Object.defineProperty(e,"message",nK);let n=Object.getPrototypeOf(e);nB.has(n)||(nB.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},nG=en("$ZodError",nq);function nX(e,t){return{callee:t?.callee??e,Err:t?.Err}}en("$ZodError",nq,void 0,{Parent:Error});let nH=e=>{let t=(n,r,i,o)=>{let a=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new er;if(s.issues.length){let n=new(o?.Err??e)(s.issues.map(e=>W(e,a,ea())));throw O(n,o?.callee??t),n}return s.value};return t},nY=e=>{let t=async(n,r,i,o)=>{let a=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new(o?.Err??e)(s.issues.map(e=>W(e,a,ea())));throw O(n,o?.callee??t),n}return s.value};return t},nQ=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new er;return o.issues.length?n0(e,o.issues,i):{success:!0,data:o.value}};function n0(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>W(e,n,ea()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let n1=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?n0(e,o.issues,i):{success:!0,data:o.value}},n4=Symbol.for("zod.compile.invalid"),n9=Symbol.for("zod.compile.fallback"),n2=new WeakSet([Object.prototype,Error.prototype]);function n6(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let n3=en("ZodError",(e,t)=>{nG.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);n2.has(n)||(n2.add(n),n6(n,"format",e=>t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length)n._errors.push(t(o));else{let r=n,i=0;for(;i<e.length;){let n=e[i],a=i===e.length-1;if("_errors"===n){a&&r._errors.push(t(o)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];a&&s._errors.push(t(o)),r=s,i++}}}};return r(e),n})(e,t)),n6(n,"flatten",e=>t=>(function(e,t=e=>e.message){let n={},r=[];for(let a of e.issues)if(a.path.length>0){var i,o;(i=a.path[0],o=()=>[],!Object.prototype.hasOwnProperty.call(n,i)&&("__proto__"===i?Object.defineProperty(n,i,{value:o(),writable:!0,enumerable:!0,configurable:!0}):n[i]=o()),n[i]).push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}})(e,t)),n6(n,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,m,2)}),n6(n,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,m,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error}),n5=nH(n3),n8=nY(n3),n7=nQ(n3),re=n1(n3),rt=(i=nH(n3),o=(e,t,n,r)=>i(e,t,n?{...n,direction:"backward"}:{direction:"backward"},nX(o,r))),rn=(a=nH(n3),s=(e,t,n,r)=>a(e,t,n,nX(s,r))),rr=(u=nY(n3),l=async(e,t,n,r)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return await u(e,t,i,nX(l,r))}),ri=(c=nY(n3),d=async(e,t,n,r)=>await c(e,t,n,nX(d,r))),ro=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return nQ(n3)(e,t,r)},ra=(e,t,n)=>nQ(n3)(e,t,n),rs=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return n1(n3)(e,t,r)},ru=async(e,t,n)=>n1(n3)(e,t,n);function rl(){eo.memoizer||ea({memoizer:eh})}let rc=en("ZodType",(e,t)=>(eo.localeError||ea(nW()),e6.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone($(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return A(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new ir({type:"custom",check:"custom",fn:e,...T(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,i;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(q(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(q(e)))},e(t.value,t)),(i=new eD({check:"custom",...T(t)}))._zod.check=n,r=i}(e,t))},overwrite(e){return this.check(np(e))},optional(){return r1(this)},exactOptional(){var e;return e=this,new r4({type:"optional",innerType:e})},nullable(){return r2(this)},nullish(){return r1(r2(this))},nonoptional(e){var t;return t=this,new r5({type:"nonoptional",innerType:t,...T(e)})},array(){return function(e){return new rV({type:"array",element:e,...T(void 0)})}(this)},or(e){return new rG({type:"union",options:[this,e],...T(void 0)})},and(e){var t;return t=this,new rX({type:"intersection",left:t,right:e})},transform(e){return ie(this,new rQ({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new r6({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():j(n)}})},prefault(e){var t,n;return t=this,n=e,new r3({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():j(n)}})},catch(e){return function(e,t){let n;return new r8({type:"catch",innerType:e,catchValue:"function"==typeof t?t:((n=()=>t)["~constantCatch"]=!0,n)})}(this,e)},pipe(e){return ie(this,e)},readonly(){var e;return e=this,new it({type:"readonly",innerType:e})},describe(e){let t=this.clone();return nr.add(t,{description:e}),t},meta(...e){if(0===e.length)return nr.get(this);let t=this.clone();return nr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return G(this,"~standard",{...e5(this),jsonSchema:{input:nO(this,"input"),output:nO(this,"output")}},!1)},set"~standard"(e){G(this,"~standard",e)},parse:function e(t,n){return n5(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await n8(this,t,n,{callee:e})},safeParse(e,t){return n7(this,e,t)},async safeParseAsync(e,t){return re(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G(this,"spa",e)},validate(e,t){let n=this._zod.bag.validator;if(void 0!==n){if(n(e)!==n4)return!0;if(!0===n.definite&&void 0===t)return!1}return function(e,t,n){let r,i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;if(o?(i[n9]=!0,r=o({value:t,issues:[]},i)):r=e._zod.run({value:t,issues:[]},i),r instanceof Promise)throw new er;return 0===r.issues.length}(this,e,t)},validateAsync(e,t){return(async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),0===i.issues.length})(this,e,t)},encode:function e(t,n){return rt(this,t,n,{callee:e})},decode:function e(t,n){return rn(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await rr(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ri(this,t,n,{callee:e})},safeEncode(e,t){return ro(this,e,t)},safeDecode(e,t){return ra(this,e,t)},async safeEncodeAsync(e,t){return rs(this,e,t)},async safeDecodeAsync(e,t){return ru(this,e,t)},toJSONSchema(e){return((e,t={})=>n=>{let r=nm({...n,processors:t});return ny(e,r),n_(r,e),n$(r,e)})(this,{})(e)},get description(){return nr.get(this)?.description},get _def(){return this._zod.def}}),rd=en("_ZodString",(e,t)=>{e8.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{n.type="string";let{minimum:r,maximum:i,format:o,patterns:a,contentEncoding:s,laxFormat:u}=nC(e);if("number"==typeof r&&(n.minLength=r),"number"==typeof i&&(n.maxLength=i),o&&(n.format=nR[o]??o,""===n.format&&delete n.format,("time"===o||u)&&delete n.format),s&&(n.contentEncoding=s),a&&a.size>0){let e=[...a].map(nU);1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n)},X({format:e=>nC(e).format??null,minLength:e=>nC(e).minimum??null,maxLength:e=>nC(e).maximum??null},{regex(...e){return this.check(function(e,t){return new eX({check:"string_format",format:"regex",...T(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new eQ({check:"string_format",format:"includes",...T(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new e0({check:"string_format",format:"starts_with",...T(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new e1({check:"string_format",format:"ends_with",...T(t),suffix:e})}(...e))},min(...e){return this.check(nd(...e))},max(...e){return this.check(nc(...e))},length(...e){return this.check(nf(...e))},nonempty(...e){return this.check(nd(1,...e))},lowercase(e){return this.check(new eH({check:"string_format",format:"lowercase",...T(e)}))},uppercase(e){return this.check(new eY({check:"string_format",format:"uppercase",...T(e)}))},trim(){return this.check(np(e=>e.trim()))},normalize(...e){return this.check(function(e){return np(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(np(e=>e.toLowerCase()))},toUpperCase(){return this.check(np(e=>e.toUpperCase()))},slugify(){return this.check(np(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})),rf=en("ZodString",(e,t)=>{e8.init(e,t),rd.init(e,t)},{email(e){return this.check(new r_({type:"string",format:"email",check:"string_format",abort:!1,...T(e)}))},url(e){return this.check(new rz({type:"string",format:"url",check:"string_format",abort:!1,...T(e)}))},jwt(e){return this.check(new rC({type:"string",format:"jwt",check:"string_format",abort:!1,...T(e)}))},emoji(e){return this.check(new rk({type:"string",format:"emoji",check:"string_format",abort:!1,...T(e)}))},guid(e){return this.check(new rb({type:"string",format:"guid",check:"string_format",abort:!1,...T(e)}))},uuid(e){return this.check(new rw({type:"string",format:"uuid",check:"string_format",abort:!1,...T(e)}))},uuidv4(e){return this.check(new rw({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(e)}))},uuidv6(e){return this.check(new rw({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(e)}))},uuidv7(e){return this.check(new rw({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(e)}))},nanoid(e){return this.check(new r$({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(e)}))},cuid(e){return this.check(new rO({type:"string",format:"cuid",check:"string_format",abort:!1,...T(e)}))},cuid2(e){return this.check(new rx({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(e)}))},ulid(e){return this.check(new rS({type:"string",format:"ulid",check:"string_format",abort:!1,...T(e)}))},base64(e){return this.check(new rI({type:"string",format:"base64",check:"string_format",abort:!1,...T(e)}))},base64url(e){return this.check(new rN({type:"string",format:"base64url",check:"string_format",abort:!1,...T(e)}))},xid(e){return this.check(new rP({type:"string",format:"xid",check:"string_format",abort:!1,...T(e)}))},ksuid(e){return this.check(new rj({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(e)}))},ipv4(e){return this.check(new rE({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(e)}))},ipv6(e){return this.check(new rZ({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(e)}))},cidrv4(e){return this.check(new rA({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(e)}))},cidrv6(e){return this.check(new rT({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(e)}))},e164(e){return this.check(new rF({type:"string",format:"e164",check:"string_format",abort:!1,...T(e)}))},datetime(e){return this.check(new rm({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(e)}))},date(e){return this.check(new rg({type:"string",format:"date",check:"string_format",...T(e)}))},time(e){return this.check(new ry({type:"string",format:"time",check:"string_format",precision:null,...T(e)}))},duration(e){return this.check(new rv({type:"string",format:"duration",check:"string_format",...T(e)}))}});function rp(e){return new rf(ni({type:"string",...T(e)}))}let rh=en("ZodStringFormat",(e,t)=>{e7.init(e,t),rd.init(e,t)}),rm=en("ZodISODateTime",(e,t)=>{th.init(e,t),rh.init(e,t)}),rg=en("ZodISODate",(e,t)=>{tm.init(e,t),rh.init(e,t)}),ry=en("ZodISOTime",(e,t)=>{tg.init(e,t),rh.init(e,t)}),rv=en("ZodISODuration",(e,t)=>{ty.init(e,t),rh.init(e,t)}),r_=en("ZodEmail",(e,t)=>{tn.init(e,t),rh.init(e,t)}),rb=en("ZodGUID",(e,t)=>{te.init(e,t),rh.init(e,t)}),rw=en("ZodUUID",(e,t)=>{tt.init(e,t),rh.init(e,t)}),rz=en("ZodURL",(e,t)=>{ta.init(e,t),rh.init(e,t)}),rk=en("ZodEmoji",(e,t)=>{ts.init(e,t),rh.init(e,t)}),r$=en("ZodNanoID",(e,t)=>{tu.init(e,t),rh.init(e,t)}),rO=en("ZodCUID",(e,t)=>{tl.init(e,t),rh.init(e,t)}),rx=en("ZodCUID2",(e,t)=>{tc.init(e,t),rh.init(e,t)}),rS=en("ZodULID",(e,t)=>{td.init(e,t),rh.init(e,t)}),rP=en("ZodXID",(e,t)=>{tf.init(e,t),rh.init(e,t)}),rj=en("ZodKSUID",(e,t)=>{tp.init(e,t),rh.init(e,t)}),rE=en("ZodIPv4",(e,t)=>{tv.init(e,t),rh.init(e,t)}),rZ=en("ZodIPv6",(e,t)=>{tw.init(e,t),rh.init(e,t)}),rA=en("ZodCIDRv4",(e,t)=>{tz.init(e,t),rh.init(e,t)}),rT=en("ZodCIDRv6",(e,t)=>{tk.init(e,t),rh.init(e,t)}),rI=en("ZodBase64",(e,t)=>{tx.init(e,t),rh.init(e,t)}),rN=en("ZodBase64URL",(e,t)=>{tP.init(e,t),rh.init(e,t)}),rF=en("ZodE164",(e,t)=>{tj.init(e,t),rh.init(e,t)}),rC=en("ZodJWT",(e,t)=>{tE.init(e,t),rh.init(e,t)}),rR=en("ZodNumber",(e,t)=>{tZ.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:i,maximum:o,multipleOf:a,exclusiveMaximum:s,exclusiveMinimum:u,isInt:l}=nC(e);n.type=l?"integer":"number";let c="number"==typeof u&&u>=(i??-1/0),d="number"==typeof s&&s<=(o??1/0),f="draft-04"===t.target||"openapi-3.0"===t.target;if(c?f?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:"number"==typeof i&&(n.minimum=i),d?f?(n.maximum=s,n.exclusiveMaximum=!0):n.exclusiveMaximum=s:"number"==typeof o&&(n.maximum=o),a){let i=new Set;for(let o of a)Number.isFinite(o)&&0!==o?i.add(Math.abs(o)):ng(e,t,n,r,`A multipleOf divisor of ${o} cannot be represented in JSON Schema`);let[o,...s]=i;void 0!==o&&(n.multipleOf=o),s.length&&(n.allOf=[...n.allOf??[],...s.map(e=>({multipleOf:e}))])}})(e,t,n,r),e.isFinite=!0},X({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=nC(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=nC(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=nC(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>nC(e).format??null},{gt(e,t){return this.check(ns(e,t))},gte(e,t){return this.check(nu(e,t))},min(e,t){return this.check(nu(e,t))},lt(e,t){return this.check(no(e,t))},lte(e,t){return this.check(na(e,t))},max(e,t){return this.check(na(e,t))},int(e){return this.check(rU(e))},safe(e){return this.check(rU(e))},positive(e){return this.check(ns(0,e))},nonnegative(e){return this.check(nu(0,e))},negative(e){return this.check(no(0,e))},nonpositive(e){return this.check(na(0,e))},multipleOf(e,t){return this.check(nl(e,t))},step(e,t){return this.check(nl(e,t))},finite(){return this}})),rD=en("ZodNumberFormat",(e,t)=>{tA.init(e,t),rR.init(e,t)});function rU(e){return new rD({type:"number",check:"number_format",abort:!1,format:"safeint",...T(e)})}let rJ=en("ZodBoolean",(e,t)=>{tT.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function rM(e){return new rJ({type:"boolean",...T(e)})}let rL=en("ZodUnknown",(e,t)=>{tI.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function rW(){return new rL({type:"unknown"})}let rK=en("ZodNever",(e,t)=>{tN.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),rV=en("ZodArray",(e,t)=>{rl(),tC.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,{minimum:o,maximum:a}=nC(e);"number"==typeof o&&(n.minItems=o),"number"==typeof a&&(n.maxItems=a),n.type="array",n.items=ny(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element},{min(e,t){return this.check(nd(e,t))},nonempty(e){return this.check(nd(1,e))},max(e,t){return this.check(nc(e,t))},length(e,t){return this.check(nf(e,t))},unwrap(){return this.element}}),rB=en("ZodObject",(e,t)=>{var n;let r,i;rl(),tL.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&ng(e,t,n,r,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in n.type="object",n.properties={},o)v(n.properties,e,ny(o[e],t,{...r,path:[...r.path,"properties",e]}));let a=[];for(let e of Object.keys(o)){let n=i.shape[e];("input"===t.io?void 0===function e(t){let n=t._zod.def;return"pipe"===n.type&&n.in._zod.traits.has("$ZodTransform")?e(n.out):"catch"===n.type?e(n.innerType):t._zod.optin}(n):void 0===n._zod.optout)&&a.push(e)}a.length>0&&(n.required=a),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=ny(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),n="shape",(i=n in(r=Object.getPrototypeOf(e))?void 0:r)&&Object.defineProperty(i,n,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:!1,value:void 0};return Object.defineProperty(this,n,e),e.value=(e=>e._zod.def.shape)(this),Object.defineProperty(this,n,e),e.value},set(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!1,value:e})}})},{keyof(){return rY(Object.keys(this._zod.def.shape))},catchall(e){return this.clone($(this._zod.def,{catchall:e}))},passthrough(){return this.clone($(this._zod.def,{catchall:rW()}))},loose(){return this.clone($(this._zod.def,{catchall:rW()}))},strict(){return this.clone($(this._zod.def,{catchall:new rK({type:"never",...T(void 0)})}))},strip(){return this.clone($(this._zod.def,{catchall:void 0}))},extend(e){if(!P(e))throw Error("Invalid input to extend: expected a plain object");let t=this._zod.def.checks;if(t&&t.length>0){let t=b(this);for(let n of Reflect.ownKeys(e))if(void 0!==Object.getOwnPropertyDescriptor(t,n))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return A(this,$(this._zod.def,{shape:R(this,e)}))},safeExtend(e){if(!P(e))throw Error("Invalid input to safeExtend: expected a plain object");return A(this,$(this._zod.def,{shape:R(this,e)}))},merge(e){if(!e?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(this._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let t={};return k(t,this,Reflect.ownKeys(b(this))),k(t,e,Reflect.ownKeys(b(e))),A(this,$(this._zod.def,{shape:t,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]}))},pick(e){return function(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");let i={};return k(i,e,C(e,t)),A(e,$(n,{shape:i,checks:[]}))}(this,e)},omit(e){return function(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");let i=new Set(C(e,t)),o={};return k(o,e,Reflect.ownKeys(b(e)).filter(e=>!i.has(e))),A(e,$(n,{shape:o,checks:[]}))}(this,e)},partial(...e){return D(r0,this,e[0])},exactPartial(...e){return D(r4,this,e[0],"exactPartial")},required(...e){var t;let n,r;return n=(t=e[0])?new Set(C(this,t)):void 0,k(r={},this,Reflect.ownKeys(b(this)),(e,t)=>n&&!n.has(t)?e:new r5({type:"nonoptional",innerType:e})),A(this,$(this._zod.def,{shape:r}))}});function rq(e,t){return new rB({type:"object",shape:e??{},...T(t)})}let rG=en("ZodUnion",(e,t)=>{tK.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=!1===(i=e._zod.def).inclusive,a=i.options.map((e,n)=>ny(e,t,{...r,path:[...r.path,o?"oneOf":"anyOf",n]})),void(o?n.oneOf=a:n.anyOf=a)},e.options=t.options}),rX=en("ZodIntersection",(e,t)=>{tV.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a,s,u;return o=ny((i=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),a=ny(i.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=u=[...(s=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...s(a)?a.allOf:[a]],t.intersections.push(u))}}),rH=en("ZodEnum",(e,t)=>{tq.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t)=>{let n=p(e._zod.def.entries);if(0===n.length){t.not={};return}n.every(e=>"number"==typeof e)&&(t.type="number"),n.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=n})(e,n),e.enum=t.entries,e.options=[...e._zod.values];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 rH({...t,checks:[],...T(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 rH({...t,checks:[],...T(r),entries:i})}});function rY(e,t){return new rH({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...T(t)})}let rQ=en("ZodTransform",(e,t)=>{rl(),tG.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{ng(e,t,n,r,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new ei(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(q(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=n.value),r.inst??(r.inst=e),n.issues.push(q(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),r0=en("ZodOptional",(e,t)=>{tH.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nL(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function r1(e){return new r0({type:"optional",innerType:e})}let r4=en("ZodExactOptional",(e,t)=>{tY.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nL(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),r9=en("ZodNullable",(e,t)=>{tQ.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=ny((i=e._zod.def).innerType,t,r),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function r2(e){return new r9({type:"nullable",innerType:e})}let r6=en("ZodDefault",(e,t)=>{t0.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o;return ny((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,void((o=nM(i.defaultValue,e,t,n,r))!==nJ&&(n.default=o))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),r3=en("ZodPrefault",(e,t)=>{t4.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(ny(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let o=nM(i.defaultValue,e,t,n,r);o!==nJ&&(n._prefault=o)})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),r5=en("ZodNonOptional",(e,t)=>{t9.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;ny((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),r8=en("ZodCatch",(e,t)=>{t3.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i,o=e._zod.def;ny(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{ng(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),r7=en("ZodPipe",(e,t)=>{t5.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(ny(a="input"===t.io?o?i.out:i.in:i.out,t,r),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function ie(e,t){return new r7({type:"pipe",in:e,out:t})}let it=en("ZodReadonly",(e,t)=>{t7.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;ny((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),ir=en("ZodCustom",(e,t)=>{nt.init(e,t),rc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{ng(e,t,n,r,"Custom types cannot be represented in JSON Schema")}}),ii=rq({screen:rp(),ajaxUrl:rp(),statusAction:rp(),statusNonce:rp(),app:rp(),pollInterval:new rR(ni({type:"number",coerce:!0,checks:[],...T(void 0)})),nextUrl:rp(),agentUrl:rp(),strings:rq({copy:rp(),copied:rp(),connected:rp(),checking:rp(),statusUnavailable:rp(),unavailable:rp(),unavailableFinal:rp(),forbidden:rp()}).strict()}).strict(),io=rq({success:rM(),data:rq({connected:rM()}).strict()}).strict();if(rY(["connected","waiting","forbidden","unavailable"]),"u">typeof window){let e=ii.safeParse(window.AutomatorSetupWizard);e.success&&function(e){let t=e.strings;document.addEventListener("click",e=>{if(!(e.target instanceof Element))return;let t=e.target.closest("[data-waiting-url]"),n=t?.getAttribute("data-waiting-url");n&&window.setTimeout(()=>window.location.assign(n),50)});let n=document.querySelector("[data-connection-pill]"),r=n?.querySelector("[data-connection-pill-text]"),i=document.querySelector("[data-connection-retry]"),o=document.querySelector("[data-connection-reload]"),a=document.querySelector("[data-connection-help]"),s=document.querySelector("[data-connection-help-container]"),u=document.querySelector("[data-connection-wait-note]");if(n&&r&&i&&o&&a&&s&&u&&"waiting"===e.screen&&e.ajaxUrl){let l,c=r.textContent,d=Math.max(1e3,e.pollInterval||3e3),f=!1,p=!1,h=!1,m=d,g=0,y=e=>{if(n.classList.remove("automator-setup-wizard__pill--wait"),r.textContent=t.statusUnavailable,u.hidden=!0,s.hidden=!1,i.hidden=e,o.hidden=!1,e){p=!0,a.textContent=t.forbidden;return}g+=1,a.textContent=(p=g>3)?t.unavailableFinal:t.unavailable},v=async()=>{if(f||p||h)return;window.clearTimeout(l),h=!0;let i=new URLSearchParams;i.append("action",e.statusAction),i.append("nonce",e.statusNonce),i.append("app",e.app);let o=new AbortController,a=window.setTimeout(()=>o.abort(),3e4);try{let a=await window.fetch(e.ajaxUrl,{method:"POST",credentials:"same-origin",body:i,signal:o.signal}),l=a.ok?await a.json():null,d=function(e,t){if(403===e)return"forbidden";if(e<200||e>=300)return"unavailable";let n=io.safeParse(t);return n.success&&n.data.success?n.data.data.connected?"connected":"waiting":"unavailable"}(a.status,l);"connected"===d?(f=!0,n.classList.remove("automator-setup-wizard__pill--wait"),n.classList.add("automator-setup-wizard__pill--ok"),r.textContent=t.connected,s.hidden=!0,u.hidden=!1,window.setTimeout(()=>window.location.assign(e.nextUrl),1400)):"waiting"===d?(g=0,r.textContent=c,n.classList.add("automator-setup-wizard__pill--wait"),s.hidden=!0,u.hidden=!1):y("forbidden"===d)}catch{y(!1)}finally{window.clearTimeout(a),h=!1,window.clearTimeout(l),f||p||"visible"!==document.visibilityState||(l=window.setTimeout(v,m),m=Math.min(3e4,Math.round(1.5*m)))}};i.addEventListener("click",()=>{p=!1,g=0,m=d,i.hidden=!0,a.textContent=t.checking,v()}),document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState?(m=d,v()):window.clearTimeout(l)}),v()}let l=e=>navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e):new Promise((t,n)=>{let r=document.createElement("textarea");r.value=e,r.setAttribute("readonly",""),r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();try{document.execCommand("copy"),t()}catch(e){n(e)}document.body.removeChild(r)});document.addEventListener("click",n=>{if(!(n.target instanceof Element))return;let r=n.target.closest("[data-prompt-action]"),i=r?.closest("[data-prompt]");if(!r||!i)return;n.preventDefault();let o=i.getAttribute("data-prompt")||"";if("ask"===r.getAttribute("data-prompt-action")){let t=new URL(e.agentUrl,window.location.href);t.searchParams.set("automator_agent_prompt",o),l(o).then(()=>window.location.assign(t.toString()),()=>window.location.assign(t.toString()));return}l(o).then(()=>{let e=r.textContent;r.textContent=t.copied,r.setAttribute("data-copied","true"),window.setTimeout(()=>{r.textContent=e,r.removeAttribute("data-copied")},2e3)})})}(e.data)}})();
Save File
Cancel