@platforma-sdk/ui-vue 1.9.3 → 1.10.0
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/CHANGELOG.md +8 -0
- package/dist/lib.js +1 -1
- package/dist/lib.umd.cjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/lib.js
CHANGED
|
@@ -3371,7 +3371,7 @@ function H1(t) {
|
|
|
3371
3371
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
3372
3372
|
throw new Error("Can't get platforma instance.");
|
|
3373
3373
|
}
|
|
3374
|
-
const j1 = "1.
|
|
3374
|
+
const j1 = "1.10.0";
|
|
3375
3375
|
function q1() {
|
|
3376
3376
|
return H1({ sdkVersion: j1 });
|
|
3377
3377
|
}
|
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(D,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@ag-grid-enterprise/core"),require("@ag-grid-community/core"),require("@ag-grid-community/client-side-row-model"),require("@ag-grid-community/infinite-row-model"),require("@ag-grid-enterprise/server-side-row-model"),require("@ag-grid-community/csv-export"),require("@ag-grid-enterprise/clipboard"),require("@ag-grid-enterprise/range-selection"),require("@ag-grid-enterprise/rich-select"),require("@ag-grid-enterprise/menu"),require("@ag-grid-enterprise/excel-export"),require("@ag-grid-community/theming"),require("@ag-grid-community/vue3")):typeof define=="function"&&define.amd?define(["exports","vue","@ag-grid-enterprise/core","@ag-grid-community/core","@ag-grid-community/client-side-row-model","@ag-grid-community/infinite-row-model","@ag-grid-enterprise/server-side-row-model","@ag-grid-community/csv-export","@ag-grid-enterprise/clipboard","@ag-grid-enterprise/range-selection","@ag-grid-enterprise/rich-select","@ag-grid-enterprise/menu","@ag-grid-enterprise/excel-export","@ag-grid-community/theming","@ag-grid-community/vue3"],r):(D=typeof globalThis<"u"?globalThis:D||self,r(D.SdkVueLib={},D.Vue,D.core$1,D.core,D.clientSideRowModel,D.infiniteRowModel,D.serverSideRowModel,D.csvExport,D.clipboard,D.rangeSelection,D.richSelect,D.menu,D.excelExport,D.theming,D.vue3))})(this,function(D,r,Re,b,Ko,$f,nd,Uf,rd,id,Wf,Hf,jf,qf,Kf){"use strict";var DF=Object.defineProperty;var Gf=D=>{throw TypeError(D)};var FF=(D,r,Re)=>r in D?DF(D,r,{enumerable:!0,configurable:!0,writable:!0,value:Re}):D[r]=Re;var Ge=(D,r,Re)=>FF(D,typeof r!="symbol"?r+"":r,Re),Jc=(D,r,Re)=>r.has(D)||Gf("Cannot "+Re);var w=(D,r,Re)=>(Jc(D,r,"read from private field"),Re?Re.call(D):r.get(D)),Le=(D,r,Re)=>r.has(D)?Gf("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(D):r.set(D,Re),he=(D,r,Re,b)=>(Jc(D,r,"write to private field"),b?b.call(D,Re):r.set(D,Re),Re),ae=(D,r,Re)=>(Jc(D,r,"access private method"),Re);var va=(D,r,Re,b)=>({set _(Ko){he(D,r,Ko,Re)},get _(){return w(D,r,b)}});var op,ci,sp,ap,cn,Mt,dn,un,di,ui,ot,pn,rt,We,we,bt,It,yt,ct,hn,dt,fn,mn,Lt,gn,hr,xt,ee,Xc,Rr,Ln,bo,Ot,Zf,Mr,pi,xo,xr,kr,Qc,_a,Ca,je,ed,qo,Sr,td;function Yf(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function Jf(t){return t!==null&&typeof t=="object"}function Nn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Nn(t[n]);return e}else if(Jf(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Nn(t[n])}),e}else return t}function wa(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function Xf(t){let e=0n,n;return async function(...i){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...i);return n=l,{ok:!0,value:await l}}}var Ai=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var em=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((s,l,c)=>`${s}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((i,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return i;const l=i.length===0?"":",";return`${i}${l}${t(s)}:${t(e[s])}`},"")}}`};const Pi=Qf(em);class ba extends Error{}class xa extends Error{constructor(e){super(e.join(`
|
|
2
2
|
`)),this.errors=e}toString(){return this.errors.join(`
|
|
3
|
-
`)}}function tm(t){return{ok:!0,value:t}}function od(t){if(!t)throw new ba;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function sd(t){return{value:t,errors:void 0}}function nm(t){if(t.errors)throw new xa(t.errors);if(!t.value)throw new ba;return t.value}function rm(t){return t!==void 0}function ka(t,e){return Pi(t)===Pi(e)}const Sa=t=>t,Ea=t=>t instanceof Error?t:Error(String(t)),Ta=t=>t.name==="ZodError",Ba=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),i=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(i).join("; ")};function Aa(t){const e=t.validate??Sa,{autoSave:n}=t,i=r.ref(),s=r.ref(),l=F=>{s.value={model:Nn(F)}};r.watch(()=>t.get(),F=>l(F),{immediate:!0});const c=()=>{var F;t.onSave(e(Nn((F=s.value)==null?void 0:F.model)))},u=()=>{l(t.get()),i.value=void 0},p=F=>{const T=Ea(F);Ta(T)?i.value=Error(Ba(T)):i.value=T},f=F=>{i.value=void 0;try{e(F),n&&c()}catch(T){p(T)}},m=r.computed({get:()=>{var F;return(F=s.value)==null?void 0:F.model},set(F){l(F),f(F)}});r.watch(s,(F,T)=>{F&&F===T&&f(F.model)},{deep:!0});const v=r.computed(()=>!i.value),k=r.computed(()=>!ka(t.get(),r.unref(s))),S=r.computed(()=>i.value?i.value.message:"");return r.reactive({model:m,valid:v,isChanged:k,error:i,errorString:S,save:c,revert:u,setError:p})}function im(t,e){const n=t.validate??Sa,{autoSave:i}=t,s=r.ref(),l=r.ref(),c=T=>{l.value={model:Object.assign(Nn(T),e??{}),stage:Symbol()}};r.watch(()=>t.get(),T=>c(T),{immediate:!0});const u=()=>{var T;t.onSave(n(Nn((T=l.value)==null?void 0:T.model)))},p=()=>{c(t.get()),s.value=void 0},f=T=>{const N=Ea(T);Ta(N)?s.value=Error(Ba(N)):s.value=N},m=T=>{s.value=void 0;try{n(T),i&&u()}catch(N){f(N)}},v=r.computed({get:()=>{var T;return(T=l.value)==null?void 0:T.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:v.value.args,ui:v.value.ui}),()=>{var T;return(T=l.value)==null?void 0:T.stage}],([T,N],[C,I])=>{N===I&&m(T)},{deep:!0});const k=r.computed(()=>!s.value),S=r.computed(()=>{var C;const{args:T,ui:N}=((C=r.unref(l))==null?void 0:C.model)??{};return!ka(t.get(),{args:T,ui:N})}),F=r.computed(()=>s.value?s.value.message:"");return r.reactive({model:v,valid:k,isChanged:S,error:s,errorString:F,save:u,revert:p,setError:f})}const om=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function sm(t,e){const i=wa(e.setBlockArgs,100),s=wa(e.setBlockUiState,100),l=wa(e.setBlockArgsAndUiState,100),c=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async T=>{T.forEach(N=>{N.key==="args"&&(c.args=Object.freeze(N.value)),N.key==="ui"&&(c.ui=Object.freeze(N.value)),N.key==="outputs"&&(c.outputs=Object.freeze(N.value)),N.key==="navigationState"&&(c.navigationState=Object.freeze(N.value))}),await r.nextTick()});const u=()=>Nn(c.args),p=()=>Nn(c.ui),f=()=>Nn(c.navigationState),m={createArgsModel(T={}){return Aa({get(){return T.transform?T.transform(c.args):c.args},validate:T.validate,autoSave:!0,onSave(N){i(N)}})},createUiModel(T={},N){return Aa({get(){return T.transform?T.transform(c.ui):c.ui??N()},validate:T.validate,autoSave:!0,onSave(C){s(C)}})},useOutputs(...T){const N=r.reactive({errors:void 0,value:void 0});return r.watch(()=>c.outputs,()=>{try{Object.assign(N,{value:this.unwrapOutputs(...T),errors:void 0})}catch(C){Object.assign(N,{value:void 0,errors:[String(C)]})}},{immediate:!0,deep:!0}),N},unwrapOutputs(...T){const N=c.outputs,C=T.map(I=>[I,od(N[I])]);return Object.fromEntries(C)},getOutputField(T){return c.outputs[T]},getOutputFieldOkOptional(T){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const N=this.getOutputField(T);if(N&&N.ok)return N.value},getOutputFieldErrorsOptional(T){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const N=this.getOutputField(T);if(N&&!N.ok)return N.errors},updateArgs(T){const N=u();return T(N),e.setBlockArgs(N)},updateUiState(T){const N=p();return e.setBlockUiState(T(N))},updateNavigationState(T){const N=f();return T(N),e.setNavigationState(N)},navigateTo(T){const N=f();return N.href=T,e.setNavigationState(N)}},v=r.computed(()=>{const T=Object.entries(c.outputs).map(([N,C])=>[N,C.ok&&C.value!==void 0?C.value:void 0]);return Object.fromEntries(T)}),k=r.computed(()=>{const T=Object.entries(c.outputs).map(([N,C])=>[N,C&&!C.ok?new xa(C.errors):void 0]);return Object.fromEntries(T)}),S={snapshot:c,queryParams:r.computed(()=>om(c.navigationState.href)),href:r.computed(()=>c.navigationState.href),hasErrors:r.computed(()=>Object.values(c.outputs).some(T=>!(T!=null&&T.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),v.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),k.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),c.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),c.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),c.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),c.navigationState))},F=im({get(){return{args:c.args,ui:c.ui}},autoSave:!0,onSave(T){l(T.args,T.ui)}},{outputs:v,outputErrors:k});return r.reactive(Object.assign(F,m,S))}var Me;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Me||(Me={}));var Pa;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Pa||(Pa={}));const ie=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kn=t=>{switch(typeof t){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return isNaN(t)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":return Array.isArray(t)?ie.array:t===null?ie.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ie.promise:typeof Map<"u"&&t instanceof Map?ie.map:typeof Set<"u"&&t instanceof Set?ie.set:typeof Date<"u"&&t instanceof Date?ie.date:ie.object;default:return ie.unknown}},J=Me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),am=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ft extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},i={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let u=i,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof Ft))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Ft.create=t=>new Ft(t);const qr=(t,e)=>{let n;switch(t.code){case J.invalid_type:t.received===ie.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Me.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(t.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(t.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(t.options)}, received '${t.received}'`;break;case J.invalid_arguments:n="Invalid function arguments";break;case J.invalid_return_type:n="Invalid function return type";break;case J.invalid_date:n="Invalid date";break;case J.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Me.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case J.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case J.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case J.custom:n="Invalid input";break;case J.invalid_intersection_types:n="Intersection results could not be merged";break;case J.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case J.not_finite:n="Number must be finite";break;default:n=e.defaultError,Me.assertNever(t)}return{message:n}};let ad=qr;function lm(t){ad=t}function Yo(){return ad}const Jo=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},cm=[];function ne(t,e){const n=Yo(),i=Jo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===qr?void 0:qr].filter(s=>!!s)});t.common.issues.push(i)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return ft.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return _e;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const _e=Object.freeze({status:"aborted"}),Kr=t=>({status:"dirty",value:t}),Ct=t=>({status:"valid",value:t}),Va=t=>t.status==="aborted",Na=t=>t.status==="dirty",Vi=t=>t.status==="valid",Ni=t=>typeof Promise<"u"&&t instanceof Promise;function Xo(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ld(t,e,n,i,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var ce;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ce||(ce={}));var Di,Fi;class xn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const cd=(t,e)=>{if(Vi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ft(t.common.issues);return this._error=n,this._error}}};function Se(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(c,u)=>{var p,f;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??i)!==null&&p!==void 0?p:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class Be{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Kn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ni(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kn(e)},l=this._parseSync({data:e,path:s.path,parent:s});return cd(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kn(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(Ni(s)?s:Promise.resolve(s));return cd(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:J.custom,...i(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new on({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Sn.create(this,this._def)}nullable(){return Qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rn.create(this,this._def)}promise(){return Qr.create(this,this._def)}or(e){return Li.create([this,e],this._def)}and(e){return Oi.create(this,e,this._def)}transform(e){return new on({...Se(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ui({...Se(this._def),innerType:this,defaultValue:n,typeName:ge.ZodDefault})}brand(){return new Ra({typeName:ge.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Wi({...Se(this._def),innerType:this,catchValue:n,typeName:ge.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Hi.create(this,e)}readonly(){return ji.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dm=/^c[^\s-]{8,}$/i,um=/^[0-9a-z]+$/,pm=/^[0-9A-HJKMNP-TV-Z]{26}$/,hm=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,fm=/^[a-z0-9_-]{21}$/i,mm=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,gm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ym="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Da;const vm=/^(?:(?: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])$/,_m=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Cm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dd="((\\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])))",wm=new RegExp(`^${dd}$`);function ud(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function bm(t){return new RegExp(`^${ud(t)}$`)}function pd(t){let e=`${dd}T${ud(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function xm(t,e){return!!((e==="v4"||!e)&&vm.test(t)||(e==="v6"||!e)&&_m.test(t))}class nn extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ie.string){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.string,received:l.parsedType}),_e}const i=new ft;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,u=e.data.length<l.value;(c||u)&&(s=this._getOrReturnCtx(e,s),c?ne(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ne(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),i.dirty())}else if(l.kind==="email")gm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"email",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="emoji")Da||(Da=new RegExp(ym,"u")),Da.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"emoji",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="uuid")hm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"uuid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="nanoid")fm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"nanoid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid")dm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid2")um.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid2",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="ulid")pm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ulid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ne(s,{validation:"url",code:J.invalid_string,message:l.message}),i.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"regex",code:J.invalid_string,message:l.message}),i.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),i.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{startsWith:l.value},message:l.message}),i.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{endsWith:l.value},message:l.message}),i.dirty()):l.kind==="datetime"?pd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"datetime",message:l.message}),i.dirty()):l.kind==="date"?wm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"date",message:l.message}),i.dirty()):l.kind==="time"?bm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"time",message:l.message}),i.dirty()):l.kind==="duration"?mm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"duration",code:J.invalid_string,message:l.message}),i.dirty()):l.kind==="ip"?xm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ip",code:J.invalid_string,message:l.message}),i.dirty()):l.kind==="base64"?Cm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"base64",code:J.invalid_string,message:l.message}),i.dirty()):Me.assertNever(l);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:J.invalid_string,...ce.errToObj(i)})}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ce.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ce.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ce.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ce.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ce.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ce.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ce.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ce.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ce.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ce.errToObj(e)})}datetime(e){var n,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...ce.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ce.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ce.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ce.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ce.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ce.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ce.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ce.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ce.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ce.errToObj(n)})}nonempty(e){return this.min(1,ce.errToObj(e))}trim(){return new nn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new nn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new nn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}nn.create=t=>{var e;return new nn({checks:[],typeName:ge.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function km(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class Yn extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ie.number){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.number,received:l.parsedType}),_e}let i;const s=new ft;for(const l of this._def.checks)l.kind==="int"?Me.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:J.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?km(e.data,l.value)!==0&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_finite,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,i,s){return new Yn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ce.toString(s)}]})}_addCheck(e){return new Yn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ce.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ce.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Me.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Yn.create=t=>new Yn({checks:[],typeName:ge.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Jn extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ie.bigint){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.bigint,received:l.parsedType}),_e}let i;const s=new ft;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,i,s){return new Jn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ce.toString(s)}]})}_addCheck(e){return new Jn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Jn.create=t=>{var e;return new Jn({checks:[],typeName:ge.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};class Ri extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ie.boolean){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.boolean,received:i.parsedType}),_e}return Ct(e.data)}}Ri.create=t=>new Ri({typeName:ge.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Er extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ie.date){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.date,received:l.parsedType}),_e}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_date}),_e}const i=new ft;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),i.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),i.dirty()):Me.assertNever(l);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ce.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ce.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Er.create=t=>new Er({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ge.ZodDate,...Se(t)});class Qo extends Be{_parse(e){if(this._getType(e)!==ie.symbol){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.symbol,received:i.parsedType}),_e}return Ct(e.data)}}Qo.create=t=>new Qo({typeName:ge.ZodSymbol,...Se(t)});class Mi extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.undefined,received:i.parsedType}),_e}return Ct(e.data)}}Mi.create=t=>new Mi({typeName:ge.ZodUndefined,...Se(t)});class Ii extends Be{_parse(e){if(this._getType(e)!==ie.null){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.null,received:i.parsedType}),_e}return Ct(e.data)}}Ii.create=t=>new Ii({typeName:ge.ZodNull,...Se(t)});class Yr extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return Ct(e.data)}}Yr.create=t=>new Yr({typeName:ge.ZodAny,...Se(t)});class Tr extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ct(e.data)}}Tr.create=t=>new Tr({typeName:ge.ZodUnknown,...Se(t)});class Dn extends Be{_parse(e){const n=this._getOrReturnCtx(e);return ne(n,{code:J.invalid_type,expected:ie.never,received:n.parsedType}),_e}}Dn.create=t=>new Dn({typeName:ge.ZodNever,...Se(t)});class es extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.void,received:i.parsedType}),_e}return Ct(e.data)}}es.create=t=>new es({typeName:ge.ZodVoid,...Se(t)});class rn extends Be{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==ie.array)return ne(n,{code:J.invalid_type,expected:ie.array,received:n.parsedType}),_e;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ne(n,{code:c?J.too_big:J.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ne(n,{code:J.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ne(n,{code:J.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new xn(n,c,n.path,u)))).then(c=>ft.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new xn(n,c,n.path,u)));return ft.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new rn({...this._def,minLength:{value:e,message:ce.toString(n)}})}max(e,n){return new rn({...this._def,maxLength:{value:e,message:ce.toString(n)}})}length(e,n){return new rn({...this._def,exactLength:{value:e,message:ce.toString(n)}})}nonempty(e){return this.min(1,e)}}rn.create=(t,e)=>new rn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...Se(e)});function Jr(t){if(t instanceof Ke){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Sn.create(Jr(i))}return new Ke({...t._def,shape:()=>e})}else return t instanceof rn?new rn({...t._def,type:Jr(t.element)}):t instanceof Sn?Sn.create(Jr(t.unwrap())):t instanceof Qn?Qn.create(Jr(t.unwrap())):t instanceof kn?kn.create(t.items.map(e=>Jr(e))):t}class Ke extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Me.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ie.object){const f=this._getOrReturnCtx(e);return ne(f,{code:J.invalid_type,expected:ie.object,received:f.parsedType}),_e}const{status:i,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Dn&&this._def.unknownKeys==="strip"))for(const f in s.data)c.includes(f)||u.push(f);const p=[];for(const f of c){const m=l[f],v=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new xn(s,v,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Dn){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ne(s,{code:J.unrecognized_keys,keys:u}),i.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const v=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new xn(s,v,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const v=await m.key,k=await m.value;f.push({key:v,value:k,alwaysSet:m.alwaysSet})}return f}).then(f=>ft.mergeObjectSync(i,f)):ft.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return ce.errToObj,new Ke({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=ce.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Ke({...this._def,unknownKeys:"strip"})}passthrough(){return new Ke({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ke({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ke({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ge.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ke({...this._def,catchall:e})}pick(e){const n={};return Me.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Ke({...this._def,shape:()=>n})}omit(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Ke({...this._def,shape:()=>n})}deepPartial(){return Jr(this)}partial(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Ke({...this._def,shape:()=>n})}required(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let l=this.shape[i];for(;l instanceof Sn;)l=l._def.innerType;n[i]=l}}),new Ke({...this._def,shape:()=>n})}keyof(){return hd(Me.objectKeys(this.shape))}}Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)}),Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)}),Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)});class Li extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new Ft(u.ctx.common.issues));return ne(n,{code:J.invalid_union,unionErrors:c}),_e}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of i){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new Ft(p));return ne(n,{code:J.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}Li.create=(t,e)=>new Li({options:t,typeName:ge.ZodUnion,...Se(e)});const Fn=t=>t instanceof zi?Fn(t.schema):t instanceof on?Fn(t.innerType()):t instanceof Zi?[t.value]:t instanceof Xn?t.options:t instanceof $i?Me.objectValues(t.enum):t instanceof Ui?Fn(t._def.innerType):t instanceof Mi?[void 0]:t instanceof Ii?[null]:t instanceof Sn?[void 0,...Fn(t.unwrap())]:t instanceof Qn?[null,...Fn(t.unwrap())]:t instanceof Ra||t instanceof ji?Fn(t.unwrap()):t instanceof Wi?Fn(t._def.innerType):[];class ts extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.object)return ne(n,{code:J.invalid_type,expected:ie.object,received:n.parsedType}),_e;const i=this.discriminator,s=n.data[i],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ne(n,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=Fn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new ts({typeName:ge.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(i)})}}function Fa(t,e){const n=Kn(t),i=Kn(e);if(t===e)return{valid:!0,data:t};if(n===ie.object&&i===ie.object){const s=Me.objectKeys(e),l=Me.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Fa(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===ie.array&&i===ie.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=Fa(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ie.date&&i===ie.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Oi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(Va(l)||Va(c))return _e;const u=Fa(l.value,c.value);return u.valid?((Na(l)||Na(c))&&n.dirty(),{status:n.value,value:u.data}):(ne(i,{code:J.invalid_intersection_types}),_e)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Oi.create=(t,e,n)=>new Oi({left:t,right:e,typeName:ge.ZodIntersection,...Se(n)});class kn extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.array)return ne(i,{code:J.invalid_type,expected:ie.array,received:i.parsedType}),_e;if(i.data.length<this._def.items.length)return ne(i,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&i.data.length>this._def.items.length&&(ne(i,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...i.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new xn(i,c,i.path,u)):null}).filter(c=>!!c);return i.common.async?Promise.all(l).then(c=>ft.mergeArray(n,c)):ft.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new kn({...this._def,rest:e})}}kn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new kn({items:t,typeName:ge.ZodTuple,rest:null,...Se(e)})};class Gi extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.object)return ne(i,{code:J.invalid_type,expected:ie.object,received:i.parsedType}),_e;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new xn(i,u,i.path,u)),value:c._parse(new xn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?ft.mergeObjectAsync(n,s):ft.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Be?new Gi({keyType:e,valueType:n,typeName:ge.ZodRecord,...Se(i)}):new Gi({keyType:nn.create(),valueType:e,typeName:ge.ZodRecord,...Se(n)})}}class ns extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.map)return ne(i,{code:J.invalid_type,expected:ie.map,received:i.parsedType}),_e;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new xn(i,u,i.path,[f,"key"])),value:l._parse(new xn(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}ns.create=(t,e,n)=>new ns({valueType:e,keyType:t,typeName:ge.ZodMap,...Se(n)});class Br extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.set)return ne(i,{code:J.invalid_type,expected:ie.set,received:i.parsedType}),_e;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(ne(i,{code:J.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(ne(i,{code:J.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return _e;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new xn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Br({...this._def,minSize:{value:e,message:ce.toString(n)}})}max(e,n){return new Br({...this._def,maxSize:{value:e,message:ce.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Br.create=(t,e)=>new Br({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...Se(e)});class Xr extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.function)return ne(n,{code:J.invalid_type,expected:ie.function,received:n.parsedType}),_e;function i(u,p){return Jo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yo(),qr].filter(f=>!!f),issueData:{code:J.invalid_arguments,argumentsError:p}})}function s(u,p){return Jo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yo(),qr].filter(f=>!!f),issueData:{code:J.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof Qr){const u=this;return Ct(async function(...p){const f=new Ft([]),m=await u._def.args.parseAsync(p,l).catch(S=>{throw f.addIssue(i(p,S)),f}),v=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(v,l).catch(S=>{throw f.addIssue(s(v,S)),f})})}else{const u=this;return Ct(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ft([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),v=u._def.returns.safeParse(m,l);if(!v.success)throw new Ft([s(m,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xr({...this._def,args:kn.create(e).rest(Tr.create())})}returns(e){return new Xr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new Xr({args:e||kn.create([]).rest(Tr.create()),returns:n||Tr.create(),typeName:ge.ZodFunction,...Se(i)})}}class zi extends Be{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}zi.create=(t,e)=>new zi({getter:t,typeName:ge.ZodLazy,...Se(e)});class Zi extends Be{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ne(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}Zi.create=(t,e)=>new Zi({value:t,typeName:ge.ZodLiteral,...Se(e)});function hd(t,e){return new Xn({values:t,typeName:ge.ZodEnum,...Se(e)})}class Xn extends Be{constructor(){super(...arguments),Di.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{expected:Me.joinValues(i),received:n.parsedType,code:J.invalid_type}),_e}if(Xo(this,Di)||ld(this,Di,new Set(this._def.values)),!Xo(this,Di).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{received:n.data,code:J.invalid_enum_value,options:i}),_e}return Ct(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Xn.create(e,{...this._def,...n})}exclude(e,n=this._def){return Xn.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}Di=new WeakMap,Xn.create=hd;class $i extends Be{constructor(){super(...arguments),Fi.set(this,void 0)}_parse(e){const n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==ie.string&&i.parsedType!==ie.number){const s=Me.objectValues(n);return ne(i,{expected:Me.joinValues(s),received:i.parsedType,code:J.invalid_type}),_e}if(Xo(this,Fi)||ld(this,Fi,new Set(Me.getValidEnumValues(this._def.values))),!Xo(this,Fi).has(e.data)){const s=Me.objectValues(n);return ne(i,{received:i.data,code:J.invalid_enum_value,options:s}),_e}return Ct(e.data)}get enum(){return this._def.values}}Fi=new WeakMap,$i.create=(t,e)=>new $i({values:t,typeName:ge.ZodNativeEnum,...Se(e)});class Qr extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.promise&&n.common.async===!1)return ne(n,{code:J.invalid_type,expected:ie.promise,received:n.parsedType}),_e;const i=n.parsedType===ie.promise?n.data:Promise.resolve(n.data);return Ct(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Qr.create=(t,e)=>new Qr({type:t,typeName:ge.ZodPromise,...Se(e)});class on extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ne(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return _e;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?_e:p.status==="dirty"||n.value==="dirty"?Kr(p.value):p});{if(n.value==="aborted")return _e;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?_e:u.status==="dirty"||n.value==="dirty"?Kr(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Vi(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>Vi(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Me.assertNever(s)}}on.create=(t,e,n)=>new on({schema:t,typeName:ge.ZodEffects,effect:e,...Se(n)}),on.createWithPreprocess=(t,e,n)=>new on({schema:e,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...Se(n)});class Sn extends Be{_parse(e){return this._getType(e)===ie.undefined?Ct(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Sn.create=(t,e)=>new Sn({innerType:t,typeName:ge.ZodOptional,...Se(e)});class Qn extends Be{_parse(e){return this._getType(e)===ie.null?Ct(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Qn.create=(t,e)=>new Qn({innerType:t,typeName:ge.ZodNullable,...Se(e)});class Ui extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===ie.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ui.create=(t,e)=>new Ui({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class Wi extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ni(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Wi.create=(t,e)=>new Wi({innerType:t,typeName:ge.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class rs extends Be{_parse(e){if(this._getType(e)!==ie.nan){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.nan,received:i.parsedType}),_e}return{status:"valid",value:e.data}}}rs.create=t=>new rs({typeName:ge.ZodNaN,...Se(t)});const Sm=Symbol("zod_brand");class Ra extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class Hi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?_e:l.status==="dirty"?(n.dirty(),Kr(l.value)):this._def.out._parseAsync({data:l.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?_e:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new Hi({in:e,out:n,typeName:ge.ZodPipeline})}}class ji extends Be{_parse(e){const n=this._def.innerType._parse(e),i=s=>(Vi(s)&&(s.value=Object.freeze(s.value)),s);return Ni(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}ji.create=(t,e)=>new ji({innerType:t,typeName:ge.ZodReadonly,...Se(e)});function fd(t,e={},n){return t?Yr.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):Yr.create()}const Em={object:Ke.lazycreate};var ge;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ge||(ge={}));const Tm=(t,e={message:`Input not instance of ${t.name}`})=>fd(n=>n instanceof t,e),md=nn.create,gd=Yn.create,Bm=rs.create,Am=Jn.create,yd=Ri.create,Pm=Er.create,Vm=Qo.create,Nm=Mi.create,Dm=Ii.create,Fm=Yr.create,Rm=Tr.create,Mm=Dn.create,Im=es.create,Lm=rn.create,Om=Ke.create,Gm=Ke.strictCreate,zm=Li.create,Zm=ts.create,$m=Oi.create,Um=kn.create,Wm=Gi.create,Hm=ns.create,jm=Br.create,qm=Xr.create,Km=zi.create,Ym=Zi.create,Jm=Xn.create,Xm=$i.create,Qm=Qr.create,vd=on.create,eg=Sn.create,tg=Qn.create,ng=on.createWithPreprocess,rg=Hi.create;var is=Object.freeze({__proto__:null,defaultErrorMap:qr,setErrorMap:lm,getErrorMap:Yo,makeIssue:Jo,EMPTY_PATH:cm,addIssueToContext:ne,ParseStatus:ft,INVALID:_e,DIRTY:Kr,OK:Ct,isAborted:Va,isDirty:Na,isValid:Vi,isAsync:Ni,get util(){return Me},get objectUtil(){return Pa},ZodParsedType:ie,getParsedType:Kn,ZodType:Be,datetimeRegex:pd,ZodString:nn,ZodNumber:Yn,ZodBigInt:Jn,ZodBoolean:Ri,ZodDate:Er,ZodSymbol:Qo,ZodUndefined:Mi,ZodNull:Ii,ZodAny:Yr,ZodUnknown:Tr,ZodNever:Dn,ZodVoid:es,ZodArray:rn,ZodObject:Ke,ZodUnion:Li,ZodDiscriminatedUnion:ts,ZodIntersection:Oi,ZodTuple:kn,ZodRecord:Gi,ZodMap:ns,ZodSet:Br,ZodFunction:Xr,ZodLazy:zi,ZodLiteral:Zi,ZodEnum:Xn,ZodNativeEnum:$i,ZodPromise:Qr,ZodEffects:on,ZodTransformer:on,ZodOptional:Sn,ZodNullable:Qn,ZodDefault:Ui,ZodCatch:Wi,ZodNaN:rs,BRAND:Sm,ZodBranded:Ra,ZodPipeline:Hi,ZodReadonly:ji,custom:fd,Schema:Be,ZodSchema:Be,late:Em,get ZodFirstPartyTypeKind(){return ge},coerce:{string:t=>nn.create({...t,coerce:!0}),number:t=>Yn.create({...t,coerce:!0}),boolean:t=>Ri.create({...t,coerce:!0}),bigint:t=>Jn.create({...t,coerce:!0}),date:t=>Er.create({...t,coerce:!0})},any:Fm,array:Lm,bigint:Am,boolean:yd,date:Pm,discriminatedUnion:Zm,effect:vd,enum:Jm,function:qm,instanceof:Tm,intersection:$m,lazy:Km,literal:Ym,map:Hm,nan:Bm,nativeEnum:Xm,never:Mm,null:Dm,nullable:tg,number:gd,object:Om,oboolean:()=>yd().optional(),onumber:()=>gd().optional(),optional:eg,ostring:()=>md().optional(),pipeline:rg,preprocess:ng,promise:Qm,record:Wm,set:jm,strictObject:Gm,string:md,symbol:Vm,transformer:vd,tuple:Um,undefined:Nm,union:zm,unknown:Rm,void:Im,NEVER:_e,ZodIssueCode:J,quotelessJson:am,ZodError:Ft});function ig(t){throw new Error("Unexpected object: "+t)}const og=-2147483648,_d=-9007199254740991n,sg=NaN,ag=NaN,lg=null,cg=null;function Cd(t,e){switch(e){case"Int":return t===og;case"Long":return t===Number(_d)||t===_d;case"Float":return t===sg;case"Double":return t===ag;case"String":return t===lg;case"Bytes":return t===cg;default:throw Error(`unsupported data type: ${e}`)}}function dg(t,e){const n=Math.floor(e/8),i=1<<7-e%8;return(t[n]&i)>0}function wd(t){const{type:e,name:n,domain:i}=t;return{type:e,name:n,...i&&{domain:i}}}function Ma(t){return t.map(wd)}function os(t,e){switch(t.type){case"column":return{type:"column",column:e(t.column)};case"inner":case"full":return{type:t.type,entries:t.entries.map(n=>os(n,e))};case"outer":return{type:"outer",primary:os(t.primary,e),secondary:t.secondary.map(n=>os(n,e))};default:ig(t)}}is.object({__isRef:is.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:is.string().describe("Upstream block id"),name:is.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function ug(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const pg="1.9.0";function hg(){return ug({sdkVersion:pg})}function fg(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function ei(t){return!!t&&typeof t.children<"u"}function er(t){return ei(t)?t.groupId:t.colId}function bd(t,e,n){const i=(c,u)=>{const p=c.children.map(er),f=b._includes(p,er(u)),m=b._last(c.children),v=m&&er(m)!==er(u);return f&&v};if(!ei(t))return!0;const s=t,l=n;if(i(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(er);if(!b._includes(c,er(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!bd(s.children[c],e,n);c--);return!1}function mg(t){const e=(s,l)=>ei(s)&&ei(l)&&er(s)===er(l),n=(s,l)=>{if(!ei(l))return s;const c=s,u=l;return u.children&&u.groupId&&bd(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},i=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):i.push(l)}return i}var gg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(ei(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new b.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const v=n(m,l+1);v&&f.push(v)}),p.setChildren(f),p}else{const c=s,u=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(u);return p||e.push(c),p}},i=[];return t.forEach(s=>{const l=n(s,0);l&&i.push(l)}),e.length>0&&b._warnOnce("unable to find grid columns for the supplied colDef(s):",e),i}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=mg(e);t(n)}getLeafPathTrees(){const t=(i,s)=>{let l;if(b.isProvidedColumnGroup(i))if(i.isPadding())l=s;else{const u=Object.assign({},i.getColGroupDef());u.groupId=i.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},i.getColDef());u.colId=i.getColId(),l=u}const c=i.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(i=>{const s=i.getColDef();return i.isPrimary()&&!s.showRowGroup}).map(i=>t(i,i.getColDef()))}};function yg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function vg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function _g(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Cg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function wg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function bg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function xg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function kg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Sg(t,e){var i;const n=(i=t.sideBarService)==null?void 0:i.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function Eg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Tg=class extends b.Component{constructor(t){super(),this.eToggleButton=b.RefPlaceholder,this.eIconWrapper=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
3
|
+
`)}}function tm(t){return{ok:!0,value:t}}function od(t){if(!t)throw new ba;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function sd(t){return{value:t,errors:void 0}}function nm(t){if(t.errors)throw new xa(t.errors);if(!t.value)throw new ba;return t.value}function rm(t){return t!==void 0}function ka(t,e){return Pi(t)===Pi(e)}const Sa=t=>t,Ea=t=>t instanceof Error?t:Error(String(t)),Ta=t=>t.name==="ZodError",Ba=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),i=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(i).join("; ")};function Aa(t){const e=t.validate??Sa,{autoSave:n}=t,i=r.ref(),s=r.ref(),l=F=>{s.value={model:Nn(F)}};r.watch(()=>t.get(),F=>l(F),{immediate:!0});const c=()=>{var F;t.onSave(e(Nn((F=s.value)==null?void 0:F.model)))},u=()=>{l(t.get()),i.value=void 0},p=F=>{const T=Ea(F);Ta(T)?i.value=Error(Ba(T)):i.value=T},f=F=>{i.value=void 0;try{e(F),n&&c()}catch(T){p(T)}},m=r.computed({get:()=>{var F;return(F=s.value)==null?void 0:F.model},set(F){l(F),f(F)}});r.watch(s,(F,T)=>{F&&F===T&&f(F.model)},{deep:!0});const v=r.computed(()=>!i.value),k=r.computed(()=>!ka(t.get(),r.unref(s))),S=r.computed(()=>i.value?i.value.message:"");return r.reactive({model:m,valid:v,isChanged:k,error:i,errorString:S,save:c,revert:u,setError:p})}function im(t,e){const n=t.validate??Sa,{autoSave:i}=t,s=r.ref(),l=r.ref(),c=T=>{l.value={model:Object.assign(Nn(T),e??{}),stage:Symbol()}};r.watch(()=>t.get(),T=>c(T),{immediate:!0});const u=()=>{var T;t.onSave(n(Nn((T=l.value)==null?void 0:T.model)))},p=()=>{c(t.get()),s.value=void 0},f=T=>{const N=Ea(T);Ta(N)?s.value=Error(Ba(N)):s.value=N},m=T=>{s.value=void 0;try{n(T),i&&u()}catch(N){f(N)}},v=r.computed({get:()=>{var T;return(T=l.value)==null?void 0:T.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:v.value.args,ui:v.value.ui}),()=>{var T;return(T=l.value)==null?void 0:T.stage}],([T,N],[C,I])=>{N===I&&m(T)},{deep:!0});const k=r.computed(()=>!s.value),S=r.computed(()=>{var C;const{args:T,ui:N}=((C=r.unref(l))==null?void 0:C.model)??{};return!ka(t.get(),{args:T,ui:N})}),F=r.computed(()=>s.value?s.value.message:"");return r.reactive({model:v,valid:k,isChanged:S,error:s,errorString:F,save:u,revert:p,setError:f})}const om=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function sm(t,e){const i=wa(e.setBlockArgs,100),s=wa(e.setBlockUiState,100),l=wa(e.setBlockArgsAndUiState,100),c=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async T=>{T.forEach(N=>{N.key==="args"&&(c.args=Object.freeze(N.value)),N.key==="ui"&&(c.ui=Object.freeze(N.value)),N.key==="outputs"&&(c.outputs=Object.freeze(N.value)),N.key==="navigationState"&&(c.navigationState=Object.freeze(N.value))}),await r.nextTick()});const u=()=>Nn(c.args),p=()=>Nn(c.ui),f=()=>Nn(c.navigationState),m={createArgsModel(T={}){return Aa({get(){return T.transform?T.transform(c.args):c.args},validate:T.validate,autoSave:!0,onSave(N){i(N)}})},createUiModel(T={},N){return Aa({get(){return T.transform?T.transform(c.ui):c.ui??N()},validate:T.validate,autoSave:!0,onSave(C){s(C)}})},useOutputs(...T){const N=r.reactive({errors:void 0,value:void 0});return r.watch(()=>c.outputs,()=>{try{Object.assign(N,{value:this.unwrapOutputs(...T),errors:void 0})}catch(C){Object.assign(N,{value:void 0,errors:[String(C)]})}},{immediate:!0,deep:!0}),N},unwrapOutputs(...T){const N=c.outputs,C=T.map(I=>[I,od(N[I])]);return Object.fromEntries(C)},getOutputField(T){return c.outputs[T]},getOutputFieldOkOptional(T){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const N=this.getOutputField(T);if(N&&N.ok)return N.value},getOutputFieldErrorsOptional(T){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const N=this.getOutputField(T);if(N&&!N.ok)return N.errors},updateArgs(T){const N=u();return T(N),e.setBlockArgs(N)},updateUiState(T){const N=p();return e.setBlockUiState(T(N))},updateNavigationState(T){const N=f();return T(N),e.setNavigationState(N)},navigateTo(T){const N=f();return N.href=T,e.setNavigationState(N)}},v=r.computed(()=>{const T=Object.entries(c.outputs).map(([N,C])=>[N,C.ok&&C.value!==void 0?C.value:void 0]);return Object.fromEntries(T)}),k=r.computed(()=>{const T=Object.entries(c.outputs).map(([N,C])=>[N,C&&!C.ok?new xa(C.errors):void 0]);return Object.fromEntries(T)}),S={snapshot:c,queryParams:r.computed(()=>om(c.navigationState.href)),href:r.computed(()=>c.navigationState.href),hasErrors:r.computed(()=>Object.values(c.outputs).some(T=>!(T!=null&&T.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),v.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),k.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),c.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),c.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),c.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),c.navigationState))},F=im({get(){return{args:c.args,ui:c.ui}},autoSave:!0,onSave(T){l(T.args,T.ui)}},{outputs:v,outputErrors:k});return r.reactive(Object.assign(F,m,S))}var Me;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Me||(Me={}));var Pa;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Pa||(Pa={}));const ie=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kn=t=>{switch(typeof t){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return isNaN(t)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":return Array.isArray(t)?ie.array:t===null?ie.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ie.promise:typeof Map<"u"&&t instanceof Map?ie.map:typeof Set<"u"&&t instanceof Set?ie.set:typeof Date<"u"&&t instanceof Date?ie.date:ie.object;default:return ie.unknown}},J=Me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),am=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ft extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},i={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let u=i,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof Ft))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Ft.create=t=>new Ft(t);const qr=(t,e)=>{let n;switch(t.code){case J.invalid_type:t.received===ie.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Me.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(t.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(t.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(t.options)}, received '${t.received}'`;break;case J.invalid_arguments:n="Invalid function arguments";break;case J.invalid_return_type:n="Invalid function return type";break;case J.invalid_date:n="Invalid date";break;case J.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Me.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case J.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case J.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case J.custom:n="Invalid input";break;case J.invalid_intersection_types:n="Intersection results could not be merged";break;case J.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case J.not_finite:n="Number must be finite";break;default:n=e.defaultError,Me.assertNever(t)}return{message:n}};let ad=qr;function lm(t){ad=t}function Yo(){return ad}const Jo=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},cm=[];function ne(t,e){const n=Yo(),i=Jo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===qr?void 0:qr].filter(s=>!!s)});t.common.issues.push(i)}class ft{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return ft.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return _e;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const _e=Object.freeze({status:"aborted"}),Kr=t=>({status:"dirty",value:t}),Ct=t=>({status:"valid",value:t}),Va=t=>t.status==="aborted",Na=t=>t.status==="dirty",Vi=t=>t.status==="valid",Ni=t=>typeof Promise<"u"&&t instanceof Promise;function Xo(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ld(t,e,n,i,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var ce;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ce||(ce={}));var Di,Fi;class xn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const cd=(t,e)=>{if(Vi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ft(t.common.issues);return this._error=n,this._error}}};function Se(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(c,u)=>{var p,f;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??i)!==null&&p!==void 0?p:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class Be{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Kn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ft,ctx:{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ni(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kn(e)},l=this._parseSync({data:e,path:s.path,parent:s});return cd(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kn(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(Ni(s)?s:Promise.resolve(s));return cd(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:J.custom,...i(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new on({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Sn.create(this,this._def)}nullable(){return Qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rn.create(this,this._def)}promise(){return Qr.create(this,this._def)}or(e){return Li.create([this,e],this._def)}and(e){return Oi.create(this,e,this._def)}transform(e){return new on({...Se(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ui({...Se(this._def),innerType:this,defaultValue:n,typeName:ge.ZodDefault})}brand(){return new Ra({typeName:ge.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Wi({...Se(this._def),innerType:this,catchValue:n,typeName:ge.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Hi.create(this,e)}readonly(){return ji.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dm=/^c[^\s-]{8,}$/i,um=/^[0-9a-z]+$/,pm=/^[0-9A-HJKMNP-TV-Z]{26}$/,hm=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,fm=/^[a-z0-9_-]{21}$/i,mm=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,gm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ym="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Da;const vm=/^(?:(?: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])$/,_m=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Cm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dd="((\\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])))",wm=new RegExp(`^${dd}$`);function ud(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function bm(t){return new RegExp(`^${ud(t)}$`)}function pd(t){let e=`${dd}T${ud(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function xm(t,e){return!!((e==="v4"||!e)&&vm.test(t)||(e==="v6"||!e)&&_m.test(t))}class nn extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ie.string){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.string,received:l.parsedType}),_e}const i=new ft;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,u=e.data.length<l.value;(c||u)&&(s=this._getOrReturnCtx(e,s),c?ne(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ne(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),i.dirty())}else if(l.kind==="email")gm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"email",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="emoji")Da||(Da=new RegExp(ym,"u")),Da.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"emoji",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="uuid")hm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"uuid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="nanoid")fm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"nanoid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid")dm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid2")um.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"cuid2",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="ulid")pm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ulid",code:J.invalid_string,message:l.message}),i.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ne(s,{validation:"url",code:J.invalid_string,message:l.message}),i.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"regex",code:J.invalid_string,message:l.message}),i.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),i.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{startsWith:l.value},message:l.message}),i.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:{endsWith:l.value},message:l.message}),i.dirty()):l.kind==="datetime"?pd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"datetime",message:l.message}),i.dirty()):l.kind==="date"?wm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"date",message:l.message}),i.dirty()):l.kind==="time"?bm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{code:J.invalid_string,validation:"time",message:l.message}),i.dirty()):l.kind==="duration"?mm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"duration",code:J.invalid_string,message:l.message}),i.dirty()):l.kind==="ip"?xm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"ip",code:J.invalid_string,message:l.message}),i.dirty()):l.kind==="base64"?Cm.test(e.data)||(s=this._getOrReturnCtx(e,s),ne(s,{validation:"base64",code:J.invalid_string,message:l.message}),i.dirty()):Me.assertNever(l);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:J.invalid_string,...ce.errToObj(i)})}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ce.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ce.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ce.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ce.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ce.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ce.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ce.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ce.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ce.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ce.errToObj(e)})}datetime(e){var n,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...ce.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ce.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ce.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ce.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ce.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ce.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ce.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ce.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ce.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ce.errToObj(n)})}nonempty(e){return this.min(1,ce.errToObj(e))}trim(){return new nn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new nn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new nn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}nn.create=t=>{var e;return new nn({checks:[],typeName:ge.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function km(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class Yn extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ie.number){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.number,received:l.parsedType}),_e}let i;const s=new ft;for(const l of this._def.checks)l.kind==="int"?Me.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:J.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?km(e.data,l.value)!==0&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_finite,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,i,s){return new Yn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ce.toString(s)}]})}_addCheck(e){return new Yn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ce.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ce.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Me.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Yn.create=t=>new Yn({checks:[],typeName:ge.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Jn extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ie.bigint){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.bigint,received:l.parsedType}),_e}let i;const s=new ft;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ne(i,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,i,s){return new Jn({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ce.toString(s)}]})}_addCheck(e){return new Jn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Jn.create=t=>{var e;return new Jn({checks:[],typeName:ge.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};class Ri extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ie.boolean){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.boolean,received:i.parsedType}),_e}return Ct(e.data)}}Ri.create=t=>new Ri({typeName:ge.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Er extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ie.date){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_type,expected:ie.date,received:l.parsedType}),_e}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ne(l,{code:J.invalid_date}),_e}const i=new ft;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),i.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ne(s,{code:J.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),i.dirty()):Me.assertNever(l);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ce.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ce.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Er.create=t=>new Er({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ge.ZodDate,...Se(t)});class Qo extends Be{_parse(e){if(this._getType(e)!==ie.symbol){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.symbol,received:i.parsedType}),_e}return Ct(e.data)}}Qo.create=t=>new Qo({typeName:ge.ZodSymbol,...Se(t)});class Mi extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.undefined,received:i.parsedType}),_e}return Ct(e.data)}}Mi.create=t=>new Mi({typeName:ge.ZodUndefined,...Se(t)});class Ii extends Be{_parse(e){if(this._getType(e)!==ie.null){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.null,received:i.parsedType}),_e}return Ct(e.data)}}Ii.create=t=>new Ii({typeName:ge.ZodNull,...Se(t)});class Yr extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return Ct(e.data)}}Yr.create=t=>new Yr({typeName:ge.ZodAny,...Se(t)});class Tr extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ct(e.data)}}Tr.create=t=>new Tr({typeName:ge.ZodUnknown,...Se(t)});class Dn extends Be{_parse(e){const n=this._getOrReturnCtx(e);return ne(n,{code:J.invalid_type,expected:ie.never,received:n.parsedType}),_e}}Dn.create=t=>new Dn({typeName:ge.ZodNever,...Se(t)});class es extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.void,received:i.parsedType}),_e}return Ct(e.data)}}es.create=t=>new es({typeName:ge.ZodVoid,...Se(t)});class rn extends Be{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==ie.array)return ne(n,{code:J.invalid_type,expected:ie.array,received:n.parsedType}),_e;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ne(n,{code:c?J.too_big:J.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ne(n,{code:J.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ne(n,{code:J.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new xn(n,c,n.path,u)))).then(c=>ft.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new xn(n,c,n.path,u)));return ft.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new rn({...this._def,minLength:{value:e,message:ce.toString(n)}})}max(e,n){return new rn({...this._def,maxLength:{value:e,message:ce.toString(n)}})}length(e,n){return new rn({...this._def,exactLength:{value:e,message:ce.toString(n)}})}nonempty(e){return this.min(1,e)}}rn.create=(t,e)=>new rn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...Se(e)});function Jr(t){if(t instanceof Ke){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Sn.create(Jr(i))}return new Ke({...t._def,shape:()=>e})}else return t instanceof rn?new rn({...t._def,type:Jr(t.element)}):t instanceof Sn?Sn.create(Jr(t.unwrap())):t instanceof Qn?Qn.create(Jr(t.unwrap())):t instanceof kn?kn.create(t.items.map(e=>Jr(e))):t}class Ke extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Me.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ie.object){const f=this._getOrReturnCtx(e);return ne(f,{code:J.invalid_type,expected:ie.object,received:f.parsedType}),_e}const{status:i,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Dn&&this._def.unknownKeys==="strip"))for(const f in s.data)c.includes(f)||u.push(f);const p=[];for(const f of c){const m=l[f],v=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new xn(s,v,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Dn){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)p.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ne(s,{code:J.unrecognized_keys,keys:u}),i.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const v=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new xn(s,v,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const v=await m.key,k=await m.value;f.push({key:v,value:k,alwaysSet:m.alwaysSet})}return f}).then(f=>ft.mergeObjectSync(i,f)):ft.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return ce.errToObj,new Ke({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=ce.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Ke({...this._def,unknownKeys:"strip"})}passthrough(){return new Ke({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ke({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ke({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ge.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ke({...this._def,catchall:e})}pick(e){const n={};return Me.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Ke({...this._def,shape:()=>n})}omit(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Ke({...this._def,shape:()=>n})}deepPartial(){return Jr(this)}partial(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Ke({...this._def,shape:()=>n})}required(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let l=this.shape[i];for(;l instanceof Sn;)l=l._def.innerType;n[i]=l}}),new Ke({...this._def,shape:()=>n})}keyof(){return hd(Me.objectKeys(this.shape))}}Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)}),Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)}),Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:Dn.create(),typeName:ge.ZodObject,...Se(e)});class Li extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new Ft(u.ctx.common.issues));return ne(n,{code:J.invalid_union,unionErrors:c}),_e}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of i){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new Ft(p));return ne(n,{code:J.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}Li.create=(t,e)=>new Li({options:t,typeName:ge.ZodUnion,...Se(e)});const Fn=t=>t instanceof zi?Fn(t.schema):t instanceof on?Fn(t.innerType()):t instanceof Zi?[t.value]:t instanceof Xn?t.options:t instanceof $i?Me.objectValues(t.enum):t instanceof Ui?Fn(t._def.innerType):t instanceof Mi?[void 0]:t instanceof Ii?[null]:t instanceof Sn?[void 0,...Fn(t.unwrap())]:t instanceof Qn?[null,...Fn(t.unwrap())]:t instanceof Ra||t instanceof ji?Fn(t.unwrap()):t instanceof Wi?Fn(t._def.innerType):[];class ts extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.object)return ne(n,{code:J.invalid_type,expected:ie.object,received:n.parsedType}),_e;const i=this.discriminator,s=n.data[i],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ne(n,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=Fn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new ts({typeName:ge.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(i)})}}function Fa(t,e){const n=Kn(t),i=Kn(e);if(t===e)return{valid:!0,data:t};if(n===ie.object&&i===ie.object){const s=Me.objectKeys(e),l=Me.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Fa(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===ie.array&&i===ie.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=Fa(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ie.date&&i===ie.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Oi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(Va(l)||Va(c))return _e;const u=Fa(l.value,c.value);return u.valid?((Na(l)||Na(c))&&n.dirty(),{status:n.value,value:u.data}):(ne(i,{code:J.invalid_intersection_types}),_e)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Oi.create=(t,e,n)=>new Oi({left:t,right:e,typeName:ge.ZodIntersection,...Se(n)});class kn extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.array)return ne(i,{code:J.invalid_type,expected:ie.array,received:i.parsedType}),_e;if(i.data.length<this._def.items.length)return ne(i,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&i.data.length>this._def.items.length&&(ne(i,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...i.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new xn(i,c,i.path,u)):null}).filter(c=>!!c);return i.common.async?Promise.all(l).then(c=>ft.mergeArray(n,c)):ft.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new kn({...this._def,rest:e})}}kn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new kn({items:t,typeName:ge.ZodTuple,rest:null,...Se(e)})};class Gi extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.object)return ne(i,{code:J.invalid_type,expected:ie.object,received:i.parsedType}),_e;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new xn(i,u,i.path,u)),value:c._parse(new xn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?ft.mergeObjectAsync(n,s):ft.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Be?new Gi({keyType:e,valueType:n,typeName:ge.ZodRecord,...Se(i)}):new Gi({keyType:nn.create(),valueType:e,typeName:ge.ZodRecord,...Se(n)})}}class ns extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.map)return ne(i,{code:J.invalid_type,expected:ie.map,received:i.parsedType}),_e;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new xn(i,u,i.path,[f,"key"])),value:l._parse(new xn(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}ns.create=(t,e,n)=>new ns({valueType:e,keyType:t,typeName:ge.ZodMap,...Se(n)});class Br extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ie.set)return ne(i,{code:J.invalid_type,expected:ie.set,received:i.parsedType}),_e;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(ne(i,{code:J.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(ne(i,{code:J.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return _e;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new xn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Br({...this._def,minSize:{value:e,message:ce.toString(n)}})}max(e,n){return new Br({...this._def,maxSize:{value:e,message:ce.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Br.create=(t,e)=>new Br({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...Se(e)});class Xr extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.function)return ne(n,{code:J.invalid_type,expected:ie.function,received:n.parsedType}),_e;function i(u,p){return Jo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yo(),qr].filter(f=>!!f),issueData:{code:J.invalid_arguments,argumentsError:p}})}function s(u,p){return Jo({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yo(),qr].filter(f=>!!f),issueData:{code:J.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof Qr){const u=this;return Ct(async function(...p){const f=new Ft([]),m=await u._def.args.parseAsync(p,l).catch(S=>{throw f.addIssue(i(p,S)),f}),v=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(v,l).catch(S=>{throw f.addIssue(s(v,S)),f})})}else{const u=this;return Ct(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ft([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),v=u._def.returns.safeParse(m,l);if(!v.success)throw new Ft([s(m,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xr({...this._def,args:kn.create(e).rest(Tr.create())})}returns(e){return new Xr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new Xr({args:e||kn.create([]).rest(Tr.create()),returns:n||Tr.create(),typeName:ge.ZodFunction,...Se(i)})}}class zi extends Be{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}zi.create=(t,e)=>new zi({getter:t,typeName:ge.ZodLazy,...Se(e)});class Zi extends Be{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ne(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}Zi.create=(t,e)=>new Zi({value:t,typeName:ge.ZodLiteral,...Se(e)});function hd(t,e){return new Xn({values:t,typeName:ge.ZodEnum,...Se(e)})}class Xn extends Be{constructor(){super(...arguments),Di.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{expected:Me.joinValues(i),received:n.parsedType,code:J.invalid_type}),_e}if(Xo(this,Di)||ld(this,Di,new Set(this._def.values)),!Xo(this,Di).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ne(n,{received:n.data,code:J.invalid_enum_value,options:i}),_e}return Ct(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Xn.create(e,{...this._def,...n})}exclude(e,n=this._def){return Xn.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}Di=new WeakMap,Xn.create=hd;class $i extends Be{constructor(){super(...arguments),Fi.set(this,void 0)}_parse(e){const n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==ie.string&&i.parsedType!==ie.number){const s=Me.objectValues(n);return ne(i,{expected:Me.joinValues(s),received:i.parsedType,code:J.invalid_type}),_e}if(Xo(this,Fi)||ld(this,Fi,new Set(Me.getValidEnumValues(this._def.values))),!Xo(this,Fi).has(e.data)){const s=Me.objectValues(n);return ne(i,{received:i.data,code:J.invalid_enum_value,options:s}),_e}return Ct(e.data)}get enum(){return this._def.values}}Fi=new WeakMap,$i.create=(t,e)=>new $i({values:t,typeName:ge.ZodNativeEnum,...Se(e)});class Qr extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.promise&&n.common.async===!1)return ne(n,{code:J.invalid_type,expected:ie.promise,received:n.parsedType}),_e;const i=n.parsedType===ie.promise?n.data:Promise.resolve(n.data);return Ct(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Qr.create=(t,e)=>new Qr({type:t,typeName:ge.ZodPromise,...Se(e)});class on extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ne(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return _e;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?_e:p.status==="dirty"||n.value==="dirty"?Kr(p.value):p});{if(n.value==="aborted")return _e;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?_e:u.status==="dirty"||n.value==="dirty"?Kr(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Vi(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>Vi(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Me.assertNever(s)}}on.create=(t,e,n)=>new on({schema:t,typeName:ge.ZodEffects,effect:e,...Se(n)}),on.createWithPreprocess=(t,e,n)=>new on({schema:e,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...Se(n)});class Sn extends Be{_parse(e){return this._getType(e)===ie.undefined?Ct(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Sn.create=(t,e)=>new Sn({innerType:t,typeName:ge.ZodOptional,...Se(e)});class Qn extends Be{_parse(e){return this._getType(e)===ie.null?Ct(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Qn.create=(t,e)=>new Qn({innerType:t,typeName:ge.ZodNullable,...Se(e)});class Ui extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===ie.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ui.create=(t,e)=>new Ui({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class Wi extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ni(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Wi.create=(t,e)=>new Wi({innerType:t,typeName:ge.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class rs extends Be{_parse(e){if(this._getType(e)!==ie.nan){const i=this._getOrReturnCtx(e);return ne(i,{code:J.invalid_type,expected:ie.nan,received:i.parsedType}),_e}return{status:"valid",value:e.data}}}rs.create=t=>new rs({typeName:ge.ZodNaN,...Se(t)});const Sm=Symbol("zod_brand");class Ra extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class Hi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?_e:l.status==="dirty"?(n.dirty(),Kr(l.value)):this._def.out._parseAsync({data:l.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?_e:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new Hi({in:e,out:n,typeName:ge.ZodPipeline})}}class ji extends Be{_parse(e){const n=this._def.innerType._parse(e),i=s=>(Vi(s)&&(s.value=Object.freeze(s.value)),s);return Ni(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}ji.create=(t,e)=>new ji({innerType:t,typeName:ge.ZodReadonly,...Se(e)});function fd(t,e={},n){return t?Yr.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):Yr.create()}const Em={object:Ke.lazycreate};var ge;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ge||(ge={}));const Tm=(t,e={message:`Input not instance of ${t.name}`})=>fd(n=>n instanceof t,e),md=nn.create,gd=Yn.create,Bm=rs.create,Am=Jn.create,yd=Ri.create,Pm=Er.create,Vm=Qo.create,Nm=Mi.create,Dm=Ii.create,Fm=Yr.create,Rm=Tr.create,Mm=Dn.create,Im=es.create,Lm=rn.create,Om=Ke.create,Gm=Ke.strictCreate,zm=Li.create,Zm=ts.create,$m=Oi.create,Um=kn.create,Wm=Gi.create,Hm=ns.create,jm=Br.create,qm=Xr.create,Km=zi.create,Ym=Zi.create,Jm=Xn.create,Xm=$i.create,Qm=Qr.create,vd=on.create,eg=Sn.create,tg=Qn.create,ng=on.createWithPreprocess,rg=Hi.create;var is=Object.freeze({__proto__:null,defaultErrorMap:qr,setErrorMap:lm,getErrorMap:Yo,makeIssue:Jo,EMPTY_PATH:cm,addIssueToContext:ne,ParseStatus:ft,INVALID:_e,DIRTY:Kr,OK:Ct,isAborted:Va,isDirty:Na,isValid:Vi,isAsync:Ni,get util(){return Me},get objectUtil(){return Pa},ZodParsedType:ie,getParsedType:Kn,ZodType:Be,datetimeRegex:pd,ZodString:nn,ZodNumber:Yn,ZodBigInt:Jn,ZodBoolean:Ri,ZodDate:Er,ZodSymbol:Qo,ZodUndefined:Mi,ZodNull:Ii,ZodAny:Yr,ZodUnknown:Tr,ZodNever:Dn,ZodVoid:es,ZodArray:rn,ZodObject:Ke,ZodUnion:Li,ZodDiscriminatedUnion:ts,ZodIntersection:Oi,ZodTuple:kn,ZodRecord:Gi,ZodMap:ns,ZodSet:Br,ZodFunction:Xr,ZodLazy:zi,ZodLiteral:Zi,ZodEnum:Xn,ZodNativeEnum:$i,ZodPromise:Qr,ZodEffects:on,ZodTransformer:on,ZodOptional:Sn,ZodNullable:Qn,ZodDefault:Ui,ZodCatch:Wi,ZodNaN:rs,BRAND:Sm,ZodBranded:Ra,ZodPipeline:Hi,ZodReadonly:ji,custom:fd,Schema:Be,ZodSchema:Be,late:Em,get ZodFirstPartyTypeKind(){return ge},coerce:{string:t=>nn.create({...t,coerce:!0}),number:t=>Yn.create({...t,coerce:!0}),boolean:t=>Ri.create({...t,coerce:!0}),bigint:t=>Jn.create({...t,coerce:!0}),date:t=>Er.create({...t,coerce:!0})},any:Fm,array:Lm,bigint:Am,boolean:yd,date:Pm,discriminatedUnion:Zm,effect:vd,enum:Jm,function:qm,instanceof:Tm,intersection:$m,lazy:Km,literal:Ym,map:Hm,nan:Bm,nativeEnum:Xm,never:Mm,null:Dm,nullable:tg,number:gd,object:Om,oboolean:()=>yd().optional(),onumber:()=>gd().optional(),optional:eg,ostring:()=>md().optional(),pipeline:rg,preprocess:ng,promise:Qm,record:Wm,set:jm,strictObject:Gm,string:md,symbol:Vm,transformer:vd,tuple:Um,undefined:Nm,union:zm,unknown:Rm,void:Im,NEVER:_e,ZodIssueCode:J,quotelessJson:am,ZodError:Ft});function ig(t){throw new Error("Unexpected object: "+t)}const og=-2147483648,_d=-9007199254740991n,sg=NaN,ag=NaN,lg=null,cg=null;function Cd(t,e){switch(e){case"Int":return t===og;case"Long":return t===Number(_d)||t===_d;case"Float":return t===sg;case"Double":return t===ag;case"String":return t===lg;case"Bytes":return t===cg;default:throw Error(`unsupported data type: ${e}`)}}function dg(t,e){const n=Math.floor(e/8),i=1<<7-e%8;return(t[n]&i)>0}function wd(t){const{type:e,name:n,domain:i}=t;return{type:e,name:n,...i&&{domain:i}}}function Ma(t){return t.map(wd)}function os(t,e){switch(t.type){case"column":return{type:"column",column:e(t.column)};case"inner":case"full":return{type:t.type,entries:t.entries.map(n=>os(n,e))};case"outer":return{type:"outer",primary:os(t.primary,e),secondary:t.secondary.map(n=>os(n,e))};default:ig(t)}}is.object({__isRef:is.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:is.string().describe("Upstream block id"),name:is.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function ug(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const pg="1.10.0";function hg(){return ug({sdkVersion:pg})}function fg(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function ei(t){return!!t&&typeof t.children<"u"}function er(t){return ei(t)?t.groupId:t.colId}function bd(t,e,n){const i=(c,u)=>{const p=c.children.map(er),f=b._includes(p,er(u)),m=b._last(c.children),v=m&&er(m)!==er(u);return f&&v};if(!ei(t))return!0;const s=t,l=n;if(i(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(er);if(!b._includes(c,er(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!bd(s.children[c],e,n);c--);return!1}function mg(t){const e=(s,l)=>ei(s)&&ei(l)&&er(s)===er(l),n=(s,l)=>{if(!ei(l))return s;const c=s,u=l;return u.children&&u.groupId&&bd(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},i=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):i.push(l)}return i}var gg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(ei(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new b.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const v=n(m,l+1);v&&f.push(v)}),p.setChildren(f),p}else{const c=s,u=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(u);return p||e.push(c),p}},i=[];return t.forEach(s=>{const l=n(s,0);l&&i.push(l)}),e.length>0&&b._warnOnce("unable to find grid columns for the supplied colDef(s):",e),i}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=mg(e);t(n)}getLeafPathTrees(){const t=(i,s)=>{let l;if(b.isProvidedColumnGroup(i))if(i.isPadding())l=s;else{const u=Object.assign({},i.getColGroupDef());u.groupId=i.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},i.getColDef());u.colId=i.getColId(),l=u}const c=i.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(i=>{const s=i.getColDef();return i.isPrimary()&&!s.showRowGroup}).map(i=>t(i,i.getColDef()))}};function yg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function vg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function _g(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Cg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function wg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function bg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function xg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function kg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Sg(t,e){var i;const n=(i=t.sideBarService)==null?void 0:i.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function Eg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Tg=class extends b.Component{constructor(t){super(),this.eToggleButton=b.RefPlaceholder,this.eIconWrapper=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
4
4
|
<button type="button" data-ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">
|
|
5
5
|
<div data-ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>
|
|
6
6
|
<span data-ref="eLabel" class="ag-side-button-label"></span>
|