@platforma-sdk/ui-vue 1.13.17 → 1.14.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 +17 -0
- package/dist/lib.js +5 -5
- package/dist/lib.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/assets/block.scss +14 -0
- package/src/components/PlAgDataTable/PlAgDataTable.vue +1 -1
- package/src/components/PlAgDataTable/PlTableFilters.vue +3 -3
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(M,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):(M=typeof globalThis<"u"?globalThis:M||self,r(M.SdkVueLib={},M.Vue,M.core$1,M.core,M.clientSideRowModel,M.infiniteRowModel,M.serverSideRowModel,M.csvExport,M.clipboard,M.rangeSelection,M.richSelect,M.menu,M.excelExport,M.theming,M.vue3))})(this,function(M,r,Ie,x,is,mm,pd,gm,hd,fd,ym,_m,vm,md,Cm){"use strict";var nM=Object.defineProperty;var pm=M=>{throw TypeError(M)};var rM=(M,r,Ie)=>r in M?nM(M,r,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):M[r]=Ie;var Ze=(M,r,Ie)=>rM(M,typeof r!="symbol"?r+"":r,Ie),ad=(M,r,Ie)=>r.has(M)||pm("Cannot "+Ie);var b=(M,r,Ie)=>(ad(M,r,"read from private field"),Ie?Ie.call(M):r.get(M)),ze=(M,r,Ie)=>r.has(M)?pm("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(M):r.set(M,Ie),me=(M,r,Ie,x)=>(ad(M,r,"write to private field"),x?x.call(M,Ie):r.set(M,Ie),Ie),de=(M,r,Ie)=>(ad(M,r,"access private method"),Ie);var Va=(M,r,Ie,x)=>({set _(is){me(M,r,is,Ie)},get _(){return b(M,r,x)}});var Ap,To,Pp,Dp,hn,zt,fn,mn,Bo,Vo,dt,gn,lt,Ke,xe,Bt,$t,xt,ft,yn,mt,_n,vn,Ut,Cn,br,Vt,re,ld,qr,Hn,Mi,Zt,fm,Kr,No,Ii,Rr,Mr,cd,Na,Aa,Je,dd,os,Ir,ud;function wm(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function bm(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function xm(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(bm(65,91));return e}function km(){return xm(42)}const gd=Array.isArray;function Sm(t){return t!==null&&typeof t=="object"}function yd(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function Bn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Bn(t[n]);return e}else if(Sm(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Bn(t[n])}),e}else return t}function _d(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],s=e[n];yd(o)&&yd(s)||gd(o)&&gd(s)&&o.length===s.length?_d(o,s):t[n]=s}),t}function Pa(t,e,n=!0){let o=0,s;return function(...l){s=()=>{t.apply(this,l),o=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>o&&s()}}function Em(t){let e=0n,n;return async function(...o){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...o);return n=l,{ok:!0,value:await l}}}var Ho=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bm=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((o,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(s)}:${t(e[s])}`},"")}}`};const Or=Tm(Bm);class Da extends Error{}class Fa extends Error{constructor(e){super(e.join(`
|
|
2
2
|
`)),this.errors=e}toString(){return this.errors.join(`
|
|
3
|
-
`)}}function Vm(t){return{ok:!0,value:t}}function vd(t){if(!t)throw new Da;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function Cd(t){return{value:t,errors:void 0}}function Nm(t){if(t.errors)throw new Fa(t.errors);if(!t.value)throw new Da;return t.value}function Am(t){return t!==void 0}function Ra(t,e){return Or(t)===Or(e)}const Ma=t=>t,Ia=t=>t instanceof Error?t:Error(String(t)),Oa=t=>t.name==="ZodError",La=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function Ga(t){const e=t.validate??Ma,{autoSave:n}=t,o=r.ref(),s=r.ref(),l=A=>{s.value={model:Bn(A)}};r.watch(()=>t.get(),A=>l(A),{immediate:!0});const c=()=>{var A;t.onSave(e(Bn((A=s.value)==null?void 0:A.model)))},u=()=>{l(t.get()),o.value=void 0},p=A=>{const I=Ia(A);Oa(I)?o.value=Error(La(I)):o.value=I},f=A=>{o.value=void 0;try{e(A),n&&c()}catch(I){p(I)}},m=r.computed({get:()=>{var A;return(A=s.value)==null?void 0:A.model},set(A){l(A),f(A)}});r.watch(s,(A,I)=>{A&&A===I&&f(A.model)},{deep:!0});const y=r.computed(()=>!o.value),T=r.computed(()=>!Ra(t.get(),r.unref(s))),B=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:T,error:o,errorString:B,save:c,revert:u,setError:p})}function Pm(t,e,n){const o=t.validate??Ma,{autoSave:s}=t,l=r.ref(),c=r.ref(),u=L=>{var C;if(n.deepPatchModel){const R=(C=c.value)==null?void 0:C.model,O=Object.assign(Bn(L),e??{});c.value={model:R?_d(R,O):O,stage:Symbol()}}else c.value={model:Object.assign(Bn(L),e??{}),stage:Symbol()}};r.watch(()=>t.get(),L=>u(L),{immediate:!0});const p=()=>{var L;t.onSave(o(Bn((L=c.value)==null?void 0:L.model)))},f=()=>{u(t.get()),l.value=void 0},m=L=>{const C=Ia(L);Oa(C)?l.value=Error(La(C)):l.value=C},y=L=>{l.value=void 0;try{o(L),s&&p()}catch(C){m(C)}},T=r.computed({get:()=>{var L;return(L=c.value)==null?void 0:L.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:T.value.args,ui:T.value.ui}),()=>{var L;return(L=c.value)==null?void 0:L.stage}],([L,C],[R,O])=>{C===O&&y(L)},{deep:!0});const B=r.computed(()=>!l.value),A=r.computed(()=>{var R;const{args:L,ui:C}=((R=r.unref(c))==null?void 0:R.model)??{};return!Ra(t.get(),{args:L,ui:C})}),I=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:T,valid:B,isChanged:A,error:l,errorString:I,save:p,revert:f,setError:m})}const Dm=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Fm(t,e,n){const o=(C,...R)=>{n.debug&&console.log(`%c>>> %c${C}`,"color: orange; font-weight: bold","color: orange",...R)},l=Pa(e.setBlockArgs,100),c=Pa(e.setBlockUiState,100),u=Pa(e.setBlockArgsAndUiState,100),p=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 C=>{C.forEach(R=>{R.key==="args"&&(p.args=Object.freeze(R.value),o("args patch",p.args)),R.key==="ui"&&(p.ui=Object.freeze(R.value),o("ui patch",p.ui)),R.key==="outputs"&&(p.outputs=Object.freeze(R.value),o("outputs patch",p.outputs)),R.key==="navigationState"&&(p.navigationState=Object.freeze(R.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const f=()=>Bn(p.args),m=()=>Bn(p.ui),y=()=>Bn(p.navigationState),T={createArgsModel(C={}){return Ga({get(){return C.transform?C.transform(p.args):p.args},validate:C.validate,autoSave:!0,onSave(R){l(R)}})},createUiModel(C={},R){return Ga({get(){return C.transform?C.transform(p.ui):p.ui??R()},validate:C.validate,autoSave:!0,onSave(O){c(O)}})},useOutputs(...C){const R=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(R,{value:this.unwrapOutputs(...C),errors:void 0})}catch(O){Object.assign(R,{value:void 0,errors:[String(O)]})}},{immediate:!0,deep:!0}),R},unwrapOutputs(...C){const R=p.outputs,O=C.map(F=>[F,vd(R[F])]);return Object.fromEntries(O)},getOutputField(C){return p.outputs[C]},getOutputFieldOkOptional(C){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const R=this.getOutputField(C);if(R&&R.ok)return R.value},getOutputFieldErrorsOptional(C){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const R=this.getOutputField(C);if(R&&!R.ok)return R.errors},updateArgs(C){const R=f();return C(R),e.setBlockArgs(R)},updateUiState(C){const R=m();return e.setBlockUiState(C(R))},updateNavigationState(C){const R=y();return C(R),e.setNavigationState(R)},navigateTo(C){const R=y();return R.href=C,e.setNavigationState(R)}},B=r.computed(()=>{const C=Object.entries(p.outputs).map(([R,O])=>[R,O.ok&&O.value!==void 0?O.value:void 0]);return Object.fromEntries(C)}),A=r.computed(()=>{const C=Object.entries(p.outputs).map(([R,O])=>[R,O&&!O.ok?new Fa(O.errors):void 0]);return Object.fromEntries(C)}),I={snapshot:p,queryParams:r.computed(()=>Dm(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(C=>!(C!=null&&C.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),B.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),A.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},L=Pm({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(C){u(C.args,C.ui)}},{outputs:B,outputErrors:A},n);return r.reactive(Object.assign(L,T,I))}var Oe;(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 o(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Oe||(Oe={}));var za;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(za||(za={}));const ae=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),or=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},J=Oe.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"]),Rm=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ot extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};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},o={_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)o._errors.push(n(c));else{let u=o,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),o}static assert(e){if(!(e instanceof Ot))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];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))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Ot.create=t=>new Ot(t);const lo=(t,e)=>{let n;switch(t.code){case J.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Oe.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}"`:Oe.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,Oe.assertNever(t)}return{message:n}};let wd=lo;function Mm(t){wd=t}function ss(){return wd}const as=t=>{const{data:e,path:n,errorMaps:o,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=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},Im=[];function ie(t,e){const n=ss(),o=as({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===lo?void 0:lo].filter(s=>!!s)});t.common.issues.push(o)}class vt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,c=await s.value;o.push({key:l,value:c})}return vt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const Ce=Object.freeze({status:"aborted"}),co=t=>({status:"dirty",value:t}),Et=t=>({status:"valid",value:t}),$a=t=>t.status==="aborted",Ua=t=>t.status==="dirty",jo=t=>t.status==="valid",qo=t=>typeof Promise<"u"&&t instanceof Promise;function ls(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function bd(t,e,n,o,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 pe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pe||(pe={}));var Ko,Yo;class Vn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,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 xd=(t,e)=>{if(jo(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 Ot(t.common.issues);return this._error=n,this._error}}};function Te(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:s}=t;if(e&&(n||o))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??o)!==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 Ne{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 or(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(qo(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 o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const s={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)},l=this._parseSync({data:e,path:s.path,parent:s});return xd(s,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={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:or(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(qo(s)?s:Promise.resolve(s));return xd(o,l)}refine(e,n){const o=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,...o(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((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new ln({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return An.create(this,this._def)}nullable(){return lr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return an.create(this,this._def)}promise(){return fo.create(this,this._def)}or(e){return ei.create([this,e],this._def)}and(e){return ti.create(this,e,this._def)}transform(e){return new ln({...Te(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new si({...Te(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new Ha({typeName:_e.ZodBranded,type:this,...Te(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ai({...Te(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return li.create(this,e)}readonly(){return ci.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Om=/^c[^\s-]{8,}$/i,Lm=/^[0-9a-z]+$/,Gm=/^[0-9A-HJKMNP-TV-Z]{26}$/,zm=/^[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,$m=/^[a-z0-9_-]{21}$/i,Um=/^[-+]?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)?)??$/,Zm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Wm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Za;const Hm=/^(?:(?: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])$/,jm=/^(([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})))$/,qm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,kd="((\\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])))",Km=new RegExp(`^${kd}$`);function Sd(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 Ym(t){return new RegExp(`^${Sd(t)}$`)}function Ed(t){let e=`${kd}T${Sd(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 Jm(t,e){return!!((e==="v4"||!e)&&Hm.test(t)||(e==="v6"||!e)&&jm.test(t))}class sn extends Ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const l=this._getOrReturnCtx(e);return ie(l,{code:J.invalid_type,expected:ae.string,received:l.parsedType}),Ce}const o=new vt;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.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?ie(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ie(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")Zm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"email",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")Za||(Za=new RegExp(Wm,"u")),Za.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"emoji",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")zm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"uuid",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")$m.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"nanoid",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")Om.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Lm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid2",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Gm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ulid",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ie(s,{validation:"url",code:J.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"regex",code:J.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),ie(s,{code:J.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.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),ie(s,{code:J.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:J.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?Ed(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:J.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?Km.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:J.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Ym(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:J.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?Um.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"duration",code:J.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Jm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ip",code:J.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?qm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"base64",code:J.invalid_string,message:l.message}),o.dirty()):Oe.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:J.invalid_string,...pe.errToObj(o)})}_addCheck(e){return new sn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pe.errToObj(e)})}datetime(e){var n,o;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:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...pe.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,...pe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...pe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...pe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...pe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...pe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...pe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...pe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...pe.errToObj(n)})}nonempty(e){return this.min(1,pe.errToObj(e))}trim(){return new sn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new sn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new sn({...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}}sn.create=t=>{var e;return new sn({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};function Xm(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class ir extends Ne{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)!==ae.number){const l=this._getOrReturnCtx(e);return ie(l,{code:J.invalid_type,expected:ae.number,received:l.parsedType}),Ce}let o;const s=new vt;for(const l of this._def.checks)l.kind==="int"?Oe.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{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)&&(o=this._getOrReturnCtx(e,o),ie(o,{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)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:J.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?Xm(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:J.not_finite,message:l.message}),s.dirty()):Oe.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new ir({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new ir({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:pe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.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"&&Oe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}ir.create=t=>new ir({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class sr extends Ne{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)!==ae.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:J.invalid_type,expected:ae.bigint,received:l.parsedType}),Ce}let o;const s=new vt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{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)&&(o=this._getOrReturnCtx(e,o),ie(o,{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)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Oe.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new sr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.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}}sr.create=t=>{var e;return new sr({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};class Jo extends Ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.boolean,received:o.parsedType}),Ce}return Et(e.data)}}Jo.create=t=>new Jo({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class Lr extends Ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const l=this._getOrReturnCtx(e);return ie(l,{code:J.invalid_type,expected:ae.date,received:l.parsedType}),Ce}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:J.invalid_date}),Ce}const o=new vt;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:J.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:J.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Oe.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Lr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:pe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:pe.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}}Lr.create=t=>new Lr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Te(t)});class cs extends Ne{_parse(e){if(this._getType(e)!==ae.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.symbol,received:o.parsedType}),Ce}return Et(e.data)}}cs.create=t=>new cs({typeName:_e.ZodSymbol,...Te(t)});class Xo extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.undefined,received:o.parsedType}),Ce}return Et(e.data)}}Xo.create=t=>new Xo({typeName:_e.ZodUndefined,...Te(t)});class Qo extends Ne{_parse(e){if(this._getType(e)!==ae.null){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.null,received:o.parsedType}),Ce}return Et(e.data)}}Qo.create=t=>new Qo({typeName:_e.ZodNull,...Te(t)});class uo extends Ne{constructor(){super(...arguments),this._any=!0}_parse(e){return Et(e.data)}}uo.create=t=>new uo({typeName:_e.ZodAny,...Te(t)});class Gr extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Et(e.data)}}Gr.create=t=>new Gr({typeName:_e.ZodUnknown,...Te(t)});class zn extends Ne{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:J.invalid_type,expected:ae.never,received:n.parsedType}),Ce}}zn.create=t=>new zn({typeName:_e.ZodNever,...Te(t)});class ds extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.void,received:o.parsedType}),Ce}return Et(e.data)}}ds.create=t=>new ds({typeName:_e.ZodVoid,...Te(t)});class an extends Ne{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==ae.array)return ie(n,{code:J.invalid_type,expected:ae.array,received:n.parsedType}),Ce;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ie(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}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ie(n,{code:J.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ie(n,{code:J.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new Vn(n,c,n.path,u)))).then(c=>vt.mergeArray(o,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new Vn(n,c,n.path,u)));return vt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new an({...this._def,minLength:{value:e,message:pe.toString(n)}})}max(e,n){return new an({...this._def,maxLength:{value:e,message:pe.toString(n)}})}length(e,n){return new an({...this._def,exactLength:{value:e,message:pe.toString(n)}})}nonempty(e){return this.min(1,e)}}an.create=(t,e)=>new an({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Te(e)});function po(t){if(t instanceof Qe){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=An.create(po(o))}return new Qe({...t._def,shape:()=>e})}else return t instanceof an?new an({...t._def,type:po(t.element)}):t instanceof An?An.create(po(t.unwrap())):t instanceof lr?lr.create(po(t.unwrap())):t instanceof Nn?Nn.create(t.items.map(e=>po(e))):t}class Qe extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Oe.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const f=this._getOrReturnCtx(e);return ie(f,{code:J.invalid_type,expected:ae.object,received:f.parsedType}),Ce}const{status:o,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof zn&&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],y=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new Vn(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof zn){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&&(ie(s,{code:J.unrecognized_keys,keys:u}),o.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 y=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new Vn(s,y,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const y=await m.key,T=await m.value;f.push({key:y,value:T,alwaysSet:m.alwaysSet})}return f}).then(f=>vt.mergeObjectSync(o,f)):vt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return pe.errToObj,new Qe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=pe.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Qe({...this._def,unknownKeys:"strip"})}passthrough(){return new Qe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Qe({...this._def,catchall:e})}pick(e){const n={};return Oe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}omit(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}deepPartial(){return po(this)}partial(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new Qe({...this._def,shape:()=>n})}required(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof An;)l=l._def.innerType;n[o]=l}}),new Qe({...this._def,shape:()=>n})}keyof(){return Td(Oe.objectKeys(this.shape))}}Qe.create=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strip",catchall:zn.create(),typeName:_e.ZodObject,...Te(e)}),Qe.strictCreate=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strict",catchall:zn.create(),typeName:_e.ZodObject,...Te(e)}),Qe.lazycreate=(t,e)=>new Qe({shape:t,unknownKeys:"strip",catchall:zn.create(),typeName:_e.ZodObject,...Te(e)});class ei extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o=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 Ot(u.ctx.common.issues));return ie(n,{code:J.invalid_union,unionErrors:c}),Ce}if(n.common.async)return Promise.all(o.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 o){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 Ot(p));return ie(n,{code:J.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}ei.create=(t,e)=>new ei({options:t,typeName:_e.ZodUnion,...Te(e)});const $n=t=>t instanceof ri?$n(t.schema):t instanceof ln?$n(t.innerType()):t instanceof oi?[t.value]:t instanceof ar?t.options:t instanceof ii?Oe.objectValues(t.enum):t instanceof si?$n(t._def.innerType):t instanceof Xo?[void 0]:t instanceof Qo?[null]:t instanceof An?[void 0,...$n(t.unwrap())]:t instanceof lr?[null,...$n(t.unwrap())]:t instanceof Ha||t instanceof ci?$n(t.unwrap()):t instanceof ai?$n(t._def.innerType):[];class us extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ie(n,{code:J.invalid_type,expected:ae.object,received:n.parsedType}),Ce;const o=this.discriminator,s=n.data[o],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}):(ie(n,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const c=$n(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 us({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Te(o)})}}function Wa(t,e){const n=or(t),o=or(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&o===ae.object){const s=Oe.objectKeys(e),l=Oe.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Wa(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===ae.array&&o===ae.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=Wa(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ti extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,c)=>{if($a(l)||$a(c))return Ce;const u=Wa(l.value,c.value);return u.valid?((Ua(l)||Ua(c))&&n.dirty(),{status:n.value,value:u.data}):(ie(o,{code:J.invalid_intersection_types}),Ce)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}ti.create=(t,e,n)=>new ti({left:t,right:e,typeName:_e.ZodIntersection,...Te(n)});class Nn extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ie(o,{code:J.invalid_type,expected:ae.array,received:o.parsedType}),Ce;if(o.data.length<this._def.items.length)return ie(o,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new Vn(o,c,o.path,u)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>vt.mergeArray(n,c)):vt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Nn({...this._def,rest:e})}}Nn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nn({items:t,typeName:_e.ZodTuple,rest:null,...Te(e)})};class ni extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ie(o,{code:J.invalid_type,expected:ae.object,received:o.parsedType}),Ce;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Vn(o,u,o.path,u)),value:c._parse(new Vn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?vt.mergeObjectAsync(n,s):vt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Ne?new ni({keyType:e,valueType:n,typeName:_e.ZodRecord,...Te(o)}):new ni({keyType:sn.create(),valueType:e,typeName:_e.ZodRecord,...Te(n)})}}class ps extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ie(o,{code:J.invalid_type,expected:ae.map,received:o.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Vn(o,u,o.path,[f,"key"])),value:l._parse(new Vn(o,p,o.path,[f,"value"]))}));if(o.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 Ce;(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 Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}ps.create=(t,e,n)=>new ps({valueType:e,keyType:t,typeName:_e.ZodMap,...Te(n)});class zr extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ie(o,{code:J.invalid_type,expected:ae.set,received:o.parsedType}),Ce;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(ie(o,{code:J.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(ie(o,{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 Ce;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...o.data.values()].map((p,f)=>l._parse(new Vn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new zr({...this._def,minSize:{value:e,message:pe.toString(n)}})}max(e,n){return new zr({...this._def,maxSize:{value:e,message:pe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}zr.create=(t,e)=>new zr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Te(e)});class ho extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return ie(n,{code:J.invalid_type,expected:ae.function,received:n.parsedType}),Ce;function o(u,p){return as({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ss(),lo].filter(f=>!!f),issueData:{code:J.invalid_arguments,argumentsError:p}})}function s(u,p){return as({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ss(),lo].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 fo){const u=this;return Et(async function(...p){const f=new Ot([]),m=await u._def.args.parseAsync(p,l).catch(B=>{throw f.addIssue(o(p,B)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(B=>{throw f.addIssue(s(y,B)),f})})}else{const u=this;return Et(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ot([o(p,f.error)]);const m=Reflect.apply(c,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new Ot([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ho({...this._def,args:Nn.create(e).rest(Gr.create())})}returns(e){return new ho({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new ho({args:e||Nn.create([]).rest(Gr.create()),returns:n||Gr.create(),typeName:_e.ZodFunction,...Te(o)})}}class ri extends Ne{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})}}ri.create=(t,e)=>new ri({getter:t,typeName:_e.ZodLazy,...Te(e)});class oi extends Ne{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}oi.create=(t,e)=>new oi({value:t,typeName:_e.ZodLiteral,...Te(e)});function Td(t,e){return new ar({values:t,typeName:_e.ZodEnum,...Te(e)})}class ar extends Ne{constructor(){super(...arguments),Ko.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Oe.joinValues(o),received:n.parsedType,code:J.invalid_type}),Ce}if(ls(this,Ko)||bd(this,Ko,new Set(this._def.values)),!ls(this,Ko).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:J.invalid_enum_value,options:o}),Ce}return Et(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 ar.create(e,{...this._def,...n})}exclude(e,n=this._def){return ar.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}Ko=new WeakMap,ar.create=Td;class ii extends Ne{constructor(){super(...arguments),Yo.set(this,void 0)}_parse(e){const n=Oe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const s=Oe.objectValues(n);return ie(o,{expected:Oe.joinValues(s),received:o.parsedType,code:J.invalid_type}),Ce}if(ls(this,Yo)||bd(this,Yo,new Set(Oe.getValidEnumValues(this._def.values))),!ls(this,Yo).has(e.data)){const s=Oe.objectValues(n);return ie(o,{received:o.data,code:J.invalid_enum_value,options:s}),Ce}return Et(e.data)}get enum(){return this._def.values}}Yo=new WeakMap,ii.create=(t,e)=>new ii({values:t,typeName:_e.ZodNativeEnum,...Te(e)});class fo extends Ne{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return ie(n,{code:J.invalid_type,expected:ae.promise,received:n.parsedType}),Ce;const o=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return Et(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}fo.create=(t,e)=>new fo({type:t,typeName:_e.ZodPromise,...Te(e)});class ln extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?co(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:c,path:o.path,parent:o});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?co(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(o.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(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!jo(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:o.data,path:o.path,parent:o}).then(c=>jo(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Oe.assertNever(s)}}ln.create=(t,e,n)=>new ln({schema:t,typeName:_e.ZodEffects,effect:e,...Te(n)}),ln.createWithPreprocess=(t,e,n)=>new ln({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Te(n)});class An extends Ne{_parse(e){return this._getType(e)===ae.undefined?Et(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}An.create=(t,e)=>new An({innerType:t,typeName:_e.ZodOptional,...Te(e)});class lr extends Ne{_parse(e){return this._getType(e)===ae.null?Et(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}lr.create=(t,e)=>new lr({innerType:t,typeName:_e.ZodNullable,...Te(e)});class si extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}si.create=(t,e)=>new si({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Te(e)});class ai extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return qo(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ot(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ot(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ai.create=(t,e)=>new ai({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Te(e)});class hs extends Ne{_parse(e){if(this._getType(e)!==ae.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.nan,received:o.parsedType}),Ce}return{status:"valid",value:e.data}}}hs.create=t=>new hs({typeName:_e.ZodNaN,...Te(t)});const Qm=Symbol("zod_brand");class Ha extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class li extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?Ce:l.status==="dirty"?(n.dirty(),co(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new li({in:e,out:n,typeName:_e.ZodPipeline})}}class ci extends Ne{_parse(e){const n=this._def.innerType._parse(e),o=s=>(jo(s)&&(s.value=Object.freeze(s.value)),s);return qo(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}ci.create=(t,e)=>new ci({innerType:t,typeName:_e.ZodReadonly,...Te(e)});function Bd(t,e={},n){return t?uo.create().superRefine((o,s)=>{var l,c;if(!t(o)){const u=typeof e=="function"?e(o):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})}}):uo.create()}const eg={object:Qe.lazycreate};var _e;(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"})(_e||(_e={}));const tg=(t,e={message:`Input not instance of ${t.name}`})=>Bd(n=>n instanceof t,e),Vd=sn.create,Nd=ir.create,ng=hs.create,rg=sr.create,Ad=Jo.create,og=Lr.create,ig=cs.create,sg=Xo.create,ag=Qo.create,lg=uo.create,cg=Gr.create,dg=zn.create,ug=ds.create,pg=an.create,hg=Qe.create,fg=Qe.strictCreate,mg=ei.create,gg=us.create,yg=ti.create,_g=Nn.create,vg=ni.create,Cg=ps.create,wg=zr.create,bg=ho.create,xg=ri.create,kg=oi.create,Sg=ar.create,Eg=ii.create,Tg=fo.create,Pd=ln.create,Bg=An.create,Vg=lr.create,Ng=ln.createWithPreprocess,Ag=li.create;var Pn=Object.freeze({__proto__:null,defaultErrorMap:lo,setErrorMap:Mm,getErrorMap:ss,makeIssue:as,EMPTY_PATH:Im,addIssueToContext:ie,ParseStatus:vt,INVALID:Ce,DIRTY:co,OK:Et,isAborted:$a,isDirty:Ua,isValid:jo,isAsync:qo,get util(){return Oe},get objectUtil(){return za},ZodParsedType:ae,getParsedType:or,ZodType:Ne,datetimeRegex:Ed,ZodString:sn,ZodNumber:ir,ZodBigInt:sr,ZodBoolean:Jo,ZodDate:Lr,ZodSymbol:cs,ZodUndefined:Xo,ZodNull:Qo,ZodAny:uo,ZodUnknown:Gr,ZodNever:zn,ZodVoid:ds,ZodArray:an,ZodObject:Qe,ZodUnion:ei,ZodDiscriminatedUnion:us,ZodIntersection:ti,ZodTuple:Nn,ZodRecord:ni,ZodMap:ps,ZodSet:zr,ZodFunction:ho,ZodLazy:ri,ZodLiteral:oi,ZodEnum:ar,ZodNativeEnum:ii,ZodPromise:fo,ZodEffects:ln,ZodTransformer:ln,ZodOptional:An,ZodNullable:lr,ZodDefault:si,ZodCatch:ai,ZodNaN:hs,BRAND:Qm,ZodBranded:Ha,ZodPipeline:li,ZodReadonly:ci,custom:Bd,Schema:Ne,ZodSchema:Ne,late:eg,get ZodFirstPartyTypeKind(){return _e},coerce:{string:t=>sn.create({...t,coerce:!0}),number:t=>ir.create({...t,coerce:!0}),boolean:t=>Jo.create({...t,coerce:!0}),bigint:t=>sr.create({...t,coerce:!0}),date:t=>Lr.create({...t,coerce:!0})},any:lg,array:pg,bigint:rg,boolean:Ad,date:og,discriminatedUnion:gg,effect:Pd,enum:Sg,function:bg,instanceof:tg,intersection:yg,lazy:xg,literal:kg,map:Cg,nan:ng,nativeEnum:Eg,never:dg,null:ag,nullable:Vg,number:Nd,object:hg,oboolean:()=>Ad().optional(),onumber:()=>Nd().optional(),optional:Bg,ostring:()=>Vd().optional(),pipeline:Ag,preprocess:Ng,promise:Tg,record:vg,set:wg,strictObject:fg,string:Vd,symbol:ig,transformer:Pd,tuple:_g,undefined:sg,union:mg,unknown:cg,void:ug,NEVER:Ce,ZodIssueCode:J,quotelessJson:Rm,ZodError:Ot});function Pg(t){throw new Error("Unexpected object: "+t)}const Dg=-2147483648,Dd=-9007199254740991n,Fg=NaN,Rg=NaN,Mg=null,Ig=null;function Fd(t,e){switch(e){case"Int":return t===Dg;case"Long":return t===Number(Dd)||t===Dd;case"Float":return t===Fg;case"Double":return t===Rg;case"String":return t===Mg;case"Bytes":return t===Ig;default:throw Error(`unsupported data type: ${e}`)}}function Og(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function ja(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function Rd(t){return t.map(ja)}function fs(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=>fs(n,e))};case"outer":return{type:"outer",primary:fs(t.primary,e),secondary:t.secondary.map(n=>fs(n,e))};default:Pg(t)}}Pn.object({__isRef:Pn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Pn.string().describe("Upstream block id"),name:Pn.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 Lg(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 Gg=Pn.object({type:Pn.string(),importance:Pn.number().optional(),id:Pn.string().optional(),label:Pn.string()});Pn.array(Gg);const zg="1.13.15";function $g(){return Lg({sdkVersion:zg})}function Ug(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function mo(t){return!!t&&typeof t.children<"u"}function cr(t){return mo(t)?t.groupId:t.colId}function Md(t,e,n){const o=(c,u)=>{const p=c.children.map(cr),f=x._includes(p,cr(u)),m=x._last(c.children),y=m&&cr(m)!==cr(u);return f&&y};if(!mo(t))return!0;const s=t,l=n;if(o(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(cr);if(!x._includes(c,cr(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!Md(s.children[c],e,n);c--);return!1}function Zg(t){const e=(s,l)=>mo(s)&&mo(l)&&cr(s)===cr(l),n=(s,l)=>{if(!mo(l))return s;const c=s,u=l;return u.children&&u.groupId&&Md(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},o=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):o.push(l)}return o}var Wg=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(mo(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new x.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&f.push(y)}),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}},o=[];return t.forEach(s=>{const l=n(s,0);l&&o.push(l)}),e.length>0&&x._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Zg(e);t(n)}getLeafPathTrees(){const t=(o,s)=>{let l;if(x.isProvidedColumnGroup(o))if(o.isPadding())l=s;else{const u=Object.assign({},o.getColGroupDef());u.groupId=o.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},o.getColDef());u.colId=o.getColId(),l=u}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const s=o.getColDef();return o.isPrimary()&&!s.showRowGroup}).map(o=>t(o,o.getColDef()))}};function Hg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function jg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function qg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Kg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Yg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Jg(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 Qg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function ey(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return x._unwrapUserComp(n)}function ty(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var ny=class extends x.Component{constructor(t){super(),this.eToggleButton=x.RefPlaceholder,this.eIconWrapper=x.RefPlaceholder,this.eLabel=x.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 Vm(t){return{ok:!0,value:t}}function vd(t){if(!t)throw new Da;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function Cd(t){return{value:t,errors:void 0}}function Nm(t){if(t.errors)throw new Fa(t.errors);if(!t.value)throw new Da;return t.value}function Am(t){return t!==void 0}function Ra(t,e){return Or(t)===Or(e)}const Ma=t=>t,Ia=t=>t instanceof Error?t:Error(String(t)),Oa=t=>t.name==="ZodError",La=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function Ga(t){const e=t.validate??Ma,{autoSave:n}=t,o=r.ref(),s=r.ref(),l=A=>{s.value={model:Bn(A)}};r.watch(()=>t.get(),A=>l(A),{immediate:!0});const c=()=>{var A;t.onSave(e(Bn((A=s.value)==null?void 0:A.model)))},u=()=>{l(t.get()),o.value=void 0},p=A=>{const I=Ia(A);Oa(I)?o.value=Error(La(I)):o.value=I},f=A=>{o.value=void 0;try{e(A),n&&c()}catch(I){p(I)}},m=r.computed({get:()=>{var A;return(A=s.value)==null?void 0:A.model},set(A){l(A),f(A)}});r.watch(s,(A,I)=>{A&&A===I&&f(A.model)},{deep:!0});const y=r.computed(()=>!o.value),T=r.computed(()=>!Ra(t.get(),r.unref(s))),B=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:T,error:o,errorString:B,save:c,revert:u,setError:p})}function Pm(t,e,n){const o=t.validate??Ma,{autoSave:s}=t,l=r.ref(),c=r.ref(),u=L=>{var C;if(n.deepPatchModel){const R=(C=c.value)==null?void 0:C.model,O=Object.assign(Bn(L),e??{});c.value={model:R?_d(R,O):O,stage:Symbol()}}else c.value={model:Object.assign(Bn(L),e??{}),stage:Symbol()}};r.watch(()=>t.get(),L=>u(L),{immediate:!0});const p=()=>{var L;t.onSave(o(Bn((L=c.value)==null?void 0:L.model)))},f=()=>{u(t.get()),l.value=void 0},m=L=>{const C=Ia(L);Oa(C)?l.value=Error(La(C)):l.value=C},y=L=>{l.value=void 0;try{o(L),s&&p()}catch(C){m(C)}},T=r.computed({get:()=>{var L;return(L=c.value)==null?void 0:L.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:T.value.args,ui:T.value.ui}),()=>{var L;return(L=c.value)==null?void 0:L.stage}],([L,C],[R,O])=>{C===O&&y(L)},{deep:!0});const B=r.computed(()=>!l.value),A=r.computed(()=>{var R;const{args:L,ui:C}=((R=r.unref(c))==null?void 0:R.model)??{};return!Ra(t.get(),{args:L,ui:C})}),I=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:T,valid:B,isChanged:A,error:l,errorString:I,save:p,revert:f,setError:m})}const Dm=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Fm(t,e,n){const o=(C,...R)=>{n.debug&&console.log(`%c>>> %c${C}`,"color: orange; font-weight: bold","color: orange",...R)},l=Pa(e.setBlockArgs,100),c=Pa(e.setBlockUiState,100),u=Pa(e.setBlockArgsAndUiState,100),p=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 C=>{C.forEach(R=>{R.key==="args"&&(p.args=Object.freeze(R.value),o("args patch",p.args)),R.key==="ui"&&(p.ui=Object.freeze(R.value),o("ui patch",p.ui)),R.key==="outputs"&&(p.outputs=Object.freeze(R.value),o("outputs patch",p.outputs)),R.key==="navigationState"&&(p.navigationState=Object.freeze(R.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const f=()=>Bn(p.args),m=()=>Bn(p.ui),y=()=>Bn(p.navigationState),T={createArgsModel(C={}){return Ga({get(){return C.transform?C.transform(p.args):p.args},validate:C.validate,autoSave:!0,onSave(R){l(R)}})},createUiModel(C={},R){return Ga({get(){return C.transform?C.transform(p.ui):p.ui??R()},validate:C.validate,autoSave:!0,onSave(O){c(O)}})},useOutputs(...C){const R=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(R,{value:this.unwrapOutputs(...C),errors:void 0})}catch(O){Object.assign(R,{value:void 0,errors:[String(O)]})}},{immediate:!0,deep:!0}),R},unwrapOutputs(...C){const R=p.outputs,O=C.map(F=>[F,vd(R[F])]);return Object.fromEntries(O)},getOutputField(C){return p.outputs[C]},getOutputFieldOkOptional(C){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const R=this.getOutputField(C);if(R&&R.ok)return R.value},getOutputFieldErrorsOptional(C){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const R=this.getOutputField(C);if(R&&!R.ok)return R.errors},updateArgs(C){const R=f();return C(R),e.setBlockArgs(R)},updateUiState(C){const R=m();return e.setBlockUiState(C(R))},updateNavigationState(C){const R=y();return C(R),e.setNavigationState(R)},navigateTo(C){const R=y();return R.href=C,e.setNavigationState(R)}},B=r.computed(()=>{const C=Object.entries(p.outputs).map(([R,O])=>[R,O.ok&&O.value!==void 0?O.value:void 0]);return Object.fromEntries(C)}),A=r.computed(()=>{const C=Object.entries(p.outputs).map(([R,O])=>[R,O&&!O.ok?new Fa(O.errors):void 0]);return Object.fromEntries(C)}),I={snapshot:p,queryParams:r.computed(()=>Dm(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(C=>!(C!=null&&C.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),B.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),A.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},L=Pm({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(C){u(C.args,C.ui)}},{outputs:B,outputErrors:A},n);return r.reactive(Object.assign(L,T,I))}var Oe;(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 o(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Oe||(Oe={}));var za;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(za||(za={}));const ae=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),or=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},J=Oe.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"]),Rm=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ot extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};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},o={_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)o._errors.push(n(c));else{let u=o,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),o}static assert(e){if(!(e instanceof Ot))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];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))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Ot.create=t=>new Ot(t);const lo=(t,e)=>{let n;switch(t.code){case J.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Oe.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}"`:Oe.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,Oe.assertNever(t)}return{message:n}};let wd=lo;function Mm(t){wd=t}function ss(){return wd}const as=t=>{const{data:e,path:n,errorMaps:o,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=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},Im=[];function ie(t,e){const n=ss(),o=as({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===lo?void 0:lo].filter(s=>!!s)});t.common.issues.push(o)}class vt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,c=await s.value;o.push({key:l,value:c})}return vt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const Ce=Object.freeze({status:"aborted"}),co=t=>({status:"dirty",value:t}),Et=t=>({status:"valid",value:t}),$a=t=>t.status==="aborted",Ua=t=>t.status==="dirty",jo=t=>t.status==="valid",qo=t=>typeof Promise<"u"&&t instanceof Promise;function ls(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function bd(t,e,n,o,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 pe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pe||(pe={}));var Ko,Yo;class Vn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,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 xd=(t,e)=>{if(jo(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 Ot(t.common.issues);return this._error=n,this._error}}};function Te(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:s}=t;if(e&&(n||o))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??o)!==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 Ne{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 or(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:or(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(qo(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 o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const s={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:or(e)},l=this._parseSync({data:e,path:s.path,parent:s});return xd(s,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={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:or(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(qo(s)?s:Promise.resolve(s));return xd(o,l)}refine(e,n){const o=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,...o(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((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new ln({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return An.create(this,this._def)}nullable(){return lr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return an.create(this,this._def)}promise(){return fo.create(this,this._def)}or(e){return ei.create([this,e],this._def)}and(e){return ti.create(this,e,this._def)}transform(e){return new ln({...Te(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new si({...Te(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new Ha({typeName:_e.ZodBranded,type:this,...Te(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ai({...Te(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return li.create(this,e)}readonly(){return ci.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Om=/^c[^\s-]{8,}$/i,Lm=/^[0-9a-z]+$/,Gm=/^[0-9A-HJKMNP-TV-Z]{26}$/,zm=/^[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,$m=/^[a-z0-9_-]{21}$/i,Um=/^[-+]?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)?)??$/,Zm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Wm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Za;const Hm=/^(?:(?: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])$/,jm=/^(([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})))$/,qm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,kd="((\\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])))",Km=new RegExp(`^${kd}$`);function Sd(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 Ym(t){return new RegExp(`^${Sd(t)}$`)}function Ed(t){let e=`${kd}T${Sd(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 Jm(t,e){return!!((e==="v4"||!e)&&Hm.test(t)||(e==="v6"||!e)&&jm.test(t))}class sn extends Ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const l=this._getOrReturnCtx(e);return ie(l,{code:J.invalid_type,expected:ae.string,received:l.parsedType}),Ce}const o=new vt;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.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?ie(s,{code:J.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&ie(s,{code:J.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")Zm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"email",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")Za||(Za=new RegExp(Wm,"u")),Za.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"emoji",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")zm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"uuid",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")$m.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"nanoid",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")Om.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Lm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid2",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Gm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ulid",code:J.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ie(s,{validation:"url",code:J.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"regex",code:J.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),ie(s,{code:J.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.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),ie(s,{code:J.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:J.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?Ed(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:J.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?Km.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:J.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Ym(l).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:J.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?Um.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"duration",code:J.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Jm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ip",code:J.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?qm.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"base64",code:J.invalid_string,message:l.message}),o.dirty()):Oe.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:J.invalid_string,...pe.errToObj(o)})}_addCheck(e){return new sn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...pe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...pe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pe.errToObj(e)})}datetime(e){var n,o;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:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...pe.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,...pe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...pe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...pe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...pe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...pe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...pe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...pe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...pe.errToObj(n)})}nonempty(e){return this.min(1,pe.errToObj(e))}trim(){return new sn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new sn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new sn({...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}}sn.create=t=>{var e;return new sn({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};function Xm(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class ir extends Ne{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)!==ae.number){const l=this._getOrReturnCtx(e);return ie(l,{code:J.invalid_type,expected:ae.number,received:l.parsedType}),Ce}let o;const s=new vt;for(const l of this._def.checks)l.kind==="int"?Oe.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{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)&&(o=this._getOrReturnCtx(e,o),ie(o,{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)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:J.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?Xm(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:J.not_finite,message:l.message}),s.dirty()):Oe.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new ir({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new ir({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:pe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.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"&&Oe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}ir.create=t=>new ir({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class sr extends Ne{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)!==ae.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:J.invalid_type,expected:ae.bigint,received:l.parsedType}),Ce}let o;const s=new vt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{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)&&(o=this._getOrReturnCtx(e,o),ie(o,{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)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:J.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Oe.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,o,s){return new sr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:pe.toString(s)}]})}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.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}}sr.create=t=>{var e;return new sr({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Te(t)})};class Jo extends Ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.boolean,received:o.parsedType}),Ce}return Et(e.data)}}Jo.create=t=>new Jo({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Te(t)});class Lr extends Ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const l=this._getOrReturnCtx(e);return ie(l,{code:J.invalid_type,expected:ae.date,received:l.parsedType}),Ce}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:J.invalid_date}),Ce}const o=new vt;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:J.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:J.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Oe.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Lr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:pe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:pe.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}}Lr.create=t=>new Lr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Te(t)});class cs extends Ne{_parse(e){if(this._getType(e)!==ae.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.symbol,received:o.parsedType}),Ce}return Et(e.data)}}cs.create=t=>new cs({typeName:_e.ZodSymbol,...Te(t)});class Xo extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.undefined,received:o.parsedType}),Ce}return Et(e.data)}}Xo.create=t=>new Xo({typeName:_e.ZodUndefined,...Te(t)});class Qo extends Ne{_parse(e){if(this._getType(e)!==ae.null){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.null,received:o.parsedType}),Ce}return Et(e.data)}}Qo.create=t=>new Qo({typeName:_e.ZodNull,...Te(t)});class uo extends Ne{constructor(){super(...arguments),this._any=!0}_parse(e){return Et(e.data)}}uo.create=t=>new uo({typeName:_e.ZodAny,...Te(t)});class Gr extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Et(e.data)}}Gr.create=t=>new Gr({typeName:_e.ZodUnknown,...Te(t)});class zn extends Ne{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:J.invalid_type,expected:ae.never,received:n.parsedType}),Ce}}zn.create=t=>new zn({typeName:_e.ZodNever,...Te(t)});class ds extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.void,received:o.parsedType}),Ce}return Et(e.data)}}ds.create=t=>new ds({typeName:_e.ZodVoid,...Te(t)});class an extends Ne{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==ae.array)return ie(n,{code:J.invalid_type,expected:ae.array,received:n.parsedType}),Ce;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ie(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}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ie(n,{code:J.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ie(n,{code:J.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new Vn(n,c,n.path,u)))).then(c=>vt.mergeArray(o,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new Vn(n,c,n.path,u)));return vt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new an({...this._def,minLength:{value:e,message:pe.toString(n)}})}max(e,n){return new an({...this._def,maxLength:{value:e,message:pe.toString(n)}})}length(e,n){return new an({...this._def,exactLength:{value:e,message:pe.toString(n)}})}nonempty(e){return this.min(1,e)}}an.create=(t,e)=>new an({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Te(e)});function po(t){if(t instanceof Qe){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=An.create(po(o))}return new Qe({...t._def,shape:()=>e})}else return t instanceof an?new an({...t._def,type:po(t.element)}):t instanceof An?An.create(po(t.unwrap())):t instanceof lr?lr.create(po(t.unwrap())):t instanceof Nn?Nn.create(t.items.map(e=>po(e))):t}class Qe extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Oe.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const f=this._getOrReturnCtx(e);return ie(f,{code:J.invalid_type,expected:ae.object,received:f.parsedType}),Ce}const{status:o,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof zn&&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],y=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new Vn(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof zn){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&&(ie(s,{code:J.unrecognized_keys,keys:u}),o.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 y=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new Vn(s,y,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of p){const y=await m.key,T=await m.value;f.push({key:y,value:T,alwaysSet:m.alwaysSet})}return f}).then(f=>vt.mergeObjectSync(o,f)):vt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return pe.errToObj,new Qe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=pe.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Qe({...this._def,unknownKeys:"strip"})}passthrough(){return new Qe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Qe({...this._def,catchall:e})}pick(e){const n={};return Oe.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}omit(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new Qe({...this._def,shape:()=>n})}deepPartial(){return po(this)}partial(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new Qe({...this._def,shape:()=>n})}required(e){const n={};return Oe.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof An;)l=l._def.innerType;n[o]=l}}),new Qe({...this._def,shape:()=>n})}keyof(){return Td(Oe.objectKeys(this.shape))}}Qe.create=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strip",catchall:zn.create(),typeName:_e.ZodObject,...Te(e)}),Qe.strictCreate=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strict",catchall:zn.create(),typeName:_e.ZodObject,...Te(e)}),Qe.lazycreate=(t,e)=>new Qe({shape:t,unknownKeys:"strip",catchall:zn.create(),typeName:_e.ZodObject,...Te(e)});class ei extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o=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 Ot(u.ctx.common.issues));return ie(n,{code:J.invalid_union,unionErrors:c}),Ce}if(n.common.async)return Promise.all(o.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 o){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 Ot(p));return ie(n,{code:J.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}ei.create=(t,e)=>new ei({options:t,typeName:_e.ZodUnion,...Te(e)});const $n=t=>t instanceof ri?$n(t.schema):t instanceof ln?$n(t.innerType()):t instanceof oi?[t.value]:t instanceof ar?t.options:t instanceof ii?Oe.objectValues(t.enum):t instanceof si?$n(t._def.innerType):t instanceof Xo?[void 0]:t instanceof Qo?[null]:t instanceof An?[void 0,...$n(t.unwrap())]:t instanceof lr?[null,...$n(t.unwrap())]:t instanceof Ha||t instanceof ci?$n(t.unwrap()):t instanceof ai?$n(t._def.innerType):[];class us extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ie(n,{code:J.invalid_type,expected:ae.object,received:n.parsedType}),Ce;const o=this.discriminator,s=n.data[o],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}):(ie(n,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const c=$n(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 us({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Te(o)})}}function Wa(t,e){const n=or(t),o=or(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&o===ae.object){const s=Oe.objectKeys(e),l=Oe.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Wa(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===ae.array&&o===ae.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=Wa(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ti extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,c)=>{if($a(l)||$a(c))return Ce;const u=Wa(l.value,c.value);return u.valid?((Ua(l)||Ua(c))&&n.dirty(),{status:n.value,value:u.data}):(ie(o,{code:J.invalid_intersection_types}),Ce)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}ti.create=(t,e,n)=>new ti({left:t,right:e,typeName:_e.ZodIntersection,...Te(n)});class Nn extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ie(o,{code:J.invalid_type,expected:ae.array,received:o.parsedType}),Ce;if(o.data.length<this._def.items.length)return ie(o,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new Vn(o,c,o.path,u)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>vt.mergeArray(n,c)):vt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Nn({...this._def,rest:e})}}Nn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nn({items:t,typeName:_e.ZodTuple,rest:null,...Te(e)})};class ni extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ie(o,{code:J.invalid_type,expected:ae.object,received:o.parsedType}),Ce;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Vn(o,u,o.path,u)),value:c._parse(new Vn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?vt.mergeObjectAsync(n,s):vt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Ne?new ni({keyType:e,valueType:n,typeName:_e.ZodRecord,...Te(o)}):new ni({keyType:sn.create(),valueType:e,typeName:_e.ZodRecord,...Te(n)})}}class ps extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ie(o,{code:J.invalid_type,expected:ae.map,received:o.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Vn(o,u,o.path,[f,"key"])),value:l._parse(new Vn(o,p,o.path,[f,"value"]))}));if(o.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 Ce;(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 Ce;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}ps.create=(t,e,n)=>new ps({valueType:e,keyType:t,typeName:_e.ZodMap,...Te(n)});class zr extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ie(o,{code:J.invalid_type,expected:ae.set,received:o.parsedType}),Ce;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(ie(o,{code:J.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(ie(o,{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 Ce;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...o.data.values()].map((p,f)=>l._parse(new Vn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new zr({...this._def,minSize:{value:e,message:pe.toString(n)}})}max(e,n){return new zr({...this._def,maxSize:{value:e,message:pe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}zr.create=(t,e)=>new zr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Te(e)});class ho extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return ie(n,{code:J.invalid_type,expected:ae.function,received:n.parsedType}),Ce;function o(u,p){return as({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ss(),lo].filter(f=>!!f),issueData:{code:J.invalid_arguments,argumentsError:p}})}function s(u,p){return as({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ss(),lo].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 fo){const u=this;return Et(async function(...p){const f=new Ot([]),m=await u._def.args.parseAsync(p,l).catch(B=>{throw f.addIssue(o(p,B)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(B=>{throw f.addIssue(s(y,B)),f})})}else{const u=this;return Et(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ot([o(p,f.error)]);const m=Reflect.apply(c,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new Ot([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ho({...this._def,args:Nn.create(e).rest(Gr.create())})}returns(e){return new ho({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new ho({args:e||Nn.create([]).rest(Gr.create()),returns:n||Gr.create(),typeName:_e.ZodFunction,...Te(o)})}}class ri extends Ne{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})}}ri.create=(t,e)=>new ri({getter:t,typeName:_e.ZodLazy,...Te(e)});class oi extends Ne{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}oi.create=(t,e)=>new oi({value:t,typeName:_e.ZodLiteral,...Te(e)});function Td(t,e){return new ar({values:t,typeName:_e.ZodEnum,...Te(e)})}class ar extends Ne{constructor(){super(...arguments),Ko.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Oe.joinValues(o),received:n.parsedType,code:J.invalid_type}),Ce}if(ls(this,Ko)||bd(this,Ko,new Set(this._def.values)),!ls(this,Ko).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:J.invalid_enum_value,options:o}),Ce}return Et(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 ar.create(e,{...this._def,...n})}exclude(e,n=this._def){return ar.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}Ko=new WeakMap,ar.create=Td;class ii extends Ne{constructor(){super(...arguments),Yo.set(this,void 0)}_parse(e){const n=Oe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const s=Oe.objectValues(n);return ie(o,{expected:Oe.joinValues(s),received:o.parsedType,code:J.invalid_type}),Ce}if(ls(this,Yo)||bd(this,Yo,new Set(Oe.getValidEnumValues(this._def.values))),!ls(this,Yo).has(e.data)){const s=Oe.objectValues(n);return ie(o,{received:o.data,code:J.invalid_enum_value,options:s}),Ce}return Et(e.data)}get enum(){return this._def.values}}Yo=new WeakMap,ii.create=(t,e)=>new ii({values:t,typeName:_e.ZodNativeEnum,...Te(e)});class fo extends Ne{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return ie(n,{code:J.invalid_type,expected:ae.promise,received:n.parsedType}),Ce;const o=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return Et(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}fo.create=(t,e)=>new fo({type:t,typeName:_e.ZodPromise,...Te(e)});class ln extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?co(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:c,path:o.path,parent:o});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?co(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(o.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(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!jo(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:o.data,path:o.path,parent:o}).then(c=>jo(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Oe.assertNever(s)}}ln.create=(t,e,n)=>new ln({schema:t,typeName:_e.ZodEffects,effect:e,...Te(n)}),ln.createWithPreprocess=(t,e,n)=>new ln({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Te(n)});class An extends Ne{_parse(e){return this._getType(e)===ae.undefined?Et(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}An.create=(t,e)=>new An({innerType:t,typeName:_e.ZodOptional,...Te(e)});class lr extends Ne{_parse(e){return this._getType(e)===ae.null?Et(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}lr.create=(t,e)=>new lr({innerType:t,typeName:_e.ZodNullable,...Te(e)});class si extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}si.create=(t,e)=>new si({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Te(e)});class ai extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return qo(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ot(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ot(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ai.create=(t,e)=>new ai({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Te(e)});class hs extends Ne{_parse(e){if(this._getType(e)!==ae.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:J.invalid_type,expected:ae.nan,received:o.parsedType}),Ce}return{status:"valid",value:e.data}}}hs.create=t=>new hs({typeName:_e.ZodNaN,...Te(t)});const Qm=Symbol("zod_brand");class Ha extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class li extends Ne{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?Ce:l.status==="dirty"?(n.dirty(),co(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new li({in:e,out:n,typeName:_e.ZodPipeline})}}class ci extends Ne{_parse(e){const n=this._def.innerType._parse(e),o=s=>(jo(s)&&(s.value=Object.freeze(s.value)),s);return qo(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}ci.create=(t,e)=>new ci({innerType:t,typeName:_e.ZodReadonly,...Te(e)});function Bd(t,e={},n){return t?uo.create().superRefine((o,s)=>{var l,c;if(!t(o)){const u=typeof e=="function"?e(o):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})}}):uo.create()}const eg={object:Qe.lazycreate};var _e;(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"})(_e||(_e={}));const tg=(t,e={message:`Input not instance of ${t.name}`})=>Bd(n=>n instanceof t,e),Vd=sn.create,Nd=ir.create,ng=hs.create,rg=sr.create,Ad=Jo.create,og=Lr.create,ig=cs.create,sg=Xo.create,ag=Qo.create,lg=uo.create,cg=Gr.create,dg=zn.create,ug=ds.create,pg=an.create,hg=Qe.create,fg=Qe.strictCreate,mg=ei.create,gg=us.create,yg=ti.create,_g=Nn.create,vg=ni.create,Cg=ps.create,wg=zr.create,bg=ho.create,xg=ri.create,kg=oi.create,Sg=ar.create,Eg=ii.create,Tg=fo.create,Pd=ln.create,Bg=An.create,Vg=lr.create,Ng=ln.createWithPreprocess,Ag=li.create;var Pn=Object.freeze({__proto__:null,defaultErrorMap:lo,setErrorMap:Mm,getErrorMap:ss,makeIssue:as,EMPTY_PATH:Im,addIssueToContext:ie,ParseStatus:vt,INVALID:Ce,DIRTY:co,OK:Et,isAborted:$a,isDirty:Ua,isValid:jo,isAsync:qo,get util(){return Oe},get objectUtil(){return za},ZodParsedType:ae,getParsedType:or,ZodType:Ne,datetimeRegex:Ed,ZodString:sn,ZodNumber:ir,ZodBigInt:sr,ZodBoolean:Jo,ZodDate:Lr,ZodSymbol:cs,ZodUndefined:Xo,ZodNull:Qo,ZodAny:uo,ZodUnknown:Gr,ZodNever:zn,ZodVoid:ds,ZodArray:an,ZodObject:Qe,ZodUnion:ei,ZodDiscriminatedUnion:us,ZodIntersection:ti,ZodTuple:Nn,ZodRecord:ni,ZodMap:ps,ZodSet:zr,ZodFunction:ho,ZodLazy:ri,ZodLiteral:oi,ZodEnum:ar,ZodNativeEnum:ii,ZodPromise:fo,ZodEffects:ln,ZodTransformer:ln,ZodOptional:An,ZodNullable:lr,ZodDefault:si,ZodCatch:ai,ZodNaN:hs,BRAND:Qm,ZodBranded:Ha,ZodPipeline:li,ZodReadonly:ci,custom:Bd,Schema:Ne,ZodSchema:Ne,late:eg,get ZodFirstPartyTypeKind(){return _e},coerce:{string:t=>sn.create({...t,coerce:!0}),number:t=>ir.create({...t,coerce:!0}),boolean:t=>Jo.create({...t,coerce:!0}),bigint:t=>sr.create({...t,coerce:!0}),date:t=>Lr.create({...t,coerce:!0})},any:lg,array:pg,bigint:rg,boolean:Ad,date:og,discriminatedUnion:gg,effect:Pd,enum:Sg,function:bg,instanceof:tg,intersection:yg,lazy:xg,literal:kg,map:Cg,nan:ng,nativeEnum:Eg,never:dg,null:ag,nullable:Vg,number:Nd,object:hg,oboolean:()=>Ad().optional(),onumber:()=>Nd().optional(),optional:Bg,ostring:()=>Vd().optional(),pipeline:Ag,preprocess:Ng,promise:Tg,record:vg,set:wg,strictObject:fg,string:Vd,symbol:ig,transformer:Pd,tuple:_g,undefined:sg,union:mg,unknown:cg,void:ug,NEVER:Ce,ZodIssueCode:J,quotelessJson:Rm,ZodError:Ot});function Pg(t){throw new Error("Unexpected object: "+t)}const Dg=-2147483648,Dd=-9007199254740991n,Fg=NaN,Rg=NaN,Mg=null,Ig=null;function Fd(t,e){switch(e){case"Int":return t===Dg;case"Long":return t===Number(Dd)||t===Dd;case"Float":return t===Fg;case"Double":return t===Rg;case"String":return t===Mg;case"Bytes":return t===Ig;default:throw Error(`unsupported data type: ${e}`)}}function Og(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function ja(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function Rd(t){return t.map(ja)}function fs(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=>fs(n,e))};case"outer":return{type:"outer",primary:fs(t.primary,e),secondary:t.secondary.map(n=>fs(n,e))};default:Pg(t)}}Pn.object({__isRef:Pn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Pn.string().describe("Upstream block id"),name:Pn.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 Lg(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 Gg=Pn.object({type:Pn.string(),importance:Pn.number().optional(),id:Pn.string().optional(),label:Pn.string()});Pn.array(Gg);const zg="1.14.0";function $g(){return Lg({sdkVersion:zg})}function Ug(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function mo(t){return!!t&&typeof t.children<"u"}function cr(t){return mo(t)?t.groupId:t.colId}function Md(t,e,n){const o=(c,u)=>{const p=c.children.map(cr),f=x._includes(p,cr(u)),m=x._last(c.children),y=m&&cr(m)!==cr(u);return f&&y};if(!mo(t))return!0;const s=t,l=n;if(o(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(cr);if(!x._includes(c,cr(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!Md(s.children[c],e,n);c--);return!1}function Zg(t){const e=(s,l)=>mo(s)&&mo(l)&&cr(s)===cr(l),n=(s,l)=>{if(!mo(l))return s;const c=s,u=l;return u.children&&u.groupId&&Md(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},o=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):o.push(l)}return o}var Wg=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(mo(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new x.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&f.push(y)}),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}},o=[];return t.forEach(s=>{const l=n(s,0);l&&o.push(l)}),e.length>0&&x._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Zg(e);t(n)}getLeafPathTrees(){const t=(o,s)=>{let l;if(x.isProvidedColumnGroup(o))if(o.isPadding())l=s;else{const u=Object.assign({},o.getColGroupDef());u.groupId=o.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},o.getColDef());u.colId=o.getColId(),l=u}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const s=o.getColDef();return o.isPrimary()&&!s.showRowGroup}).map(o=>t(o,o.getColDef()))}};function Hg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function jg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function qg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Kg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Yg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Jg(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 Qg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function ey(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return x._unwrapUserComp(n)}function ty(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var ny=class extends x.Component{constructor(t){super(),this.eToggleButton=x.RefPlaceholder,this.eIconWrapper=x.RefPlaceholder,this.eLabel=x.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>
|
|
@@ -88,4 +88,4 @@ __p += '`),Me&&(K+=`' +
|
|
|
88
88
|
function print() { __p += __j.call(arguments, '') }
|
|
89
89
|
`:`;
|
|
90
90
|
`)+K+`return __p
|
|
91
|
-
}`;var Pe=cm(function(){return Ue(v,ue+"return "+K).apply(n,E)});if(Pe.source=K,Yc(Pe))throw Pe;return Pe}function cR(i){return We(i).toLowerCase()}function dR(i){return We(i).toUpperCase()}function uR(i,a,d){if(i=We(i),i&&(d||a===n))return yh(i);if(!i||!(a=jt(a)))return i;var h=kn(i),g=kn(a),v=_h(h,g),E=vh(h,g)+1;return Dr(h,v,E).join("")}function pR(i,a,d){if(i=We(i),i&&(d||a===n))return i.slice(0,wh(i)+1);if(!i||!(a=jt(a)))return i;var h=kn(i),g=vh(h,kn(a))+1;return Dr(h,0,g).join("")}function hR(i,a,d){if(i=We(i),i&&(d||a===n))return i.replace(Yl,"");if(!i||!(a=jt(a)))return i;var h=kn(i),g=_h(h,kn(a));return Dr(h,g).join("")}function fR(i,a){var d=q,h=ee;if(tt(a)){var g="separator"in a?a.separator:g;d="length"in a?Ve(a.length):d,h="omission"in a?jt(a.omission):h}i=We(i);var v=i.length;if(Fo(i)){var E=kn(i);v=E.length}if(d>=v)return i;var V=d-Ro(h);if(V<1)return h;var D=E?Dr(E,0,V).join(""):i.slice(0,V);if(g===n)return D+h;if(E&&(V+=D.length-V),Jc(g)){if(i.slice(V).search(g)){var W,H=D;for(g.global||(g=hc(g.source,We(Lp.exec(g))+"g")),g.lastIndex=0;W=g.exec(H);)var K=W.index;D=D.slice(0,K===n?V:K)}}else if(i.indexOf(jt(g),V)!=V){var oe=D.lastIndexOf(g);oe>-1&&(D=D.slice(0,oe))}return D+h}function mR(i){return i=We(i),i&&EB.test(i)?i.replace(Mp,ZV):i}var gR=$o(function(i,a,d){return i+(d?" ":"")+a.toUpperCase()}),ed=df("toUpperCase");function lm(i,a,d){return i=We(i),a=d?n:a,a===n?LV(i)?jV(i):NV(i):i.match(a)||[]}var cm=De(function(i,a){try{return Wt(i,n,a)}catch(d){return Yc(d)?d:new ke(d)}}),yR=Qn(function(i,a){return Xt(a,function(d){d=Gn(d),Jn(i,d,qc(i[d],i))}),i});function _R(i){var a=i==null?0:i.length,d=fe();return i=a?Xe(i,function(h){if(typeof h[1]!="function")throw new Qt(c);return[d(h[0]),h[1]]}):[],De(function(h){for(var g=-1;++g<a;){var v=i[g];if(Wt(v[0],this,h))return Wt(v[1],this,h)}})}function vR(i){return ZN(tn(i,y))}function td(i){return function(){return i}}function CR(i,a){return i==null||i!==i?a:i}var wR=pf(),bR=pf(!0);function It(i){return i}function nd(i){return zh(typeof i=="function"?i:tn(i,y))}function xR(i){return Uh(tn(i,y))}function kR(i,a){return Zh(i,tn(a,y))}var SR=De(function(i,a){return function(d){return Ji(d,i,a)}}),ER=De(function(i,a){return function(d){return Ji(i,d,a)}});function rd(i,a,d){var h=gt(a),g=ca(a,h);d==null&&!(tt(a)&&(g.length||!h.length))&&(d=a,a=i,i=this,g=ca(a,gt(a)));var v=!(tt(d)&&"chain"in d)||!!d.chain,E=tr(i);return Xt(g,function(V){var D=a[V];i[V]=D,E&&(i.prototype[V]=function(){var W=this.__chain__;if(v||W){var H=i(this.__wrapped__),K=H.__actions__=Ft(this.__actions__);return K.push({func:D,args:arguments,thisArg:i}),H.__chain__=W,H}return D.apply(i,Tr([this.value()],arguments))})}),i}function TR(){return yt._===this&&(yt._=QV),this}function od(){}function BR(i){return i=Ve(i),De(function(a){return Wh(a,i)})}var VR=Rc(Xe),NR=Rc(ph),AR=Rc(sc);function dm(i){return $c(i)?ac(Gn(i)):aA(i)}function PR(i){return function(a){return i==null?n:oo(i,a)}}var DR=ff(),FR=ff(!0);function id(){return[]}function sd(){return!1}function RR(){return{}}function MR(){return""}function IR(){return!0}function OR(i,a){if(i=Ve(i),i<1||i>ne)return[];var d=ot,h=kt(i,ot);a=fe(a),i-=ot;for(var g=dc(h,a);++d<i;)a(d);return g}function LR(i){return Ee(i)?Xe(i,Gn):qt(i)?[i]:Ft(Nf(We(i)))}function GR(i){var a=++JV;return We(i)+a}var zR=ma(function(i,a){return i+a},0),$R=Mc("ceil"),UR=ma(function(i,a){return i/a},1),ZR=Mc("floor");function WR(i){return i&&i.length?la(i,It,wc):n}function HR(i,a){return i&&i.length?la(i,fe(a,2),wc):n}function jR(i){return mh(i,It)}function qR(i,a){return mh(i,fe(a,2))}function KR(i){return i&&i.length?la(i,It,Sc):n}function YR(i,a){return i&&i.length?la(i,fe(a,2),Sc):n}var JR=ma(function(i,a){return i*a},1),XR=Mc("round"),QR=ma(function(i,a){return i-a},0);function eM(i){return i&&i.length?cc(i,It):0}function tM(i,a){return i&&i.length?cc(i,fe(a,2)):0}return _.after=xD,_.ary=zf,_.assign=dF,_.assignIn=tm,_.assignInWith=Ba,_.assignWith=uF,_.at=pF,_.before=$f,_.bind=qc,_.bindAll=yR,_.bindKey=Uf,_.castArray=RD,_.chain=Of,_.chunk=ZA,_.compact=WA,_.concat=HA,_.cond=_R,_.conforms=vR,_.constant=td,_.countBy=eD,_.create=hF,_.curry=Zf,_.curryRight=Wf,_.debounce=Hf,_.defaults=fF,_.defaultsDeep=mF,_.defer=kD,_.delay=SD,_.difference=jA,_.differenceBy=qA,_.differenceWith=KA,_.drop=YA,_.dropRight=JA,_.dropRightWhile=XA,_.dropWhile=QA,_.fill=eP,_.filter=nD,_.flatMap=iD,_.flatMapDeep=sD,_.flatMapDepth=aD,_.flatten=Ff,_.flattenDeep=tP,_.flattenDepth=nP,_.flip=ED,_.flow=wR,_.flowRight=bR,_.fromPairs=rP,_.functions=bF,_.functionsIn=xF,_.groupBy=lD,_.initial=iP,_.intersection=sP,_.intersectionBy=aP,_.intersectionWith=lP,_.invert=SF,_.invertBy=EF,_.invokeMap=dD,_.iteratee=nd,_.keyBy=uD,_.keys=gt,_.keysIn=Mt,_.map=ba,_.mapKeys=BF,_.mapValues=VF,_.matches=xR,_.matchesProperty=kR,_.memoize=ka,_.merge=NF,_.mergeWith=nm,_.method=SR,_.methodOf=ER,_.mixin=rd,_.negate=Sa,_.nthArg=BR,_.omit=AF,_.omitBy=PF,_.once=TD,_.orderBy=pD,_.over=VR,_.overArgs=BD,_.overEvery=NR,_.overSome=AR,_.partial=Kc,_.partialRight=jf,_.partition=hD,_.pick=DF,_.pickBy=rm,_.property=dm,_.propertyOf=PR,_.pull=pP,_.pullAll=Mf,_.pullAllBy=hP,_.pullAllWith=fP,_.pullAt=mP,_.range=DR,_.rangeRight=FR,_.rearg=VD,_.reject=gD,_.remove=gP,_.rest=ND,_.reverse=Hc,_.sampleSize=_D,_.set=RF,_.setWith=MF,_.shuffle=vD,_.slice=yP,_.sortBy=bD,_.sortedUniq=kP,_.sortedUniqBy=SP,_.split=iR,_.spread=AD,_.tail=EP,_.take=TP,_.takeRight=BP,_.takeRightWhile=VP,_.takeWhile=NP,_.tap=WP,_.throttle=PD,_.thru=wa,_.toArray=Xf,_.toPairs=om,_.toPairsIn=im,_.toPath=LR,_.toPlainObject=em,_.transform=IF,_.unary=DD,_.union=AP,_.unionBy=PP,_.unionWith=DP,_.uniq=FP,_.uniqBy=RP,_.uniqWith=MP,_.unset=OF,_.unzip=jc,_.unzipWith=If,_.update=LF,_.updateWith=GF,_.values=Wo,_.valuesIn=zF,_.without=IP,_.words=lm,_.wrap=FD,_.xor=OP,_.xorBy=LP,_.xorWith=GP,_.zip=zP,_.zipObject=$P,_.zipObjectDeep=UP,_.zipWith=ZP,_.entries=om,_.entriesIn=im,_.extend=tm,_.extendWith=Ba,rd(_,_),_.add=zR,_.attempt=cm,_.camelCase=WF,_.capitalize=sm,_.ceil=$R,_.clamp=$F,_.clone=MD,_.cloneDeep=OD,_.cloneDeepWith=LD,_.cloneWith=ID,_.conformsTo=GD,_.deburr=am,_.defaultTo=CR,_.divide=UR,_.endsWith=HF,_.eq=En,_.escape=jF,_.escapeRegExp=qF,_.every=tD,_.find=rD,_.findIndex=Pf,_.findKey=gF,_.findLast=oD,_.findLastIndex=Df,_.findLastKey=yF,_.floor=ZR,_.forEach=Lf,_.forEachRight=Gf,_.forIn=_F,_.forInRight=vF,_.forOwn=CF,_.forOwnRight=wF,_.get=Xc,_.gt=zD,_.gte=$D,_.has=kF,_.hasIn=Qc,_.head=Rf,_.identity=It,_.includes=cD,_.indexOf=oP,_.inRange=UF,_.invoke=TF,_.isArguments=ao,_.isArray=Ee,_.isArrayBuffer=UD,_.isArrayLike=Rt,_.isArrayLikeObject=it,_.isBoolean=ZD,_.isBuffer=Fr,_.isDate=WD,_.isElement=HD,_.isEmpty=jD,_.isEqual=qD,_.isEqualWith=KD,_.isError=Yc,_.isFinite=YD,_.isFunction=tr,_.isInteger=qf,_.isLength=Ea,_.isMap=Kf,_.isMatch=JD,_.isMatchWith=XD,_.isNaN=QD,_.isNative=eF,_.isNil=nF,_.isNull=tF,_.isNumber=Yf,_.isObject=tt,_.isObjectLike=nt,_.isPlainObject=rs,_.isRegExp=Jc,_.isSafeInteger=rF,_.isSet=Jf,_.isString=Ta,_.isSymbol=qt,_.isTypedArray=Zo,_.isUndefined=oF,_.isWeakMap=iF,_.isWeakSet=sF,_.join=cP,_.kebabCase=KF,_.last=rn,_.lastIndexOf=dP,_.lowerCase=YF,_.lowerFirst=JF,_.lt=aF,_.lte=lF,_.max=WR,_.maxBy=HR,_.mean=jR,_.meanBy=qR,_.min=KR,_.minBy=YR,_.stubArray=id,_.stubFalse=sd,_.stubObject=RR,_.stubString=MR,_.stubTrue=IR,_.multiply=JR,_.nth=uP,_.noConflict=TR,_.noop=od,_.now=xa,_.pad=XF,_.padEnd=QF,_.padStart=eR,_.parseInt=tR,_.random=ZF,_.reduce=fD,_.reduceRight=mD,_.repeat=nR,_.replace=rR,_.result=FF,_.round=XR,_.runInContext=P,_.sample=yD,_.size=CD,_.snakeCase=oR,_.some=wD,_.sortedIndex=_P,_.sortedIndexBy=vP,_.sortedIndexOf=CP,_.sortedLastIndex=wP,_.sortedLastIndexBy=bP,_.sortedLastIndexOf=xP,_.startCase=sR,_.startsWith=aR,_.subtract=QR,_.sum=eM,_.sumBy=tM,_.template=lR,_.times=OR,_.toFinite=nr,_.toInteger=Ve,_.toLength=Qf,_.toLower=cR,_.toNumber=on,_.toSafeInteger=cF,_.toString=We,_.toUpper=dR,_.trim=uR,_.trimEnd=pR,_.trimStart=hR,_.truncate=fR,_.unescape=mR,_.uniqueId=GR,_.upperCase=gR,_.upperFirst=ed,_.each=Lf,_.eachRight=Gf,_.first=Rf,rd(_,function(){var i={};return On(_,function(a,d){He.call(_.prototype,d)||(i[d]=a)}),i}(),{chain:!1}),_.VERSION=o,Xt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){_[i].placeholder=_}),Xt(["drop","take"],function(i,a){Re.prototype[i]=function(d){d=d===n?1:pt(Ve(d),0);var h=this.__filtered__&&!a?new Re(this):this.clone();return h.__filtered__?h.__takeCount__=kt(d,h.__takeCount__):h.__views__.push({size:kt(d,ot),type:i+(h.__dir__<0?"Right":"")}),h},Re.prototype[i+"Right"]=function(d){return this.reverse()[i](d).reverse()}}),Xt(["filter","map","takeWhile"],function(i,a){var d=a+1,h=d==w||d==$;Re.prototype[i]=function(g){var v=this.clone();return v.__iteratees__.push({iteratee:fe(g,3),type:d}),v.__filtered__=v.__filtered__||h,v}}),Xt(["head","last"],function(i,a){var d="take"+(a?"Right":"");Re.prototype[i]=function(){return this[d](1).value()[0]}}),Xt(["initial","tail"],function(i,a){var d="drop"+(a?"":"Right");Re.prototype[i]=function(){return this.__filtered__?new Re(this):this[d](1)}}),Re.prototype.compact=function(){return this.filter(It)},Re.prototype.find=function(i){return this.filter(i).head()},Re.prototype.findLast=function(i){return this.reverse().find(i)},Re.prototype.invokeMap=De(function(i,a){return typeof i=="function"?new Re(this):this.map(function(d){return Ji(d,i,a)})}),Re.prototype.reject=function(i){return this.filter(Sa(fe(i)))},Re.prototype.slice=function(i,a){i=Ve(i);var d=this;return d.__filtered__&&(i>0||a<0)?new Re(d):(i<0?d=d.takeRight(-i):i&&(d=d.drop(i)),a!==n&&(a=Ve(a),d=a<0?d.dropRight(-a):d.take(a-i)),d)},Re.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Re.prototype.toArray=function(){return this.take(ot)},On(Re.prototype,function(i,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=_[h?"take"+(a=="last"?"Right":""):a],v=h||/^find/.test(a);g&&(_.prototype[a]=function(){var E=this.__wrapped__,V=h?[1]:arguments,D=E instanceof Re,W=V[0],H=D||Ee(E),K=function(Fe){var Me=g.apply(_,Tr([Fe],V));return h&&oe?Me[0]:Me};H&&d&&typeof W=="function"&&W.length!=1&&(D=H=!1);var oe=this.__chain__,ue=!!this.__actions__.length,ge=v&&!oe,Pe=D&&!ue;if(!v&&H){E=Pe?E:new Re(this);var ye=i.apply(E,V);return ye.__actions__.push({func:wa,args:[K],thisArg:n}),new en(ye,oe)}return ge&&Pe?i.apply(this,V):(ye=this.thru(K),ge?h?ye.value()[0]:ye.value():ye)})}),Xt(["pop","push","shift","sort","splice","unshift"],function(i){var a=js[i],d=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",h=/^(?:pop|shift)$/.test(i);_.prototype[i]=function(){var g=arguments;if(h&&!this.__chain__){var v=this.value();return a.apply(Ee(v)?v:[],g)}return this[d](function(E){return a.apply(Ee(E)?E:[],g)})}}),On(Re.prototype,function(i,a){var d=_[a];if(d){var h=d.name+"";He.call(Lo,h)||(Lo[h]=[]),Lo[h].push({name:a,func:d})}}),Lo[fa(n,C).name]=[{name:"wrapper",func:n}],Re.prototype.clone=mN,Re.prototype.reverse=gN,Re.prototype.value=yN,_.prototype.at=HP,_.prototype.chain=jP,_.prototype.commit=qP,_.prototype.next=KP,_.prototype.plant=JP,_.prototype.reverse=XP,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=QP,_.prototype.first=_.prototype.head,Zi&&(_.prototype[Zi]=YP),_},Mo=qV();Qr?((Qr.exports=Mo)._=Mo,nc._=Mo):yt._=Mo}).call(Ho)}(Fs,Fs.exports);var Ge=Fs.exports;const DT={class:"grid-overlay-container"},yp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",DT,[e.params.notReady?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n[0]||(n[0]=r.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),n[1]||(n[1]=r.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[n[2]||(n[2]=r.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),n[3]||(n[3]=r.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),FT={},RT={class:"grid-overlay-container"};function MT(t,e){return r.openBlock(),r.createElementBlock("div",RT,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const _p=Ds(FT,[["render",MT]]);async function IT(t,e){throw Error("not implemented")}function OT(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function LT(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const s=OT(t[o].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=ja(l),u=t.findIndex(p=>Ge.isEqual(p.id,c));if(u===-1)throw console.error("axis not found",o,c,t),Error("axis not found");n.push({columnIdx:o,axisIdx:u})}}return n}const vp=(t,e)=>(t+e).toString();function GT(t,e,n,o,s,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let u=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===c.axisIdx&&(u=y),l[y]===c.columnIdx&&(p=y);const f=(()=>{const T=o[u].data.filter(B=>B!==null);return Array.from(new Set(T))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=zT(s,o,u,p,f,e.rows);for(let y=0;y<f.length;++y){const T=f[y],B=Or(T+"@"+y);n.push({colId:B,field:vp(o.length,y),headerName:T,valueFormatter:wp})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function zT(t,e,n,o,s,l){const c=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let I=0;I<e.length;++I){if(I===n||I===o)continue;const L=t[I].toString();m[L]=e[I].data[f]}let y;const T=Or(Object.values(m))??"";c.has(T)?y=c.get(T):(c.set(T,m),y=m,y.id=u.toString(),u++);const B=s.indexOf(e[n].data[f]);if(B===-1)throw Error("index not found");const A=vp(e.length,B);y[A]=e[o].data[f]}return Array.from(c.values())}function $T(t){return Or(t)}function Cp(t){return JSON.parse(t)}const wp=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function UT(t,e,n){var s,l,c;const o=$T(e);return{colId:o,field:t.toString(),headerName:((l=(s=e.spec.annotations)==null?void 0:s["pl7.app/label"])==null?void 0:l.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(o))??((c=e.spec.annotations)==null?void 0:c["pl7.app/table/visibility"])==="optional",valueFormatter:wp,cellDataType:(u=>{switch(u){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${u}`)}})(e.type==="axis"?e.spec.type:e.spec.valueType)}}function bp(t,e){switch(e){case"Int":return t;case"Long":return typeof t=="bigint"?Number(t):t;case"Float":return t;case"Double":return t;case"String":return t;case"Bytes":return Buffer.from(t).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function xp(t){const e=[];return fs(t,n=>(e.push(n),n)),e}async function ZT(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Ge.uniqWith(n.map(s=>Rd(s.spec.axesSpec).map(Ge.cloneDeep)).flat(),Ge.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function WT(t,e,n){const o=xp(n),l=(await ZT(t,e,o)).filter(c=>!Ge.find(o,u=>c.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function HT(t,e,n,o){const s=n.filter(m=>m.type!=="Bytes"),l=xp(o),c=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const y=Rd(l[m].spec.axesSpec);for(let T=0;T<y.length;++T){const B=Ge.findIndex(s,A=>Ge.isEqual(A,y[T]));B===-1||u[B]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[B]=[[m,T]],u[B]=l[m].columnId):c[B].push([m,T]))}}for(let m=s.length-1;m>=0;--m)c[m].length||(u.splice(m,1),c.splice(m,1),s.splice(m,1));const p=100,f=s.map(m=>new Set);e:for(let m=s.length-1;m>=0;--m){for(const[y,T]of c[m]){const B=await t.getUniqueValues(e,{columnId:l[y].columnId,...!u[m]&&{axis:Ge.cloneDeep(s[m])},filters:[],limit:p});if(B.overflow){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}const A=B.values.type;for(const I of B.values.data)if(!(Fd(I,A)||I===null)&&(f[m].add(bp(I,A)),f[m].size===p)){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}}if(!f[m].size){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}}return s.map((m,y)=>{const T=[...f[y]].map(A=>({value:A,label:A.toString()})),B=T[0].value;return{axis:Ge.cloneDeep(m),...u[y]&&{column:u[y]},options:T,defaultValue:B}})}function jT(t,e,n,o){const s=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const u=[],p=(o++).toString();for(const m of n)u.push(e[m].data[c]);const f={key:u,id:p};for(let m=0;m<s;++m){const y=t[m].toString(),T=e[m].data[c],B=e[m].type;Og(e[m].absent,c)?f[y]=void 0:Fd(T,B)||T===null?f[y]=null:f[y]=bp(T,B)}l.push(f)}return l}const qT=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function KT(t,e,n,o){const s=await t.getSpec(e);let l=s.findIndex(C=>C.type==="column");l===-1&&(l=s.length);const c=[...s.keys()].filter(C=>!Ge.find(n,R=>Ge.isEqual(R.axis,s[C].id)||Ge.isEqual(R.column,s[C].id))).sort((C,R)=>{var N,U;if(s[C].type!==s[R].type)return s[C].type==="axis"?-1:1;const O=(N=s[C].spec.annotations)==null?void 0:N["pl7.app/table/orderPriority"],F=(U=s[R].spec.annotations)==null?void 0:U["pl7.app/table/orderPriority"];return O===void 0?F===void 0?0:1:F===void 0?-1:Number(F)-Number(O)}),u=Ge.cloneDeep(c),p=LT(s,c);for(let C=c.length-1;C>=0;--C){const R=c[C];if(!qT(s[R]))continue;const O=ja(s[R].spec.axesSpec[0]),F=Ge.findIndex(c,N=>Ge.isEqual(s[N].id,O));if(F===-1&&Ge.findIndex(n,U=>Ge.isEqual(U.axis,O))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${O}`);continue}c[F]=R;for(const N of p)N.axisIdx===R&&(N.axisIdx=F);c.splice(C,1),u.splice(C,1)}const f=await t.getShape(e),m=f.rows,y=u.map(C=>UT(C,s[C],o));if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return GT(p,f,y,await t.getData(e,c),u,c);const T=[...c],B=new Map;for(let C=0;C<l;++C)B.set(C,-1);for(let C=0;C<T.length;++C){const R=T[C];B.has(R)&&B.set(R,C)}for(const[C,R]of B)R===-1&&(B.set(C,T.length),T.push(C));const A=[];for(let C=0;C<l;++C){const R=B.get(C);if(R===void 0||R===-1)throw new Error("assertion exception");A.push(R)}let I;return{rowModelType:"serverSide",columnDefs:y,serverSideDatasource:{getRows:async C=>{try{if(m==0){C.success({rowData:[],rowCount:m}),C.api.setGridOption("loading",!1),C.api.showNoRowsOverlay();return}if(I&&!Ge.isEqual(I.request.sortModel,C.request.sortModel)){I=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}I=C;let R=0,O=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(R=Math.min(m,C.request.endRow)-C.request.startRow,R>0)){const F=await t.getData(e,T,{offset:C.request.startRow,length:R});O=jT(u,F,A,C.request.startRow)}C.success({rowData:O,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(R){C.api.setGridOption("loading",!0),C.fail(),console.trace(R)}}}}}const kp=km(),YT=["onClick"],Sp=r.defineComponent({__name:"PlAgGridColumnManager",props:{api:{}},setup(t){const e=t,{api:n}=r.toRefs(e),o=r.ref([]),s=r.ref(),l=r.ref(!1),c=r.ref(0);gp(s,{handle:".handle",onChange(p){n.value.moveColumns(p.map(f=>o.value[f]),0)}});function u(p){n.value.setColumnsVisible([p],!p.isVisible())}return r.onMounted(()=>{n.value.addEventListener("displayedColumnsChanged",()=>{o.value=[...n.value.getAllGridColumns()??[]],c.value++}),o.value=n.value.getAllGridColumns()??[]}),(p,f)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(r.Teleport,{to:`#${r.unref(kp)}`},[r.createVNode(r.unref(Cs),{onClick:f[0]||(f[0]=r.withModifiers(m=>l.value=!l.value,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(cn),{name:"columns"})]),default:r.withCtx(()=>[f[2]||(f[2]=r.createTextVNode(" Columns "))]),_:1})],8,["to"])),r.createVNode(r.unref($u),{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=m=>l.value=m),shadow:!0,width:"368px","close-on-outside-click":""},{title:r.withCtx(()=>f[3]||(f[3]=[r.createTextVNode("Columns")])),default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("div",{ref_key:"listRef",ref:s,key:c.value,class:"pl-ag-columns"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,m=>(r.openBlock(),r.createElementBlock("div",{key:m.getId(),class:"pl-ag-columns__item"},[r.createElementVNode("div",{class:r.normalizeClass([{handle:!m.getColDef().lockPosition},"pl-ag-columns__drag"])},[r.createVNode(r.unref(Un),{name:"drag-dots"})],2),r.createElementVNode("div",{class:r.normalizeClass([{visible:m.isVisible()},"pl-ag-columns__title"])},r.toDisplayString(m.getColDef().headerName),3),r.createElementVNode("div",{class:"pl-ag-columns__visibility",onClick:y=>u(m)},[r.createVNode(r.unref(Ct),{"close-delay":500,position:"top"},{tooltip:r.withCtx(()=>f[4]||(f[4]=[r.createTextVNode("Show/Hide")])),default:r.withCtx(()=>[r.createVNode(r.unref(cn),{name:m.isVisible()?"view-show":"view-hide"},null,8,["name"])]),_:2},1024)],8,YT)]))),128))]))]),_:1},8,["modelValue"])]))}}),JT=["id"],XT=r.defineComponent({__name:"PlAgDataTableToolsPanel",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(kp),class:"d-flex gap-6"},[r.renderSlot(e.$slots,"default")],8,JT))}}),QT={class:"ap-ag-data-table-container"},eB={key:1,class:"ap-ag-data-table-sheets"},tB=Ds(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{},showColumnsPanel:{type:Boolean}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{expose:e,emit:n}){x.ModuleRegistry.registerModules([is.ClientSideRowModelModule,hd.ClipboardModule,pd.ServerSideRowModelModule,fd.RangeSelectionModule,Ja,ru]);const o=r.useModel(t,"modelValue"),s=t,{settings:l}=r.toRefs(s),c=n;r.watch(()=>l.value,async(S,w)=>{if(S.sourceType!=="pframe"||!S.pFrame||!S.join||w&&w.sourceType==="pframe"&&Ge.isEqual(S.pFrame,w.pFrame)&&Ge.isEqual(S.join,w.join))return;const k=window.platforma;if(!k)throw Error("platforma not set");const $=k.pFrameDriver;if(!$)throw Error("platforma.pFrameDriver not set");const Q=await WT($,S.pFrame,S.join),ne=o.value;ne.pTableParams||(ne.pTableParams={sorting:[],filters:[]}),ne.pTableParams.join=Q,o.value=ne});const u=Ep(()=>l.value.sourceType,async S=>{var k;const w=l.value.sourceType;switch(w){case"pframe":{const $=window.platforma;if(!$)throw Error("platforma not set");const Q=$.pFrameDriver;if(!Q)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const ne=l.value.pFrame,be=(k=o.value.pTableParams)==null?void 0:k.join;return be?await HT(Q,ne,l.value.sheetAxes,be):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${w}`)}});function p(S){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(S==null?void 0:S.sortModel.map(w=>{const{spec:k,...$}=Cp(w.colId);return{column:$,ascending:w.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const f=r.computed({get:()=>{const S=o.value;return{columnOrder:S.gridState.columnOrder,sort:S.gridState.sort,columnVisibility:S.gridState.columnVisibility}},set:S=>{const w=o.value,k=A.value.rowModelType==="clientSide"?void 0:p(S.sort);w.gridState={...w.gridState,...S},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(w.pTableParams||(w.pTableParams={sorting:[],filters:[]}),w.pTableParams.sorting=k),o.value=w}}),m=S=>Or(S);function y(S){var w;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((w=u.value)==null?void 0:w.map(k=>({type:"bySingleColumn",column:k.column?{type:"column",id:k.column}:{type:"axis",id:k.axis},predicate:{operator:"Equal",reference:S[m(k.axis)]}})))??[]}const T=r.computed({get:()=>o.value.gridState.sheets??{},set:S=>{const w=y(S),k=o.value;k.gridState.sheets=S,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(k.pTableParams||(k.pTableParams={sorting:[],filters:[]}),k.pTableParams.filters=w),o.value=k}});r.watch(()=>[l.value,u.value],(S,w)=>{const[k,$]=S;if(!$)return;if(w){const[ne,be]=w;if((k.sourceType==="ptable"||k.sourceType==="pframe")&&k.sourceType===(ne==null?void 0:ne.sourceType)&&Ge.isEqual($,be))return}if(k.sourceType!=="ptable"&&k.sourceType!=="pframe"){T.value={};return}const Q=T.value;for(const ne of $){const be=m(ne.axis);Q[be]||(Q[be]=ne.defaultValue??ne.options[0].value)}T.value=Q},{immediate:!0});const B=r.shallowRef(),A=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:f.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:S=>{S.api.autoSizeAllColumns()},onRowDoubleClicked:S=>{S.data&&c("onRowDoubleClicked",S.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:S=>S.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:yp,noRowsOverlayComponent:_p,sideBar:{},defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),I=S=>{const w=S.api;B.value=new Proxy(w,{get(k,$,Q){switch($){case"setGridOption":return(ne,be)=>{const $e=A.value;$e[ne]=be,A.value=$e,w.setGridOption(ne,be)};case"updateGridOptions":return ne=>{A.value={...A.value,...ne},w.updateGridOptions(ne)};default:return Reflect.get(k,$,Q)}}})},L=S=>({columnOrder:S.columnOrder,sort:S.sort,columnVisibility:S.columnVisibility??(S.columnOrder?{hiddenColIds:[]}:void 0)}),C=S=>{A.value.initialState=f.value=L(S.state),S.api.autoSizeAllColumns()},R=()=>{A.value.initialState=f.value=L(B.value.getState()),B.value=void 0};let O=!1;const F=()=>{if(!O)return;const S=B.value;S!==void 0&&(S.exportDataAsCsv(),O=!1,S.setGridOption("cacheBlockSize",100))},N=()=>{if(!O)return;const S=B.value;if(S===void 0)return;const w=S.getServerSideGroupLevelState()[0];w.cacheBlockSize===w.rowCount&&S.refreshServerSide({route:w.route,purge:!1})};e({exportCsv:async()=>{const S=B.value;if(S!==void 0){if(A.value.rowModelType==="clientSide"){S.exportDataAsCsv();return}if(A.value.rowModelType==="serverSide"){const w=S.getServerSideGroupLevelState()[0];if(w.rowCount<=w.cacheBlockSize){S.exportDataAsCsv();return}O||(O=!0,S.setGridOption("cacheBlockSize",w.rowCount))}}}});const te=r.ref(0);r.watch(()=>[B.value,f.value],(S,w)=>{if(Ge.isEqual(S,w))return;const[k,$]=S;if(!k)return;const Q=L(k.getState());Ge.isEqual($,Q)||(A.value.initialState=$,++te.value)}),r.watch(()=>A.value,(S,w)=>{var k;if(w&&(S.rowModelType!=w.rowModelType&&++te.value,!Ge.isEqual(S.columnDefs,w.columnDefs)&&S.columnDefs)){const $=be=>!("children"in be),Q=(k=S.columnDefs)==null?void 0:k.filter($),ne=Q==null?void 0:Q.map(be=>be.colId).filter(be=>be!==void 0).map(be=>Cp(be));c("columnsChanged",ne??[])}});const j=(S,w)=>{var $;const k=T.value;k[S]!==w&&(k[S]=w,T.value=k,($=B.value)==null||$.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},Y=window.platforma;if(!Y)throw Error("platforma not set");const q=Y.pFrameDriver;if(!q)throw Error("platforma.pFrameDriver not set");const ee=Y.blobDriver;if(!ee)throw Error("platforma.blobDriver not set");let G;return r.watch(()=>[B.value,l.value,u.value],async S=>{var ne,be;const[w,k,$]=S;if(!w||Ge.isEqual(k,G))return;G=k;const Q=k.sourceType;switch(Q){case"pframe":case"ptable":{const $e=k.pTable;if(!$e||!$)return w.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ot=(be=(ne=f.value)==null?void 0:ne.columnVisibility)==null?void 0:be.hiddenColIds,wn=await KT(q,$e,$,ot);return w.updateGridOptions({loading:wn.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...wn})}case"xsv":{const $e=k.xsvFile;if(!($e!=null&&$e.ok)||!$e.value)return w.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ot=await IT(ee,$e.value);return w.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ot})}default:throw Error(`unsupported source type: ${Q}`)}}),(S,w)=>(r.openBlock(),r.createElementBlock("div",QT,[B.value&&S.showColumnsPanel?(r.openBlock(),r.createBlock(r.unref(Sp),{key:0,api:B.value},null,8,["api"])):r.createCommentVNode("",!0),r.unref(u).value&&r.unref(u).value.length>0?(r.openBlock(),r.createElementBlock("div",eB,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u).value,(k,$)=>(r.openBlock(),r.createBlock(r.unref(Gu),{key:$,"model-value":T.value[m(k.axis)],options:k.options,"onUpdate:modelValue":Q=>j(m(k.axis),Q)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(Cm.AgGridVue),{key:te.value,theme:r.unref(iu),class:"ap-ag-data-table-grid","grid-options":A.value,onGridReady:I,onStateUpdated:C,onGridPreDestroyed:R,onStoreRefreshed:F,onModelUpdated:N},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-330ddc9a"]]),nB={key:0,class:"d-flex gap-10 flex-column"},rB={key:0},oB=Ds(r.defineComponent({__name:"PlTableFilters",props:r.mergeModels({columns:{},restrictions:{},defaults:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{columns:o,restrictions:s,defaults:l}=r.toRefs(n),c=G=>Or(G.id),u=r.computed(()=>o.value.filter(G=>{const S=G.type;switch(S){case"axis":return G.spec.type!=="Bytes";case"column":return G.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${S}`)}}).map(G=>({column:G,id:c(G)}))),p=r.computed(()=>{const G=s.value??[],S={};for(const{column:w,id:k}of u.value){const $=Ge.find(G,Q=>Ge.isEqual(Q.column.id,w.id));$!==void 0&&(S[k]=$.allowedFilterTypes)}return S}),f=r.computed(()=>{const G=l.value??[],S={};for(const{column:w,id:k}of u.value){const $=Ge.find(G,Q=>Ge.isEqual(Q.column.id,w.id));$!==void 0&&(S[k]=$.default)}return S}),m=G=>G!==void 0?G:f.value,y=r.reactive({state:m(e.value.state)});r.watch(()=>e.value,G=>{Ge.isEqual(y.state,G.state)||(y.state=m(G.state))}),r.watch(()=>u.value,G=>{if(y.state!==void 0&&G.length===0)return;const S=y.state??{},w={};for(const{id:k}of G)S[k]!==void 0&&(w[k]=S[k]);y.state=w},{immediate:!0});const T=G=>{switch(G){case"isNotNA":return"Is not NA";case"isNA":return"Is NA";case"number_equals":case"string_equals":return"Equals";case"number_notEquals":case"string_notEquals":return"Not equals";case"number_greaterThan":return"Greater than";case"number_greaterThanOrEqualTo":return"Greater than or equal to";case"number_lessThan":return"Less than";case"number_lessThanOrEqualTo":return"Less than or equal to";case"number_between":return"Between";case"string_contains":return"Contains";case"string_doesNotContain":return"Does not contain";case"string_matches":return"Matches";case"string_doesNotMatch":return"Does not match";case"string_containsFuzzyMatch":return"Contains fuzzy match";default:throw Error(`unsupported filter type: ${G}`)}},B=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],A=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"],I=r.computed(()=>{const G=p.value,S={};for(const{column:w,id:k}of u.value){let Q=(w.type==="column"?w.spec.valueType:w.spec.type)==="String"?A:B;const ne=G[k];ne!==void 0&&(Q=Q.filter(be=>ne.includes(be))),S[k]=Q.map(be=>({value:be,text:T(be)}))}return S}),L=r.computed(()=>Ge.some(Object.values(I.value),G=>G.length>0)),C=G=>{const S=G.type;switch(S){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return G.reference;case"number_between":return G.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return G.reference;default:throw Error(`unsupported filter type: ${S}`)}},R=(G,S)=>{switch(G){case"isNotNA":case"isNA":return{type:G};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:G,reference:typeof S=="number"?S:0};case"number_between":return{type:G,lowerBound:typeof S=="number"?S:0,includeLowerBound:!0,upperBound:100,includeUpperBound:!1};case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":return{type:G,reference:typeof S=="string"?S:""};case"string_containsFuzzyMatch":return{type:G,reference:typeof S=="string"?S:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${G}`)}},O=(G,S)=>{const w=y.state[G];y.state[G]=R(S,C(w))},F=G=>{y.state[G]=f.value[G]??R(I.value[G][0].value)},N=(G,S)=>{S?F(G):delete y.state[G]},U=(G,S)=>{var ne,be;const w=Number(S);if(!Number.isFinite(w))throw Error("Model value is not a number.");const k=G.type==="column"?G.spec.valueType:G.spec.type;if((k==="Int"||k==="Long")&&!Number.isInteger(w))throw Error("Model value is not an integer.");const $=(ne=G.spec.annotations)==null?void 0:ne["pl7.app/min"];if($!==void 0){const $e=Number($);if(Number.isFinite($e)&&w<Number($))throw Error("Model value is too low.")}const Q=(be=G.spec.annotations)==null?void 0:be["pl7.app/max"];if(Q!==void 0){const $e=Number(Q);if(Number.isFinite($e)&&w>Number(Q))throw Error("Model value is too high.")}return w},te=(G,S)=>{var k,$;const w=((k=G.spec.domain)==null?void 0:k["pl7.app/alphabet"])??(($=G.spec.annotations)==null?void 0:$["pl7.app/alphabet"]);if(w==="nucleotide"&&!/^[AaTtGgCcNn]+$/.test(S))throw Error("Model value is not a nucleotide.");if(w==="aminoacid"&&!/^[AaCcDdEeFfGgHhIiKkLlMmNnPpQqRrSsTtVvWwYyXx]+$/.test(S))throw Error("Model value is not an aminoacid.");return S},j=G=>{try{return new RegExp(G),G}catch(S){throw S instanceof SyntaxError?Error("Model value is not a regexp."):S}},Y=(G,S)=>{var $,Q;const w=(($=G.spec.domain)==null?void 0:$["pl7.app/alphabet"])??((Q=G.spec.annotations)==null?void 0:Q["pl7.app/alphabet"]);if(w==="nucleotide")return[{value:"N",text:"N"}];if(w==="aminoacid")return[{value:"X",text:"X"}];const k=Ge.uniq(S);return k.sort(),k.map(ne=>({value:ne,text:ne}))},q=G=>{const S=G.type;switch(S){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":case"string_equals":return{operator:"Equal",reference:G.reference};case"number_notEquals":case"string_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:G.reference}};case"number_greaterThan":return{operator:"Greater",reference:G.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:G.reference};case"number_lessThan":return{operator:"Less",reference:G.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:G.reference};case"number_between":return{operator:"And",operands:[{operator:G.includeLowerBound?"GreaterOrEqual":"Greater",reference:G.lowerBound},{operator:G.includeUpperBound?"LessOrEqual":"Less",reference:G.upperBound}]};case"string_contains":return{operator:"StringContains",substring:G.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:"StringContains",substring:G.reference}};case"string_matches":return{operator:"Matches",regex:G.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:G.reference}};case"string_containsFuzzyMatch":return{operator:"StringContainsFuzzy",reference:G.reference,maxEdits:G.maxEdits,substitutionsOnly:G.substitutionsOnly,wildcard:G.wildcard};default:throw Error(`unsupported filter type: ${S}`)}},ee=G=>u.value.map(({column:S,id:w})=>{if(!(w in G))return;const k=q(G[w]),{spec:$,...Q}=S;return{type:"bySingleColumn",column:Q,predicate:k}}).filter(S=>S!==void 0);return r.watch(()=>y,G=>{Ge.isEqual(G.state,e.value.state)||(e.value={state:Ge.cloneDeep(G.state),filters:ee(G.state)})},{immediate:!0,deep:!0}),(G,S)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,({column:w,id:k},$)=>{var Q,ne,be,$e,ot,wn,In,xr,jn,Jr,Os,kr,Sr,Ls;return r.openBlock(),r.createElementBlock("div",{key:k},[I.value[k].length>0?(r.openBlock(),r.createElementBlock("form",nB,[r.createVNode(r.unref(zu),{"model-value":!!y.state[k],"onUpdate:modelValue":Se=>N(k,Se)},{default:r.withCtx(()=>{var Se,Xr;return[r.createTextVNode(r.toDisplayString(((Xr=(Se=w.spec.annotations)==null?void 0:Se["pl7.app/label"])==null?void 0:Xr.trim())??"Unlabeled "+w.type+" "+$.toString()),1)]}),_:2},1032,["model-value","onUpdate:modelValue"]),r.createElementVNode("div",{class:r.normalizeClass(["controls d-flex gap-10 flex-column",{open:!!y.state[k]}])},[y.state[k]?(r.openBlock(),r.createBlock(r.unref(yi),{key:0,"model-value":y.state[k].type,options:I.value[k],label:"Predicate","onUpdate:modelValue":Se=>O(k,Se)},null,8,["model-value","options","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Q=y.state[k])==null?void 0:Q.type)==="number_equals"||((ne=y.state[k])==null?void 0:ne.type)==="number_notEquals"||((be=y.state[k])==null?void 0:be.type)==="number_lessThan"||(($e=y.state[k])==null?void 0:$e.type)==="number_lessThanOrEqualTo"||((ot=y.state[k])==null?void 0:ot.type)==="number_greaterThan"||((wn=y.state[k])==null?void 0:wn.type)==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(Ur),{key:1,modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:Se=>U(w,Se),label:"Reference value"},null,8,["modelValue","onUpdate:modelValue","parse"])):r.createCommentVNode("",!0),((In=y.state[k])==null?void 0:In.type)==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createVNode(r.unref(Ur),{modelValue:y.state[k].lowerBound,"onUpdate:modelValue":Se=>y.state[k].lowerBound=Se,parse:Se=>U(w,Se),label:"Lower bound"},null,8,["modelValue","onUpdate:modelValue","parse"]),r.createVNode(r.unref(xs),{modelValue:y.state[k].includeLowerBound,"onUpdate:modelValue":Se=>y.state[k].includeLowerBound=Se,label:"Include lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(Ur),{modelValue:y.state[k].upperBound,"onUpdate:modelValue":Se=>y.state[k].upperBound=Se,parse:Se=>U(w,Se),label:"Upper bound"},null,8,["modelValue","onUpdate:modelValue","parse"]),r.createVNode(r.unref(xs),{modelValue:y.state[k].includeUpperBound,"onUpdate:modelValue":Se=>y.state[k].includeUpperBound=Se,label:"Include upper bound"},null,8,["modelValue","onUpdate:modelValue"])],64)):r.createCommentVNode("",!0),((xr=y.state[k])==null?void 0:xr.type)==="string_equals"||((jn=y.state[k])==null?void 0:jn.type)==="string_notEquals"||((Jr=y.state[k])==null?void 0:Jr.type)==="string_contains"||((Os=y.state[k])==null?void 0:Os.type)==="string_doesNotContain"?(r.openBlock(),r.createBlock(r.unref(Ur),{key:3,modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:Se=>te(w,Se),label:"Reference value"},null,8,["modelValue","onUpdate:modelValue","parse"])):r.createCommentVNode("",!0),((kr=y.state[k])==null?void 0:kr.type)==="string_matches"||((Sr=y.state[k])==null?void 0:Sr.type)==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(Ur),{key:4,modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:j,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Ls=y.state[k])==null?void 0:Ls.type)==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:5},[r.createVNode(r.unref(Ur),{modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:Se=>te(w,Se),label:"Reference value"},null,8,["modelValue","onUpdate:modelValue","parse"]),r.createVNode(r.unref(hp),{modelValue:y.state[k].maxEdits,"onUpdate:modelValue":Se=>y.state[k].maxEdits=Se,max:5,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(xs),{modelValue:y.state[k].substitutionsOnly,"onUpdate:modelValue":Se=>y.state[k].substitutionsOnly=Se,label:"Substitutions only"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(yi),{modelValue:y.state[k].wildcard,"onUpdate:modelValue":Se=>y.state[k].wildcard=Se,options:Y(w,y.state[k].reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","onUpdate:modelValue","options"])],64)):r.createCommentVNode("",!0)],2)])):r.createCommentVNode("",!0)])}),128)),L.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",rB,"No filters applicable"))],64))}}),[["__scopeId","data-v-6cb52299"]]),iB={key:1,class:"alert-error"},sB={key:2},aB=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&o.value===void 0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[n.value!==void 0?r.renderSlot(l.$slots,"default",r.normalizeProps(r.mergeProps({key:0},{value:n.value}))):r.createCommentVNode("",!0),o.value?(r.openBlock(),r.createElementBlock("div",iB,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",sB,"Unresolved")):r.createCommentVNode("",!0)]))}}),lB={style:{height:"100%"}},cB=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function s(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(c,u)=>(r.openBlock(),r.createElementBlock("div",lB,[r.createVNode(r.unref(up),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":o.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),dB={class:"pl-ag-grid-open-cell d-flex"},uB={class:"pl-ag-grid-open-cell__value"},pB=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;function n(){if(e.params.invokeRowsOnDoubleClick){const o=e.params.api,s={rowPinned:e.params.node.rowPinned,api:o,rowIndex:e.params.node.rowIndex,context:o,type:"rowDoubleClicked",node:e.params.node,data:e.params.data,event:null};o.dispatchEvent(s)}else e.params.onClick&&e.params.onClick(e.params)}return(o,s)=>(r.openBlock(),r.createElementBlock("div",dB,[r.createElementVNode("div",uB,r.toDisplayString(o.params.value),1),r.createElementVNode("div",{class:"pl-ag-grid-open-cell__activator text-caps11 align-center",onClick:r.withModifiers(n,["stop"])},[r.createVNode(r.unref(Un),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}}),Rs=new Map;function hB(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{Rs.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function fB(t){const e=Symbol();return()=>(Rs.has(e)||Rs.set(e,hB(e,t)),Rs.get(e))}function mB(t){return r.computed(()=>{try{return Cd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function Ep(t,e,n){const o=r.ref(0),s=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=Em(e);return r.watch(t,async c=>{s.error=void 0,o.value++,l(c).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const Eo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Tp=new Set,Rl=typeof process=="object"&&process?process:{},Bp=(t,e,n,o)=>{typeof Rl.emitWarning=="function"?Rl.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let Ms=globalThis.AbortController,Vp=globalThis.AbortSignal;if(typeof Ms>"u"){Vp=class{constructor(){Ze(this,"onabort");Ze(this,"_onabort",[]);Ze(this,"reason");Ze(this,"aborted",!1)}addEventListener(o,s){this._onabort.push(s)}},Ms=class{constructor(){Ze(this,"signal",new Vp);e()}abort(o){var s,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const c of this.signal._onabort)c(o);(l=(s=this.signal).onabort)==null||l.call(s,o)}}};let t=((Ap=Rl.env)==null?void 0:Ap.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,Bp("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const gB=t=>!Tp.has(t),wr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Np=t=>wr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Is:null:null;class Is extends Array{constructor(e){super(e),this.fill(0)}}const jr=class jr{constructor(e,n){Ze(this,"heap");Ze(this,"length");if(!b(jr,To))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=Np(e);if(!n)return[];me(jr,To,!0);const o=new jr(e,n);return me(jr,To,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};To=new WeakMap,ze(jr,To,!1);let Ml=jr;const Ll=class Ll{constructor(e){ze(this,re);ze(this,hn);ze(this,zt);ze(this,fn);ze(this,mn);ze(this,Bo);ze(this,Vo);Ze(this,"ttl");Ze(this,"ttlResolution");Ze(this,"ttlAutopurge");Ze(this,"updateAgeOnGet");Ze(this,"updateAgeOnHas");Ze(this,"allowStale");Ze(this,"noDisposeOnSet");Ze(this,"noUpdateTTL");Ze(this,"maxEntrySize");Ze(this,"sizeCalculation");Ze(this,"noDeleteOnFetchRejection");Ze(this,"noDeleteOnStaleGet");Ze(this,"allowStaleOnFetchAbort");Ze(this,"allowStaleOnFetchRejection");Ze(this,"ignoreFetchAbort");ze(this,dt);ze(this,gn);ze(this,lt);ze(this,Ke);ze(this,xe);ze(this,Bt);ze(this,$t);ze(this,xt);ze(this,ft);ze(this,yn);ze(this,mt);ze(this,_n);ze(this,vn);ze(this,Ut);ze(this,Cn);ze(this,br);ze(this,Vt);ze(this,qr,()=>{});ze(this,Hn,()=>{});ze(this,Mi,()=>{});ze(this,Zt,()=>!1);ze(this,Kr,e=>{});ze(this,No,(e,n,o)=>{});ze(this,Ii,(e,n,o,s)=>{if(o||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ze(this,Pp,"LRUCache");const{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:T,maxSize:B=0,maxEntrySize:A=0,sizeCalculation:I,fetchMethod:L,memoMethod:C,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:F,allowStaleOnFetchAbort:N,ignoreFetchAbort:U}=e;if(n!==0&&!wr(n))throw new TypeError("max option must be a nonnegative integer");const te=n?Np(n):Array;if(!te)throw new Error("invalid max value: "+n);if(me(this,hn,n),me(this,zt,B),this.maxEntrySize=A||b(this,zt),this.sizeCalculation=I,this.sizeCalculation){if(!b(this,zt)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(me(this,Vo,C),L!==void 0&&typeof L!="function")throw new TypeError("fetchMethod must be a function if specified");if(me(this,Bo,L),me(this,br,!!L),me(this,lt,new Map),me(this,Ke,new Array(n).fill(void 0)),me(this,xe,new Array(n).fill(void 0)),me(this,Bt,new te(n)),me(this,$t,new te(n)),me(this,xt,0),me(this,ft,0),me(this,yn,Ml.create(n)),me(this,dt,0),me(this,gn,0),typeof f=="function"&&me(this,fn,f),typeof m=="function"?(me(this,mn,m),me(this,mt,[])):(me(this,mn,void 0),me(this,mt,void 0)),me(this,Cn,!!b(this,fn)),me(this,Vt,!!b(this,mn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!T,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!F,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!U,this.maxEntrySize!==0){if(b(this,zt)!==0&&!wr(b(this,zt)))throw new TypeError("maxSize must be a positive integer if specified");if(!wr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");de(this,re,fm).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!u,this.ttlResolution=wr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!wr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");de(this,re,ld).call(this)}if(b(this,hn)===0&&this.ttl===0&&b(this,zt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!b(this,hn)&&!b(this,zt)){const j="LRU_CACHE_UNBOUNDED";gB(j)&&(Tp.add(j),Bp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,Ll))}}static unsafeExposeInternals(e){return{starts:b(e,vn),ttls:b(e,Ut),sizes:b(e,_n),keyMap:b(e,lt),keyList:b(e,Ke),valList:b(e,xe),next:b(e,Bt),prev:b(e,$t),get head(){return b(e,xt)},get tail(){return b(e,ft)},free:b(e,yn),isBackgroundFetch:n=>{var o;return de(o=e,re,Je).call(o,n)},backgroundFetch:(n,o,s,l)=>{var c;return de(c=e,re,Aa).call(c,n,o,s,l)},moveToTail:n=>{var o;return de(o=e,re,os).call(o,n)},indexes:n=>{var o;return de(o=e,re,Rr).call(o,n)},rindexes:n=>{var o;return de(o=e,re,Mr).call(o,n)},isStale:n=>{var o;return b(o=e,Zt).call(o,n)}}}get max(){return b(this,hn)}get maxSize(){return b(this,zt)}get calculatedSize(){return b(this,gn)}get size(){return b(this,dt)}get fetchMethod(){return b(this,Bo)}get memoMethod(){return b(this,Vo)}get dispose(){return b(this,fn)}get disposeAfter(){return b(this,mn)}getRemainingTTL(e){return b(this,lt).has(e)?1/0:0}*entries(){for(const e of de(this,re,Rr).call(this))b(this,xe)[e]!==void 0&&b(this,Ke)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield[b(this,Ke)[e],b(this,xe)[e]])}*rentries(){for(const e of de(this,re,Mr).call(this))b(this,xe)[e]!==void 0&&b(this,Ke)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield[b(this,Ke)[e],b(this,xe)[e]])}*keys(){for(const e of de(this,re,Rr).call(this)){const n=b(this,Ke)[e];n!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield n)}}*rkeys(){for(const e of de(this,re,Mr).call(this)){const n=b(this,Ke)[e];n!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield n)}}*values(){for(const e of de(this,re,Rr).call(this))b(this,xe)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield b(this,xe)[e])}*rvalues(){for(const e of de(this,re,Mr).call(this))b(this,xe)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield b(this,xe)[e])}[(Dp=Symbol.iterator,Pp=Symbol.toStringTag,Dp)](){return this.entries()}find(e,n={}){for(const o of de(this,re,Rr).call(this)){const s=b(this,xe)[o],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,b(this,Ke)[o],this))return this.get(b(this,Ke)[o],n)}}forEach(e,n=this){for(const o of de(this,re,Rr).call(this)){const s=b(this,xe)[o],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,b(this,Ke)[o],this)}}rforEach(e,n=this){for(const o of de(this,re,Mr).call(this)){const s=b(this,xe)[o],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,b(this,Ke)[o],this)}}purgeStale(){let e=!1;for(const n of de(this,re,Mr).call(this,{allowStale:!0}))b(this,Zt).call(this,n)&&(de(this,re,Ir).call(this,b(this,Ke)[n],"expire"),e=!0);return e}info(e){const n=b(this,lt).get(e);if(n===void 0)return;const o=b(this,xe)[n],s=de(this,re,Je).call(this,o)?o.__staleWhileFetching:o;if(s===void 0)return;const l={value:s};if(b(this,Ut)&&b(this,vn)){const c=b(this,Ut)[n],u=b(this,vn)[n];if(c&&u){const p=c-(Eo.now()-u);l.ttl=p,l.start=Date.now()}}return b(this,_n)&&(l.size=b(this,_n)[n]),l}dump(){const e=[];for(const n of de(this,re,Rr).call(this,{allowStale:!0})){const o=b(this,Ke)[n],s=b(this,xe)[n],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||o===void 0)continue;const c={value:l};if(b(this,Ut)&&b(this,vn)){c.ttl=b(this,Ut)[n];const u=Eo.now()-b(this,vn)[n];c.start=Math.floor(Date.now()-u)}b(this,_n)&&(c.size=b(this,_n)[n]),e.unshift([o,c])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const s=Date.now()-o.start;o.start=Eo.now()-s}this.set(n,o.value,o)}}set(e,n,o={}){var T,B,A,I,L;if(n===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=o;let{noUpdateTTL:f=this.noUpdateTTL}=o;const m=b(this,Ii).call(this,e,n,o.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),de(this,re,Ir).call(this,e,"set"),this;let y=b(this,dt)===0?void 0:b(this,lt).get(e);if(y===void 0)y=b(this,dt)===0?b(this,ft):b(this,yn).length!==0?b(this,yn).pop():b(this,dt)===b(this,hn)?de(this,re,Na).call(this,!1):b(this,dt),b(this,Ke)[y]=e,b(this,xe)[y]=n,b(this,lt).set(e,y),b(this,Bt)[b(this,ft)]=y,b(this,$t)[y]=b(this,ft),me(this,ft,y),Va(this,dt)._++,b(this,No).call(this,y,m,p),p&&(p.set="add"),f=!1;else{de(this,re,os).call(this,y);const C=b(this,xe)[y];if(n!==C){if(b(this,br)&&de(this,re,Je).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:R}=C;R!==void 0&&!c&&(b(this,Cn)&&((T=b(this,fn))==null||T.call(this,R,e,"set")),b(this,Vt)&&((B=b(this,mt))==null||B.push([R,e,"set"])))}else c||(b(this,Cn)&&((A=b(this,fn))==null||A.call(this,C,e,"set")),b(this,Vt)&&((I=b(this,mt))==null||I.push([C,e,"set"])));if(b(this,Kr).call(this,y),b(this,No).call(this,y,m,p),b(this,xe)[y]=n,p){p.set="replace";const R=C&&de(this,re,Je).call(this,C)?C.__staleWhileFetching:C;R!==void 0&&(p.oldValue=R)}}else p&&(p.set="update")}if(s!==0&&!b(this,Ut)&&de(this,re,ld).call(this),b(this,Ut)&&(f||b(this,Mi).call(this,y,s,l),p&&b(this,Hn).call(this,p,y)),!c&&b(this,Vt)&&b(this,mt)){const C=b(this,mt);let R;for(;R=C==null?void 0:C.shift();)(L=b(this,mn))==null||L.call(this,...R)}return this}pop(){var e;try{for(;b(this,dt);){const n=b(this,xe)[b(this,xt)];if(de(this,re,Na).call(this,!0),de(this,re,Je).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(b(this,Vt)&&b(this,mt)){const n=b(this,mt);let o;for(;o=n==null?void 0:n.shift();)(e=b(this,mn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:s}=n,l=b(this,lt).get(e);if(l!==void 0){const c=b(this,xe)[l];if(de(this,re,Je).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(b(this,Zt).call(this,l))s&&(s.has="stale",b(this,Hn).call(this,s,l));else return o&&b(this,qr).call(this,l),s&&(s.has="hit",b(this,Hn).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,s=b(this,lt).get(e);if(s===void 0||!o&&b(this,Zt).call(this,s))return;const l=b(this,xe)[s];return de(this,re,Je).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:T=this.allowStaleOnFetchRejection,ignoreFetchAbort:B=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:I,forceRefresh:L=!1,status:C,signal:R}=n;if(!b(this,br))return C&&(C.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const O={allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:A,ignoreFetchAbort:B,status:C,signal:R};let F=b(this,lt).get(e);if(F===void 0){C&&(C.fetch="miss");const N=de(this,re,Aa).call(this,e,F,O,I);return N.__returned=N}else{const N=b(this,xe)[F];if(de(this,re,Je).call(this,N)){const q=o&&N.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",q&&(C.returnedStale=!0)),q?N.__staleWhileFetching:N.__returned=N}const U=b(this,Zt).call(this,F);if(!L&&!U)return C&&(C.fetch="hit"),de(this,re,os).call(this,F),s&&b(this,qr).call(this,F),C&&b(this,Hn).call(this,C,F),N;const te=de(this,re,Aa).call(this,e,F,O,I),Y=te.__staleWhileFetching!==void 0&&o;return C&&(C.fetch=U?"stale":"refresh",Y&&U&&(C.returnedStale=!0)),Y?te.__staleWhileFetching:te.__returned=te}}async forceFetch(e,n={}){const o=await this.fetch(e,n);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,n={}){const o=b(this,Vo);if(!o)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:l,...c}=n,u=this.get(e,c);if(!l&&u!==void 0)return u;const p=o(e,u,{options:c,context:s});return this.set(e,p,c),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,u=b(this,lt).get(e);if(u!==void 0){const p=b(this,xe)[u],f=de(this,re,Je).call(this,p);return c&&b(this,Hn).call(this,c,u),b(this,Zt).call(this,u)?(c&&(c.get="stale"),f?(c&&o&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||de(this,re,Ir).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),f?p.__staleWhileFetching:(de(this,re,os).call(this,u),s&&b(this,qr).call(this,u),p))}else c&&(c.get="miss")}delete(e){return de(this,re,Ir).call(this,e,"delete")}clear(){return de(this,re,ud).call(this,"delete")}};hn=new WeakMap,zt=new WeakMap,fn=new WeakMap,mn=new WeakMap,Bo=new WeakMap,Vo=new WeakMap,dt=new WeakMap,gn=new WeakMap,lt=new WeakMap,Ke=new WeakMap,xe=new WeakMap,Bt=new WeakMap,$t=new WeakMap,xt=new WeakMap,ft=new WeakMap,yn=new WeakMap,mt=new WeakMap,_n=new WeakMap,vn=new WeakMap,Ut=new WeakMap,Cn=new WeakMap,br=new WeakMap,Vt=new WeakMap,re=new WeakSet,ld=function(){const e=new Is(b(this,hn)),n=new Is(b(this,hn));me(this,Ut,e),me(this,vn,n),me(this,Mi,(l,c,u=Eo.now())=>{if(n[l]=c!==0?u:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{b(this,Zt).call(this,l)&&de(this,re,Ir).call(this,b(this,Ke)[l],"expire")},c+1);p.unref&&p.unref()}}),me(this,qr,l=>{n[l]=e[l]!==0?Eo.now():0}),me(this,Hn,(l,c)=>{if(e[c]){const u=e[c],p=n[c];if(!u||!p)return;l.ttl=u,l.start=p,l.now=o||s();const f=l.now-p;l.remainingTTL=u-f}});let o=0;const s=()=>{const l=Eo.now();if(this.ttlResolution>0){o=l;const c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=b(this,lt).get(l);if(c===void 0)return 0;const u=e[c],p=n[c];if(!u||!p)return 1/0;const f=(o||s())-p;return u-f},me(this,Zt,l=>{const c=n[l],u=e[l];return!!u&&!!c&&(o||s())-c>u})},qr=new WeakMap,Hn=new WeakMap,Mi=new WeakMap,Zt=new WeakMap,fm=function(){const e=new Is(b(this,hn));me(this,gn,0),me(this,_n,e),me(this,Kr,n=>{me(this,gn,b(this,gn)-e[n]),e[n]=0}),me(this,Ii,(n,o,s,l)=>{if(de(this,re,Je).call(this,o))return 0;if(!wr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(o,n),!wr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),me(this,No,(n,o,s)=>{if(e[n]=o,b(this,zt)){const l=b(this,zt)-e[n];for(;b(this,gn)>l;)de(this,re,Na).call(this,!0)}me(this,gn,b(this,gn)+e[n]),s&&(s.entrySize=o,s.totalCalculatedSize=b(this,gn))})},Kr=new WeakMap,No=new WeakMap,Ii=new WeakMap,Rr=function*({allowStale:e=this.allowStale}={}){if(b(this,dt))for(let n=b(this,ft);!(!de(this,re,cd).call(this,n)||((e||!b(this,Zt).call(this,n))&&(yield n),n===b(this,xt)));)n=b(this,$t)[n]},Mr=function*({allowStale:e=this.allowStale}={}){if(b(this,dt))for(let n=b(this,xt);!(!de(this,re,cd).call(this,n)||((e||!b(this,Zt).call(this,n))&&(yield n),n===b(this,ft)));)n=b(this,Bt)[n]},cd=function(e){return e!==void 0&&b(this,lt).get(b(this,Ke)[e])===e},Na=function(e){var l,c;const n=b(this,xt),o=b(this,Ke)[n],s=b(this,xe)[n];return b(this,br)&&de(this,re,Je).call(this,s)?s.__abortController.abort(new Error("evicted")):(b(this,Cn)||b(this,Vt))&&(b(this,Cn)&&((l=b(this,fn))==null||l.call(this,s,o,"evict")),b(this,Vt)&&((c=b(this,mt))==null||c.push([s,o,"evict"]))),b(this,Kr).call(this,n),e&&(b(this,Ke)[n]=void 0,b(this,xe)[n]=void 0,b(this,yn).push(n)),b(this,dt)===1?(me(this,xt,me(this,ft,0)),b(this,yn).length=0):me(this,xt,b(this,Bt)[n]),b(this,lt).delete(o),Va(this,dt)._--,n},Aa=function(e,n,o,s){const l=n===void 0?void 0:b(this,xe)[n];if(de(this,re,Je).call(this,l))return l;const c=new Ms,{signal:u}=o;u==null||u.addEventListener("abort",()=>c.abort(u.reason),{signal:c.signal});const p={signal:c.signal,options:o,context:s},f=(I,L=!1)=>{const{aborted:C}=c.signal,R=o.ignoreFetchAbort&&I!==void 0;if(o.status&&(C&&!L?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,R&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),C&&!R&&!L)return y(c.signal.reason);const O=B;return b(this,xe)[n]===B&&(I===void 0?O.__staleWhileFetching?b(this,xe)[n]=O.__staleWhileFetching:de(this,re,Ir).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,I,p.options))),I},m=I=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=I),y(I)),y=I=>{const{aborted:L}=c.signal,C=L&&o.allowStaleOnFetchAbort,R=C||o.allowStaleOnFetchRejection,O=R||o.noDeleteOnFetchRejection,F=B;if(b(this,xe)[n]===B&&(!O||F.__staleWhileFetching===void 0?de(this,re,Ir).call(this,e,"fetch"):C||(b(this,xe)[n]=F.__staleWhileFetching)),R)return o.status&&F.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),F.__staleWhileFetching;if(F.__returned===F)throw I},T=(I,L)=>{var R;const C=(R=b(this,Bo))==null?void 0:R.call(this,e,l,p);C&&C instanceof Promise&&C.then(O=>I(O===void 0?void 0:O),L),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(I(void 0),o.allowStaleOnFetchAbort&&(I=O=>f(O,!0)))})};o.status&&(o.status.fetchDispatched=!0);const B=new Promise(T).then(f,m),A=Object.assign(B,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,A,{...p.options,status:void 0}),n=b(this,lt).get(e)):b(this,xe)[n]=A,A},Je=function(e){if(!b(this,br))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Ms},dd=function(e,n){b(this,$t)[n]=e,b(this,Bt)[e]=n},os=function(e){e!==b(this,ft)&&(e===b(this,xt)?me(this,xt,b(this,Bt)[e]):de(this,re,dd).call(this,b(this,$t)[e],b(this,Bt)[e]),de(this,re,dd).call(this,b(this,ft),e),me(this,ft,e))},Ir=function(e,n){var s,l,c,u;let o=!1;if(b(this,dt)!==0){const p=b(this,lt).get(e);if(p!==void 0)if(o=!0,b(this,dt)===1)de(this,re,ud).call(this,n);else{b(this,Kr).call(this,p);const f=b(this,xe)[p];if(de(this,re,Je).call(this,f)?f.__abortController.abort(new Error("deleted")):(b(this,Cn)||b(this,Vt))&&(b(this,Cn)&&((s=b(this,fn))==null||s.call(this,f,e,n)),b(this,Vt)&&((l=b(this,mt))==null||l.push([f,e,n]))),b(this,lt).delete(e),b(this,Ke)[p]=void 0,b(this,xe)[p]=void 0,p===b(this,ft))me(this,ft,b(this,$t)[p]);else if(p===b(this,xt))me(this,xt,b(this,Bt)[p]);else{const m=b(this,$t)[p];b(this,Bt)[m]=b(this,Bt)[p];const y=b(this,Bt)[p];b(this,$t)[y]=b(this,$t)[p]}Va(this,dt)._--,b(this,yn).push(p)}}if(b(this,Vt)&&((c=b(this,mt))!=null&&c.length)){const p=b(this,mt);let f;for(;f=p==null?void 0:p.shift();)(u=b(this,mn))==null||u.call(this,...f)}return o},ud=function(e){var n,o,s;for(const l of de(this,re,Mr).call(this,{allowStale:!0})){const c=b(this,xe)[l];if(de(this,re,Je).call(this,c))c.__abortController.abort(new Error("deleted"));else{const u=b(this,Ke)[l];b(this,Cn)&&((n=b(this,fn))==null||n.call(this,c,u,e)),b(this,Vt)&&((o=b(this,mt))==null||o.push([c,u,e]))}}if(b(this,lt).clear(),b(this,xe).fill(void 0),b(this,Ke).fill(void 0),b(this,Ut)&&b(this,vn)&&(b(this,Ut).fill(0),b(this,vn).fill(0)),b(this,_n)&&b(this,_n).fill(0),me(this,xt,0),me(this,ft,0),b(this,yn).length=0,me(this,gn,0),me(this,dt,0),b(this,Vt)&&b(this,mt)){const l=b(this,mt);let c;for(;c=l==null?void 0:l.shift();)(s=b(this,mn))==null||s.call(this,...c)}};let Il=Ll;const yB={cacheSize:15e6};class _B{constructor(e){Ze(this,"_str");Ze(this,"_rawJson");Ze(this,"_zodSchema");Ze(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const Yr=class Yr{constructor(e){Ze(this,"fileDataCache");Ze(this,"fileDataRefs",new Map);const n={...yB,...e??{}};this.fileDataCache=new Il({maxSize:n.cacheSize,fetchMethod:async o=>new _B(await $g().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const o=r.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const s=await this.fileDataCache.fetch(e);o.value=s}catch(s){console.error(s)}})(),o}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n==null?void 0:n.value)==null?void 0:o.str})}getContentJson(e,n){if(e===void 0)return;const o=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=o==null?void 0:o.value)==null?void 0:s.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Yr.globalInstance.getContentBytes(e)}static getContentString(e){return Yr.globalInstance.getContentString(e)}static getContentJson(e,n){return Yr.globalInstance.getContentJson(e,n)}};Ze(Yr,"globalInstance",new Yr);let Ol=Yr;M.AgGridTheme=iu,M.BlockLayout=PT,M.ContextProvider=yS,M.DataTable=iC,M.DemoData=yT,M.DropdownListItem=yo,M.LongText=kl,M.MultiError=Fa,M.PlAccordion=xx,M.PlAccordionSection=Px,M.PlAgCellFile=cB,M.PlAgDataTable=tB,M.PlAgDataTableToolsPanel=XT,M.PlAgGridColumnManager=Sp,M.PlAgOverlayLoading=yp,M.PlAgOverlayNoRows=_p,M.PlAgTextAndButtonCell=pB,M.PlAlert=MC,M.PlBlockPage=bC,M.PlBtnAccent=e0,M.PlBtnDanger=n0,M.PlBtnGhost=Cs,M.PlBtnGroup=Nu,M.PlBtnLink=s0,M.PlBtnPrimary=gl,M.PlBtnSecondary=yl,M.PlBtnSplit=KC,M.PlCheckbox=zu,M.PlCheckboxGroup=Mb,M.PlChip=Sl,M.PlContainer=kC,M.PlDialogModal=Tl,M.PlDropdown=yi,M.PlDropdownLegacy=ob,M.PlDropdownLine=Gu,M.PlDropdownMulti=Ab,M.PlDropdownRef=Dw,M.PlEditableTitle=N0,M.PlFileDialog=Ku,M.PlFileInput=up,M.PlGrid=NC,M.PlIcon16=vo,M.PlIcon24=bs,M.PlLogView=Zu,M.PlMaskIcon16=Un,M.PlMaskIcon24=cn,M.PlNotificationAlert=pp,M.PlNumberField=gb,M.PlProgressBar=cb,M.PlRow=EC,M.PlSearchField=Mu,M.PlSectionSeparator=Wu,M.PlSlideModal=$u,M.PlSpacer=Bu,M.PlTableFilters=oB,M.PlTabs=yx,M.PlTextArea=hw,M.PlTextField=Ur,M.PlToggleSwitch=xs,M.PlTooltip=Ct,M.ReactiveFileContent=Ol,M.Scrollable=s1,M.Slider=hp,M.SliderRange=n1,M.SliderRangeTriple=ZS,M.ThemeSwitcher=mC,M.UnresolvedError=Da,M.ValueOrErrorsComponent=aB,M.activateAgGrid=ou,M.animate=bu,M.animateInfinite=dC,M.call=yu,M.computedResult=mB,M.createModel=Ga,M.debounce=xu,M.defineApp=F_,M.defineStore=fB,M.delay=_u,M.detectOutside=fw,M.ensureError=Ia,M.eventListener=bl,M.formatZodError=La,M.getElementScrollPosition=Ou,M.identity=Ma,M.isDefined=Am,M.isElementVisible=Iu,M.isJsonEqual=Ra,M.isZodError=Oa,M.listToOptions=uC,M.makeEaseInOut=cC,M.makeEaseOut=wu,M.maskIcons16=mT,M.maskIcons24=gT,M.normalizeListOptions=pr,M.notEmpty=ul,M.randomInt=Cu,M.randomString=lC,M.requestTick=pl,M.scrollIntoView=gi,M.showContextMenu=ll,M.throttle=ku,M.timeout=vu,M.unwrapOptionalResult=Nm,M.unwrapValueOrErrors=vd,M.useClickOutside=ws,M.useDraggable=DS,M.useEventListener=rt,M.useFormState=AS,M.useHover=mu,M.useInterval=NS,M.useLabelNotch=Zn,M.useLocalStorage=Su,M.useMouse=fu,M.useMouseCapture=ur,M.usePosition=_o,M.useQuery=PS,M.useResizeObserver=fp,M.useScroll=BS,M.useSdkPlugin=rl,M.useSortable=gp,M.useTheme=Tu,M.useWatchFetch=Ep,M.wrapOptionalResult=Cd,M.wrapValueOrErrors=Vm,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
91
|
+
}`;var Pe=cm(function(){return Ue(v,ue+"return "+K).apply(n,E)});if(Pe.source=K,Yc(Pe))throw Pe;return Pe}function cR(i){return We(i).toLowerCase()}function dR(i){return We(i).toUpperCase()}function uR(i,a,d){if(i=We(i),i&&(d||a===n))return yh(i);if(!i||!(a=jt(a)))return i;var h=kn(i),g=kn(a),v=_h(h,g),E=vh(h,g)+1;return Dr(h,v,E).join("")}function pR(i,a,d){if(i=We(i),i&&(d||a===n))return i.slice(0,wh(i)+1);if(!i||!(a=jt(a)))return i;var h=kn(i),g=vh(h,kn(a))+1;return Dr(h,0,g).join("")}function hR(i,a,d){if(i=We(i),i&&(d||a===n))return i.replace(Yl,"");if(!i||!(a=jt(a)))return i;var h=kn(i),g=_h(h,kn(a));return Dr(h,g).join("")}function fR(i,a){var d=q,h=ee;if(tt(a)){var g="separator"in a?a.separator:g;d="length"in a?Ve(a.length):d,h="omission"in a?jt(a.omission):h}i=We(i);var v=i.length;if(Fo(i)){var E=kn(i);v=E.length}if(d>=v)return i;var V=d-Ro(h);if(V<1)return h;var D=E?Dr(E,0,V).join(""):i.slice(0,V);if(g===n)return D+h;if(E&&(V+=D.length-V),Jc(g)){if(i.slice(V).search(g)){var W,H=D;for(g.global||(g=hc(g.source,We(Lp.exec(g))+"g")),g.lastIndex=0;W=g.exec(H);)var K=W.index;D=D.slice(0,K===n?V:K)}}else if(i.indexOf(jt(g),V)!=V){var oe=D.lastIndexOf(g);oe>-1&&(D=D.slice(0,oe))}return D+h}function mR(i){return i=We(i),i&&EB.test(i)?i.replace(Mp,ZV):i}var gR=$o(function(i,a,d){return i+(d?" ":"")+a.toUpperCase()}),ed=df("toUpperCase");function lm(i,a,d){return i=We(i),a=d?n:a,a===n?LV(i)?jV(i):NV(i):i.match(a)||[]}var cm=De(function(i,a){try{return Wt(i,n,a)}catch(d){return Yc(d)?d:new ke(d)}}),yR=Qn(function(i,a){return Xt(a,function(d){d=Gn(d),Jn(i,d,qc(i[d],i))}),i});function _R(i){var a=i==null?0:i.length,d=fe();return i=a?Xe(i,function(h){if(typeof h[1]!="function")throw new Qt(c);return[d(h[0]),h[1]]}):[],De(function(h){for(var g=-1;++g<a;){var v=i[g];if(Wt(v[0],this,h))return Wt(v[1],this,h)}})}function vR(i){return ZN(tn(i,y))}function td(i){return function(){return i}}function CR(i,a){return i==null||i!==i?a:i}var wR=pf(),bR=pf(!0);function It(i){return i}function nd(i){return zh(typeof i=="function"?i:tn(i,y))}function xR(i){return Uh(tn(i,y))}function kR(i,a){return Zh(i,tn(a,y))}var SR=De(function(i,a){return function(d){return Ji(d,i,a)}}),ER=De(function(i,a){return function(d){return Ji(i,d,a)}});function rd(i,a,d){var h=gt(a),g=ca(a,h);d==null&&!(tt(a)&&(g.length||!h.length))&&(d=a,a=i,i=this,g=ca(a,gt(a)));var v=!(tt(d)&&"chain"in d)||!!d.chain,E=tr(i);return Xt(g,function(V){var D=a[V];i[V]=D,E&&(i.prototype[V]=function(){var W=this.__chain__;if(v||W){var H=i(this.__wrapped__),K=H.__actions__=Ft(this.__actions__);return K.push({func:D,args:arguments,thisArg:i}),H.__chain__=W,H}return D.apply(i,Tr([this.value()],arguments))})}),i}function TR(){return yt._===this&&(yt._=QV),this}function od(){}function BR(i){return i=Ve(i),De(function(a){return Wh(a,i)})}var VR=Rc(Xe),NR=Rc(ph),AR=Rc(sc);function dm(i){return $c(i)?ac(Gn(i)):aA(i)}function PR(i){return function(a){return i==null?n:oo(i,a)}}var DR=ff(),FR=ff(!0);function id(){return[]}function sd(){return!1}function RR(){return{}}function MR(){return""}function IR(){return!0}function OR(i,a){if(i=Ve(i),i<1||i>ne)return[];var d=ot,h=kt(i,ot);a=fe(a),i-=ot;for(var g=dc(h,a);++d<i;)a(d);return g}function LR(i){return Ee(i)?Xe(i,Gn):qt(i)?[i]:Ft(Nf(We(i)))}function GR(i){var a=++JV;return We(i)+a}var zR=ma(function(i,a){return i+a},0),$R=Mc("ceil"),UR=ma(function(i,a){return i/a},1),ZR=Mc("floor");function WR(i){return i&&i.length?la(i,It,wc):n}function HR(i,a){return i&&i.length?la(i,fe(a,2),wc):n}function jR(i){return mh(i,It)}function qR(i,a){return mh(i,fe(a,2))}function KR(i){return i&&i.length?la(i,It,Sc):n}function YR(i,a){return i&&i.length?la(i,fe(a,2),Sc):n}var JR=ma(function(i,a){return i*a},1),XR=Mc("round"),QR=ma(function(i,a){return i-a},0);function eM(i){return i&&i.length?cc(i,It):0}function tM(i,a){return i&&i.length?cc(i,fe(a,2)):0}return _.after=xD,_.ary=zf,_.assign=dF,_.assignIn=tm,_.assignInWith=Ba,_.assignWith=uF,_.at=pF,_.before=$f,_.bind=qc,_.bindAll=yR,_.bindKey=Uf,_.castArray=RD,_.chain=Of,_.chunk=ZA,_.compact=WA,_.concat=HA,_.cond=_R,_.conforms=vR,_.constant=td,_.countBy=eD,_.create=hF,_.curry=Zf,_.curryRight=Wf,_.debounce=Hf,_.defaults=fF,_.defaultsDeep=mF,_.defer=kD,_.delay=SD,_.difference=jA,_.differenceBy=qA,_.differenceWith=KA,_.drop=YA,_.dropRight=JA,_.dropRightWhile=XA,_.dropWhile=QA,_.fill=eP,_.filter=nD,_.flatMap=iD,_.flatMapDeep=sD,_.flatMapDepth=aD,_.flatten=Ff,_.flattenDeep=tP,_.flattenDepth=nP,_.flip=ED,_.flow=wR,_.flowRight=bR,_.fromPairs=rP,_.functions=bF,_.functionsIn=xF,_.groupBy=lD,_.initial=iP,_.intersection=sP,_.intersectionBy=aP,_.intersectionWith=lP,_.invert=SF,_.invertBy=EF,_.invokeMap=dD,_.iteratee=nd,_.keyBy=uD,_.keys=gt,_.keysIn=Mt,_.map=ba,_.mapKeys=BF,_.mapValues=VF,_.matches=xR,_.matchesProperty=kR,_.memoize=ka,_.merge=NF,_.mergeWith=nm,_.method=SR,_.methodOf=ER,_.mixin=rd,_.negate=Sa,_.nthArg=BR,_.omit=AF,_.omitBy=PF,_.once=TD,_.orderBy=pD,_.over=VR,_.overArgs=BD,_.overEvery=NR,_.overSome=AR,_.partial=Kc,_.partialRight=jf,_.partition=hD,_.pick=DF,_.pickBy=rm,_.property=dm,_.propertyOf=PR,_.pull=pP,_.pullAll=Mf,_.pullAllBy=hP,_.pullAllWith=fP,_.pullAt=mP,_.range=DR,_.rangeRight=FR,_.rearg=VD,_.reject=gD,_.remove=gP,_.rest=ND,_.reverse=Hc,_.sampleSize=_D,_.set=RF,_.setWith=MF,_.shuffle=vD,_.slice=yP,_.sortBy=bD,_.sortedUniq=kP,_.sortedUniqBy=SP,_.split=iR,_.spread=AD,_.tail=EP,_.take=TP,_.takeRight=BP,_.takeRightWhile=VP,_.takeWhile=NP,_.tap=WP,_.throttle=PD,_.thru=wa,_.toArray=Xf,_.toPairs=om,_.toPairsIn=im,_.toPath=LR,_.toPlainObject=em,_.transform=IF,_.unary=DD,_.union=AP,_.unionBy=PP,_.unionWith=DP,_.uniq=FP,_.uniqBy=RP,_.uniqWith=MP,_.unset=OF,_.unzip=jc,_.unzipWith=If,_.update=LF,_.updateWith=GF,_.values=Wo,_.valuesIn=zF,_.without=IP,_.words=lm,_.wrap=FD,_.xor=OP,_.xorBy=LP,_.xorWith=GP,_.zip=zP,_.zipObject=$P,_.zipObjectDeep=UP,_.zipWith=ZP,_.entries=om,_.entriesIn=im,_.extend=tm,_.extendWith=Ba,rd(_,_),_.add=zR,_.attempt=cm,_.camelCase=WF,_.capitalize=sm,_.ceil=$R,_.clamp=$F,_.clone=MD,_.cloneDeep=OD,_.cloneDeepWith=LD,_.cloneWith=ID,_.conformsTo=GD,_.deburr=am,_.defaultTo=CR,_.divide=UR,_.endsWith=HF,_.eq=En,_.escape=jF,_.escapeRegExp=qF,_.every=tD,_.find=rD,_.findIndex=Pf,_.findKey=gF,_.findLast=oD,_.findLastIndex=Df,_.findLastKey=yF,_.floor=ZR,_.forEach=Lf,_.forEachRight=Gf,_.forIn=_F,_.forInRight=vF,_.forOwn=CF,_.forOwnRight=wF,_.get=Xc,_.gt=zD,_.gte=$D,_.has=kF,_.hasIn=Qc,_.head=Rf,_.identity=It,_.includes=cD,_.indexOf=oP,_.inRange=UF,_.invoke=TF,_.isArguments=ao,_.isArray=Ee,_.isArrayBuffer=UD,_.isArrayLike=Rt,_.isArrayLikeObject=it,_.isBoolean=ZD,_.isBuffer=Fr,_.isDate=WD,_.isElement=HD,_.isEmpty=jD,_.isEqual=qD,_.isEqualWith=KD,_.isError=Yc,_.isFinite=YD,_.isFunction=tr,_.isInteger=qf,_.isLength=Ea,_.isMap=Kf,_.isMatch=JD,_.isMatchWith=XD,_.isNaN=QD,_.isNative=eF,_.isNil=nF,_.isNull=tF,_.isNumber=Yf,_.isObject=tt,_.isObjectLike=nt,_.isPlainObject=rs,_.isRegExp=Jc,_.isSafeInteger=rF,_.isSet=Jf,_.isString=Ta,_.isSymbol=qt,_.isTypedArray=Zo,_.isUndefined=oF,_.isWeakMap=iF,_.isWeakSet=sF,_.join=cP,_.kebabCase=KF,_.last=rn,_.lastIndexOf=dP,_.lowerCase=YF,_.lowerFirst=JF,_.lt=aF,_.lte=lF,_.max=WR,_.maxBy=HR,_.mean=jR,_.meanBy=qR,_.min=KR,_.minBy=YR,_.stubArray=id,_.stubFalse=sd,_.stubObject=RR,_.stubString=MR,_.stubTrue=IR,_.multiply=JR,_.nth=uP,_.noConflict=TR,_.noop=od,_.now=xa,_.pad=XF,_.padEnd=QF,_.padStart=eR,_.parseInt=tR,_.random=ZF,_.reduce=fD,_.reduceRight=mD,_.repeat=nR,_.replace=rR,_.result=FF,_.round=XR,_.runInContext=P,_.sample=yD,_.size=CD,_.snakeCase=oR,_.some=wD,_.sortedIndex=_P,_.sortedIndexBy=vP,_.sortedIndexOf=CP,_.sortedLastIndex=wP,_.sortedLastIndexBy=bP,_.sortedLastIndexOf=xP,_.startCase=sR,_.startsWith=aR,_.subtract=QR,_.sum=eM,_.sumBy=tM,_.template=lR,_.times=OR,_.toFinite=nr,_.toInteger=Ve,_.toLength=Qf,_.toLower=cR,_.toNumber=on,_.toSafeInteger=cF,_.toString=We,_.toUpper=dR,_.trim=uR,_.trimEnd=pR,_.trimStart=hR,_.truncate=fR,_.unescape=mR,_.uniqueId=GR,_.upperCase=gR,_.upperFirst=ed,_.each=Lf,_.eachRight=Gf,_.first=Rf,rd(_,function(){var i={};return On(_,function(a,d){He.call(_.prototype,d)||(i[d]=a)}),i}(),{chain:!1}),_.VERSION=o,Xt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){_[i].placeholder=_}),Xt(["drop","take"],function(i,a){Re.prototype[i]=function(d){d=d===n?1:pt(Ve(d),0);var h=this.__filtered__&&!a?new Re(this):this.clone();return h.__filtered__?h.__takeCount__=kt(d,h.__takeCount__):h.__views__.push({size:kt(d,ot),type:i+(h.__dir__<0?"Right":"")}),h},Re.prototype[i+"Right"]=function(d){return this.reverse()[i](d).reverse()}}),Xt(["filter","map","takeWhile"],function(i,a){var d=a+1,h=d==w||d==$;Re.prototype[i]=function(g){var v=this.clone();return v.__iteratees__.push({iteratee:fe(g,3),type:d}),v.__filtered__=v.__filtered__||h,v}}),Xt(["head","last"],function(i,a){var d="take"+(a?"Right":"");Re.prototype[i]=function(){return this[d](1).value()[0]}}),Xt(["initial","tail"],function(i,a){var d="drop"+(a?"":"Right");Re.prototype[i]=function(){return this.__filtered__?new Re(this):this[d](1)}}),Re.prototype.compact=function(){return this.filter(It)},Re.prototype.find=function(i){return this.filter(i).head()},Re.prototype.findLast=function(i){return this.reverse().find(i)},Re.prototype.invokeMap=De(function(i,a){return typeof i=="function"?new Re(this):this.map(function(d){return Ji(d,i,a)})}),Re.prototype.reject=function(i){return this.filter(Sa(fe(i)))},Re.prototype.slice=function(i,a){i=Ve(i);var d=this;return d.__filtered__&&(i>0||a<0)?new Re(d):(i<0?d=d.takeRight(-i):i&&(d=d.drop(i)),a!==n&&(a=Ve(a),d=a<0?d.dropRight(-a):d.take(a-i)),d)},Re.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Re.prototype.toArray=function(){return this.take(ot)},On(Re.prototype,function(i,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=_[h?"take"+(a=="last"?"Right":""):a],v=h||/^find/.test(a);g&&(_.prototype[a]=function(){var E=this.__wrapped__,V=h?[1]:arguments,D=E instanceof Re,W=V[0],H=D||Ee(E),K=function(Fe){var Me=g.apply(_,Tr([Fe],V));return h&&oe?Me[0]:Me};H&&d&&typeof W=="function"&&W.length!=1&&(D=H=!1);var oe=this.__chain__,ue=!!this.__actions__.length,ge=v&&!oe,Pe=D&&!ue;if(!v&&H){E=Pe?E:new Re(this);var ye=i.apply(E,V);return ye.__actions__.push({func:wa,args:[K],thisArg:n}),new en(ye,oe)}return ge&&Pe?i.apply(this,V):(ye=this.thru(K),ge?h?ye.value()[0]:ye.value():ye)})}),Xt(["pop","push","shift","sort","splice","unshift"],function(i){var a=js[i],d=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",h=/^(?:pop|shift)$/.test(i);_.prototype[i]=function(){var g=arguments;if(h&&!this.__chain__){var v=this.value();return a.apply(Ee(v)?v:[],g)}return this[d](function(E){return a.apply(Ee(E)?E:[],g)})}}),On(Re.prototype,function(i,a){var d=_[a];if(d){var h=d.name+"";He.call(Lo,h)||(Lo[h]=[]),Lo[h].push({name:a,func:d})}}),Lo[fa(n,C).name]=[{name:"wrapper",func:n}],Re.prototype.clone=mN,Re.prototype.reverse=gN,Re.prototype.value=yN,_.prototype.at=HP,_.prototype.chain=jP,_.prototype.commit=qP,_.prototype.next=KP,_.prototype.plant=JP,_.prototype.reverse=XP,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=QP,_.prototype.first=_.prototype.head,Zi&&(_.prototype[Zi]=YP),_},Mo=qV();Qr?((Qr.exports=Mo)._=Mo,nc._=Mo):yt._=Mo}).call(Ho)}(Fs,Fs.exports);var Ge=Fs.exports;const DT={class:"grid-overlay-container"},yp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",DT,[e.params.notReady?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[n[0]||(n[0]=r.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),n[1]||(n[1]=r.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[n[2]||(n[2]=r.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),n[3]||(n[3]=r.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),FT={},RT={class:"grid-overlay-container"};function MT(t,e){return r.openBlock(),r.createElementBlock("div",RT,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const _p=Ds(FT,[["render",MT]]);async function IT(t,e){throw Error("not implemented")}function OT(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function LT(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const s=OT(t[o].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=ja(l),u=t.findIndex(p=>Ge.isEqual(p.id,c));if(u===-1)throw console.error("axis not found",o,c,t),Error("axis not found");n.push({columnIdx:o,axisIdx:u})}}return n}const vp=(t,e)=>(t+e).toString();function GT(t,e,n,o,s,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let u=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===c.axisIdx&&(u=y),l[y]===c.columnIdx&&(p=y);const f=(()=>{const T=o[u].data.filter(B=>B!==null);return Array.from(new Set(T))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=zT(s,o,u,p,f,e.rows);for(let y=0;y<f.length;++y){const T=f[y],B=Or(T+"@"+y);n.push({colId:B,field:vp(o.length,y),headerName:T,valueFormatter:wp})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function zT(t,e,n,o,s,l){const c=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let I=0;I<e.length;++I){if(I===n||I===o)continue;const L=t[I].toString();m[L]=e[I].data[f]}let y;const T=Or(Object.values(m))??"";c.has(T)?y=c.get(T):(c.set(T,m),y=m,y.id=u.toString(),u++);const B=s.indexOf(e[n].data[f]);if(B===-1)throw Error("index not found");const A=vp(e.length,B);y[A]=e[o].data[f]}return Array.from(c.values())}function $T(t){return Or(t)}function Cp(t){return JSON.parse(t)}const wp=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function UT(t,e,n){var s,l,c;const o=$T(e);return{colId:o,field:t.toString(),headerName:((l=(s=e.spec.annotations)==null?void 0:s["pl7.app/label"])==null?void 0:l.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(o))??((c=e.spec.annotations)==null?void 0:c["pl7.app/table/visibility"])==="optional",valueFormatter:wp,cellDataType:(u=>{switch(u){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${u}`)}})(e.type==="axis"?e.spec.type:e.spec.valueType)}}function bp(t,e){switch(e){case"Int":return t;case"Long":return typeof t=="bigint"?Number(t):t;case"Float":return t;case"Double":return t;case"String":return t;case"Bytes":return Buffer.from(t).toString("hex");default:throw Error(`unsupported data type: ${e}`)}}function xp(t){const e=[];return fs(t,n=>(e.push(n),n)),e}async function ZT(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Ge.uniqWith(n.map(s=>Rd(s.spec.axesSpec).map(Ge.cloneDeep)).flat(),Ge.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function WT(t,e,n){const o=xp(n),l=(await ZT(t,e,o)).filter(c=>!Ge.find(o,u=>c.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function HT(t,e,n,o){const s=n.filter(m=>m.type!=="Bytes"),l=xp(o),c=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const y=Rd(l[m].spec.axesSpec);for(let T=0;T<y.length;++T){const B=Ge.findIndex(s,A=>Ge.isEqual(A,y[T]));B===-1||u[B]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[B]=[[m,T]],u[B]=l[m].columnId):c[B].push([m,T]))}}for(let m=s.length-1;m>=0;--m)c[m].length||(u.splice(m,1),c.splice(m,1),s.splice(m,1));const p=100,f=s.map(m=>new Set);e:for(let m=s.length-1;m>=0;--m){for(const[y,T]of c[m]){const B=await t.getUniqueValues(e,{columnId:l[y].columnId,...!u[m]&&{axis:Ge.cloneDeep(s[m])},filters:[],limit:p});if(B.overflow){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}const A=B.values.type;for(const I of B.values.data)if(!(Fd(I,A)||I===null)&&(f[m].add(bp(I,A)),f[m].size===p)){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}}if(!f[m].size){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}}return s.map((m,y)=>{const T=[...f[y]].map(A=>({value:A,label:A.toString()})),B=T[0].value;return{axis:Ge.cloneDeep(m),...u[y]&&{column:u[y]},options:T,defaultValue:B}})}function jT(t,e,n,o){const s=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const u=[],p=(o++).toString();for(const m of n)u.push(e[m].data[c]);const f={key:u,id:p};for(let m=0;m<s;++m){const y=t[m].toString(),T=e[m].data[c],B=e[m].type;Og(e[m].absent,c)?f[y]=void 0:Fd(T,B)||T===null?f[y]=null:f[y]=bp(T,B)}l.push(f)}return l}const qT=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function KT(t,e,n,o){const s=await t.getSpec(e);let l=s.findIndex(C=>C.type==="column");l===-1&&(l=s.length);const c=[...s.keys()].filter(C=>!Ge.find(n,R=>Ge.isEqual(R.axis,s[C].id)||Ge.isEqual(R.column,s[C].id))).sort((C,R)=>{var N,U;if(s[C].type!==s[R].type)return s[C].type==="axis"?-1:1;const O=(N=s[C].spec.annotations)==null?void 0:N["pl7.app/table/orderPriority"],F=(U=s[R].spec.annotations)==null?void 0:U["pl7.app/table/orderPriority"];return O===void 0?F===void 0?0:1:F===void 0?-1:Number(F)-Number(O)}),u=Ge.cloneDeep(c),p=LT(s,c);for(let C=c.length-1;C>=0;--C){const R=c[C];if(!qT(s[R]))continue;const O=ja(s[R].spec.axesSpec[0]),F=Ge.findIndex(c,N=>Ge.isEqual(s[N].id,O));if(F===-1&&Ge.findIndex(n,U=>Ge.isEqual(U.axis,O))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${O}`);continue}c[F]=R;for(const N of p)N.axisIdx===R&&(N.axisIdx=F);c.splice(C,1),u.splice(C,1)}const f=await t.getShape(e),m=f.rows,y=u.map(C=>UT(C,s[C],o));if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return GT(p,f,y,await t.getData(e,c),u,c);const T=[...c],B=new Map;for(let C=0;C<l;++C)B.set(C,-1);for(let C=0;C<T.length;++C){const R=T[C];B.has(R)&&B.set(R,C)}for(const[C,R]of B)R===-1&&(B.set(C,T.length),T.push(C));const A=[];for(let C=0;C<l;++C){const R=B.get(C);if(R===void 0||R===-1)throw new Error("assertion exception");A.push(R)}let I;return{rowModelType:"serverSide",columnDefs:y,serverSideDatasource:{getRows:async C=>{try{if(m==0){C.success({rowData:[],rowCount:m}),C.api.setGridOption("loading",!1),C.api.showNoRowsOverlay();return}if(I&&!Ge.isEqual(I.request.sortModel,C.request.sortModel)){I=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}I=C;let R=0,O=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(R=Math.min(m,C.request.endRow)-C.request.startRow,R>0)){const F=await t.getData(e,T,{offset:C.request.startRow,length:R});O=jT(u,F,A,C.request.startRow)}C.success({rowData:O,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(R){C.api.setGridOption("loading",!0),C.fail(),console.trace(R)}}}}}const kp=km(),YT=["onClick"],Sp=r.defineComponent({__name:"PlAgGridColumnManager",props:{api:{}},setup(t){const e=t,{api:n}=r.toRefs(e),o=r.ref([]),s=r.ref(),l=r.ref(!1),c=r.ref(0);gp(s,{handle:".handle",onChange(p){n.value.moveColumns(p.map(f=>o.value[f]),0)}});function u(p){n.value.setColumnsVisible([p],!p.isVisible())}return r.onMounted(()=>{n.value.addEventListener("displayedColumnsChanged",()=>{o.value=[...n.value.getAllGridColumns()??[]],c.value++}),o.value=n.value.getAllGridColumns()??[]}),(p,f)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(r.Teleport,{to:`#${r.unref(kp)}`},[r.createVNode(r.unref(Cs),{onClick:f[0]||(f[0]=r.withModifiers(m=>l.value=!l.value,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(cn),{name:"columns"})]),default:r.withCtx(()=>[f[2]||(f[2]=r.createTextVNode(" Columns "))]),_:1})],8,["to"])),r.createVNode(r.unref($u),{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=m=>l.value=m),shadow:!0,width:"368px","close-on-outside-click":""},{title:r.withCtx(()=>f[3]||(f[3]=[r.createTextVNode("Columns")])),default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("div",{ref_key:"listRef",ref:s,key:c.value,class:"pl-ag-columns"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,m=>(r.openBlock(),r.createElementBlock("div",{key:m.getId(),class:"pl-ag-columns__item"},[r.createElementVNode("div",{class:r.normalizeClass([{handle:!m.getColDef().lockPosition},"pl-ag-columns__drag"])},[r.createVNode(r.unref(Un),{name:"drag-dots"})],2),r.createElementVNode("div",{class:r.normalizeClass([{visible:m.isVisible()},"pl-ag-columns__title"])},r.toDisplayString(m.getColDef().headerName),3),r.createElementVNode("div",{class:"pl-ag-columns__visibility",onClick:y=>u(m)},[r.createVNode(r.unref(Ct),{"close-delay":500,position:"top"},{tooltip:r.withCtx(()=>f[4]||(f[4]=[r.createTextVNode("Show/Hide")])),default:r.withCtx(()=>[r.createVNode(r.unref(cn),{name:m.isVisible()?"view-show":"view-hide"},null,8,["name"])]),_:2},1024)],8,YT)]))),128))]))]),_:1},8,["modelValue"])]))}}),JT=["id"],XT=r.defineComponent({__name:"PlAgDataTableToolsPanel",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(kp),class:"d-flex gap-6"},[r.renderSlot(e.$slots,"default")],8,JT))}}),QT={class:"ap-ag-data-table-container"},eB={key:1,class:"ap-ag-data-table-sheets"},tB=Ds(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{},showColumnsPanel:{type:Boolean}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{expose:e,emit:n}){x.ModuleRegistry.registerModules([is.ClientSideRowModelModule,hd.ClipboardModule,pd.ServerSideRowModelModule,fd.RangeSelectionModule,Ja,ru]);const o=r.useModel(t,"modelValue"),s=t,{settings:l}=r.toRefs(s),c=n;r.watch(()=>l.value,async(S,w)=>{if(S.sourceType!=="pframe"||!S.pFrame||!S.join||w&&w.sourceType==="pframe"&&Ge.isEqual(S.pFrame,w.pFrame)&&Ge.isEqual(S.join,w.join))return;const k=window.platforma;if(!k)throw Error("platforma not set");const $=k.pFrameDriver;if(!$)throw Error("platforma.pFrameDriver not set");const Q=await WT($,S.pFrame,S.join),ne=o.value;ne.pTableParams||(ne.pTableParams={sorting:[],filters:[]}),ne.pTableParams.join=Q,o.value=ne});const u=Ep(()=>l.value.sourceType,async S=>{var k;const w=l.value.sourceType;switch(w){case"pframe":{const $=window.platforma;if(!$)throw Error("platforma not set");const Q=$.pFrameDriver;if(!Q)throw Error("platforma.pFrameDriver not set");if(!l.value.pFrame)return[];const ne=l.value.pFrame,be=(k=o.value.pTableParams)==null?void 0:k.join;return be?await HT(Q,ne,l.value.sheetAxes,be):[]}case"ptable":return l.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${w}`)}});function p(S){if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return(S==null?void 0:S.sortModel.map(w=>{const{spec:k,...$}=Cp(w.colId);return{column:$,ascending:w.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const f=r.computed({get:()=>{const S=o.value;return{columnOrder:S.gridState.columnOrder,sort:S.gridState.sort,columnVisibility:S.gridState.columnVisibility}},set:S=>{const w=o.value,k=A.value.rowModelType==="clientSide"?void 0:p(S.sort);w.gridState={...w.gridState,...S},(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(w.pTableParams||(w.pTableParams={sorting:[],filters:[]}),w.pTableParams.sorting=k),o.value=w}}),m=S=>Or(S);function y(S){var w;if(!(l.value.sourceType!=="ptable"&&l.value.sourceType!=="pframe"))return((w=u.value)==null?void 0:w.map(k=>({type:"bySingleColumnV2",column:k.column?{type:"column",id:k.column}:{type:"axis",id:k.axis},predicate:{operator:"Equal",reference:S[m(k.axis)]}})))??[]}const T=r.computed({get:()=>o.value.gridState.sheets??{},set:S=>{const w=y(S),k=o.value;k.gridState.sheets=S,(l.value.sourceType==="ptable"||l.value.sourceType==="pframe")&&(k.pTableParams||(k.pTableParams={sorting:[],filters:[]}),k.pTableParams.filters=w),o.value=k}});r.watch(()=>[l.value,u.value],(S,w)=>{const[k,$]=S;if(!$)return;if(w){const[ne,be]=w;if((k.sourceType==="ptable"||k.sourceType==="pframe")&&k.sourceType===(ne==null?void 0:ne.sourceType)&&Ge.isEqual($,be))return}if(k.sourceType!=="ptable"&&k.sourceType!=="pframe"){T.value={};return}const Q=T.value;for(const ne of $){const be=m(ne.axis);Q[be]||(Q[be]=ne.defaultValue??ne.options[0].value)}T.value=Q},{immediate:!0});const B=r.shallowRef(),A=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:f.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:S=>{S.api.autoSizeAllColumns()},onRowDoubleClicked:S=>{S.data&&c("onRowDoubleClicked",S.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:S=>S.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:yp,noRowsOverlayComponent:_p,sideBar:{},defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),I=S=>{const w=S.api;B.value=new Proxy(w,{get(k,$,Q){switch($){case"setGridOption":return(ne,be)=>{const $e=A.value;$e[ne]=be,A.value=$e,w.setGridOption(ne,be)};case"updateGridOptions":return ne=>{A.value={...A.value,...ne},w.updateGridOptions(ne)};default:return Reflect.get(k,$,Q)}}})},L=S=>({columnOrder:S.columnOrder,sort:S.sort,columnVisibility:S.columnVisibility??(S.columnOrder?{hiddenColIds:[]}:void 0)}),C=S=>{A.value.initialState=f.value=L(S.state),S.api.autoSizeAllColumns()},R=()=>{A.value.initialState=f.value=L(B.value.getState()),B.value=void 0};let O=!1;const F=()=>{if(!O)return;const S=B.value;S!==void 0&&(S.exportDataAsCsv(),O=!1,S.setGridOption("cacheBlockSize",100))},N=()=>{if(!O)return;const S=B.value;if(S===void 0)return;const w=S.getServerSideGroupLevelState()[0];w.cacheBlockSize===w.rowCount&&S.refreshServerSide({route:w.route,purge:!1})};e({exportCsv:async()=>{const S=B.value;if(S!==void 0){if(A.value.rowModelType==="clientSide"){S.exportDataAsCsv();return}if(A.value.rowModelType==="serverSide"){const w=S.getServerSideGroupLevelState()[0];if(w.rowCount<=w.cacheBlockSize){S.exportDataAsCsv();return}O||(O=!0,S.setGridOption("cacheBlockSize",w.rowCount))}}}});const te=r.ref(0);r.watch(()=>[B.value,f.value],(S,w)=>{if(Ge.isEqual(S,w))return;const[k,$]=S;if(!k)return;const Q=L(k.getState());Ge.isEqual($,Q)||(A.value.initialState=$,++te.value)}),r.watch(()=>A.value,(S,w)=>{var k;if(w&&(S.rowModelType!=w.rowModelType&&++te.value,!Ge.isEqual(S.columnDefs,w.columnDefs)&&S.columnDefs)){const $=be=>!("children"in be),Q=(k=S.columnDefs)==null?void 0:k.filter($),ne=Q==null?void 0:Q.map(be=>be.colId).filter(be=>be!==void 0).map(be=>Cp(be));c("columnsChanged",ne??[])}});const j=(S,w)=>{var $;const k=T.value;k[S]!==w&&(k[S]=w,T.value=k,($=B.value)==null||$.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},Y=window.platforma;if(!Y)throw Error("platforma not set");const q=Y.pFrameDriver;if(!q)throw Error("platforma.pFrameDriver not set");const ee=Y.blobDriver;if(!ee)throw Error("platforma.blobDriver not set");let G;return r.watch(()=>[B.value,l.value,u.value],async S=>{var ne,be;const[w,k,$]=S;if(!w||Ge.isEqual(k,G))return;G=k;const Q=k.sourceType;switch(Q){case"pframe":case"ptable":{const $e=k.pTable;if(!$e||!$)return w.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ot=(be=(ne=f.value)==null?void 0:ne.columnVisibility)==null?void 0:be.hiddenColIds,wn=await KT(q,$e,$,ot);return w.updateGridOptions({loading:wn.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...wn})}case"xsv":{const $e=k.xsvFile;if(!($e!=null&&$e.ok)||!$e.value)return w.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const ot=await IT(ee,$e.value);return w.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...ot})}default:throw Error(`unsupported source type: ${Q}`)}}),(S,w)=>(r.openBlock(),r.createElementBlock("div",QT,[B.value&&S.showColumnsPanel?(r.openBlock(),r.createBlock(r.unref(Sp),{key:0,api:B.value},null,8,["api"])):r.createCommentVNode("",!0),r.unref(u).value&&r.unref(u).value.length>0?(r.openBlock(),r.createElementBlock("div",eB,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(u).value,(k,$)=>(r.openBlock(),r.createBlock(r.unref(Gu),{key:$,"model-value":T.value[m(k.axis)],options:k.options,"onUpdate:modelValue":Q=>j(m(k.axis),Q)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(Cm.AgGridVue),{key:te.value,theme:r.unref(iu),class:"ap-ag-data-table-grid","grid-options":A.value,onGridReady:I,onStateUpdated:C,onGridPreDestroyed:R,onStoreRefreshed:F,onModelUpdated:N},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-ea0278e4"]]),nB={key:0,class:"d-flex gap-10 flex-column"},rB={key:0},oB=Ds(r.defineComponent({__name:"PlTableFilters",props:r.mergeModels({columns:{},restrictions:{},defaults:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{columns:o,restrictions:s,defaults:l}=r.toRefs(n),c=G=>Or(G.id),u=r.computed(()=>o.value.filter(G=>{const S=G.type;switch(S){case"axis":return G.spec.type!=="Bytes";case"column":return G.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${S}`)}}).map(G=>({column:G,id:c(G)}))),p=r.computed(()=>{const G=s.value??[],S={};for(const{column:w,id:k}of u.value){const $=Ge.find(G,Q=>Ge.isEqual(Q.column.id,w.id));$!==void 0&&(S[k]=$.allowedFilterTypes)}return S}),f=r.computed(()=>{const G=l.value??[],S={};for(const{column:w,id:k}of u.value){const $=Ge.find(G,Q=>Ge.isEqual(Q.column.id,w.id));$!==void 0&&(S[k]=$.default)}return S}),m=G=>G!==void 0?G:f.value,y=r.reactive({state:m(e.value.state)});r.watch(()=>e.value,G=>{Ge.isEqual(y.state,G.state)||(y.state=m(G.state))}),r.watch(()=>u.value,G=>{if(y.state!==void 0&&G.length===0)return;const S=y.state??{},w={};for(const{id:k}of G)S[k]!==void 0&&(w[k]=S[k]);y.state=w},{immediate:!0});const T=G=>{switch(G){case"isNotNA":return"Is not NA";case"isNA":return"Is NA";case"number_equals":case"string_equals":return"Equals";case"number_notEquals":case"string_notEquals":return"Not equals";case"number_greaterThan":return"Greater than";case"number_greaterThanOrEqualTo":return"Greater than or equal to";case"number_lessThan":return"Less than";case"number_lessThanOrEqualTo":return"Less than or equal to";case"number_between":return"Between";case"string_contains":return"Contains";case"string_doesNotContain":return"Does not contain";case"string_matches":return"Matches";case"string_doesNotMatch":return"Does not match";case"string_containsFuzzyMatch":return"Contains fuzzy match";default:throw Error(`unsupported filter type: ${G}`)}},B=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],A=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"],I=r.computed(()=>{const G=p.value,S={};for(const{column:w,id:k}of u.value){let Q=(w.type==="column"?w.spec.valueType:w.spec.type)==="String"?A:B;const ne=G[k];ne!==void 0&&(Q=Q.filter(be=>ne.includes(be))),S[k]=Q.map(be=>({value:be,text:T(be)}))}return S}),L=r.computed(()=>Ge.some(Object.values(I.value),G=>G.length>0)),C=G=>{const S=G.type;switch(S){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return G.reference;case"number_between":return G.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return G.reference;default:throw Error(`unsupported filter type: ${S}`)}},R=(G,S)=>{switch(G){case"isNotNA":case"isNA":return{type:G};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:G,reference:typeof S=="number"?S:0};case"number_between":return{type:G,lowerBound:typeof S=="number"?S:0,includeLowerBound:!0,upperBound:100,includeUpperBound:!1};case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":return{type:G,reference:typeof S=="string"?S:""};case"string_containsFuzzyMatch":return{type:G,reference:typeof S=="string"?S:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${G}`)}},O=(G,S)=>{const w=y.state[G];y.state[G]=R(S,C(w))},F=G=>{y.state[G]=f.value[G]??R(I.value[G][0].value)},N=(G,S)=>{S?F(G):delete y.state[G]},U=(G,S)=>{var ne,be;const w=Number(S);if(!Number.isFinite(w))throw Error("Model value is not a number.");const k=G.type==="column"?G.spec.valueType:G.spec.type;if((k==="Int"||k==="Long")&&!Number.isInteger(w))throw Error("Model value is not an integer.");const $=(ne=G.spec.annotations)==null?void 0:ne["pl7.app/min"];if($!==void 0){const $e=Number($);if(Number.isFinite($e)&&w<Number($))throw Error("Model value is too low.")}const Q=(be=G.spec.annotations)==null?void 0:be["pl7.app/max"];if(Q!==void 0){const $e=Number(Q);if(Number.isFinite($e)&&w>Number(Q))throw Error("Model value is too high.")}return w},te=(G,S)=>{var k,$;const w=((k=G.spec.domain)==null?void 0:k["pl7.app/alphabet"])??(($=G.spec.annotations)==null?void 0:$["pl7.app/alphabet"]);if(w==="nucleotide"&&!/^[AaTtGgCcNn]+$/.test(S))throw Error("Model value is not a nucleotide.");if(w==="aminoacid"&&!/^[AaCcDdEeFfGgHhIiKkLlMmNnPpQqRrSsTtVvWwYyXx]+$/.test(S))throw Error("Model value is not an aminoacid.");return S},j=G=>{try{return new RegExp(G),G}catch(S){throw S instanceof SyntaxError?Error("Model value is not a regexp."):S}},Y=(G,S)=>{var $,Q;const w=(($=G.spec.domain)==null?void 0:$["pl7.app/alphabet"])??((Q=G.spec.annotations)==null?void 0:Q["pl7.app/alphabet"]);if(w==="nucleotide")return[{value:"N",text:"N"}];if(w==="aminoacid")return[{value:"X",text:"X"}];const k=Ge.uniq(S);return k.sort(),k.map(ne=>({value:ne,text:ne}))},q=G=>{const S=G.type;switch(S){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":case"string_equals":return{operator:"Equal",reference:G.reference};case"number_notEquals":case"string_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:G.reference}};case"number_greaterThan":return{operator:"Greater",reference:G.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:G.reference};case"number_lessThan":return{operator:"Less",reference:G.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:G.reference};case"number_between":return{operator:"And",operands:[{operator:G.includeLowerBound?"GreaterOrEqual":"Greater",reference:G.lowerBound},{operator:G.includeUpperBound?"LessOrEqual":"Less",reference:G.upperBound}]};case"string_contains":return{operator:"StringContains",substring:G.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:"StringContains",substring:G.reference}};case"string_matches":return{operator:"Matches",regex:G.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:G.reference}};case"string_containsFuzzyMatch":return{operator:"StringContainsFuzzy",reference:G.reference,maxEdits:G.maxEdits,substitutionsOnly:G.substitutionsOnly,wildcard:G.wildcard};default:throw Error(`unsupported filter type: ${S}`)}},ee=G=>u.value.map(({column:S,id:w})=>{if(!(w in G))return;const k=q(G[w]),{spec:$,...Q}=S;return{type:"bySingleColumnV2",column:Q,predicate:k}}).filter(S=>S!==void 0);return r.watch(()=>y,G=>{Ge.isEqual(G.state,e.value.state)||(e.value={state:Ge.cloneDeep(G.state),filters:ee(G.state)})},{immediate:!0,deep:!0}),(G,S)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,({column:w,id:k},$)=>{var Q,ne,be,$e,ot,wn,In,xr,jn,Jr,Os,kr,Sr,Ls;return r.openBlock(),r.createElementBlock("div",{key:k},[I.value[k].length>0?(r.openBlock(),r.createElementBlock("form",nB,[r.createVNode(r.unref(zu),{"model-value":!!y.state[k],"onUpdate:modelValue":Se=>N(k,Se)},{default:r.withCtx(()=>{var Se,Xr;return[r.createTextVNode(r.toDisplayString(((Xr=(Se=w.spec.annotations)==null?void 0:Se["pl7.app/label"])==null?void 0:Xr.trim())??"Unlabeled "+w.type+" "+$.toString()),1)]}),_:2},1032,["model-value","onUpdate:modelValue"]),r.createElementVNode("div",{class:r.normalizeClass(["controls d-flex gap-10 flex-column",{open:!!y.state[k]}])},[y.state[k]?(r.openBlock(),r.createBlock(r.unref(yi),{key:0,"model-value":y.state[k].type,options:I.value[k],label:"Predicate","onUpdate:modelValue":Se=>O(k,Se)},null,8,["model-value","options","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Q=y.state[k])==null?void 0:Q.type)==="number_equals"||((ne=y.state[k])==null?void 0:ne.type)==="number_notEquals"||((be=y.state[k])==null?void 0:be.type)==="number_lessThan"||(($e=y.state[k])==null?void 0:$e.type)==="number_lessThanOrEqualTo"||((ot=y.state[k])==null?void 0:ot.type)==="number_greaterThan"||((wn=y.state[k])==null?void 0:wn.type)==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(Ur),{key:1,modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:Se=>U(w,Se),label:"Reference value"},null,8,["modelValue","onUpdate:modelValue","parse"])):r.createCommentVNode("",!0),((In=y.state[k])==null?void 0:In.type)==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createVNode(r.unref(Ur),{modelValue:y.state[k].lowerBound,"onUpdate:modelValue":Se=>y.state[k].lowerBound=Se,parse:Se=>U(w,Se),label:"Lower bound"},null,8,["modelValue","onUpdate:modelValue","parse"]),r.createVNode(r.unref(xs),{modelValue:y.state[k].includeLowerBound,"onUpdate:modelValue":Se=>y.state[k].includeLowerBound=Se,label:"Include lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(Ur),{modelValue:y.state[k].upperBound,"onUpdate:modelValue":Se=>y.state[k].upperBound=Se,parse:Se=>U(w,Se),label:"Upper bound"},null,8,["modelValue","onUpdate:modelValue","parse"]),r.createVNode(r.unref(xs),{modelValue:y.state[k].includeUpperBound,"onUpdate:modelValue":Se=>y.state[k].includeUpperBound=Se,label:"Include upper bound"},null,8,["modelValue","onUpdate:modelValue"])],64)):r.createCommentVNode("",!0),((xr=y.state[k])==null?void 0:xr.type)==="string_equals"||((jn=y.state[k])==null?void 0:jn.type)==="string_notEquals"||((Jr=y.state[k])==null?void 0:Jr.type)==="string_contains"||((Os=y.state[k])==null?void 0:Os.type)==="string_doesNotContain"?(r.openBlock(),r.createBlock(r.unref(Ur),{key:3,modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:Se=>te(w,Se),label:"Reference value"},null,8,["modelValue","onUpdate:modelValue","parse"])):r.createCommentVNode("",!0),((kr=y.state[k])==null?void 0:kr.type)==="string_matches"||((Sr=y.state[k])==null?void 0:Sr.type)==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(Ur),{key:4,modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:j,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Ls=y.state[k])==null?void 0:Ls.type)==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:5},[r.createVNode(r.unref(Ur),{modelValue:y.state[k].reference,"onUpdate:modelValue":Se=>y.state[k].reference=Se,parse:Se=>te(w,Se),label:"Reference value"},null,8,["modelValue","onUpdate:modelValue","parse"]),r.createVNode(r.unref(hp),{modelValue:y.state[k].maxEdits,"onUpdate:modelValue":Se=>y.state[k].maxEdits=Se,max:5,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(xs),{modelValue:y.state[k].substitutionsOnly,"onUpdate:modelValue":Se=>y.state[k].substitutionsOnly=Se,label:"Substitutions only"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(yi),{modelValue:y.state[k].wildcard,"onUpdate:modelValue":Se=>y.state[k].wildcard=Se,options:Y(w,y.state[k].reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","onUpdate:modelValue","options"])],64)):r.createCommentVNode("",!0)],2)])):r.createCommentVNode("",!0)])}),128)),L.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",rB,"No filters applicable"))],64))}}),[["__scopeId","data-v-bbbd2a6f"]]),iB={key:1,class:"alert-error"},sB={key:2},aB=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&o.value===void 0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[n.value!==void 0?r.renderSlot(l.$slots,"default",r.normalizeProps(r.mergeProps({key:0},{value:n.value}))):r.createCommentVNode("",!0),o.value?(r.openBlock(),r.createElementBlock("div",iB,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",sB,"Unresolved")):r.createCommentVNode("",!0)]))}}),lB={style:{height:"100%"}},cB=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function s(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(c,u)=>(r.openBlock(),r.createElementBlock("div",lB,[r.createVNode(r.unref(up),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":o.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),dB={class:"pl-ag-grid-open-cell d-flex"},uB={class:"pl-ag-grid-open-cell__value"},pB=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;function n(){if(e.params.invokeRowsOnDoubleClick){const o=e.params.api,s={rowPinned:e.params.node.rowPinned,api:o,rowIndex:e.params.node.rowIndex,context:o,type:"rowDoubleClicked",node:e.params.node,data:e.params.data,event:null};o.dispatchEvent(s)}else e.params.onClick&&e.params.onClick(e.params)}return(o,s)=>(r.openBlock(),r.createElementBlock("div",dB,[r.createElementVNode("div",uB,r.toDisplayString(o.params.value),1),r.createElementVNode("div",{class:"pl-ag-grid-open-cell__activator text-caps11 align-center",onClick:r.withModifiers(n,["stop"])},[r.createVNode(r.unref(Un),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}}),Rs=new Map;function hB(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{Rs.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function fB(t){const e=Symbol();return()=>(Rs.has(e)||Rs.set(e,hB(e,t)),Rs.get(e))}function mB(t){return r.computed(()=>{try{return Cd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function Ep(t,e,n){const o=r.ref(0),s=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=Em(e);return r.watch(t,async c=>{s.error=void 0,o.value++,l(c).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const Eo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Tp=new Set,Rl=typeof process=="object"&&process?process:{},Bp=(t,e,n,o)=>{typeof Rl.emitWarning=="function"?Rl.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let Ms=globalThis.AbortController,Vp=globalThis.AbortSignal;if(typeof Ms>"u"){Vp=class{constructor(){Ze(this,"onabort");Ze(this,"_onabort",[]);Ze(this,"reason");Ze(this,"aborted",!1)}addEventListener(o,s){this._onabort.push(s)}},Ms=class{constructor(){Ze(this,"signal",new Vp);e()}abort(o){var s,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const c of this.signal._onabort)c(o);(l=(s=this.signal).onabort)==null||l.call(s,o)}}};let t=((Ap=Rl.env)==null?void 0:Ap.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,Bp("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const gB=t=>!Tp.has(t),wr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Np=t=>wr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Is:null:null;class Is extends Array{constructor(e){super(e),this.fill(0)}}const jr=class jr{constructor(e,n){Ze(this,"heap");Ze(this,"length");if(!b(jr,To))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=Np(e);if(!n)return[];me(jr,To,!0);const o=new jr(e,n);return me(jr,To,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};To=new WeakMap,ze(jr,To,!1);let Ml=jr;const Ll=class Ll{constructor(e){ze(this,re);ze(this,hn);ze(this,zt);ze(this,fn);ze(this,mn);ze(this,Bo);ze(this,Vo);Ze(this,"ttl");Ze(this,"ttlResolution");Ze(this,"ttlAutopurge");Ze(this,"updateAgeOnGet");Ze(this,"updateAgeOnHas");Ze(this,"allowStale");Ze(this,"noDisposeOnSet");Ze(this,"noUpdateTTL");Ze(this,"maxEntrySize");Ze(this,"sizeCalculation");Ze(this,"noDeleteOnFetchRejection");Ze(this,"noDeleteOnStaleGet");Ze(this,"allowStaleOnFetchAbort");Ze(this,"allowStaleOnFetchRejection");Ze(this,"ignoreFetchAbort");ze(this,dt);ze(this,gn);ze(this,lt);ze(this,Ke);ze(this,xe);ze(this,Bt);ze(this,$t);ze(this,xt);ze(this,ft);ze(this,yn);ze(this,mt);ze(this,_n);ze(this,vn);ze(this,Ut);ze(this,Cn);ze(this,br);ze(this,Vt);ze(this,qr,()=>{});ze(this,Hn,()=>{});ze(this,Mi,()=>{});ze(this,Zt,()=>!1);ze(this,Kr,e=>{});ze(this,No,(e,n,o)=>{});ze(this,Ii,(e,n,o,s)=>{if(o||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ze(this,Pp,"LRUCache");const{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:T,maxSize:B=0,maxEntrySize:A=0,sizeCalculation:I,fetchMethod:L,memoMethod:C,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:F,allowStaleOnFetchAbort:N,ignoreFetchAbort:U}=e;if(n!==0&&!wr(n))throw new TypeError("max option must be a nonnegative integer");const te=n?Np(n):Array;if(!te)throw new Error("invalid max value: "+n);if(me(this,hn,n),me(this,zt,B),this.maxEntrySize=A||b(this,zt),this.sizeCalculation=I,this.sizeCalculation){if(!b(this,zt)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(me(this,Vo,C),L!==void 0&&typeof L!="function")throw new TypeError("fetchMethod must be a function if specified");if(me(this,Bo,L),me(this,br,!!L),me(this,lt,new Map),me(this,Ke,new Array(n).fill(void 0)),me(this,xe,new Array(n).fill(void 0)),me(this,Bt,new te(n)),me(this,$t,new te(n)),me(this,xt,0),me(this,ft,0),me(this,yn,Ml.create(n)),me(this,dt,0),me(this,gn,0),typeof f=="function"&&me(this,fn,f),typeof m=="function"?(me(this,mn,m),me(this,mt,[])):(me(this,mn,void 0),me(this,mt,void 0)),me(this,Cn,!!b(this,fn)),me(this,Vt,!!b(this,mn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!T,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!F,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!U,this.maxEntrySize!==0){if(b(this,zt)!==0&&!wr(b(this,zt)))throw new TypeError("maxSize must be a positive integer if specified");if(!wr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");de(this,re,fm).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!u,this.ttlResolution=wr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!wr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");de(this,re,ld).call(this)}if(b(this,hn)===0&&this.ttl===0&&b(this,zt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!b(this,hn)&&!b(this,zt)){const j="LRU_CACHE_UNBOUNDED";gB(j)&&(Tp.add(j),Bp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,Ll))}}static unsafeExposeInternals(e){return{starts:b(e,vn),ttls:b(e,Ut),sizes:b(e,_n),keyMap:b(e,lt),keyList:b(e,Ke),valList:b(e,xe),next:b(e,Bt),prev:b(e,$t),get head(){return b(e,xt)},get tail(){return b(e,ft)},free:b(e,yn),isBackgroundFetch:n=>{var o;return de(o=e,re,Je).call(o,n)},backgroundFetch:(n,o,s,l)=>{var c;return de(c=e,re,Aa).call(c,n,o,s,l)},moveToTail:n=>{var o;return de(o=e,re,os).call(o,n)},indexes:n=>{var o;return de(o=e,re,Rr).call(o,n)},rindexes:n=>{var o;return de(o=e,re,Mr).call(o,n)},isStale:n=>{var o;return b(o=e,Zt).call(o,n)}}}get max(){return b(this,hn)}get maxSize(){return b(this,zt)}get calculatedSize(){return b(this,gn)}get size(){return b(this,dt)}get fetchMethod(){return b(this,Bo)}get memoMethod(){return b(this,Vo)}get dispose(){return b(this,fn)}get disposeAfter(){return b(this,mn)}getRemainingTTL(e){return b(this,lt).has(e)?1/0:0}*entries(){for(const e of de(this,re,Rr).call(this))b(this,xe)[e]!==void 0&&b(this,Ke)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield[b(this,Ke)[e],b(this,xe)[e]])}*rentries(){for(const e of de(this,re,Mr).call(this))b(this,xe)[e]!==void 0&&b(this,Ke)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield[b(this,Ke)[e],b(this,xe)[e]])}*keys(){for(const e of de(this,re,Rr).call(this)){const n=b(this,Ke)[e];n!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield n)}}*rkeys(){for(const e of de(this,re,Mr).call(this)){const n=b(this,Ke)[e];n!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield n)}}*values(){for(const e of de(this,re,Rr).call(this))b(this,xe)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield b(this,xe)[e])}*rvalues(){for(const e of de(this,re,Mr).call(this))b(this,xe)[e]!==void 0&&!de(this,re,Je).call(this,b(this,xe)[e])&&(yield b(this,xe)[e])}[(Dp=Symbol.iterator,Pp=Symbol.toStringTag,Dp)](){return this.entries()}find(e,n={}){for(const o of de(this,re,Rr).call(this)){const s=b(this,xe)[o],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,b(this,Ke)[o],this))return this.get(b(this,Ke)[o],n)}}forEach(e,n=this){for(const o of de(this,re,Rr).call(this)){const s=b(this,xe)[o],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,b(this,Ke)[o],this)}}rforEach(e,n=this){for(const o of de(this,re,Mr).call(this)){const s=b(this,xe)[o],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,b(this,Ke)[o],this)}}purgeStale(){let e=!1;for(const n of de(this,re,Mr).call(this,{allowStale:!0}))b(this,Zt).call(this,n)&&(de(this,re,Ir).call(this,b(this,Ke)[n],"expire"),e=!0);return e}info(e){const n=b(this,lt).get(e);if(n===void 0)return;const o=b(this,xe)[n],s=de(this,re,Je).call(this,o)?o.__staleWhileFetching:o;if(s===void 0)return;const l={value:s};if(b(this,Ut)&&b(this,vn)){const c=b(this,Ut)[n],u=b(this,vn)[n];if(c&&u){const p=c-(Eo.now()-u);l.ttl=p,l.start=Date.now()}}return b(this,_n)&&(l.size=b(this,_n)[n]),l}dump(){const e=[];for(const n of de(this,re,Rr).call(this,{allowStale:!0})){const o=b(this,Ke)[n],s=b(this,xe)[n],l=de(this,re,Je).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||o===void 0)continue;const c={value:l};if(b(this,Ut)&&b(this,vn)){c.ttl=b(this,Ut)[n];const u=Eo.now()-b(this,vn)[n];c.start=Math.floor(Date.now()-u)}b(this,_n)&&(c.size=b(this,_n)[n]),e.unshift([o,c])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const s=Date.now()-o.start;o.start=Eo.now()-s}this.set(n,o.value,o)}}set(e,n,o={}){var T,B,A,I,L;if(n===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=o;let{noUpdateTTL:f=this.noUpdateTTL}=o;const m=b(this,Ii).call(this,e,n,o.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),de(this,re,Ir).call(this,e,"set"),this;let y=b(this,dt)===0?void 0:b(this,lt).get(e);if(y===void 0)y=b(this,dt)===0?b(this,ft):b(this,yn).length!==0?b(this,yn).pop():b(this,dt)===b(this,hn)?de(this,re,Na).call(this,!1):b(this,dt),b(this,Ke)[y]=e,b(this,xe)[y]=n,b(this,lt).set(e,y),b(this,Bt)[b(this,ft)]=y,b(this,$t)[y]=b(this,ft),me(this,ft,y),Va(this,dt)._++,b(this,No).call(this,y,m,p),p&&(p.set="add"),f=!1;else{de(this,re,os).call(this,y);const C=b(this,xe)[y];if(n!==C){if(b(this,br)&&de(this,re,Je).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:R}=C;R!==void 0&&!c&&(b(this,Cn)&&((T=b(this,fn))==null||T.call(this,R,e,"set")),b(this,Vt)&&((B=b(this,mt))==null||B.push([R,e,"set"])))}else c||(b(this,Cn)&&((A=b(this,fn))==null||A.call(this,C,e,"set")),b(this,Vt)&&((I=b(this,mt))==null||I.push([C,e,"set"])));if(b(this,Kr).call(this,y),b(this,No).call(this,y,m,p),b(this,xe)[y]=n,p){p.set="replace";const R=C&&de(this,re,Je).call(this,C)?C.__staleWhileFetching:C;R!==void 0&&(p.oldValue=R)}}else p&&(p.set="update")}if(s!==0&&!b(this,Ut)&&de(this,re,ld).call(this),b(this,Ut)&&(f||b(this,Mi).call(this,y,s,l),p&&b(this,Hn).call(this,p,y)),!c&&b(this,Vt)&&b(this,mt)){const C=b(this,mt);let R;for(;R=C==null?void 0:C.shift();)(L=b(this,mn))==null||L.call(this,...R)}return this}pop(){var e;try{for(;b(this,dt);){const n=b(this,xe)[b(this,xt)];if(de(this,re,Na).call(this,!0),de(this,re,Je).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(b(this,Vt)&&b(this,mt)){const n=b(this,mt);let o;for(;o=n==null?void 0:n.shift();)(e=b(this,mn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:s}=n,l=b(this,lt).get(e);if(l!==void 0){const c=b(this,xe)[l];if(de(this,re,Je).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(b(this,Zt).call(this,l))s&&(s.has="stale",b(this,Hn).call(this,s,l));else return o&&b(this,qr).call(this,l),s&&(s.has="hit",b(this,Hn).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,s=b(this,lt).get(e);if(s===void 0||!o&&b(this,Zt).call(this,s))return;const l=b(this,xe)[s];return de(this,re,Je).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:T=this.allowStaleOnFetchRejection,ignoreFetchAbort:B=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:I,forceRefresh:L=!1,status:C,signal:R}=n;if(!b(this,br))return C&&(C.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const O={allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:A,ignoreFetchAbort:B,status:C,signal:R};let F=b(this,lt).get(e);if(F===void 0){C&&(C.fetch="miss");const N=de(this,re,Aa).call(this,e,F,O,I);return N.__returned=N}else{const N=b(this,xe)[F];if(de(this,re,Je).call(this,N)){const q=o&&N.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",q&&(C.returnedStale=!0)),q?N.__staleWhileFetching:N.__returned=N}const U=b(this,Zt).call(this,F);if(!L&&!U)return C&&(C.fetch="hit"),de(this,re,os).call(this,F),s&&b(this,qr).call(this,F),C&&b(this,Hn).call(this,C,F),N;const te=de(this,re,Aa).call(this,e,F,O,I),Y=te.__staleWhileFetching!==void 0&&o;return C&&(C.fetch=U?"stale":"refresh",Y&&U&&(C.returnedStale=!0)),Y?te.__staleWhileFetching:te.__returned=te}}async forceFetch(e,n={}){const o=await this.fetch(e,n);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,n={}){const o=b(this,Vo);if(!o)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:l,...c}=n,u=this.get(e,c);if(!l&&u!==void 0)return u;const p=o(e,u,{options:c,context:s});return this.set(e,p,c),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,u=b(this,lt).get(e);if(u!==void 0){const p=b(this,xe)[u],f=de(this,re,Je).call(this,p);return c&&b(this,Hn).call(this,c,u),b(this,Zt).call(this,u)?(c&&(c.get="stale"),f?(c&&o&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||de(this,re,Ir).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),f?p.__staleWhileFetching:(de(this,re,os).call(this,u),s&&b(this,qr).call(this,u),p))}else c&&(c.get="miss")}delete(e){return de(this,re,Ir).call(this,e,"delete")}clear(){return de(this,re,ud).call(this,"delete")}};hn=new WeakMap,zt=new WeakMap,fn=new WeakMap,mn=new WeakMap,Bo=new WeakMap,Vo=new WeakMap,dt=new WeakMap,gn=new WeakMap,lt=new WeakMap,Ke=new WeakMap,xe=new WeakMap,Bt=new WeakMap,$t=new WeakMap,xt=new WeakMap,ft=new WeakMap,yn=new WeakMap,mt=new WeakMap,_n=new WeakMap,vn=new WeakMap,Ut=new WeakMap,Cn=new WeakMap,br=new WeakMap,Vt=new WeakMap,re=new WeakSet,ld=function(){const e=new Is(b(this,hn)),n=new Is(b(this,hn));me(this,Ut,e),me(this,vn,n),me(this,Mi,(l,c,u=Eo.now())=>{if(n[l]=c!==0?u:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{b(this,Zt).call(this,l)&&de(this,re,Ir).call(this,b(this,Ke)[l],"expire")},c+1);p.unref&&p.unref()}}),me(this,qr,l=>{n[l]=e[l]!==0?Eo.now():0}),me(this,Hn,(l,c)=>{if(e[c]){const u=e[c],p=n[c];if(!u||!p)return;l.ttl=u,l.start=p,l.now=o||s();const f=l.now-p;l.remainingTTL=u-f}});let o=0;const s=()=>{const l=Eo.now();if(this.ttlResolution>0){o=l;const c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=b(this,lt).get(l);if(c===void 0)return 0;const u=e[c],p=n[c];if(!u||!p)return 1/0;const f=(o||s())-p;return u-f},me(this,Zt,l=>{const c=n[l],u=e[l];return!!u&&!!c&&(o||s())-c>u})},qr=new WeakMap,Hn=new WeakMap,Mi=new WeakMap,Zt=new WeakMap,fm=function(){const e=new Is(b(this,hn));me(this,gn,0),me(this,_n,e),me(this,Kr,n=>{me(this,gn,b(this,gn)-e[n]),e[n]=0}),me(this,Ii,(n,o,s,l)=>{if(de(this,re,Je).call(this,o))return 0;if(!wr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(o,n),!wr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),me(this,No,(n,o,s)=>{if(e[n]=o,b(this,zt)){const l=b(this,zt)-e[n];for(;b(this,gn)>l;)de(this,re,Na).call(this,!0)}me(this,gn,b(this,gn)+e[n]),s&&(s.entrySize=o,s.totalCalculatedSize=b(this,gn))})},Kr=new WeakMap,No=new WeakMap,Ii=new WeakMap,Rr=function*({allowStale:e=this.allowStale}={}){if(b(this,dt))for(let n=b(this,ft);!(!de(this,re,cd).call(this,n)||((e||!b(this,Zt).call(this,n))&&(yield n),n===b(this,xt)));)n=b(this,$t)[n]},Mr=function*({allowStale:e=this.allowStale}={}){if(b(this,dt))for(let n=b(this,xt);!(!de(this,re,cd).call(this,n)||((e||!b(this,Zt).call(this,n))&&(yield n),n===b(this,ft)));)n=b(this,Bt)[n]},cd=function(e){return e!==void 0&&b(this,lt).get(b(this,Ke)[e])===e},Na=function(e){var l,c;const n=b(this,xt),o=b(this,Ke)[n],s=b(this,xe)[n];return b(this,br)&&de(this,re,Je).call(this,s)?s.__abortController.abort(new Error("evicted")):(b(this,Cn)||b(this,Vt))&&(b(this,Cn)&&((l=b(this,fn))==null||l.call(this,s,o,"evict")),b(this,Vt)&&((c=b(this,mt))==null||c.push([s,o,"evict"]))),b(this,Kr).call(this,n),e&&(b(this,Ke)[n]=void 0,b(this,xe)[n]=void 0,b(this,yn).push(n)),b(this,dt)===1?(me(this,xt,me(this,ft,0)),b(this,yn).length=0):me(this,xt,b(this,Bt)[n]),b(this,lt).delete(o),Va(this,dt)._--,n},Aa=function(e,n,o,s){const l=n===void 0?void 0:b(this,xe)[n];if(de(this,re,Je).call(this,l))return l;const c=new Ms,{signal:u}=o;u==null||u.addEventListener("abort",()=>c.abort(u.reason),{signal:c.signal});const p={signal:c.signal,options:o,context:s},f=(I,L=!1)=>{const{aborted:C}=c.signal,R=o.ignoreFetchAbort&&I!==void 0;if(o.status&&(C&&!L?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,R&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),C&&!R&&!L)return y(c.signal.reason);const O=B;return b(this,xe)[n]===B&&(I===void 0?O.__staleWhileFetching?b(this,xe)[n]=O.__staleWhileFetching:de(this,re,Ir).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,I,p.options))),I},m=I=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=I),y(I)),y=I=>{const{aborted:L}=c.signal,C=L&&o.allowStaleOnFetchAbort,R=C||o.allowStaleOnFetchRejection,O=R||o.noDeleteOnFetchRejection,F=B;if(b(this,xe)[n]===B&&(!O||F.__staleWhileFetching===void 0?de(this,re,Ir).call(this,e,"fetch"):C||(b(this,xe)[n]=F.__staleWhileFetching)),R)return o.status&&F.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),F.__staleWhileFetching;if(F.__returned===F)throw I},T=(I,L)=>{var R;const C=(R=b(this,Bo))==null?void 0:R.call(this,e,l,p);C&&C instanceof Promise&&C.then(O=>I(O===void 0?void 0:O),L),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(I(void 0),o.allowStaleOnFetchAbort&&(I=O=>f(O,!0)))})};o.status&&(o.status.fetchDispatched=!0);const B=new Promise(T).then(f,m),A=Object.assign(B,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,A,{...p.options,status:void 0}),n=b(this,lt).get(e)):b(this,xe)[n]=A,A},Je=function(e){if(!b(this,br))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Ms},dd=function(e,n){b(this,$t)[n]=e,b(this,Bt)[e]=n},os=function(e){e!==b(this,ft)&&(e===b(this,xt)?me(this,xt,b(this,Bt)[e]):de(this,re,dd).call(this,b(this,$t)[e],b(this,Bt)[e]),de(this,re,dd).call(this,b(this,ft),e),me(this,ft,e))},Ir=function(e,n){var s,l,c,u;let o=!1;if(b(this,dt)!==0){const p=b(this,lt).get(e);if(p!==void 0)if(o=!0,b(this,dt)===1)de(this,re,ud).call(this,n);else{b(this,Kr).call(this,p);const f=b(this,xe)[p];if(de(this,re,Je).call(this,f)?f.__abortController.abort(new Error("deleted")):(b(this,Cn)||b(this,Vt))&&(b(this,Cn)&&((s=b(this,fn))==null||s.call(this,f,e,n)),b(this,Vt)&&((l=b(this,mt))==null||l.push([f,e,n]))),b(this,lt).delete(e),b(this,Ke)[p]=void 0,b(this,xe)[p]=void 0,p===b(this,ft))me(this,ft,b(this,$t)[p]);else if(p===b(this,xt))me(this,xt,b(this,Bt)[p]);else{const m=b(this,$t)[p];b(this,Bt)[m]=b(this,Bt)[p];const y=b(this,Bt)[p];b(this,$t)[y]=b(this,$t)[p]}Va(this,dt)._--,b(this,yn).push(p)}}if(b(this,Vt)&&((c=b(this,mt))!=null&&c.length)){const p=b(this,mt);let f;for(;f=p==null?void 0:p.shift();)(u=b(this,mn))==null||u.call(this,...f)}return o},ud=function(e){var n,o,s;for(const l of de(this,re,Mr).call(this,{allowStale:!0})){const c=b(this,xe)[l];if(de(this,re,Je).call(this,c))c.__abortController.abort(new Error("deleted"));else{const u=b(this,Ke)[l];b(this,Cn)&&((n=b(this,fn))==null||n.call(this,c,u,e)),b(this,Vt)&&((o=b(this,mt))==null||o.push([c,u,e]))}}if(b(this,lt).clear(),b(this,xe).fill(void 0),b(this,Ke).fill(void 0),b(this,Ut)&&b(this,vn)&&(b(this,Ut).fill(0),b(this,vn).fill(0)),b(this,_n)&&b(this,_n).fill(0),me(this,xt,0),me(this,ft,0),b(this,yn).length=0,me(this,gn,0),me(this,dt,0),b(this,Vt)&&b(this,mt)){const l=b(this,mt);let c;for(;c=l==null?void 0:l.shift();)(s=b(this,mn))==null||s.call(this,...c)}};let Il=Ll;const yB={cacheSize:15e6};class _B{constructor(e){Ze(this,"_str");Ze(this,"_rawJson");Ze(this,"_zodSchema");Ze(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const Yr=class Yr{constructor(e){Ze(this,"fileDataCache");Ze(this,"fileDataRefs",new Map);const n={...yB,...e??{}};this.fileDataCache=new Il({maxSize:n.cacheSize,fetchMethod:async o=>new _B(await $g().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const o=r.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const s=await this.fileDataCache.fetch(e);o.value=s}catch(s){console.error(s)}})(),o}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n==null?void 0:n.value)==null?void 0:o.str})}getContentJson(e,n){if(e===void 0)return;const o=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=o==null?void 0:o.value)==null?void 0:s.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Yr.globalInstance.getContentBytes(e)}static getContentString(e){return Yr.globalInstance.getContentString(e)}static getContentJson(e,n){return Yr.globalInstance.getContentJson(e,n)}};Ze(Yr,"globalInstance",new Yr);let Ol=Yr;M.AgGridTheme=iu,M.BlockLayout=PT,M.ContextProvider=yS,M.DataTable=iC,M.DemoData=yT,M.DropdownListItem=yo,M.LongText=kl,M.MultiError=Fa,M.PlAccordion=xx,M.PlAccordionSection=Px,M.PlAgCellFile=cB,M.PlAgDataTable=tB,M.PlAgDataTableToolsPanel=XT,M.PlAgGridColumnManager=Sp,M.PlAgOverlayLoading=yp,M.PlAgOverlayNoRows=_p,M.PlAgTextAndButtonCell=pB,M.PlAlert=MC,M.PlBlockPage=bC,M.PlBtnAccent=e0,M.PlBtnDanger=n0,M.PlBtnGhost=Cs,M.PlBtnGroup=Nu,M.PlBtnLink=s0,M.PlBtnPrimary=gl,M.PlBtnSecondary=yl,M.PlBtnSplit=KC,M.PlCheckbox=zu,M.PlCheckboxGroup=Mb,M.PlChip=Sl,M.PlContainer=kC,M.PlDialogModal=Tl,M.PlDropdown=yi,M.PlDropdownLegacy=ob,M.PlDropdownLine=Gu,M.PlDropdownMulti=Ab,M.PlDropdownRef=Dw,M.PlEditableTitle=N0,M.PlFileDialog=Ku,M.PlFileInput=up,M.PlGrid=NC,M.PlIcon16=vo,M.PlIcon24=bs,M.PlLogView=Zu,M.PlMaskIcon16=Un,M.PlMaskIcon24=cn,M.PlNotificationAlert=pp,M.PlNumberField=gb,M.PlProgressBar=cb,M.PlRow=EC,M.PlSearchField=Mu,M.PlSectionSeparator=Wu,M.PlSlideModal=$u,M.PlSpacer=Bu,M.PlTableFilters=oB,M.PlTabs=yx,M.PlTextArea=hw,M.PlTextField=Ur,M.PlToggleSwitch=xs,M.PlTooltip=Ct,M.ReactiveFileContent=Ol,M.Scrollable=s1,M.Slider=hp,M.SliderRange=n1,M.SliderRangeTriple=ZS,M.ThemeSwitcher=mC,M.UnresolvedError=Da,M.ValueOrErrorsComponent=aB,M.activateAgGrid=ou,M.animate=bu,M.animateInfinite=dC,M.call=yu,M.computedResult=mB,M.createModel=Ga,M.debounce=xu,M.defineApp=F_,M.defineStore=fB,M.delay=_u,M.detectOutside=fw,M.ensureError=Ia,M.eventListener=bl,M.formatZodError=La,M.getElementScrollPosition=Ou,M.identity=Ma,M.isDefined=Am,M.isElementVisible=Iu,M.isJsonEqual=Ra,M.isZodError=Oa,M.listToOptions=uC,M.makeEaseInOut=cC,M.makeEaseOut=wu,M.maskIcons16=mT,M.maskIcons24=gT,M.normalizeListOptions=pr,M.notEmpty=ul,M.randomInt=Cu,M.randomString=lC,M.requestTick=pl,M.scrollIntoView=gi,M.showContextMenu=ll,M.throttle=ku,M.timeout=vu,M.unwrapOptionalResult=Nm,M.unwrapValueOrErrors=vd,M.useClickOutside=ws,M.useDraggable=DS,M.useEventListener=rt,M.useFormState=AS,M.useHover=mu,M.useInterval=NS,M.useLabelNotch=Zn,M.useLocalStorage=Su,M.useMouse=fu,M.useMouseCapture=ur,M.usePosition=_o,M.useQuery=PS,M.useResizeObserver=fp,M.useScroll=BS,M.useSdkPlugin=rl,M.useSortable=gp,M.useTheme=Tu,M.useWatchFetch=Ep,M.wrapOptionalResult=Cd,M.wrapValueOrErrors=Vm,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|