@platforma-sdk/ui-vue 1.10.13 → 1.10.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.umd.cjs CHANGED
@@ -1,89 +1,89 @@
1
- (function(I,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):(I=typeof globalThis<"u"?globalThis:I||self,r(I.SdkVueLib={},I.Vue,I.core$1,I.core,I.clientSideRowModel,I.infiniteRowModel,I.serverSideRowModel,I.csvExport,I.clipboard,I.rangeSelection,I.richSelect,I.menu,I.excelExport,I.theming,I.vue3))})(this,function(I,r,Re,b,Qo,qf,od,Kf,sd,ad,Yf,Jf,Xf,Qf,em){"use strict";var HF=Object.defineProperty;var Wf=I=>{throw TypeError(I)};var jF=(I,r,Re)=>r in I?HF(I,r,{enumerable:!0,configurable:!0,writable:!0,value:Re}):I[r]=Re;var Ue=(I,r,Re)=>jF(I,typeof r!="symbol"?r+"":r,Re),ed=(I,r,Re)=>r.has(I)||Wf("Cannot "+Re);var w=(I,r,Re)=>(ed(I,r,"read from private field"),Re?Re.call(I):r.get(I)),Oe=(I,r,Re)=>r.has(I)?Wf("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(I):r.set(I,Re),fe=(I,r,Re,b)=>(ed(I,r,"write to private field"),b?b.call(I,Re):r.set(I,Re),Re),le=(I,r,Re)=>(ed(I,r,"access private method"),Re);var ka=(I,r,Re,b)=>({set _(Qo){fe(I,r,Qo,Re)},get _(){return w(I,r,b)}});var dp,Ci,up,pp,dn,Lt,un,pn,wi,bi,st,hn,it,je,be,St,Gt,_t,dt,fn,ut,mn,gn,zt,yn,yr,Et,te,td,Ur,zn,No,Ut,jf,Zr,xi,Vo,Nr,Vr,nd,Sa,Ea,Ke,rd,Xo,Pr,id;function tm(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function nm(t){return t!==null&&typeof t=="object"}function Rn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Rn(t[n]);return e}else if(nm(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Rn(t[n])}),e}else return t}function Ta(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function rm(t){let e=0n,n;return async function(...i){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...i);return n=l,{ok:!0,value:await l}}}var Li=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function im(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var om=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((s,l,c)=>`${s}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((i,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return i;const l=i.length===0?"":",";return`${i}${l}${t(s)}:${t(e[s])}`},"")}}`};const ti=im(om);class Ba extends Error{}class Aa extends Error{constructor(e){super(e.join(`
1
+ (function(I,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):(I=typeof globalThis<"u"?globalThis:I||self,r(I.SdkVueLib={},I.Vue,I.core$1,I.core,I.clientSideRowModel,I.infiniteRowModel,I.serverSideRowModel,I.csvExport,I.clipboard,I.rangeSelection,I.richSelect,I.menu,I.excelExport,I.theming,I.vue3))})(this,function(I,r,Re,b,Qo,qf,od,Kf,sd,ad,Yf,Jf,Xf,Qf,em){"use strict";var WF=Object.defineProperty;var Wf=I=>{throw TypeError(I)};var HF=(I,r,Re)=>r in I?WF(I,r,{enumerable:!0,configurable:!0,writable:!0,value:Re}):I[r]=Re;var $e=(I,r,Re)=>HF(I,typeof r!="symbol"?r+"":r,Re),ed=(I,r,Re)=>r.has(I)||Wf("Cannot "+Re);var w=(I,r,Re)=>(ed(I,r,"read from private field"),Re?Re.call(I):r.get(I)),Le=(I,r,Re)=>r.has(I)?Wf("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(I):r.set(I,Re),fe=(I,r,Re,b)=>(ed(I,r,"write to private field"),b?b.call(I,Re):r.set(I,Re),Re),le=(I,r,Re)=>(ed(I,r,"access private method"),Re);var ka=(I,r,Re,b)=>({set _(Qo){fe(I,r,Qo,Re)},get _(){return w(I,r,b)}});var dp,Ci,up,pp,dn,Ot,un,pn,wi,bi,st,hn,it,je,be,Et,Gt,_t,dt,fn,ut,mn,gn,zt,yn,yr,Tt,te,td,$r,zn,Ao,$t,jf,Ur,xi,Vo,Ar,Vr,nd,Sa,Ea,Ke,rd,Xo,Pr,id;function tm(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function nm(t){return t!==null&&typeof t=="object"}function Rn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Rn(t[n]);return e}else if(nm(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Rn(t[n])}),e}else return t}function Ta(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function rm(t){let e=0n,n;return async function(...i){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...i);return n=l,{ok:!0,value:await l}}}var Oi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function im(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var om=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((s,l,c)=>`${s}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((i,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return i;const l=i.length===0?"":",";return`${i}${l}${t(s)}:${t(e[s])}`},"")}}`};const ti=im(om);class Ba extends Error{}class Na extends Error{constructor(e){super(e.join(`
2
2
  `)),this.errors=e}toString(){return this.errors.join(`
3
- `)}}function sm(t){return{ok:!0,value:t}}function ld(t){if(!t)throw new Ba;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function cd(t){return{value:t,errors:void 0}}function am(t){if(t.errors)throw new Aa(t.errors);if(!t.value)throw new Ba;return t.value}function lm(t){return t!==void 0}function Na(t,e){return ti(t)===ti(e)}const Va=t=>t,Pa=t=>t instanceof Error?t:Error(String(t)),Da=t=>t.name==="ZodError",Fa=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),i=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(i).join("; ")};function Ra(t){const e=t.validate??Va,{autoSave:n}=t,i=r.ref(),s=r.ref(),l=M=>{s.value={model:Rn(M)}};r.watch(()=>t.get(),M=>l(M),{immediate:!0});const c=()=>{var M;t.onSave(e(Rn((M=s.value)==null?void 0:M.model)))},u=()=>{l(t.get()),i.value=void 0},p=M=>{const T=Pa(M);Da(T)?i.value=Error(Fa(T)):i.value=T},f=M=>{i.value=void 0;try{e(M),n&&c()}catch(T){p(T)}},m=r.computed({get:()=>{var M;return(M=s.value)==null?void 0:M.model},set(M){l(M),f(M)}});r.watch(s,(M,T)=>{M&&M===T&&f(M.model)},{deep:!0});const y=r.computed(()=>!i.value),k=r.computed(()=>!Na(t.get(),r.unref(s))),S=r.computed(()=>i.value?i.value.message:"");return r.reactive({model:m,valid:y,isChanged:k,error:i,errorString:S,save:c,revert:u,setError:p})}function cm(t,e){const n=t.validate??Va,{autoSave:i}=t,s=r.ref(),l=r.ref(),c=T=>{l.value={model:Object.assign(Rn(T),e??{}),stage:Symbol()}};r.watch(()=>t.get(),T=>c(T),{immediate:!0});const u=()=>{var T;t.onSave(n(Rn((T=l.value)==null?void 0:T.model)))},p=()=>{c(t.get()),s.value=void 0},f=T=>{const R=Pa(T);Da(R)?s.value=Error(Fa(R)):s.value=R},m=T=>{s.value=void 0;try{n(T),i&&u()}catch(R){f(R)}},y=r.computed({get:()=>{var T;return(T=l.value)==null?void 0:T.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:y.value.args,ui:y.value.ui}),()=>{var T;return(T=l.value)==null?void 0:T.stage}],([T,R],[C,G])=>{R===G&&m(T)},{deep:!0});const k=r.computed(()=>!s.value),S=r.computed(()=>{var C;const{args:T,ui:R}=((C=r.unref(l))==null?void 0:C.model)??{};return!Na(t.get(),{args:T,ui:R})}),M=r.computed(()=>s.value?s.value.message:"");return r.reactive({model:y,valid:k,isChanged:S,error:s,errorString:M,save:u,revert:p,setError:f})}const dm=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function um(t,e){const i=Ta(e.setBlockArgs,100),s=Ta(e.setBlockUiState,100),l=Ta(e.setBlockArgsAndUiState,100),c=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async T=>{T.forEach(R=>{R.key==="args"&&(c.args=Object.freeze(R.value)),R.key==="ui"&&(c.ui=Object.freeze(R.value)),R.key==="outputs"&&(c.outputs=Object.freeze(R.value)),R.key==="navigationState"&&(c.navigationState=Object.freeze(R.value))}),await r.nextTick()});const u=()=>Rn(c.args),p=()=>Rn(c.ui),f=()=>Rn(c.navigationState),m={createArgsModel(T={}){return Ra({get(){return T.transform?T.transform(c.args):c.args},validate:T.validate,autoSave:!0,onSave(R){i(R)}})},createUiModel(T={},R){return Ra({get(){return T.transform?T.transform(c.ui):c.ui??R()},validate:T.validate,autoSave:!0,onSave(C){s(C)}})},useOutputs(...T){const R=r.reactive({errors:void 0,value:void 0});return r.watch(()=>c.outputs,()=>{try{Object.assign(R,{value:this.unwrapOutputs(...T),errors:void 0})}catch(C){Object.assign(R,{value:void 0,errors:[String(C)]})}},{immediate:!0,deep:!0}),R},unwrapOutputs(...T){const R=c.outputs,C=T.map(G=>[G,ld(R[G])]);return Object.fromEntries(C)},getOutputField(T){return c.outputs[T]},getOutputFieldOkOptional(T){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const R=this.getOutputField(T);if(R&&R.ok)return R.value},getOutputFieldErrorsOptional(T){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const R=this.getOutputField(T);if(R&&!R.ok)return R.errors},updateArgs(T){const R=u();return T(R),e.setBlockArgs(R)},updateUiState(T){const R=p();return e.setBlockUiState(T(R))},updateNavigationState(T){const R=f();return T(R),e.setNavigationState(R)},navigateTo(T){const R=f();return R.href=T,e.setNavigationState(R)}},y=r.computed(()=>{const T=Object.entries(c.outputs).map(([R,C])=>[R,C.ok&&C.value!==void 0?C.value:void 0]);return Object.fromEntries(T)}),k=r.computed(()=>{const T=Object.entries(c.outputs).map(([R,C])=>[R,C&&!C.ok?new Aa(C.errors):void 0]);return Object.fromEntries(T)}),S={snapshot:c,queryParams:r.computed(()=>dm(c.navigationState.href)),href:r.computed(()=>c.navigationState.href),hasErrors:r.computed(()=>Object.values(c.outputs).some(T=>!(T!=null&&T.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),y.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),k.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),c.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),c.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),c.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),c.navigationState))},M=cm({get(){return{args:c.args,ui:c.ui}},autoSave:!0,onSave(T){l(T.args,T.ui)}},{outputs:y,outputErrors:k});return r.reactive(Object.assign(M,m,S))}var Me;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Me||(Me={}));var Ma;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ma||(Ma={}));const oe=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qn=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map<"u"&&t instanceof Map?oe.map:typeof Set<"u"&&t instanceof Set?oe.set:typeof Date<"u"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},Q=Me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),pm=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class It extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},i={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let u=i,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof It))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}It.create=t=>new It(t);const ni=(t,e)=>{let n;switch(t.code){case Q.invalid_type:t.received===oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Me.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(t.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(t.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Me.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Q.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 Q.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 Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=e.defaultError,Me.assertNever(t)}return{message:n}};let dd=ni;function hm(t){dd=t}function es(){return dd}const ts=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},fm=[];function re(t,e){const n=es(),i=ts({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ni?void 0:ni].filter(s=>!!s)});t.common.issues.push(i)}class gt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return gt.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return _e;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const _e=Object.freeze({status:"aborted"}),ri=t=>({status:"dirty",value:t}),xt=t=>({status:"valid",value:t}),Ia=t=>t.status==="aborted",Oa=t=>t.status==="dirty",Gi=t=>t.status==="valid",zi=t=>typeof Promise<"u"&&t instanceof Promise;function ns(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ud(t,e,n,i,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var de;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(de||(de={}));var Ui,Zi;class kn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const pd=(t,e)=>{if(Gi(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 It(t.common.issues);return this._error=n,this._error}}};function Se(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(c,u)=>{var p,f;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??i)!==null&&p!==void 0?p:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class Be{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Qn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Qn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new gt,ctx:{common:e.parent.common,data:e.data,parsedType:Qn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(zi(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qn(e)},l=this._parseSync({data:e,path:s.path,parent:s});return pd(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qn(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(zi(s)?s:Promise.resolve(s));return pd(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:Q.custom,...i(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new sn({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return En.create(this,this._def)}nullable(){return rr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return on.create(this,this._def)}promise(){return ai.create(this,this._def)}or(e){return ji.create([this,e],this._def)}and(e){return qi.create(this,e,this._def)}transform(e){return new sn({...Se(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Qi({...Se(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new za({typeName:ye.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new eo({...Se(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return to.create(this,e)}readonly(){return no.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mm=/^c[^\s-]{8,}$/i,gm=/^[0-9a-z]+$/,ym=/^[0-9A-HJKMNP-TV-Z]{26}$/,vm=/^[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,Cm=/^[-+]?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)?)??$/,wm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,bm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let La;const xm=/^(?:(?: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])$/,km=/^(([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})))$/,Sm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hd="((\\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])))",Em=new RegExp(`^${hd}$`);function fd(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 Tm(t){return new RegExp(`^${fd(t)}$`)}function md(t){let e=`${hd}T${fd(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 Bm(t,e){return!!((e==="v4"||!e)&&xm.test(t)||(e==="v6"||!e)&&km.test(t))}class rn extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:oe.string,received:l.parsedType}),_e}const i=new gt;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),re(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),re(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,u=e.data.length<l.value;(c||u)&&(s=this._getOrReturnCtx(e,s),c?re(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&re(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),i.dirty())}else if(l.kind==="email")wm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"email",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="emoji")La||(La=new RegExp(bm,"u")),La.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"emoji",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="uuid")vm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"uuid",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="nanoid")_m.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"nanoid",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid")mm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"cuid",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid2")gm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"cuid2",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="ulid")ym.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"ulid",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),re(s,{validation:"url",code:Q.invalid_string,message:l.message}),i.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"regex",code:Q.invalid_string,message:l.message}),i.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),i.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:{startsWith:l.value},message:l.message}),i.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:{endsWith:l.value},message:l.message}),i.dirty()):l.kind==="datetime"?md(l).test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:"datetime",message:l.message}),i.dirty()):l.kind==="date"?Em.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:"date",message:l.message}),i.dirty()):l.kind==="time"?Tm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:"time",message:l.message}),i.dirty()):l.kind==="duration"?Cm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"duration",code:Q.invalid_string,message:l.message}),i.dirty()):l.kind==="ip"?Bm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"ip",code:Q.invalid_string,message:l.message}),i.dirty()):l.kind==="base64"?Sm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"base64",code:Q.invalid_string,message:l.message}),i.dirty()):Me.assertNever(l);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:Q.invalid_string,...de.errToObj(i)})}_addCheck(e){return new rn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...de.errToObj(e)})}url(e){return this._addCheck({kind:"url",...de.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...de.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...de.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...de.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...de.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...de.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...de.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...de.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...de.errToObj(e)})}datetime(e){var n,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...de.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,...de.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...de.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...de.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...de.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...de.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...de.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...de.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...de.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...de.errToObj(n)})}nonempty(e){return this.min(1,de.errToObj(e))}trim(){return new rn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new rn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new rn({...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}}rn.create=t=>{var e;return new rn({checks:[],typeName:ye.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function Am(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class er extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==oe.number){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:oe.number,received:l.parsedType}),_e}let i;const s=new gt;for(const l of this._def.checks)l.kind==="int"?Me.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:Q.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?Am(e.data,l.value)!==0&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:Q.not_finite,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new er({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new er({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:de.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:de.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Me.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}er.create=t=>new er({checks:[],typeName:ye.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class tr extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==oe.bigint){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:oe.bigint,received:l.parsedType}),_e}let i;const s=new gt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new tr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new tr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.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}}tr.create=t=>{var e;return new tr({checks:[],typeName:ye.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};class $i extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.boolean,received:i.parsedType}),_e}return xt(e.data)}}$i.create=t=>new $i({typeName:ye.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Dr extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:oe.date,received:l.parsedType}),_e}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_date}),_e}const i=new gt;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),re(s,{code:Q.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),i.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),re(s,{code:Q.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),i.dirty()):Me.assertNever(l);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Dr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:de.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:de.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}}Dr.create=t=>new Dr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ye.ZodDate,...Se(t)});class rs extends Be{_parse(e){if(this._getType(e)!==oe.symbol){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.symbol,received:i.parsedType}),_e}return xt(e.data)}}rs.create=t=>new rs({typeName:ye.ZodSymbol,...Se(t)});class Wi extends Be{_parse(e){if(this._getType(e)!==oe.undefined){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.undefined,received:i.parsedType}),_e}return xt(e.data)}}Wi.create=t=>new Wi({typeName:ye.ZodUndefined,...Se(t)});class Hi extends Be{_parse(e){if(this._getType(e)!==oe.null){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.null,received:i.parsedType}),_e}return xt(e.data)}}Hi.create=t=>new Hi({typeName:ye.ZodNull,...Se(t)});class ii extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return xt(e.data)}}ii.create=t=>new ii({typeName:ye.ZodAny,...Se(t)});class Fr extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xt(e.data)}}Fr.create=t=>new Fr({typeName:ye.ZodUnknown,...Se(t)});class Mn extends Be{_parse(e){const n=this._getOrReturnCtx(e);return re(n,{code:Q.invalid_type,expected:oe.never,received:n.parsedType}),_e}}Mn.create=t=>new Mn({typeName:ye.ZodNever,...Se(t)});class is extends Be{_parse(e){if(this._getType(e)!==oe.undefined){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.void,received:i.parsedType}),_e}return xt(e.data)}}is.create=t=>new is({typeName:ye.ZodVoid,...Se(t)});class on extends Be{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==oe.array)return re(n,{code:Q.invalid_type,expected:oe.array,received:n.parsedType}),_e;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(re(n,{code:c?Q.too_big:Q.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(re(n,{code:Q.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(re(n,{code:Q.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new kn(n,c,n.path,u)))).then(c=>gt.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new kn(n,c,n.path,u)));return gt.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new on({...this._def,minLength:{value:e,message:de.toString(n)}})}max(e,n){return new on({...this._def,maxLength:{value:e,message:de.toString(n)}})}length(e,n){return new on({...this._def,exactLength:{value:e,message:de.toString(n)}})}nonempty(e){return this.min(1,e)}}on.create=(t,e)=>new on({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...Se(e)});function oi(t){if(t instanceof Je){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=En.create(oi(i))}return new Je({...t._def,shape:()=>e})}else return t instanceof on?new on({...t._def,type:oi(t.element)}):t instanceof En?En.create(oi(t.unwrap())):t instanceof rr?rr.create(oi(t.unwrap())):t instanceof Sn?Sn.create(t.items.map(e=>oi(e))):t}class Je extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Me.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==oe.object){const f=this._getOrReturnCtx(e);return re(f,{code:Q.invalid_type,expected:oe.object,received:f.parsedType}),_e}const{status:i,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Mn&&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 kn(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Mn){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&&(re(s,{code:Q.unrecognized_keys,keys:u}),i.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new kn(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,k=await m.value;f.push({key:y,value:k,alwaysSet:m.alwaysSet})}return f}).then(f=>gt.mergeObjectSync(i,f)):gt.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return de.errToObj,new Je({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=de.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Je({...this._def,unknownKeys:"strip"})}passthrough(){return new Je({...this._def,unknownKeys:"passthrough"})}extend(e){return new Je({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Je({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ye.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Je({...this._def,catchall:e})}pick(e){const n={};return Me.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Je({...this._def,shape:()=>n})}omit(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Je({...this._def,shape:()=>n})}deepPartial(){return oi(this)}partial(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Je({...this._def,shape:()=>n})}required(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let l=this.shape[i];for(;l instanceof En;)l=l._def.innerType;n[i]=l}}),new Je({...this._def,shape:()=>n})}keyof(){return gd(Me.objectKeys(this.shape))}}Je.create=(t,e)=>new Je({shape:()=>t,unknownKeys:"strip",catchall:Mn.create(),typeName:ye.ZodObject,...Se(e)}),Je.strictCreate=(t,e)=>new Je({shape:()=>t,unknownKeys:"strict",catchall:Mn.create(),typeName:ye.ZodObject,...Se(e)}),Je.lazycreate=(t,e)=>new Je({shape:t,unknownKeys:"strip",catchall:Mn.create(),typeName:ye.ZodObject,...Se(e)});class ji extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new It(u.ctx.common.issues));return re(n,{code:Q.invalid_union,unionErrors:c}),_e}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of i){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new It(p));return re(n,{code:Q.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}ji.create=(t,e)=>new ji({options:t,typeName:ye.ZodUnion,...Se(e)});const In=t=>t instanceof Yi?In(t.schema):t instanceof sn?In(t.innerType()):t instanceof Ji?[t.value]:t instanceof nr?t.options:t instanceof Xi?Me.objectValues(t.enum):t instanceof Qi?In(t._def.innerType):t instanceof Wi?[void 0]:t instanceof Hi?[null]:t instanceof En?[void 0,...In(t.unwrap())]:t instanceof rr?[null,...In(t.unwrap())]:t instanceof za||t instanceof no?In(t.unwrap()):t instanceof eo?In(t._def.innerType):[];class os extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.object)return re(n,{code:Q.invalid_type,expected:oe.object,received:n.parsedType}),_e;const i=this.discriminator,s=n.data[i],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(re(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=In(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 os({typeName:ye.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(i)})}}function Ga(t,e){const n=Qn(t),i=Qn(e);if(t===e)return{valid:!0,data:t};if(n===oe.object&&i===oe.object){const s=Me.objectKeys(e),l=Me.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Ga(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===oe.array&&i===oe.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=Ga(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===oe.date&&i===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class qi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(Ia(l)||Ia(c))return _e;const u=Ga(l.value,c.value);return u.valid?((Oa(l)||Oa(c))&&n.dirty(),{status:n.value,value:u.data}):(re(i,{code:Q.invalid_intersection_types}),_e)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}qi.create=(t,e,n)=>new qi({left:t,right:e,typeName:ye.ZodIntersection,...Se(n)});class Sn extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.array)return re(i,{code:Q.invalid_type,expected:oe.array,received:i.parsedType}),_e;if(i.data.length<this._def.items.length)return re(i,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&i.data.length>this._def.items.length&&(re(i,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...i.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new kn(i,c,i.path,u)):null}).filter(c=>!!c);return i.common.async?Promise.all(l).then(c=>gt.mergeArray(n,c)):gt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Sn({...this._def,rest:e})}}Sn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sn({items:t,typeName:ye.ZodTuple,rest:null,...Se(e)})};class Ki extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.object)return re(i,{code:Q.invalid_type,expected:oe.object,received:i.parsedType}),_e;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new kn(i,u,i.path,u)),value:c._parse(new kn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?gt.mergeObjectAsync(n,s):gt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Be?new Ki({keyType:e,valueType:n,typeName:ye.ZodRecord,...Se(i)}):new Ki({keyType:rn.create(),valueType:e,typeName:ye.ZodRecord,...Se(n)})}}class ss extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.map)return re(i,{code:Q.invalid_type,expected:oe.map,received:i.parsedType}),_e;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new kn(i,u,i.path,[f,"key"])),value:l._parse(new kn(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}ss.create=(t,e,n)=>new ss({valueType:e,keyType:t,typeName:ye.ZodMap,...Se(n)});class Rr extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.set)return re(i,{code:Q.invalid_type,expected:oe.set,received:i.parsedType}),_e;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(re(i,{code:Q.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(re(i,{code:Q.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return _e;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new kn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Rr({...this._def,minSize:{value:e,message:de.toString(n)}})}max(e,n){return new Rr({...this._def,maxSize:{value:e,message:de.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Rr.create=(t,e)=>new Rr({valueType:t,minSize:null,maxSize:null,typeName:ye.ZodSet,...Se(e)});class si extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.function)return re(n,{code:Q.invalid_type,expected:oe.function,received:n.parsedType}),_e;function i(u,p){return ts({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,es(),ni].filter(f=>!!f),issueData:{code:Q.invalid_arguments,argumentsError:p}})}function s(u,p){return ts({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,es(),ni].filter(f=>!!f),issueData:{code:Q.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof ai){const u=this;return xt(async function(...p){const f=new It([]),m=await u._def.args.parseAsync(p,l).catch(S=>{throw f.addIssue(i(p,S)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(S=>{throw f.addIssue(s(y,S)),f})})}else{const u=this;return xt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new It([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new It([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new si({...this._def,args:Sn.create(e).rest(Fr.create())})}returns(e){return new si({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new si({args:e||Sn.create([]).rest(Fr.create()),returns:n||Fr.create(),typeName:ye.ZodFunction,...Se(i)})}}class Yi extends Be{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Yi.create=(t,e)=>new Yi({getter:t,typeName:ye.ZodLazy,...Se(e)});class Ji extends Be{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return re(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ji.create=(t,e)=>new Ji({value:t,typeName:ye.ZodLiteral,...Se(e)});function gd(t,e){return new nr({values:t,typeName:ye.ZodEnum,...Se(e)})}class nr extends Be{constructor(){super(...arguments),Ui.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{expected:Me.joinValues(i),received:n.parsedType,code:Q.invalid_type}),_e}if(ns(this,Ui)||ud(this,Ui,new Set(this._def.values)),!ns(this,Ui).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{received:n.data,code:Q.invalid_enum_value,options:i}),_e}return xt(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 nr.create(e,{...this._def,...n})}exclude(e,n=this._def){return nr.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}Ui=new WeakMap,nr.create=gd;class Xi extends Be{constructor(){super(...arguments),Zi.set(this,void 0)}_parse(e){const n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==oe.string&&i.parsedType!==oe.number){const s=Me.objectValues(n);return re(i,{expected:Me.joinValues(s),received:i.parsedType,code:Q.invalid_type}),_e}if(ns(this,Zi)||ud(this,Zi,new Set(Me.getValidEnumValues(this._def.values))),!ns(this,Zi).has(e.data)){const s=Me.objectValues(n);return re(i,{received:i.data,code:Q.invalid_enum_value,options:s}),_e}return xt(e.data)}get enum(){return this._def.values}}Zi=new WeakMap,Xi.create=(t,e)=>new Xi({values:t,typeName:ye.ZodNativeEnum,...Se(e)});class ai extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.promise&&n.common.async===!1)return re(n,{code:Q.invalid_type,expected:oe.promise,received:n.parsedType}),_e;const i=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return xt(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ai.create=(t,e)=>new ai({type:t,typeName:ye.ZodPromise,...Se(e)});class sn extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{re(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return _e;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?_e:p.status==="dirty"||n.value==="dirty"?ri(p.value):p});{if(n.value==="aborted")return _e;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?_e:u.status==="dirty"||n.value==="dirty"?ri(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Gi(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>Gi(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Me.assertNever(s)}}sn.create=(t,e,n)=>new sn({schema:t,typeName:ye.ZodEffects,effect:e,...Se(n)}),sn.createWithPreprocess=(t,e,n)=>new sn({schema:e,effect:{type:"preprocess",transform:t},typeName:ye.ZodEffects,...Se(n)});class En extends Be{_parse(e){return this._getType(e)===oe.undefined?xt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}En.create=(t,e)=>new En({innerType:t,typeName:ye.ZodOptional,...Se(e)});class rr extends Be{_parse(e){return this._getType(e)===oe.null?xt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rr.create=(t,e)=>new rr({innerType:t,typeName:ye.ZodNullable,...Se(e)});class Qi extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===oe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Qi.create=(t,e)=>new Qi({innerType:t,typeName:ye.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class eo extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return zi(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new It(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new It(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}eo.create=(t,e)=>new eo({innerType:t,typeName:ye.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class as extends Be{_parse(e){if(this._getType(e)!==oe.nan){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.nan,received:i.parsedType}),_e}return{status:"valid",value:e.data}}}as.create=t=>new as({typeName:ye.ZodNaN,...Se(t)});const Nm=Symbol("zod_brand");class za extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class to extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?_e:l.status==="dirty"?(n.dirty(),ri(l.value)):this._def.out._parseAsync({data:l.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?_e:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new to({in:e,out:n,typeName:ye.ZodPipeline})}}class no extends Be{_parse(e){const n=this._def.innerType._parse(e),i=s=>(Gi(s)&&(s.value=Object.freeze(s.value)),s);return zi(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}no.create=(t,e)=>new no({innerType:t,typeName:ye.ZodReadonly,...Se(e)});function yd(t,e={},n){return t?ii.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):ii.create()}const Vm={object:Je.lazycreate};var ye;(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"})(ye||(ye={}));const Pm=(t,e={message:`Input not instance of ${t.name}`})=>yd(n=>n instanceof t,e),vd=rn.create,_d=er.create,Dm=as.create,Fm=tr.create,Cd=$i.create,Rm=Dr.create,Mm=rs.create,Im=Wi.create,Om=Hi.create,Lm=ii.create,Gm=Fr.create,zm=Mn.create,Um=is.create,Zm=on.create,$m=Je.create,Wm=Je.strictCreate,Hm=ji.create,jm=os.create,qm=qi.create,Km=Sn.create,Ym=Ki.create,Jm=ss.create,Xm=Rr.create,Qm=si.create,eg=Yi.create,tg=Ji.create,ng=nr.create,rg=Xi.create,ig=ai.create,wd=sn.create,og=En.create,sg=rr.create,ag=sn.createWithPreprocess,lg=to.create;var ls=Object.freeze({__proto__:null,defaultErrorMap:ni,setErrorMap:hm,getErrorMap:es,makeIssue:ts,EMPTY_PATH:fm,addIssueToContext:re,ParseStatus:gt,INVALID:_e,DIRTY:ri,OK:xt,isAborted:Ia,isDirty:Oa,isValid:Gi,isAsync:zi,get util(){return Me},get objectUtil(){return Ma},ZodParsedType:oe,getParsedType:Qn,ZodType:Be,datetimeRegex:md,ZodString:rn,ZodNumber:er,ZodBigInt:tr,ZodBoolean:$i,ZodDate:Dr,ZodSymbol:rs,ZodUndefined:Wi,ZodNull:Hi,ZodAny:ii,ZodUnknown:Fr,ZodNever:Mn,ZodVoid:is,ZodArray:on,ZodObject:Je,ZodUnion:ji,ZodDiscriminatedUnion:os,ZodIntersection:qi,ZodTuple:Sn,ZodRecord:Ki,ZodMap:ss,ZodSet:Rr,ZodFunction:si,ZodLazy:Yi,ZodLiteral:Ji,ZodEnum:nr,ZodNativeEnum:Xi,ZodPromise:ai,ZodEffects:sn,ZodTransformer:sn,ZodOptional:En,ZodNullable:rr,ZodDefault:Qi,ZodCatch:eo,ZodNaN:as,BRAND:Nm,ZodBranded:za,ZodPipeline:to,ZodReadonly:no,custom:yd,Schema:Be,ZodSchema:Be,late:Vm,get ZodFirstPartyTypeKind(){return ye},coerce:{string:t=>rn.create({...t,coerce:!0}),number:t=>er.create({...t,coerce:!0}),boolean:t=>$i.create({...t,coerce:!0}),bigint:t=>tr.create({...t,coerce:!0}),date:t=>Dr.create({...t,coerce:!0})},any:Lm,array:Zm,bigint:Fm,boolean:Cd,date:Rm,discriminatedUnion:jm,effect:wd,enum:ng,function:Qm,instanceof:Pm,intersection:qm,lazy:eg,literal:tg,map:Jm,nan:Dm,nativeEnum:rg,never:zm,null:Om,nullable:sg,number:_d,object:$m,oboolean:()=>Cd().optional(),onumber:()=>_d().optional(),optional:og,ostring:()=>vd().optional(),pipeline:lg,preprocess:ag,promise:ig,record:Ym,set:Xm,strictObject:Wm,string:vd,symbol:Mm,transformer:wd,tuple:Km,undefined:Im,union:Hm,unknown:Gm,void:Um,NEVER:_e,ZodIssueCode:Q,quotelessJson:pm,ZodError:It});function cg(t){throw new Error("Unexpected object: "+t)}const dg=-2147483648,bd=-9007199254740991n,ug=NaN,pg=NaN,hg=null,fg=null;function xd(t,e){switch(e){case"Int":return t===dg;case"Long":return t===Number(bd)||t===bd;case"Float":return t===ug;case"Double":return t===pg;case"String":return t===hg;case"Bytes":return t===fg;default:throw Error(`unsupported data type: ${e}`)}}function mg(t,e){const n=Math.floor(e/8),i=1<<7-e%8;return(t[n]&i)>0}function kd(t){const{type:e,name:n,domain:i}=t;return{type:e,name:n,...i&&{domain:i}}}function Ua(t){return t.map(kd)}function cs(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=>cs(n,e))};case"outer":return{type:"outer",primary:cs(t.primary,e),secondary:t.secondary.map(n=>cs(n,e))};default:cg(t)}}ls.object({__isRef:ls.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:ls.string().describe("Upstream block id"),name:ls.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 gg(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 yg="1.10.12";function vg(){return gg({sdkVersion:yg})}function _g(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function li(t){return!!t&&typeof t.children<"u"}function ir(t){return li(t)?t.groupId:t.colId}function Sd(t,e,n){const i=(c,u)=>{const p=c.children.map(ir),f=b._includes(p,ir(u)),m=b._last(c.children),y=m&&ir(m)!==ir(u);return f&&y};if(!li(t))return!0;const s=t,l=n;if(i(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(ir);if(!b._includes(c,ir(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!Sd(s.children[c],e,n);c--);return!1}function Cg(t){const e=(s,l)=>li(s)&&li(l)&&ir(s)===ir(l),n=(s,l)=>{if(!li(l))return s;const c=s,u=l;return u.children&&u.groupId&&Sd(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},i=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):i.push(l)}return i}var wg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(li(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new b.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const 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}},i=[];return t.forEach(s=>{const l=n(s,0);l&&i.push(l)}),e.length>0&&b._warnOnce("unable to find grid columns for the supplied colDef(s):",e),i}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Cg(e);t(n)}getLeafPathTrees(){const t=(i,s)=>{let l;if(b.isProvidedColumnGroup(i))if(i.isPadding())l=s;else{const u=Object.assign({},i.getColGroupDef());u.groupId=i.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},i.getColDef());u.colId=i.getColId(),l=u}const c=i.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(i=>{const s=i.getColDef();return i.isPrimary()&&!s.showRowGroup}).map(i=>t(i,i.getColDef()))}};function bg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function xg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function kg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Sg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Eg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Tg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function Bg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function Ag(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Ng(t,e){var i;const n=(i=t.sideBarService)==null?void 0:i.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function Vg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Pg=class extends b.Component{constructor(t){super(),this.eToggleButton=b.RefPlaceholder,this.eIconWrapper=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
3
+ `)}}function sm(t){return{ok:!0,value:t}}function ld(t){if(!t)throw new Ba;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function cd(t){return{value:t,errors:void 0}}function am(t){if(t.errors)throw new Na(t.errors);if(!t.value)throw new Ba;return t.value}function lm(t){return t!==void 0}function Aa(t,e){return ti(t)===ti(e)}const Va=t=>t,Pa=t=>t instanceof Error?t:Error(String(t)),Da=t=>t.name==="ZodError",Fa=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),i=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(i).join("; ")};function Ra(t){const e=t.validate??Va,{autoSave:n}=t,i=r.ref(),s=r.ref(),l=D=>{s.value={model:Rn(D)}};r.watch(()=>t.get(),D=>l(D),{immediate:!0});const c=()=>{var D;t.onSave(e(Rn((D=s.value)==null?void 0:D.model)))},u=()=>{l(t.get()),i.value=void 0},p=D=>{const k=Pa(D);Da(k)?i.value=Error(Fa(k)):i.value=k},f=D=>{i.value=void 0;try{e(D),n&&c()}catch(k){p(k)}},m=r.computed({get:()=>{var D;return(D=s.value)==null?void 0:D.model},set(D){l(D),f(D)}});r.watch(s,(D,k)=>{D&&D===k&&f(D.model)},{deep:!0});const y=r.computed(()=>!i.value),T=r.computed(()=>!Aa(t.get(),r.unref(s))),S=r.computed(()=>i.value?i.value.message:"");return r.reactive({model:m,valid:y,isChanged:T,error:i,errorString:S,save:c,revert:u,setError:p})}function cm(t,e){const n=t.validate??Va,{autoSave:i}=t,s=r.ref(),l=r.ref(),c=k=>{l.value={model:Object.assign(Rn(k),e??{}),stage:Symbol()}};r.watch(()=>t.get(),k=>c(k),{immediate:!0});const u=()=>{var k;t.onSave(n(Rn((k=l.value)==null?void 0:k.model)))},p=()=>{c(t.get()),s.value=void 0},f=k=>{const M=Pa(k);Da(M)?s.value=Error(Fa(M)):s.value=M},m=k=>{s.value=void 0;try{n(k),i&&u()}catch(M){f(M)}},y=r.computed({get:()=>{var k;return(k=l.value)==null?void 0:k.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:y.value.args,ui:y.value.ui}),()=>{var k;return(k=l.value)==null?void 0:k.stage}],([k,M],[C,G])=>{M===G&&m(k)},{deep:!0});const T=r.computed(()=>!s.value),S=r.computed(()=>{var C;const{args:k,ui:M}=((C=r.unref(l))==null?void 0:C.model)??{};return!Aa(t.get(),{args:k,ui:M})}),D=r.computed(()=>s.value?s.value.message:"");return r.reactive({model:y,valid:T,isChanged:S,error:s,errorString:D,save:u,revert:p,setError:f})}const dm=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function um(t,e){const i=Ta(e.setBlockArgs,100),s=Ta(e.setBlockUiState,100),l=Ta(e.setBlockArgsAndUiState,100),c=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async k=>{k.forEach(M=>{M.key==="args"&&(c.args=Object.freeze(M.value)),M.key==="ui"&&(c.ui=Object.freeze(M.value)),M.key==="outputs"&&(c.outputs=Object.freeze(M.value)),M.key==="navigationState"&&(c.navigationState=Object.freeze(M.value))}),await r.nextTick()});const u=()=>Rn(c.args),p=()=>Rn(c.ui),f=()=>Rn(c.navigationState),m={createArgsModel(k={}){return Ra({get(){return k.transform?k.transform(c.args):c.args},validate:k.validate,autoSave:!0,onSave(M){i(M)}})},createUiModel(k={},M){return Ra({get(){return k.transform?k.transform(c.ui):c.ui??M()},validate:k.validate,autoSave:!0,onSave(C){s(C)}})},useOutputs(...k){const M=r.reactive({errors:void 0,value:void 0});return r.watch(()=>c.outputs,()=>{try{Object.assign(M,{value:this.unwrapOutputs(...k),errors:void 0})}catch(C){Object.assign(M,{value:void 0,errors:[String(C)]})}},{immediate:!0,deep:!0}),M},unwrapOutputs(...k){const M=c.outputs,C=k.map(G=>[G,ld(M[G])]);return Object.fromEntries(C)},getOutputField(k){return c.outputs[k]},getOutputFieldOkOptional(k){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const M=this.getOutputField(k);if(M&&M.ok)return M.value},getOutputFieldErrorsOptional(k){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const M=this.getOutputField(k);if(M&&!M.ok)return M.errors},updateArgs(k){const M=u();return k(M),e.setBlockArgs(M)},updateUiState(k){const M=p();return e.setBlockUiState(k(M))},updateNavigationState(k){const M=f();return k(M),e.setNavigationState(M)},navigateTo(k){const M=f();return M.href=k,e.setNavigationState(M)}},y=r.computed(()=>{const k=Object.entries(c.outputs).map(([M,C])=>[M,C.ok&&C.value!==void 0?C.value:void 0]);return Object.fromEntries(k)}),T=r.computed(()=>{const k=Object.entries(c.outputs).map(([M,C])=>[M,C&&!C.ok?new Na(C.errors):void 0]);return Object.fromEntries(k)}),S={snapshot:c,queryParams:r.computed(()=>dm(c.navigationState.href)),href:r.computed(()=>c.navigationState.href),hasErrors:r.computed(()=>Object.values(c.outputs).some(k=>!(k!=null&&k.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),y.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),T.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),c.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),c.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),c.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),c.navigationState))},D=cm({get(){return{args:c.args,ui:c.ui}},autoSave:!0,onSave(k){l(k.args,k.ui)}},{outputs:y,outputErrors:T});return r.reactive(Object.assign(D,m,S))}var Me;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Me||(Me={}));var Ma;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ma||(Ma={}));const oe=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qn=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map<"u"&&t instanceof Map?oe.map:typeof Set<"u"&&t instanceof Set?oe.set:typeof Date<"u"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},Q=Me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),pm=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class It extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},i={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let u=i,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof It))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}It.create=t=>new It(t);const ni=(t,e)=>{let n;switch(t.code){case Q.invalid_type:t.received===oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Me.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(t.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(t.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(t.options)}, received '${t.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Me.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Q.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 Q.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 Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=e.defaultError,Me.assertNever(t)}return{message:n}};let dd=ni;function hm(t){dd=t}function es(){return dd}const ts=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},fm=[];function re(t,e){const n=es(),i=ts({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ni?void 0:ni].filter(s=>!!s)});t.common.issues.push(i)}class gt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return gt.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return _e;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const _e=Object.freeze({status:"aborted"}),ri=t=>({status:"dirty",value:t}),xt=t=>({status:"valid",value:t}),Ia=t=>t.status==="aborted",La=t=>t.status==="dirty",Gi=t=>t.status==="valid",zi=t=>typeof Promise<"u"&&t instanceof Promise;function ns(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ud(t,e,n,i,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var de;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(de||(de={}));var $i,Ui;class kn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const pd=(t,e)=>{if(Gi(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 It(t.common.issues);return this._error=n,this._error}}};function Se(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(c,u)=>{var p,f;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??i)!==null&&p!==void 0?p:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class Be{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Qn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Qn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new gt,ctx:{common:e.parent.common,data:e.data,parsedType:Qn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(zi(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qn(e)},l=this._parseSync({data:e,path:s.path,parent:s});return pd(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qn(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(zi(s)?s:Promise.resolve(s));return pd(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:Q.custom,...i(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new sn({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return En.create(this,this._def)}nullable(){return rr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return on.create(this,this._def)}promise(){return ai.create(this,this._def)}or(e){return ji.create([this,e],this._def)}and(e){return qi.create(this,e,this._def)}transform(e){return new sn({...Se(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Qi({...Se(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new za({typeName:ye.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new eo({...Se(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return to.create(this,e)}readonly(){return no.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mm=/^c[^\s-]{8,}$/i,gm=/^[0-9a-z]+$/,ym=/^[0-9A-HJKMNP-TV-Z]{26}$/,vm=/^[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,Cm=/^[-+]?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)?)??$/,wm=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,bm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oa;const xm=/^(?:(?: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])$/,km=/^(([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})))$/,Sm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hd="((\\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])))",Em=new RegExp(`^${hd}$`);function fd(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 Tm(t){return new RegExp(`^${fd(t)}$`)}function md(t){let e=`${hd}T${fd(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 Bm(t,e){return!!((e==="v4"||!e)&&xm.test(t)||(e==="v6"||!e)&&km.test(t))}class rn extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:oe.string,received:l.parsedType}),_e}const i=new gt;let s;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(s=this._getOrReturnCtx(e,s),re(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="max")e.data.length>l.value&&(s=this._getOrReturnCtx(e,s),re(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),i.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,u=e.data.length<l.value;(c||u)&&(s=this._getOrReturnCtx(e,s),c?re(s,{code:Q.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):u&&re(s,{code:Q.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),i.dirty())}else if(l.kind==="email")wm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"email",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="emoji")Oa||(Oa=new RegExp(bm,"u")),Oa.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"emoji",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="uuid")vm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"uuid",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="nanoid")_m.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"nanoid",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid")mm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"cuid",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="cuid2")gm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"cuid2",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="ulid")ym.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"ulid",code:Q.invalid_string,message:l.message}),i.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),re(s,{validation:"url",code:Q.invalid_string,message:l.message}),i.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"regex",code:Q.invalid_string,message:l.message}),i.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),i.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:{startsWith:l.value},message:l.message}),i.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:{endsWith:l.value},message:l.message}),i.dirty()):l.kind==="datetime"?md(l).test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:"datetime",message:l.message}),i.dirty()):l.kind==="date"?Em.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:"date",message:l.message}),i.dirty()):l.kind==="time"?Tm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:"time",message:l.message}),i.dirty()):l.kind==="duration"?Cm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"duration",code:Q.invalid_string,message:l.message}),i.dirty()):l.kind==="ip"?Bm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"ip",code:Q.invalid_string,message:l.message}),i.dirty()):l.kind==="base64"?Sm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"base64",code:Q.invalid_string,message:l.message}),i.dirty()):Me.assertNever(l);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:Q.invalid_string,...de.errToObj(i)})}_addCheck(e){return new rn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...de.errToObj(e)})}url(e){return this._addCheck({kind:"url",...de.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...de.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...de.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...de.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...de.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...de.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...de.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...de.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...de.errToObj(e)})}datetime(e){var n,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...de.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,...de.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...de.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...de.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...de.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...de.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...de.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...de.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...de.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...de.errToObj(n)})}nonempty(e){return this.min(1,de.errToObj(e))}trim(){return new rn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new rn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new rn({...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}}rn.create=t=>{var e;return new rn({checks:[],typeName:ye.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function Nm(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class er extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==oe.number){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:oe.number,received:l.parsedType}),_e}let i;const s=new gt;for(const l of this._def.checks)l.kind==="int"?Me.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:Q.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?Nm(e.data,l.value)!==0&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),re(i,{code:Q.not_finite,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new er({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new er({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:de.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:de.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Me.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}er.create=t=>new er({checks:[],typeName:ye.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class tr extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==oe.bigint){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:oe.bigint,received:l.parsedType}),_e}let i;const s=new gt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),re(i,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Me.assertNever(l);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,de.toString(n))}gt(e,n){return this.setLimit("min",e,!1,de.toString(n))}lte(e,n){return this.setLimit("max",e,!0,de.toString(n))}lt(e,n){return this.setLimit("max",e,!1,de.toString(n))}setLimit(e,n,i,s){return new tr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:de.toString(s)}]})}_addCheck(e){return new tr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:de.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}}tr.create=t=>{var e;return new tr({checks:[],typeName:ye.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};class Zi extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.boolean,received:i.parsedType}),_e}return xt(e.data)}}Zi.create=t=>new Zi({typeName:ye.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Dr extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:oe.date,received:l.parsedType}),_e}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_date}),_e}const i=new gt;let s;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(s=this._getOrReturnCtx(e,s),re(s,{code:Q.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),i.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(s=this._getOrReturnCtx(e,s),re(s,{code:Q.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),i.dirty()):Me.assertNever(l);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Dr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:de.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:de.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}}Dr.create=t=>new Dr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ye.ZodDate,...Se(t)});class rs extends Be{_parse(e){if(this._getType(e)!==oe.symbol){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.symbol,received:i.parsedType}),_e}return xt(e.data)}}rs.create=t=>new rs({typeName:ye.ZodSymbol,...Se(t)});class Wi extends Be{_parse(e){if(this._getType(e)!==oe.undefined){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.undefined,received:i.parsedType}),_e}return xt(e.data)}}Wi.create=t=>new Wi({typeName:ye.ZodUndefined,...Se(t)});class Hi extends Be{_parse(e){if(this._getType(e)!==oe.null){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.null,received:i.parsedType}),_e}return xt(e.data)}}Hi.create=t=>new Hi({typeName:ye.ZodNull,...Se(t)});class ii extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return xt(e.data)}}ii.create=t=>new ii({typeName:ye.ZodAny,...Se(t)});class Fr extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xt(e.data)}}Fr.create=t=>new Fr({typeName:ye.ZodUnknown,...Se(t)});class Mn extends Be{_parse(e){const n=this._getOrReturnCtx(e);return re(n,{code:Q.invalid_type,expected:oe.never,received:n.parsedType}),_e}}Mn.create=t=>new Mn({typeName:ye.ZodNever,...Se(t)});class is extends Be{_parse(e){if(this._getType(e)!==oe.undefined){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.void,received:i.parsedType}),_e}return xt(e.data)}}is.create=t=>new is({typeName:ye.ZodVoid,...Se(t)});class on extends Be{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==oe.array)return re(n,{code:Q.invalid_type,expected:oe.array,received:n.parsedType}),_e;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(re(n,{code:c?Q.too_big:Q.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(re(n,{code:Q.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(re(n,{code:Q.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new kn(n,c,n.path,u)))).then(c=>gt.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new kn(n,c,n.path,u)));return gt.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new on({...this._def,minLength:{value:e,message:de.toString(n)}})}max(e,n){return new on({...this._def,maxLength:{value:e,message:de.toString(n)}})}length(e,n){return new on({...this._def,exactLength:{value:e,message:de.toString(n)}})}nonempty(e){return this.min(1,e)}}on.create=(t,e)=>new on({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...Se(e)});function oi(t){if(t instanceof Je){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=En.create(oi(i))}return new Je({...t._def,shape:()=>e})}else return t instanceof on?new on({...t._def,type:oi(t.element)}):t instanceof En?En.create(oi(t.unwrap())):t instanceof rr?rr.create(oi(t.unwrap())):t instanceof Sn?Sn.create(t.items.map(e=>oi(e))):t}class Je extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Me.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==oe.object){const f=this._getOrReturnCtx(e);return re(f,{code:Q.invalid_type,expected:oe.object,received:f.parsedType}),_e}const{status:i,ctx:s}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Mn&&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 kn(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Mn){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&&(re(s,{code:Q.unrecognized_keys,keys:u}),i.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new kn(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=>gt.mergeObjectSync(i,f)):gt.mergeObjectSync(i,p)}get shape(){return this._def.shape()}strict(e){return de.errToObj,new Je({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=de.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Je({...this._def,unknownKeys:"strip"})}passthrough(){return new Je({...this._def,unknownKeys:"passthrough"})}extend(e){return new Je({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Je({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ye.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Je({...this._def,catchall:e})}pick(e){const n={};return Me.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Je({...this._def,shape:()=>n})}omit(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Je({...this._def,shape:()=>n})}deepPartial(){return oi(this)}partial(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Je({...this._def,shape:()=>n})}required(e){const n={};return Me.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let l=this.shape[i];for(;l instanceof En;)l=l._def.innerType;n[i]=l}}),new Je({...this._def,shape:()=>n})}keyof(){return gd(Me.objectKeys(this.shape))}}Je.create=(t,e)=>new Je({shape:()=>t,unknownKeys:"strip",catchall:Mn.create(),typeName:ye.ZodObject,...Se(e)}),Je.strictCreate=(t,e)=>new Je({shape:()=>t,unknownKeys:"strict",catchall:Mn.create(),typeName:ye.ZodObject,...Se(e)}),Je.lazycreate=(t,e)=>new Je({shape:t,unknownKeys:"strip",catchall:Mn.create(),typeName:ye.ZodObject,...Se(e)});class ji extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new It(u.ctx.common.issues));return re(n,{code:Q.invalid_union,unionErrors:c}),_e}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of i){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new It(p));return re(n,{code:Q.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}ji.create=(t,e)=>new ji({options:t,typeName:ye.ZodUnion,...Se(e)});const In=t=>t instanceof Yi?In(t.schema):t instanceof sn?In(t.innerType()):t instanceof Ji?[t.value]:t instanceof nr?t.options:t instanceof Xi?Me.objectValues(t.enum):t instanceof Qi?In(t._def.innerType):t instanceof Wi?[void 0]:t instanceof Hi?[null]:t instanceof En?[void 0,...In(t.unwrap())]:t instanceof rr?[null,...In(t.unwrap())]:t instanceof za||t instanceof no?In(t.unwrap()):t instanceof eo?In(t._def.innerType):[];class os extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.object)return re(n,{code:Q.invalid_type,expected:oe.object,received:n.parsedType}),_e;const i=this.discriminator,s=n.data[i],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(re(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=In(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 os({typeName:ye.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(i)})}}function Ga(t,e){const n=Qn(t),i=Qn(e);if(t===e)return{valid:!0,data:t};if(n===oe.object&&i===oe.object){const s=Me.objectKeys(e),l=Me.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Ga(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===oe.array&&i===oe.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=Ga(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===oe.date&&i===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class qi extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(Ia(l)||Ia(c))return _e;const u=Ga(l.value,c.value);return u.valid?((La(l)||La(c))&&n.dirty(),{status:n.value,value:u.data}):(re(i,{code:Q.invalid_intersection_types}),_e)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}qi.create=(t,e,n)=>new qi({left:t,right:e,typeName:ye.ZodIntersection,...Se(n)});class Sn extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.array)return re(i,{code:Q.invalid_type,expected:oe.array,received:i.parsedType}),_e;if(i.data.length<this._def.items.length)return re(i,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&i.data.length>this._def.items.length&&(re(i,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...i.data].map((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new kn(i,c,i.path,u)):null}).filter(c=>!!c);return i.common.async?Promise.all(l).then(c=>gt.mergeArray(n,c)):gt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Sn({...this._def,rest:e})}}Sn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sn({items:t,typeName:ye.ZodTuple,rest:null,...Se(e)})};class Ki extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.object)return re(i,{code:Q.invalid_type,expected:oe.object,received:i.parsedType}),_e;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new kn(i,u,i.path,u)),value:c._parse(new kn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?gt.mergeObjectAsync(n,s):gt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Be?new Ki({keyType:e,valueType:n,typeName:ye.ZodRecord,...Se(i)}):new Ki({keyType:rn.create(),valueType:e,typeName:ye.ZodRecord,...Se(n)})}}class ss extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.map)return re(i,{code:Q.invalid_type,expected:oe.map,received:i.parsedType}),_e;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new kn(i,u,i.path,[f,"key"])),value:l._parse(new kn(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const p of c){const f=p.key,m=p.value;if(f.status==="aborted"||m.status==="aborted")return _e;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}ss.create=(t,e,n)=>new ss({valueType:e,keyType:t,typeName:ye.ZodMap,...Se(n)});class Rr extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.set)return re(i,{code:Q.invalid_type,expected:oe.set,received:i.parsedType}),_e;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(re(i,{code:Q.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(re(i,{code:Q.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return _e;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...i.data.values()].map((p,f)=>l._parse(new kn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Rr({...this._def,minSize:{value:e,message:de.toString(n)}})}max(e,n){return new Rr({...this._def,maxSize:{value:e,message:de.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Rr.create=(t,e)=>new Rr({valueType:t,minSize:null,maxSize:null,typeName:ye.ZodSet,...Se(e)});class si extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.function)return re(n,{code:Q.invalid_type,expected:oe.function,received:n.parsedType}),_e;function i(u,p){return ts({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,es(),ni].filter(f=>!!f),issueData:{code:Q.invalid_arguments,argumentsError:p}})}function s(u,p){return ts({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,es(),ni].filter(f=>!!f),issueData:{code:Q.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof ai){const u=this;return xt(async function(...p){const f=new It([]),m=await u._def.args.parseAsync(p,l).catch(S=>{throw f.addIssue(i(p,S)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(S=>{throw f.addIssue(s(y,S)),f})})}else{const u=this;return xt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new It([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new It([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new si({...this._def,args:Sn.create(e).rest(Fr.create())})}returns(e){return new si({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new si({args:e||Sn.create([]).rest(Fr.create()),returns:n||Fr.create(),typeName:ye.ZodFunction,...Se(i)})}}class Yi extends Be{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Yi.create=(t,e)=>new Yi({getter:t,typeName:ye.ZodLazy,...Se(e)});class Ji extends Be{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return re(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ji.create=(t,e)=>new Ji({value:t,typeName:ye.ZodLiteral,...Se(e)});function gd(t,e){return new nr({values:t,typeName:ye.ZodEnum,...Se(e)})}class nr extends Be{constructor(){super(...arguments),$i.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{expected:Me.joinValues(i),received:n.parsedType,code:Q.invalid_type}),_e}if(ns(this,$i)||ud(this,$i,new Set(this._def.values)),!ns(this,$i).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return re(n,{received:n.data,code:Q.invalid_enum_value,options:i}),_e}return xt(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 nr.create(e,{...this._def,...n})}exclude(e,n=this._def){return nr.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}$i=new WeakMap,nr.create=gd;class Xi extends Be{constructor(){super(...arguments),Ui.set(this,void 0)}_parse(e){const n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==oe.string&&i.parsedType!==oe.number){const s=Me.objectValues(n);return re(i,{expected:Me.joinValues(s),received:i.parsedType,code:Q.invalid_type}),_e}if(ns(this,Ui)||ud(this,Ui,new Set(Me.getValidEnumValues(this._def.values))),!ns(this,Ui).has(e.data)){const s=Me.objectValues(n);return re(i,{received:i.data,code:Q.invalid_enum_value,options:s}),_e}return xt(e.data)}get enum(){return this._def.values}}Ui=new WeakMap,Xi.create=(t,e)=>new Xi({values:t,typeName:ye.ZodNativeEnum,...Se(e)});class ai extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==oe.promise&&n.common.async===!1)return re(n,{code:Q.invalid_type,expected:oe.promise,received:n.parsedType}),_e;const i=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return xt(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ai.create=(t,e)=>new ai({type:t,typeName:ye.ZodPromise,...Se(e)});class sn extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{re(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return _e;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?_e:p.status==="dirty"||n.value==="dirty"?ri(p.value):p});{if(n.value==="aborted")return _e;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?_e:u.status==="dirty"||n.value==="dirty"?ri(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Gi(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>Gi(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Me.assertNever(s)}}sn.create=(t,e,n)=>new sn({schema:t,typeName:ye.ZodEffects,effect:e,...Se(n)}),sn.createWithPreprocess=(t,e,n)=>new sn({schema:e,effect:{type:"preprocess",transform:t},typeName:ye.ZodEffects,...Se(n)});class En extends Be{_parse(e){return this._getType(e)===oe.undefined?xt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}En.create=(t,e)=>new En({innerType:t,typeName:ye.ZodOptional,...Se(e)});class rr extends Be{_parse(e){return this._getType(e)===oe.null?xt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rr.create=(t,e)=>new rr({innerType:t,typeName:ye.ZodNullable,...Se(e)});class Qi extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===oe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Qi.create=(t,e)=>new Qi({innerType:t,typeName:ye.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class eo extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return zi(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new It(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new It(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}eo.create=(t,e)=>new eo({innerType:t,typeName:ye.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class as extends Be{_parse(e){if(this._getType(e)!==oe.nan){const i=this._getOrReturnCtx(e);return re(i,{code:Q.invalid_type,expected:oe.nan,received:i.parsedType}),_e}return{status:"valid",value:e.data}}}as.create=t=>new as({typeName:ye.ZodNaN,...Se(t)});const Am=Symbol("zod_brand");class za extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class to extends Be{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?_e:l.status==="dirty"?(n.dirty(),ri(l.value)):this._def.out._parseAsync({data:l.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?_e:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new to({in:e,out:n,typeName:ye.ZodPipeline})}}class no extends Be{_parse(e){const n=this._def.innerType._parse(e),i=s=>(Gi(s)&&(s.value=Object.freeze(s.value)),s);return zi(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}no.create=(t,e)=>new no({innerType:t,typeName:ye.ZodReadonly,...Se(e)});function yd(t,e={},n){return t?ii.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):ii.create()}const Vm={object:Je.lazycreate};var ye;(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"})(ye||(ye={}));const Pm=(t,e={message:`Input not instance of ${t.name}`})=>yd(n=>n instanceof t,e),vd=rn.create,_d=er.create,Dm=as.create,Fm=tr.create,Cd=Zi.create,Rm=Dr.create,Mm=rs.create,Im=Wi.create,Lm=Hi.create,Om=ii.create,Gm=Fr.create,zm=Mn.create,$m=is.create,Um=on.create,Zm=Je.create,Wm=Je.strictCreate,Hm=ji.create,jm=os.create,qm=qi.create,Km=Sn.create,Ym=Ki.create,Jm=ss.create,Xm=Rr.create,Qm=si.create,eg=Yi.create,tg=Ji.create,ng=nr.create,rg=Xi.create,ig=ai.create,wd=sn.create,og=En.create,sg=rr.create,ag=sn.createWithPreprocess,lg=to.create;var ls=Object.freeze({__proto__:null,defaultErrorMap:ni,setErrorMap:hm,getErrorMap:es,makeIssue:ts,EMPTY_PATH:fm,addIssueToContext:re,ParseStatus:gt,INVALID:_e,DIRTY:ri,OK:xt,isAborted:Ia,isDirty:La,isValid:Gi,isAsync:zi,get util(){return Me},get objectUtil(){return Ma},ZodParsedType:oe,getParsedType:Qn,ZodType:Be,datetimeRegex:md,ZodString:rn,ZodNumber:er,ZodBigInt:tr,ZodBoolean:Zi,ZodDate:Dr,ZodSymbol:rs,ZodUndefined:Wi,ZodNull:Hi,ZodAny:ii,ZodUnknown:Fr,ZodNever:Mn,ZodVoid:is,ZodArray:on,ZodObject:Je,ZodUnion:ji,ZodDiscriminatedUnion:os,ZodIntersection:qi,ZodTuple:Sn,ZodRecord:Ki,ZodMap:ss,ZodSet:Rr,ZodFunction:si,ZodLazy:Yi,ZodLiteral:Ji,ZodEnum:nr,ZodNativeEnum:Xi,ZodPromise:ai,ZodEffects:sn,ZodTransformer:sn,ZodOptional:En,ZodNullable:rr,ZodDefault:Qi,ZodCatch:eo,ZodNaN:as,BRAND:Am,ZodBranded:za,ZodPipeline:to,ZodReadonly:no,custom:yd,Schema:Be,ZodSchema:Be,late:Vm,get ZodFirstPartyTypeKind(){return ye},coerce:{string:t=>rn.create({...t,coerce:!0}),number:t=>er.create({...t,coerce:!0}),boolean:t=>Zi.create({...t,coerce:!0}),bigint:t=>tr.create({...t,coerce:!0}),date:t=>Dr.create({...t,coerce:!0})},any:Om,array:Um,bigint:Fm,boolean:Cd,date:Rm,discriminatedUnion:jm,effect:wd,enum:ng,function:Qm,instanceof:Pm,intersection:qm,lazy:eg,literal:tg,map:Jm,nan:Dm,nativeEnum:rg,never:zm,null:Lm,nullable:sg,number:_d,object:Zm,oboolean:()=>Cd().optional(),onumber:()=>_d().optional(),optional:og,ostring:()=>vd().optional(),pipeline:lg,preprocess:ag,promise:ig,record:Ym,set:Xm,strictObject:Wm,string:vd,symbol:Mm,transformer:wd,tuple:Km,undefined:Im,union:Hm,unknown:Gm,void:$m,NEVER:_e,ZodIssueCode:Q,quotelessJson:pm,ZodError:It});function cg(t){throw new Error("Unexpected object: "+t)}const dg=-2147483648,bd=-9007199254740991n,ug=NaN,pg=NaN,hg=null,fg=null;function xd(t,e){switch(e){case"Int":return t===dg;case"Long":return t===Number(bd)||t===bd;case"Float":return t===ug;case"Double":return t===pg;case"String":return t===hg;case"Bytes":return t===fg;default:throw Error(`unsupported data type: ${e}`)}}function mg(t,e){const n=Math.floor(e/8),i=1<<7-e%8;return(t[n]&i)>0}function kd(t){const{type:e,name:n,domain:i}=t;return{type:e,name:n,...i&&{domain:i}}}function $a(t){return t.map(kd)}function cs(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=>cs(n,e))};case"outer":return{type:"outer",primary:cs(t.primary,e),secondary:t.secondary.map(n=>cs(n,e))};default:cg(t)}}ls.object({__isRef:ls.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:ls.string().describe("Upstream block id"),name:ls.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 gg(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 yg="1.10.12";function vg(){return gg({sdkVersion:yg})}function _g(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function li(t){return!!t&&typeof t.children<"u"}function ir(t){return li(t)?t.groupId:t.colId}function Sd(t,e,n){const i=(c,u)=>{const p=c.children.map(ir),f=b._includes(p,ir(u)),m=b._last(c.children),y=m&&ir(m)!==ir(u);return f&&y};if(!li(t))return!0;const s=t,l=n;if(i(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(ir);if(!b._includes(c,ir(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!Sd(s.children[c],e,n);c--);return!1}function Cg(t){const e=(s,l)=>li(s)&&li(l)&&ir(s)===ir(l),n=(s,l)=>{if(!li(l))return s;const c=s,u=l;return u.children&&u.groupId&&Sd(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},i=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):i.push(l)}return i}var wg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(li(s)){const c=s,u=typeof c.groupId<"u"?c.groupId:c.headerName,p=new b.AgProvidedColumnGroup(c,u,!1,l),f=[];return c.children.forEach(m=>{const 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}},i=[];return t.forEach(s=>{const l=n(s,0);l&&i.push(l)}),e.length>0&&b._warnOnce("unable to find grid columns for the supplied colDef(s):",e),i}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Cg(e);t(n)}getLeafPathTrees(){const t=(i,s)=>{let l;if(b.isProvidedColumnGroup(i))if(i.isPadding())l=s;else{const u=Object.assign({},i.getColGroupDef());u.groupId=i.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},i.getColDef());u.colId=i.getColId(),l=u}const c=i.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(i=>{const s=i.getColDef();return i.isPrimary()&&!s.showRowGroup}).map(i=>t(i,i.getColDef()))}};function bg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function xg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function kg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Sg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Eg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Tg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function Bg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function Ng(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Ag(t,e){var i;const n=(i=t.sideBarService)==null?void 0:i.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function Vg(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Pg=class extends b.Component{constructor(t){super(),this.eToggleButton=b.RefPlaceholder,this.eIconWrapper=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
4
4
  <button type="button" data-ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">
5
5
  <div data-ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>
6
6
  <span data-ref="eLabel" class="ag-side-button-label"></span>
7
7
  </button>
8
- </div>`}setLabel(){const t=this.localeService.getLocaleTextFunc(),e=this.toolPanelDef,n=t(e.labelKey,e.labelDefault);this.eLabel.innerText=n}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",b._createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(t){this.addOrRemoveCssClass("ag-selected",t),b._setAriaExpanded(this.eToggleButton,t)}getButtonElement(){return this.eToggleButton}},Dg=class extends b.Component{constructor(){super('<div class="ag-side-buttons" role="tablist"></div>'),this.buttonComps=[]}wireBeans(t){this.focusService=t.focusService,this.visibleColsService=t.visibleColsService}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(t){if(!(t.key!==b.KeyCode.TAB||!t.shiftKey)){if(this.focusService.focusNextGridCoreContainer(!0)){t.preventDefault();return}b._stopPropagationForAgGrid(t)}}setActiveButton(t){this.buttonComps.forEach(e=>{e.setSelected(t===e.getToolPanelId())})}addButtonComp(t){const e=this.createBean(new Pg(t));return this.buttonComps.push(e),this.appendChild(e),e.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:t.id})}),e}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),b._clearElement(this.getGui()),super.destroy()}destroy(){this.clearButtons(),super.destroy()}},Fg={selector:"AG-SIDE-BAR-BUTTONS",component:Dg},Ed={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},Td={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},Za={columns:Ed,filters:Td};function $a(t){if(!t)return;if(t===!0)return{toolPanels:[Ed,Td],defaultToolPanel:"columns"};if(typeof t=="string")return $a([t]);if(Array.isArray(t)){const n=[];return t.forEach(i=>{const s=Za[i];if(!s){Bd(i);return}n.push(s)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:Rg(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function Bd(t){b._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(Za).join(",")}`)}function Rg(t){const e=[];return t&&t.forEach(n=>{let i=null;if(typeof n=="string"){const s=Za[n];if(!s){Bd(n);return}i=s}else i=n;e.push(i)}),e}var Mg=class extends b.Component{constructor(){super('<div class="ag-tool-panel-horizontal-resize"></div>'),this.minWidth=100,this.maxWidth=null}wireBeans(t){this.horizontalResizeService=t.horizontalResizeService}setElementToResize(t){this.elementToResize=t}postConstruct(){const t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gos.get("enableRtl"))}dispatchResizeEvent(t,e,n){this.eventService.dispatchEvent({type:"toolPanelSizeChanged",width:n,started:t,ended:e})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(t){return this.onResizing(t,!0)}onResizing(t,e=!1){const n=this.inverted?-1:1;let i=Math.max(this.minWidth,Math.floor(this.startingWidth-t*n));this.maxWidth!=null&&(i=Math.min(this.maxWidth,i)),this.elementToResize.style.width=`${i}px`,this.dispatchResizeEvent(!1,e,i)}setInverted(t){this.inverted=t}setMaxWidth(t){this.maxWidth=t}setMinWidth(t){t!=null?this.minWidth=t:this.minWidth=100}},Ig=class extends b.Component{wireBeans(t){this.userComponentFactory=t.userComponentFactory}constructor(){super('<div class="ag-tool-panel-wrapper" role="tabpanel"/>')}postConstruct(){const t=this.getGui(),e=this.resizeBar=this.createManagedBean(new Mg);t.setAttribute("id",`ag-${this.getCompId()}`),e.setElementToResize(t),this.appendChild(e)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(t,e){const{id:n,minWidth:i,maxWidth:s,width:l}=t;this.toolPanelId=n,this.width=l;const c=this.userComponentFactory.getToolPanelCompDetails(t,e),u=c.newAgStackInstance();if(this.params=c.params,u==null){b._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}u.then(this.setToolPanelComponent.bind(this)),i!=null&&this.resizeBar.setMinWidth(i),s!=null&&this.resizeBar.setMaxWidth(s)}setToolPanelComponent(t){this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc(()=>{this.destroyBean(t)}),this.width&&(this.getGui().style.width=`${this.width}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(t){const e=this.gos.get("enableRtl"),n=t==="left",i=e?n:!n;this.resizeBar.setInverted(i)}refresh(){var t;(t=this.toolPanelCompInstance)==null||t.refresh(this.params)}},Og=class extends b.Component{constructor(){super(`<div class="ag-side-bar ag-unselectable">
8
+ </div>`}setLabel(){const t=this.localeService.getLocaleTextFunc(),e=this.toolPanelDef,n=t(e.labelKey,e.labelDefault);this.eLabel.innerText=n}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",b._createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(t){this.addOrRemoveCssClass("ag-selected",t),b._setAriaExpanded(this.eToggleButton,t)}getButtonElement(){return this.eToggleButton}},Dg=class extends b.Component{constructor(){super('<div class="ag-side-buttons" role="tablist"></div>'),this.buttonComps=[]}wireBeans(t){this.focusService=t.focusService,this.visibleColsService=t.visibleColsService}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(t){if(!(t.key!==b.KeyCode.TAB||!t.shiftKey)){if(this.focusService.focusNextGridCoreContainer(!0)){t.preventDefault();return}b._stopPropagationForAgGrid(t)}}setActiveButton(t){this.buttonComps.forEach(e=>{e.setSelected(t===e.getToolPanelId())})}addButtonComp(t){const e=this.createBean(new Pg(t));return this.buttonComps.push(e),this.appendChild(e),e.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:t.id})}),e}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),b._clearElement(this.getGui()),super.destroy()}destroy(){this.clearButtons(),super.destroy()}},Fg={selector:"AG-SIDE-BAR-BUTTONS",component:Dg},Ed={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},Td={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},Ua={columns:Ed,filters:Td};function Za(t){if(!t)return;if(t===!0)return{toolPanels:[Ed,Td],defaultToolPanel:"columns"};if(typeof t=="string")return Za([t]);if(Array.isArray(t)){const n=[];return t.forEach(i=>{const s=Ua[i];if(!s){Bd(i);return}n.push(s)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:Rg(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function Bd(t){b._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(Ua).join(",")}`)}function Rg(t){const e=[];return t&&t.forEach(n=>{let i=null;if(typeof n=="string"){const s=Ua[n];if(!s){Bd(n);return}i=s}else i=n;e.push(i)}),e}var Mg=class extends b.Component{constructor(){super('<div class="ag-tool-panel-horizontal-resize"></div>'),this.minWidth=100,this.maxWidth=null}wireBeans(t){this.horizontalResizeService=t.horizontalResizeService}setElementToResize(t){this.elementToResize=t}postConstruct(){const t=this.horizontalResizeService.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(t),this.setInverted(this.gos.get("enableRtl"))}dispatchResizeEvent(t,e,n){this.eventService.dispatchEvent({type:"toolPanelSizeChanged",width:n,started:t,ended:e})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(t){return this.onResizing(t,!0)}onResizing(t,e=!1){const n=this.inverted?-1:1;let i=Math.max(this.minWidth,Math.floor(this.startingWidth-t*n));this.maxWidth!=null&&(i=Math.min(this.maxWidth,i)),this.elementToResize.style.width=`${i}px`,this.dispatchResizeEvent(!1,e,i)}setInverted(t){this.inverted=t}setMaxWidth(t){this.maxWidth=t}setMinWidth(t){t!=null?this.minWidth=t:this.minWidth=100}},Ig=class extends b.Component{wireBeans(t){this.userComponentFactory=t.userComponentFactory}constructor(){super('<div class="ag-tool-panel-wrapper" role="tabpanel"/>')}postConstruct(){const t=this.getGui(),e=this.resizeBar=this.createManagedBean(new Mg);t.setAttribute("id",`ag-${this.getCompId()}`),e.setElementToResize(t),this.appendChild(e)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(t,e){const{id:n,minWidth:i,maxWidth:s,width:l}=t;this.toolPanelId=n,this.width=l;const c=this.userComponentFactory.getToolPanelCompDetails(t,e),u=c.newAgStackInstance();if(this.params=c.params,u==null){b._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}u.then(this.setToolPanelComponent.bind(this)),i!=null&&this.resizeBar.setMinWidth(i),s!=null&&this.resizeBar.setMaxWidth(s)}setToolPanelComponent(t){this.toolPanelCompInstance=t,this.appendChild(t.getGui()),this.addDestroyFunc(()=>{this.destroyBean(t)}),this.width&&(this.getGui().style.width=`${this.width}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(t){const e=this.gos.get("enableRtl"),n=t==="left",i=e?n:!n;this.resizeBar.setInverted(i)}refresh(){var t;(t=this.toolPanelCompInstance)==null||t.refresh(this.params)}},Lg=class extends b.Component{constructor(){super(`<div class="ag-side-bar ag-unselectable">
9
9
  <ag-side-bar-buttons data-ref="sideBarButtons"></ag-side-bar-buttons>
10
- </div>`,[Fg]),this.sideBarButtons=b.RefPlaceholder,this.toolPanelWrappers=[]}wireBeans(t){this.focusService=t.focusService,this.filterManager=t.filterManager,this.sideBarService=t.sideBarService}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{sideBar:t}=this.gos.get("initialState")??{};this.setSideBarDef({sideBarDef:$a(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new b.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),b._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,i=this.getGui(),s=n.getGui(),l=b._getActiveDomElement(this.gos),c=i.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),u=t.target;if(!c)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(s.contains(l)){e.focusInto(c,t.shiftKey)&&t.preventDefault();return}if(!t.shiftKey)return;let p=null;c.contains(l)?p=this.focusService.findNextFocusableElement(c,void 0,!0):e.isTargetUnderManagedComponent(c,u)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(c,u)),p||(p=s.querySelector(".ag-selected button")),p&&p!==t.target&&(t.preventDefault(),p.focus())}handleKeyDown(t){const e=b._getActiveDomElement(this.gos);if(!this.sideBarButtons.getGui().contains(e))return;const n=this.sideBarButtons.getGui(),i=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),s=i.findIndex(u=>u.contains(e));let l=null;switch(t.key){case b.KeyCode.LEFT:case b.KeyCode.UP:l=Math.max(0,s-1);break;case b.KeyCode.RIGHT:case b.KeyCode.DOWN:l=Math.min(s+1,i.length-1);break}if(l===null)return;const c=i[l].querySelector("button");c&&(c.focus(),t.preventDefault())}onToolPanelButtonClicked(t){const e=t.toolPanelId;this.openedItem()===e?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(e,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:n}){if(this.setDisplayed(!1),this.sideBar=t,this.sideBar&&this.sideBar.toolPanels){const i=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(i,e,n),!this.toolPanelWrappers.length)return;const s=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(s),this.setSideBarPosition(e?e.position:this.sideBar.position),s)if(e){const{openToolPanel:l}=e;l&&this.openToolPanel(l,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(t){t||(t="right"),this.position=t;const e=t==="left",n=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach(i=>{i.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,i;t[e.getToolPanelId()]=(i=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:i.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var i;for(const s of t)this.createToolPanelAndSideButton(s,(i=e==null?void 0:e.toolPanels)==null?void 0:i[s.id],n==null?void 0:n[s.id])}validateDef(t){var e;if(t.id==null)return b._warnOnce("please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if(t.toolPanel==="agColumnsToolPanel"&&!this.gos.assertModuleRegistered(b.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(b.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return b._warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(t,e,n){if(!this.validateDef(t))return;const i=this.sideBarButtons.addButtonComp(t);let s;n?s=n:(s=this.createBean(new Ig),s.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),s.setDisplayed(!1);const l=s.getGui();this.appendChild(l),this.toolPanelWrappers.push(s),b._setAriaControls(i.getButtonElement(),l)}refresh(){this.toolPanelWrappers.forEach(t=>t.refresh())}openToolPanel(t,e="api"){const n=this.openedItem();if(n===t)return;this.toolPanelWrappers.forEach(l=>{const c=t===l.getToolPanelId();l.setDisplayed(c)});const i=this.openedItem();n!==i&&(this.sideBarButtons.setActiveButton(t),this.raiseToolPanelVisibleEvent(t,n??void 0,e))}getToolPanelInstance(t){const e=this.toolPanelWrappers.filter(n=>n.getToolPanelId()===t)[0];if(!e){b._warnOnce(`unable to lookup Tool Panel as invalid key supplied: ${t}`);return}return e.getToolPanelInstance()}raiseToolPanelVisibleEvent(t,e,n){const i=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:i}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:i})}close(t="api"){this.openToolPanel(void 0,t)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let t=null;return this.toolPanelWrappers.forEach(e=>{e.isDisplayed()&&(t=e.getToolPanelId())}),t}onSideBarUpdated(){var n;const t=$a(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(i=>{var f,m;const{id:s}=i;if(!s)return;const l=(f=this.sideBar.toolPanels)==null?void 0:f.find(y=>y.id===s);if(!l||i.toolPanel!==l.toolPanel)return;const c=this.toolPanelWrappers.find(y=>y.getToolPanelId()===s);if(!c)return;const u=this.gos.addGridCommonParams({...i.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=c.getToolPanelInstance())==null?void 0:m.refresh(u))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(y=>y!==c),b._removeFromParent(c.getGui()),e[s]=c)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:e})}dispatchSideBarUpdated(){this.eventService.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(t=>{b._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},Lg={selector:"AG-SIDE-BAR",component:Og},Gg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return Lg}},Wa="32.3.3",Ad=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-core`,beans:[wg,Gg],dependantModules:[Re.EnterpriseCoreModule]}),zg=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:bg,setSideBarVisible:xg,setSideBarPosition:kg,openToolPanel:Sg,closeToolPanel:Eg,getOpenedToolPanel:Tg,refreshToolPanel:Bg,isToolPanelShowing:Ag,getToolPanelInstance:Ng,getSideBar:Vg},dependantModules:[Ad]}),Ha=b._defineModule({version:Wa,moduleName:b.ModuleNames.SideBarModule,dependantModules:[Ad,zg]}),Ug={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Zg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="aggFuncService",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){const t=this.aggFuncsMap;t.sum=$g,t.first=Wg,t.last=Hg,t.min=jg,t.max=qg,t.count=Kg,t.avg=Yg,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),i=b._includes(n,e),s=b._exists(this.aggFuncsMap[e]);return i&&s}getDefaultFuncLabel(t){return Ug[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(b._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return b._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),b._iterateObject(t,(e,n)=>{this.aggFuncsMap[e]=n})}getAggFunc(t){return this.init(),this.aggFuncsMap[t]}getFuncNames(t){const e=t.getColDef().allowedAggFuncs;return e??Object.keys(this.aggFuncsMap).sort()}clear(){this.aggFuncsMap={}}};function $g(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];typeof s=="number"?n===null?n=s:n+=typeof n=="number"?s:BigInt(s):typeof s=="bigint"&&(n===null?n=s:n=(typeof n=="bigint"?n:BigInt(n))+s)}return n}function Wg(t){return t.values.length>0?t.values[0]:null}function Hg(t){return t.values.length>0?b._last(t.values):null}function jg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n>s)&&(n=s)}return n}function qg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n<s)&&(n=s)}return n}function Kg(t){var s,l;const{values:e}=t;let n=0;for(let c=0;c<e.length;c++){const u=e[c];n+=u!=null&&typeof u.value=="number"?u.value:1}const i=(l=(s=t.rowNode)==null?void 0:s.aggData)==null?void 0:l[t.column.getColId()];return i&&i.value===n?i:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function Yg(t){var c,u,p;const{values:e}=t;let n=0,i=0;for(let f=0;f<e.length;f++){const m=e[f];let y=null;typeof m=="number"||typeof m=="bigint"?(y=m,i++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(y=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),i+=m.count),typeof y=="number"?n+=typeof n=="number"?y:BigInt(y):typeof y=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+y)}let s=null;i>0&&(s=n/(typeof n=="number"?i:BigInt(i)));const l=(p=(c=t.rowNode)==null?void 0:c.aggData)==null?void 0:p[(u=t.column)==null?void 0:u.getColId()];return l&&l.count===i&&l.value===s?l:{count:i,value:s,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var Jg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="aggregationStage"}wireBeans(t){this.columnModel=t.columnModel,this.aggFuncService=t.aggFuncService,this.funcColsService=t.funcColsService,this.pivotResultColsService=t.pivotResultColsService,this.valueService=t.valueService}execute(t){const e=b._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),i=t.changedPath&&t.changedPath.isActive();if(e&&n&&i)return;const s=this.createAggDetails(t);this.recursivelyCreateAggData(s)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),i=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!b._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:i,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return b._getGroupAggFiltering(this.gos)!==void 0||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(t){const e=n=>{if(!n.hasChildren()){n.aggData&&n.setAggData(null);return}if(n.level===-1&&!t.groupIncludeTotalFooter){const l=!this.columnModel.isPivotMode();if(!t.alwaysAggregateAtRootLevel&&l){n.setAggData(null);return}}this.aggregateRowNode(n,t)};t.changedPath.forEachChangedNodeDepthFirst(e,!0)}aggregateRowNode(t,e){const n=e.valueColumns.length===0,i=e.pivotColumns.length===0;let s;e.userAggFunc?s=e.userAggFunc({nodes:t.childrenAfterFilter}):n?s=null:i?s=this.aggregateRowNodeUsingValuesOnly(t,e):s=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(s),t.sibling&&t.sibling.setAggData(s)}aggregateRowNodeUsingValuesAndPivot(t){var s;const e={},n=((s=this.pivotResultColsService.getPivotResultCols())==null?void 0:s.list)??[];let i=!0;for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds!=null){i=!1;continue}const p=u.pivotKeys??[];let f;t.leafGroup?f=this.getValuesFromMappedSet(t.childrenMapped,p,u.pivotValueColumn):f=this.getValuesPivotNonLeaf(t,u.colId),e[u.colId]=this.aggregateValues(f,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,c)}if(!i)for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds==null||!u.pivotTotalColumnIds.length)continue;const p=u.pivotTotalColumnIds.map(f=>e[f]);e[u.colId]=this.aggregateValues(p,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,c)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},i=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,s=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,i,e.filteredOnly),c=t.aggData;return i.forEach((u,p)=>{n[u.getId()]=this.aggregateValues(l[p],u.getAggFunc(),u,t)}),s&&c&&s.forEach(u=>{n[u.getId()]=c[u.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let i=t;for(let s=0;s<e.length;s++){const l=e[s];i=i?i[l]:null}return i?i.map(s=>this.valueService.getValue(n,s)):[]}getValuesNormal(t,e,n){const i=[];e.forEach(()=>i.push([]));const s=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,c=l.length;for(let u=0;u<c;u++){const p=l[u];for(let f=0;f<s;f++){const m=e[f],y=this.valueService.getValue(m,p);i[f].push(y)}}return i}aggregateValues(t,e,n,i,s){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return b._errorOnce(`unrecognised aggregation function ${e}`),null;const c=l,u=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:s,rowNode:i,data:i?i.data:void 0});return c(u)}},Xg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="autoColService"}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.columnFactory=t.columnFactory}createAutoCols(t){const e=[],n=this.gos.get("treeData");let i=b._isGroupMultiAutoColumn(this.gos);return n&&i&&(b._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),i=!1),i?t.forEach((s,l)=>{e.push(this.createOneAutoCol(s,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,i)=>this.updateOneAutoCol(n,i,e))}createOneAutoCol(t,e){let n;t?n=`${b.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=b.GROUP_AUTO_COLUMN_ID;const i=this.createAutoColDef(n,t,e);i.colId=n;const s=new b.AgColumn(i,null,n,!0);return this.createBean(s),s}updateOneAutoCol(t,e,n){const i=t.getColDef(),s=typeof i.showRowGroup=="string"?i.showRowGroup:void 0,l=s!=null?this.columnModel.getColDefCol(s):void 0,c=this.createAutoColDef(t.getId(),l??void 0,e);t.setColDef(c,null,n),this.columnFactory.applyColumnState(t,c,n)}createAutoColDef(t,e,n){let i=this.createBaseColDef(e);const s=this.gos.get("autoGroupColumnDef");b._mergeDeep(i,s),i=this.columnFactory.addColumnDefaultAndTypes(i,t),this.gos.get("treeData")||b._missing(i.field)&&b._missing(i.valueGetter)&&b._missing(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter"&&(i.filter=!1),n&&n>0&&(i.headerCheckboxSelection=!1);const l=b._isColumnsSortingCoupledToGroup(this.gos),c=i.valueGetter||i.field!=null;return l&&!c&&(i.sortIndex=void 0,i.initialSort=void 0),i}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(i,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),i.showRowGroup=t.getColId()}else i.showRowGroup=!0;return i}},Qg=class extends Re.PillDragComp{constructor(t,e,n,i,s){super(e,n,s,`
10
+ </div>`,[Fg]),this.sideBarButtons=b.RefPlaceholder,this.toolPanelWrappers=[]}wireBeans(t){this.focusService=t.focusService,this.filterManager=t.filterManager,this.sideBarService=t.sideBarService}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{sideBar:t}=this.gos.get("initialState")??{};this.setSideBarDef({sideBarDef:Za(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new b.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),b._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,i=this.getGui(),s=n.getGui(),l=b._getActiveDomElement(this.gos),c=i.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),u=t.target;if(!c)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(s.contains(l)){e.focusInto(c,t.shiftKey)&&t.preventDefault();return}if(!t.shiftKey)return;let p=null;c.contains(l)?p=this.focusService.findNextFocusableElement(c,void 0,!0):e.isTargetUnderManagedComponent(c,u)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(c,u)),p||(p=s.querySelector(".ag-selected button")),p&&p!==t.target&&(t.preventDefault(),p.focus())}handleKeyDown(t){const e=b._getActiveDomElement(this.gos);if(!this.sideBarButtons.getGui().contains(e))return;const n=this.sideBarButtons.getGui(),i=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),s=i.findIndex(u=>u.contains(e));let l=null;switch(t.key){case b.KeyCode.LEFT:case b.KeyCode.UP:l=Math.max(0,s-1);break;case b.KeyCode.RIGHT:case b.KeyCode.DOWN:l=Math.min(s+1,i.length-1);break}if(l===null)return;const c=i[l].querySelector("button");c&&(c.focus(),t.preventDefault())}onToolPanelButtonClicked(t){const e=t.toolPanelId;this.openedItem()===e?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(e,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:n}){if(this.setDisplayed(!1),this.sideBar=t,this.sideBar&&this.sideBar.toolPanels){const i=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(i,e,n),!this.toolPanelWrappers.length)return;const s=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(s),this.setSideBarPosition(e?e.position:this.sideBar.position),s)if(e){const{openToolPanel:l}=e;l&&this.openToolPanel(l,"sideBarInitializing")}else this.openToolPanel(this.sideBar.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(t){t||(t="right"),this.position=t;const e=t==="left",n=e?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",e),this.addOrRemoveCssClass("ag-side-bar-right",!e),this.toolPanelWrappers.forEach(i=>{i.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,i;t[e.getToolPanelId()]=(i=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:i.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var i;for(const s of t)this.createToolPanelAndSideButton(s,(i=e==null?void 0:e.toolPanels)==null?void 0:i[s.id],n==null?void 0:n[s.id])}validateDef(t){var e;if(t.id==null)return b._warnOnce("please review all your toolPanel components, it seems like at least one of them doesn't have an id"),!1;if(t.toolPanel==="agColumnsToolPanel"&&!this.gos.assertModuleRegistered(b.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(b.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return b._warnOnce("Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled."),!1}return!0}createToolPanelAndSideButton(t,e,n){if(!this.validateDef(t))return;const i=this.sideBarButtons.addButtonComp(t);let s;n?s=n:(s=this.createBean(new Ig),s.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),s.setDisplayed(!1);const l=s.getGui();this.appendChild(l),this.toolPanelWrappers.push(s),b._setAriaControls(i.getButtonElement(),l)}refresh(){this.toolPanelWrappers.forEach(t=>t.refresh())}openToolPanel(t,e="api"){const n=this.openedItem();if(n===t)return;this.toolPanelWrappers.forEach(l=>{const c=t===l.getToolPanelId();l.setDisplayed(c)});const i=this.openedItem();n!==i&&(this.sideBarButtons.setActiveButton(t),this.raiseToolPanelVisibleEvent(t,n??void 0,e))}getToolPanelInstance(t){const e=this.toolPanelWrappers.filter(n=>n.getToolPanelId()===t)[0];if(!e){b._warnOnce(`unable to lookup Tool Panel as invalid key supplied: ${t}`);return}return e.getToolPanelInstance()}raiseToolPanelVisibleEvent(t,e,n){const i=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:i}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:i})}close(t="api"){this.openToolPanel(void 0,t)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let t=null;return this.toolPanelWrappers.forEach(e=>{e.isDisplayed()&&(t=e.getToolPanelId())}),t}onSideBarUpdated(){var n;const t=Za(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(i=>{var f,m;const{id:s}=i;if(!s)return;const l=(f=this.sideBar.toolPanels)==null?void 0:f.find(y=>y.id===s);if(!l||i.toolPanel!==l.toolPanel)return;const c=this.toolPanelWrappers.find(y=>y.getToolPanelId()===s);if(!c)return;const u=this.gos.addGridCommonParams({...i.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=c.getToolPanelInstance())==null?void 0:m.refresh(u))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(y=>y!==c),b._removeFromParent(c.getGui()),e[s]=c)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:e})}dispatchSideBarUpdated(){this.eventService.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(t=>{b._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},Og={selector:"AG-SIDE-BAR",component:Lg},Gg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return Og}},Wa="32.3.3",Nd=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-core`,beans:[wg,Gg],dependantModules:[Re.EnterpriseCoreModule]}),zg=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:bg,setSideBarVisible:xg,setSideBarPosition:kg,openToolPanel:Sg,closeToolPanel:Eg,getOpenedToolPanel:Tg,refreshToolPanel:Bg,isToolPanelShowing:Ng,getToolPanelInstance:Ag,getSideBar:Vg},dependantModules:[Nd]}),Ha=b._defineModule({version:Wa,moduleName:b.ModuleNames.SideBarModule,dependantModules:[Nd,zg]}),$g={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Ug=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="aggFuncService",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){const t=this.aggFuncsMap;t.sum=Zg,t.first=Wg,t.last=Hg,t.min=jg,t.max=qg,t.count=Kg,t.avg=Yg,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),i=b._includes(n,e),s=b._exists(this.aggFuncsMap[e]);return i&&s}getDefaultFuncLabel(t){return $g[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(b._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return b._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),b._iterateObject(t,(e,n)=>{this.aggFuncsMap[e]=n})}getAggFunc(t){return this.init(),this.aggFuncsMap[t]}getFuncNames(t){const e=t.getColDef().allowedAggFuncs;return e??Object.keys(this.aggFuncsMap).sort()}clear(){this.aggFuncsMap={}}};function Zg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];typeof s=="number"?n===null?n=s:n+=typeof n=="number"?s:BigInt(s):typeof s=="bigint"&&(n===null?n=s:n=(typeof n=="bigint"?n:BigInt(n))+s)}return n}function Wg(t){return t.values.length>0?t.values[0]:null}function Hg(t){return t.values.length>0?b._last(t.values):null}function jg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n>s)&&(n=s)}return n}function qg(t){const{values:e}=t;let n=null;for(let i=0;i<e.length;i++){const s=e[i];(typeof s=="number"||typeof s=="bigint")&&(n===null||n<s)&&(n=s)}return n}function Kg(t){var s,l;const{values:e}=t;let n=0;for(let c=0;c<e.length;c++){const u=e[c];n+=u!=null&&typeof u.value=="number"?u.value:1}const i=(l=(s=t.rowNode)==null?void 0:s.aggData)==null?void 0:l[t.column.getColId()];return i&&i.value===n?i:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function Yg(t){var c,u,p;const{values:e}=t;let n=0,i=0;for(let f=0;f<e.length;f++){const m=e[f];let y=null;typeof m=="number"||typeof m=="bigint"?(y=m,i++):m!=null&&(typeof m.value=="number"||typeof m.value=="bigint")&&typeof m.count=="number"&&(y=m.value*(typeof m.value=="number"?m.count:BigInt(m.count)),i+=m.count),typeof y=="number"?n+=typeof n=="number"?y:BigInt(y):typeof y=="bigint"&&(n=(typeof n=="bigint"?n:BigInt(n))+y)}let s=null;i>0&&(s=n/(typeof n=="number"?i:BigInt(i)));const l=(p=(c=t.rowNode)==null?void 0:c.aggData)==null?void 0:p[(u=t.column)==null?void 0:u.getColId()];return l&&l.count===i&&l.value===s?l:{count:i,value:s,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var Jg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="aggregationStage"}wireBeans(t){this.columnModel=t.columnModel,this.aggFuncService=t.aggFuncService,this.funcColsService=t.funcColsService,this.pivotResultColsService=t.pivotResultColsService,this.valueService=t.valueService}execute(t){const e=b._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),i=t.changedPath&&t.changedPath.isActive();if(e&&n&&i)return;const s=this.createAggDetails(t);this.recursivelyCreateAggData(s)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),i=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!b._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:i,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return b._getGroupAggFiltering(this.gos)!==void 0||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(t){const e=n=>{if(!n.hasChildren()){n.aggData&&n.setAggData(null);return}if(n.level===-1&&!t.groupIncludeTotalFooter){const l=!this.columnModel.isPivotMode();if(!t.alwaysAggregateAtRootLevel&&l){n.setAggData(null);return}}this.aggregateRowNode(n,t)};t.changedPath.forEachChangedNodeDepthFirst(e,!0)}aggregateRowNode(t,e){const n=e.valueColumns.length===0,i=e.pivotColumns.length===0;let s;e.userAggFunc?s=e.userAggFunc({nodes:t.childrenAfterFilter}):n?s=null:i?s=this.aggregateRowNodeUsingValuesOnly(t,e):s=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(s),t.sibling&&t.sibling.setAggData(s)}aggregateRowNodeUsingValuesAndPivot(t){var s;const e={},n=((s=this.pivotResultColsService.getPivotResultCols())==null?void 0:s.list)??[];let i=!0;for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds!=null){i=!1;continue}const p=u.pivotKeys??[];let f;t.leafGroup?f=this.getValuesFromMappedSet(t.childrenMapped,p,u.pivotValueColumn):f=this.getValuesPivotNonLeaf(t,u.colId),e[u.colId]=this.aggregateValues(f,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,c)}if(!i)for(let l=0;l<n.length;l++){const c=n[l],u=c.getColDef();if(u.pivotTotalColumnIds==null||!u.pivotTotalColumnIds.length)continue;const p=u.pivotTotalColumnIds.map(f=>e[f]);e[u.colId]=this.aggregateValues(p,u.pivotValueColumn.getAggFunc(),u.pivotValueColumn,t,c)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},i=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,s=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,i,e.filteredOnly),c=t.aggData;return i.forEach((u,p)=>{n[u.getId()]=this.aggregateValues(l[p],u.getAggFunc(),u,t)}),s&&c&&s.forEach(u=>{n[u.getId()]=c[u.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let i=t;for(let s=0;s<e.length;s++){const l=e[s];i=i?i[l]:null}return i?i.map(s=>this.valueService.getValue(n,s)):[]}getValuesNormal(t,e,n){const i=[];e.forEach(()=>i.push([]));const s=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,c=l.length;for(let u=0;u<c;u++){const p=l[u];for(let f=0;f<s;f++){const m=e[f],y=this.valueService.getValue(m,p);i[f].push(y)}}return i}aggregateValues(t,e,n,i,s){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return b._errorOnce(`unrecognised aggregation function ${e}`),null;const c=l,u=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:s,rowNode:i,data:i?i.data:void 0});return c(u)}},Xg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="autoColService"}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.columnFactory=t.columnFactory}createAutoCols(t){const e=[],n=this.gos.get("treeData");let i=b._isGroupMultiAutoColumn(this.gos);return n&&i&&(b._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),i=!1),i?t.forEach((s,l)=>{e.push(this.createOneAutoCol(s,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,i)=>this.updateOneAutoCol(n,i,e))}createOneAutoCol(t,e){let n;t?n=`${b.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=b.GROUP_AUTO_COLUMN_ID;const i=this.createAutoColDef(n,t,e);i.colId=n;const s=new b.AgColumn(i,null,n,!0);return this.createBean(s),s}updateOneAutoCol(t,e,n){const i=t.getColDef(),s=typeof i.showRowGroup=="string"?i.showRowGroup:void 0,l=s!=null?this.columnModel.getColDefCol(s):void 0,c=this.createAutoColDef(t.getId(),l??void 0,e);t.setColDef(c,null,n),this.columnFactory.applyColumnState(t,c,n)}createAutoColDef(t,e,n){let i=this.createBaseColDef(e);const s=this.gos.get("autoGroupColumnDef");b._mergeDeep(i,s),i=this.columnFactory.addColumnDefaultAndTypes(i,t),this.gos.get("treeData")||b._missing(i.field)&&b._missing(i.valueGetter)&&b._missing(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter"&&(i.filter=!1),n&&n>0&&(i.headerCheckboxSelection=!1);const l=b._isColumnsSortingCoupledToGroup(this.gos),c=i.valueGetter||i.field!=null;return l&&!c&&(i.sortIndex=void 0,i.initialSort=void 0),i}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(i,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),i.showRowGroup=t.getColId()}else i.showRowGroup=!0;return i}},Qg=class extends Re.PillDragComp{constructor(t,e,n,i,s){super(e,n,s,`
11
11
  <span role="option">
12
12
  <span data-ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>
13
13
  <span data-ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>
14
14
  <ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator>
15
15
  <span data-ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>
16
16
  </span>
17
- `,[b.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=i,this.eSortIndicator=b.RefPlaceholder,this.popupShowing=!1}wireBeans(t){super.wireBeans(t),this.popupService=t.popupService,this.sortController=t.sortController,this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.aggFuncService=t.aggFuncService}postConstruct(){this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(t,e){const n=this.gos.get("rowGroupPanelSuppressSort"),i=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!i){const s=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(s)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const s=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(s)}super.addAdditionalAriaInstructions(t,e)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const t=this.localeService.getLocaleTextFunc(),{name:e,aggFuncName:n}=this.getColumnAndAggFuncName(),i=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),s={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),c=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${i}`,e,this.isGroupingZone()&&!c&&l&&`, ${s[l]}`].filter(u=>!!u).join("")}getColumnAndAggFuncName(){const t=this.displayName;let e="";if(this.isAggregationZone()){const n=this.column.getAggFunc(),i=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(i,i)}return{name:t,aggFuncName:e}}setupSort(){const t=this.column.isSortable(),e=this.isGroupingZone();if(!(!t||!e)&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const n=i=>{i.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?i.ctrlKey||i.metaKey:i.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",i=>{i.key===b.KeyCode.ENTER&&this.isGroupingZone()&&n(i)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:t}=this;return()=>{const e={};return e[t.getId()]=t.isVisible(),{columns:[t],visibleState:e}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(t){super.onKeyDown(t),t.key===b.KeyCode.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(t.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:t,aggFuncName:e}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${e}(${t})`:t}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const t=new Re.VirtualList({cssIdentifier:"select-agg-func"}),e=this.aggFuncService.getFuncNames(this.column),n=this.getGui(),i=t.getGui();t.setModel({getRow:function(m){return e[m]},getRowCount:function(){return e.length}}),this.createBean(t);const s=b._loadTemplate('<div class="ag-select-agg-func-popup"></div>');s.style.top="0px",s.style.left="0px",s.appendChild(i),s.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(s,{focusout:m=>{!s.contains(m.relatedTarget)&&p&&p.hideFunc()}}),c=m=>{this.destroyBean(t),this.popupShowing=!1,(m==null?void 0:m.key)==="Escape"&&n.focus(),l&&l()},u=this.localeService.getLocaleTextFunc(),p=this.popupService.addPopup({modal:!0,eChild:s,closeOnEsc:!0,closedCallback:c,ariaLabel:u("ariaLabelAggregationFunction","Aggregation Function")});p&&t.setComponentCreator(this.createAggSelect.bind(this,p.hideFunc)),t.addGuiEventListener("keydown",m=>{if(m.key===b.KeyCode.ENTER||m.key===b.KeyCode.SPACE){const y=t.getLastFocusedRow();if(y==null)return;const k=t.getComponentAt(y);k&&k.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:s,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let f=e.findIndex(m=>m===this.column.getAggFunc());f===-1&&(f=0),t.focusRow(f)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},i=this.localeService.getLocaleTextFunc(),s=e.toString(),l=i(s,s);return new ey(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return b.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},ey=class extends b.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},ja=class extends Re.PillDropZonePanel{constructor(t,e){super(t),this.dropZonePurpose=e}wireBeans(t){super.wireBeans(t),this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}init(t){super.init(t),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(t){return t.columns??[]}isInterestedIn(t){return t===b.DragSourceType.HeaderCell||t===b.DragSourceType.ToolPanel}minimumAllowedNewInsertIndex(){const t=this.gos.get("groupLockGroupColumns"),e=this.funcColsService.getRowGroupColumns().length;return t===-1?e:Math.min(t,e)}showOrHideColumnOnExit(t){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!t.fromNudge}handleDragEnterEnd(t){if(this.showOrHideColumnOnExit(t)){const i=t.dragSource.getDragItem().columns;this.setColumnsVisible(i,!1,"uiColumnDragged")}}handleDragLeaveEnd(t){if(this.showOrHideColumnOnExit(t)){const n=t.dragSource.getDragItem();this.setColumnsVisible(n.columns,!0,"uiColumnDragged")}}setColumnsVisible(t,e,n){if(t){const i=t.filter(s=>!s.getColDef().lockVisible);this.columnModel.setColsVisible(i,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,i){return new Qg(t,e,n,this.dropZonePurpose,i)}},qa=class extends ja{constructor(t){super(t,"pivot")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("pivotColumnsEmptyMessage","Drag here to set column labels"),n=t("pivots","Column Labels");super.init({icon:b._createIconNoSpan("pivotPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}getTooltipParams(){const t=super.getTooltipParams();return t.location="pivotColumnsList",t}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const t=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const e=this.columnModel.isPivotActive();this.setDisplayed(t&&e);break}default:this.setDisplayed(!1);break}else this.setDisplayed(t)}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowPivot()&&(!t.isPivotActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setPivotColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.funcColsService.getPivotColumns()}},Ka=class extends ja{constructor(t){super(t,"rowGroup")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("rowGroupColumnsEmptyMessage","Drag here to set row groups"),n=t("groups","Row Groups");super.init({icon:b._createIconNoSpan("rowGroupPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}getTooltipParams(){const t=super.getTooltipParams();return t.location="rowGroupColumnsList",t}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowRowGroup()&&(!t.isRowGroupActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setRowGroupColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.funcColsService.getRowGroupColumns()}},ty=class extends b.Component{wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());const t=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:t,newColumnsLoaded:t}),this.addManagedPropertyListener("rowGroupPanelShow",t),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const t=document.createElement("div");t.classList.add("ag-column-drop-wrapper"),b._setAriaRole(t,"presentation"),this.rowGroupComp=new Ka(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new qa(!0),this.createManagedBean(this.pivotComp),t.appendChild(this.rowGroupComp.getGui()),t.appendChild(this.pivotComp.getGui());const e=this.onDropPanelVisible.bind(this);return this.addManagedListeners(this.rowGroupComp,{displayChanged:e}),this.addManagedListeners(this.pivotComp,{displayChanged:e}),this.onDropPanelVisible(),t}onDropPanelVisible(){const t=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed(),e="ag-column-drop-horizontal-half-width";this.rowGroupComp.addOrRemoveCssClass(e,t),this.pivotComp.addOrRemoveCssClass(e,t)}onRowGroupChanged(){if(!this.rowGroupComp)return;const t=this.gos.get("rowGroupPanelShow");if(t==="always")this.rowGroupComp.setDisplayed(!0);else if(t==="onlyWhenGrouping"){const e=!this.funcColsService.isRowGroupEmpty();this.rowGroupComp.setDisplayed(e)}else this.rowGroupComp.setDisplayed(!1)}onPivotPanelShow(){if(!this.pivotComp)return;const t=this.gos.get("pivotPanelShow");if(t==="always")this.pivotComp.setDisplayed(!0);else if(t==="onlyWhenPivoting"){const e=this.columnModel.isPivotActive();this.pivotComp.setDisplayed(e)}else this.pivotComp.setDisplayed(!1)}},ny={selector:"AG-GRID-HEADER-DROP-ZONES",component:ty},ry=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return ny}},iy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var f,m;const e=this.columnModel.isPivotMode(),n=((f=this.filterManager)==null?void 0:f.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),i=y=>!y.node.group,s=y=>y.node.leafGroup,l=b._getGroupAggFiltering(this.gos)||(e?s:i),{changedPath:c}=t,u=(y,k=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,k&&y.childrenAfterAggFilter.forEach(S=>u(S,k)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var k;y.childrenAfterAggFilter=((k=y.childrenAfterFilter)==null?void 0:k.filter(S=>{var R;return l({node:S})&&this.filterManager.doesRowPassAggregateFilters({rowNode:S})?(u(S,!0),!0):(R=S.childrenAfterAggFilter)==null?void 0:R.length}))||null,this.setAllChildrenCount(y),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)};c.forEachChangedNodeDepthFirst(n?p:u,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const i=e.length;n=i;for(let s=0;s<i;++s)n+=e[s].allChildrenCount??0}t.setAllChildrenCount(n===0&&t.level>=0?null:n)}setAllChildrenCountGridGrouping(t){let e=0;t.childrenAfterAggFilter.forEach(n=>{n.group?e+=n.allChildrenCount:e++}),t.setAllChildrenCount(e)}setAllChildrenCount(t){if(!t.hasChildren()){t.setAllChildrenCount(null);return}this.gos.get("treeData")?this.setAllChildrenCountTreeData(t):this.setAllChildrenCountGridGrouping(t)}},oy=class extends b.TabGuardComp{constructor(){super(`
17
+ `,[b.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=i,this.eSortIndicator=b.RefPlaceholder,this.popupShowing=!1}wireBeans(t){super.wireBeans(t),this.popupService=t.popupService,this.sortController=t.sortController,this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.aggFuncService=t.aggFuncService}postConstruct(){this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}}),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(t,e){const n=this.gos.get("rowGroupPanelSuppressSort"),i=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!i){const s=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(s)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const s=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(s)}super.addAdditionalAriaInstructions(t,e)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const t=this.localeService.getLocaleTextFunc(),{name:e,aggFuncName:n}=this.getColumnAndAggFuncName(),i=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),s={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),c=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${i}`,e,this.isGroupingZone()&&!c&&l&&`, ${s[l]}`].filter(u=>!!u).join("")}getColumnAndAggFuncName(){const t=this.displayName;let e="";if(this.isAggregationZone()){const n=this.column.getAggFunc(),i=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(i,i)}return{name:t,aggFuncName:e}}setupSort(){const t=this.column.isSortable(),e=this.isGroupingZone();if(!(!t||!e)&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const n=i=>{i.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?i.ctrlKey||i.metaKey:i.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",i=>{i.key===b.KeyCode.ENTER&&this.isGroupingZone()&&n(i)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:t}=this;return()=>{const e={};return e[t.getId()]=t.isVisible(),{columns:[t],visibleState:e}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(t){super.onKeyDown(t),t.key===b.KeyCode.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(t.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:t,aggFuncName:e}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${e}(${t})`:t}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const t=new Re.VirtualList({cssIdentifier:"select-agg-func"}),e=this.aggFuncService.getFuncNames(this.column),n=this.getGui(),i=t.getGui();t.setModel({getRow:function(m){return e[m]},getRowCount:function(){return e.length}}),this.createBean(t);const s=b._loadTemplate('<div class="ag-select-agg-func-popup"></div>');s.style.top="0px",s.style.left="0px",s.appendChild(i),s.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(s,{focusout:m=>{!s.contains(m.relatedTarget)&&p&&p.hideFunc()}}),c=m=>{this.destroyBean(t),this.popupShowing=!1,(m==null?void 0:m.key)==="Escape"&&n.focus(),l&&l()},u=this.localeService.getLocaleTextFunc(),p=this.popupService.addPopup({modal:!0,eChild:s,closeOnEsc:!0,closedCallback:c,ariaLabel:u("ariaLabelAggregationFunction","Aggregation Function")});p&&t.setComponentCreator(this.createAggSelect.bind(this,p.hideFunc)),t.addGuiEventListener("keydown",m=>{if(m.key===b.KeyCode.ENTER||m.key===b.KeyCode.SPACE){const y=t.getLastFocusedRow();if(y==null)return;const T=t.getComponentAt(y);T&&T.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:s,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let f=e.findIndex(m=>m===this.column.getAggFunc());f===-1&&(f=0),t.focusRow(f)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},i=this.localeService.getLocaleTextFunc(),s=e.toString(),l=i(s,s);return new ey(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return b.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},ey=class extends b.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},ja=class extends Re.PillDropZonePanel{constructor(t,e){super(t),this.dropZonePurpose=e}wireBeans(t){super.wireBeans(t),this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}init(t){super.init(t),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(t){return t.columns??[]}isInterestedIn(t){return t===b.DragSourceType.HeaderCell||t===b.DragSourceType.ToolPanel}minimumAllowedNewInsertIndex(){const t=this.gos.get("groupLockGroupColumns"),e=this.funcColsService.getRowGroupColumns().length;return t===-1?e:Math.min(t,e)}showOrHideColumnOnExit(t){return this.isRowGroupPanel()&&!this.gos.get("suppressRowGroupHidesColumns")&&!t.fromNudge}handleDragEnterEnd(t){if(this.showOrHideColumnOnExit(t)){const i=t.dragSource.getDragItem().columns;this.setColumnsVisible(i,!1,"uiColumnDragged")}}handleDragLeaveEnd(t){if(this.showOrHideColumnOnExit(t)){const n=t.dragSource.getDragItem();this.setColumnsVisible(n.columns,!0,"uiColumnDragged")}}setColumnsVisible(t,e,n){if(t){const i=t.filter(s=>!s.getColDef().lockVisible);this.columnModel.setColsVisible(i,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,i){return new Qg(t,e,n,this.dropZonePurpose,i)}},qa=class extends ja{constructor(t){super(t,"pivot")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("pivotColumnsEmptyMessage","Drag here to set column labels"),n=t("pivots","Column Labels");super.init({icon:b._createIconNoSpan("pivotPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}getTooltipParams(){const t=super.getTooltipParams();return t.location="pivotColumnsList",t}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const t=this.columnModel.isPivotMode();if(this.isHorizontal())switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const e=this.columnModel.isPivotActive();this.setDisplayed(t&&e);break}default:this.setDisplayed(!1);break}else this.setDisplayed(t)}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowPivot()&&(!t.isPivotActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setPivotColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.funcColsService.getPivotColumns()}},Ka=class extends ja{constructor(t){super(t,"rowGroup")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("rowGroupColumnsEmptyMessage","Drag here to set row groups"),n=t("groups","Row Groups");super.init({icon:b._createIconNoSpan("rowGroupPanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}getTooltipParams(){const t=super.getTooltipParams();return t.location="rowGroupColumnsList",t}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowRowGroup()&&(!t.isRowGroupActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setRowGroupColumns(t,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.funcColsService.getRowGroupColumns()}},ty=class extends b.Component{wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());const t=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:t,newColumnsLoaded:t}),this.addManagedPropertyListener("rowGroupPanelShow",t),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const t=document.createElement("div");t.classList.add("ag-column-drop-wrapper"),b._setAriaRole(t,"presentation"),this.rowGroupComp=new Ka(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new qa(!0),this.createManagedBean(this.pivotComp),t.appendChild(this.rowGroupComp.getGui()),t.appendChild(this.pivotComp.getGui());const e=this.onDropPanelVisible.bind(this);return this.addManagedListeners(this.rowGroupComp,{displayChanged:e}),this.addManagedListeners(this.pivotComp,{displayChanged:e}),this.onDropPanelVisible(),t}onDropPanelVisible(){const t=this.rowGroupComp.isDisplayed()&&this.pivotComp.isDisplayed(),e="ag-column-drop-horizontal-half-width";this.rowGroupComp.addOrRemoveCssClass(e,t),this.pivotComp.addOrRemoveCssClass(e,t)}onRowGroupChanged(){if(!this.rowGroupComp)return;const t=this.gos.get("rowGroupPanelShow");if(t==="always")this.rowGroupComp.setDisplayed(!0);else if(t==="onlyWhenGrouping"){const e=!this.funcColsService.isRowGroupEmpty();this.rowGroupComp.setDisplayed(e)}else this.rowGroupComp.setDisplayed(!1)}onPivotPanelShow(){if(!this.pivotComp)return;const t=this.gos.get("pivotPanelShow");if(t==="always")this.pivotComp.setDisplayed(!0);else if(t==="onlyWhenPivoting"){const e=this.columnModel.isPivotActive();this.pivotComp.setDisplayed(e)}else this.pivotComp.setDisplayed(!1)}},ny={selector:"AG-GRID-HEADER-DROP-ZONES",component:ty},ry=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return ny}},iy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var f,m;const e=this.columnModel.isPivotMode(),n=((f=this.filterManager)==null?void 0:f.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),i=y=>!y.node.group,s=y=>y.node.leafGroup,l=b._getGroupAggFiltering(this.gos)||(e?s:i),{changedPath:c}=t,u=(y,T=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,T&&y.childrenAfterAggFilter.forEach(S=>u(S,T)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var T;y.childrenAfterAggFilter=((T=y.childrenAfterFilter)==null?void 0:T.filter(S=>{var M;return l({node:S})&&this.filterManager.doesRowPassAggregateFilters({rowNode:S})?(u(S,!0),!0):(M=S.childrenAfterAggFilter)==null?void 0:M.length}))||null,this.setAllChildrenCount(y),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)};c.forEachChangedNodeDepthFirst(n?p:u,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const i=e.length;n=i;for(let s=0;s<i;++s)n+=e[s].allChildrenCount??0}t.setAllChildrenCount(n===0&&t.level>=0?null:n)}setAllChildrenCountGridGrouping(t){let e=0;t.childrenAfterAggFilter.forEach(n=>{n.group?e+=n.allChildrenCount:e++}),t.setAllChildrenCount(e)}setAllChildrenCount(t){if(!t.hasChildren()){t.setAllChildrenCount(null);return}this.gos.get("treeData")?this.setAllChildrenCountTreeData(t):this.setAllChildrenCountGridGrouping(t)}},oy=class extends b.TabGuardComp{constructor(){super(`
18
18
  <div class="ag-group-filter">
19
19
  <div data-ref="eGroupField"></div>
20
20
  <div data-ref="eUnderlyingFilter"></div>
21
21
  </div>
22
22
  `),this.eGroupField=b.RefPlaceholder,this.eUnderlyingFilter=b.RefPlaceholder}wireBeans(t){this.filterManager=t.filterManager,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService}postConstruct(){this.initialiseTabGuard({})}init(t){return this.updateParams(t).then(()=>{this.addManagedEventListeners({columnRowGroupChanged:()=>this.onColumnRowGroupChanged(),filterDestroyed:e=>this.onFilterDestroyed(e)})})}refresh(t){return this.updateParams(t),!0}updateParams(t){return this.params=t,this.validateParams(),this.updateGroups()}validateParams(){const{colDef:t}=this.params;t.field&&b._warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),t.filterValueGetter&&b._warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),t.filterParams&&b._warnOnce('Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.')}updateGroups(){const t=this.updateGroupField();return this.getUnderlyingFilters(t)}getSourceColumns(){if(this.groupColumn=this.params.column,this.gos.get("treeData"))return b._warnOnce("Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter."),[];const t=this.funcColsService.getSourceColumnsForGroupColumn(this.groupColumn);return t||(b._warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){b._clearElement(this.eGroupField),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect);const t=this.getSourceColumns(),e=t.filter(n=>n.isFilterAllowed());return e.length?(t.length===1?(this.selectedColumn=e[0],b._setDisplayed(this.eGroupField,!1)):((!this.selectedColumn||!e.some(n=>n.getId()===this.selectedColumn.getId()))&&(this.selectedColumn=e[0]),this.createGroupFieldSelectElement(e),this.eGroupField.appendChild(this.eGroupFieldSelect.getGui()),this.eGroupField.appendChild(b._loadTemplate('<div class="ag-filter-separator"></div>')),b._setDisplayed(this.eGroupField,!0)),e):(this.selectedColumn=void 0,b._setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(t){this.eGroupFieldSelect=this.createManagedBean(new b.AgSelect);const e=this.localeService.getLocaleTextFunc();this.eGroupFieldSelect.setLabel(e("groupFilterSelect","Select field:")),this.eGroupFieldSelect.setLabelAlignment("top"),this.eGroupFieldSelect.addOptions(t.map(n=>({value:n.getId(),text:this.columnNameService.getDisplayNameForColumn(n,"groupFilter",!1)??void 0}))),this.eGroupFieldSelect.setValue(this.selectedColumn.getId()),this.eGroupFieldSelect.onValueChange(n=>this.updateSelectedColumn(n)),this.eGroupFieldSelect.addCssClass("ag-group-filter-field-select-wrapper"),t.length===1&&this.eGroupFieldSelect.setDisabled(!0)}getUnderlyingFilters(t){if(!t)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,this.groupColumn.setFilterActive(!1,"columnRowGroupChanged"),b.AgPromise.resolve();const e=[],n=[];return t.forEach(i=>{const s=this.filterManager.getOrCreateFilterWrapper(i);s!=null&&s.filterPromise&&e.push(s.filterPromise.then(l=>(l&&n.push({filter:l,column:i}),i.getId()===this.selectedColumn.getId()&&(this.selectedFilter=l??void 0),l)))}),b.AgPromise.all(e).then(()=>{this.filterColumnPairs=n,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e;if(b._clearElement(this.eUnderlyingFilter),!this.selectedColumn)return b.AgPromise.resolve();const t=this.createManagedBean(new b.FilterWrapperComp(this.selectedColumn,"COLUMN_MENU"));return this.filterWrapperComp=t,t.hasFilter()?(this.eUnderlyingFilter.appendChild(t.getGui()),((e=t.getFilter())==null?void 0:e.then(()=>{var n,i;(n=t.afterGuiAttached)==null||n.call(t,this.afterGuiAttachedParams),!((i=this.afterGuiAttachedParams)!=null&&i.suppressFocus)&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()}))??b.AgPromise.resolve()):b.AgPromise.resolve()}updateSelectedColumn(t){var n;if(!t)return;(n=this.filterWrapperComp)==null||n.afterGuiDetached(),this.destroyBean(this.filterWrapperComp);const e=this.getFilterColumnPair(t);this.selectedColumn=e==null?void 0:e.column,this.selectedFilter=e==null?void 0:e.filter,this.dispatchLocalEvent({type:"selectedColumnChanged"}),this.addUnderlyingFilterElement()}isFilterActive(){var t;return!!((t=this.filterColumnPairs)!=null&&t.some(({filter:e})=>e.isFilterActive()))}doesFilterPass(){return!0}getModel(){return null}setModel(){return b.AgPromise.resolve()}afterGuiAttached(t){this.afterGuiAttachedParams=t,this.addUnderlyingFilterElement()}afterGuiDetached(){var t,e;b._clearElement(this.eUnderlyingFilter),(e=(t=this.selectedFilter)==null?void 0:t.afterGuiDetached)==null||e.call(t)}onColumnRowGroupChanged(){this.updateGroups().then(()=>{this.dispatchLocalEvent({type:"columnRowGroupChanged"})})}onFilterDestroyed({column:t,source:e}){var i;if(e==="gridDestroyed")return;const n=t.getColId();(i=this.filterColumnPairs)!=null&&i.some(({column:s})=>s.getColId()===n)&&setTimeout(()=>{this.isAlive()&&this.updateGroups()})}getFilterColumnPair(t){var e;if(t)return(e=this.filterColumnPairs)==null?void 0:e.find(({column:n})=>n.getId()===t)}getSelectedFilter(){return this.selectedFilter}getSelectedColumn(){return this.selectedColumn}isFilterAllowed(){return!!this.selectedColumn}destroy(){super.destroy()}},sy=class extends b.Component{constructor(){super(`
23
23
  <div data-ref="eFloatingFilter" class="ag-group-floating-filter ag-floating-filter-input" role="presentation"></div>
24
- `),this.eFloatingFilter=b.RefPlaceholder,this.haveAddedColumnListeners=!1}wireBeans(t){this.columnNameService=t.columnNameService,this.filterManager=t.filterManager}init(t){this.params=t;const e=this.gos.get("groupDisplayType")==="multipleColumns";return new b.AgPromise(n=>{this.params.parentFilterInstance(i=>{this.parentFilterInstance=i,e?this.setupUnderlyingFloatingFilterElement().then(()=>n()):(this.setupReadOnlyFloatingFilterElement(),n())})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{selectedColumnChanged:this.onSelectedColumnChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this)})})}onParamsUpdated(t){this.refresh(t)}refresh(t){this.params=t,this.setParams()}setParams(){var n;const t=this.columnNameService.getDisplayNameForColumn(this.params.column,"header",!0),e=this.localeService.getLocaleTextFunc();(n=this.eFloatingFilterText)==null||n.setInputAriaLabel(`${t} ${e("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new b.AgInputTextField),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,b._clearElement(this.eFloatingFilter);const t=this.parentFilterInstance.getSelectedColumn();if(t&&!t.isVisible()){const e=this.filterManager.getFloatingFilterCompDetails(t,this.params.showParentFilter);if(e)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(t,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),e.newAgStackInstance().then(n=>{var i,s;this.underlyingFloatingFilter=n,(s=this.underlyingFloatingFilter)==null||s.onParentModelChanged((i=this.parentFilterInstance.getSelectedFilter())==null?void 0:i.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),b.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,i,s;if(!t.column)return;const e=this.filterManager.getFloatingFilterCompDetails(t.column,this.params.showParentFilter);e&&((n=this.underlyingFloatingFilter)!=null&&n.refresh?this.underlyingFloatingFilter.refresh(e.params):(s=(i=this.underlyingFloatingFilter)==null?void 0:i.onParamsUpdated)==null||s.call(i,e.params))}onParentModelChanged(t,e){var n,i;this.showingUnderlyingFloatingFilter?(i=this.underlyingFloatingFilter)==null||i.onParentModelChanged((n=this.parentFilterInstance.getSelectedFilter())==null?void 0:n.getModel(),e):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const t=this.parentFilterInstance.getSelectedFilter();if(!t){this.eFloatingFilterText.setValue(""),this.eFloatingFilterText.setDisplayed(!1);return}if(this.eFloatingFilterText.setDisplayed(!0),t.getModelAsString){const e=t.getModel();this.eFloatingFilterText.setValue(e==null?"":t.getModelAsString(e))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}},Ya=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(t,e){const n=this.getSet(t);n.removeFromChildrenAfterGroup[e.id]=!0}isRemoveFromAllLeafChildren(t,e){return!!this.getSet(t).removeFromAllLeafChildren[e.id]}preventRemoveFromAllLeafChildren(t,e){const n=this.getSet(t);delete n.removeFromAllLeafChildren[e.id]}removeFromAllLeafChildren(t,e){const n=this.getSet(t);n.removeFromAllLeafChildren[e.id]=!0}getSet(t){return this.allSets[t.id]||(this.allSets[t.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(t)),this.allSets[t.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(t=>{var i;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(s=>!e.removeFromChildrenAfterGroup[s.id]),t.allLeafChildren=((i=t.allLeafChildren)==null?void 0:i.filter(s=>!e.removeFromAllLeafChildren[s.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function ay(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let i=1;i<e;i++)if(Nd(t[i-1],t[i])>0){n=!0;break}return n?(t.sort(Nd),!0):!1}function Nd(t,e){const n=t.sourceRowIndex,i=e.sourceRowIndex,s=n>=0,l=i>=0,c=s&&l,u=!s&&!l;return c?n-i:u?t.__objectId-e.__objectId:s?1:-1}var ly=class extends b.BeanStub{wireBeans(t){this.beans=t,this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.valueService=t.valueService,this.selectionService=t.selectionService,this.showRowGroupColsService=t.showRowGroupColsService}execute(t){const e=this.createGroupingDetails(t);if(e.transactions)this.handleTransaction(e);else{const n=t.afterColumnsChanged===!0;this.shotgunResetEverything(e,n)}this.positionLeafsAndGroups(t.changedPath),this.orderGroups(e)}positionLeafsAndGroups(t){t.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const n=[],i=[];let s;e.childrenAfterGroup.forEach(l=>{var c;(c=l.childrenAfterGroup)!=null&&c.length?l.key===""&&!s?s=l:i.push(l):n.push(l)}),s&&i.push(s),e.childrenAfterGroup=[...n,...i]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:i,rowNodesOrderChanged:s}=t,l=this.funcColsService.getRowGroupColumns();return{expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:l,rootNode:e,pivotMode:this.columnModel.isPivotMode(),groupedColCount:(l==null?void 0:l.length)??0,transactions:i,rowNodesOrderChanged:!!s,changedPath:n,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),keyCreators:(l==null?void 0:l.map(u=>u.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new Ya;b._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),b._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),b._existsAndNotEmpty(e.add)&&this.insertNodes(e.add,t);const i=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(i,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{ay(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;b._exists(e)&&n(t.rootNode);function n(i){b._exists(i.childrenAfterGroup)&&!i.leafGroup&&(i.childrenAfterGroup.sort((l,c)=>e({nodeA:l,nodeB:c})),i.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let i=t.parent;for(;i&&i!==e.rootNode;)n.push({key:i.key,rowGroupColumn:i.rowGroupColumn,field:i.field}),i=i.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(i=>{e.changedPath.isActive()&&e.changedPath.addParentNode(i.parent);const s=p=>p.key,l=this.getExistingPathForNode(i,e).map(s),c=this.getGroupInfo(i,e).map(s);b._areEqual(l,c)||this.moveNode(i,e,n)})}moveNode(t,e,n){if(this.removeNodesFromParents([t],e,n),this.insertOneNode(t,e,n),t.setData(t.data),e.changedPath.isActive()){const i=t.parent;e.changedPath.addParentNode(i)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(i=>e.changedPath.addParentNode(i.parent))}forEachParentGroup(t,e,n){let i=e;for(;i&&i!==t.rootNode;)n(i),i=i.parent}removeNodesFromParents(t,e,n){const i=n==null,s=n||new Ya;t.forEach(l=>{this.removeFromParent(l,s),this.forEachParentGroup(e,l.parent,c=>{s.removeFromAllLeafChildren(c,l)})}),i&&s.flush()}removeEmptyGroups(t,e){let n=!0;const i=s=>{var p;const l=this.getChildrenMappedKey(s.key,s.rowGroupColumn),c=s.parent;return(c!=null&&c.childrenMapped?!c.childrenMapped[l]:!0)?!1:!!s.group&&(((p=s.childrenAfterGroup)==null?void 0:p.length)??0)===0};for(;n;){n=!1;const s=new Ya;t.forEach(l=>{this.forEachParentGroup(e,l,c=>{i(c)&&(n=!0,this.removeFromParent(c,s),c.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(t,e){var i;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(b._removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);(i=t.parent)!=null&&i.childrenMapped&&delete t.parent.childrenMapped[n],t.setRowTop(null),t.setRowIndex(null)}addToParent(t,e){const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);e!=null&&e.childrenMapped&&e.childrenMapped[n]!==t&&(e.childrenMapped[n]=t,e.childrenAfterGroup.push(t),e.setGroup(!0))}areGroupColsEqual(t,e){return t==null||e==null||t.pivotMode!==e.pivotMode?!1:b._areEqual(t.groupedCols,e.groupedCols)&&b._areEqual(t.keyCreators,e.keyCreators)}checkAllGroupDataAfterColsChanged(t){const e=n=>{n&&n.forEach(i=>{var c;if(!i.group)return;const l={field:i.field,key:i.key,rowGroupColumn:i.rowGroupColumn,leafNode:(c=i.allLeafChildren)==null?void 0:c[0]};this.setGroupData(i,l,t),e(i.childrenAfterGroup)})};e(t.rootNode.childrenAfterGroup)}shotgunResetEverything(t,e){if(this.noChangeInGroupingColumns(t,e))return;this.selectionService.filterFromSelection(l=>l&&!l.group);const{groupedCols:n}=t,i=t.rootNode;i.leafGroup=n.length===0,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren();const s=i.sibling;s&&(s.childrenAfterGroup=i.childrenAfterGroup,s.childrenMapped=i.childrenMapped),this.insertNodes(i.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const i=this.showRowGroupColsService.getShowRowGroupCols(),s=i?i.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==s&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=s,n}insertNodes(t,e){t.forEach(n=>{this.insertOneNode(n,e),e.changedPath.isActive()&&e.changedPath.addParentNode(n.parent)})}insertOneNode(t,e,n){const i=this.getGroupInfo(t,e),s=this.findParentForNode(t,i,e,n);s.group||b._warnOnce("duplicate group keys for row data, keys should be unique",[s.data,t.data]),t.parent=s,t.level=i.length,s.childrenAfterGroup.push(t),s.updateHasChildren()}findParentForNode(t,e,n,i){let s=n.rootNode;return e.forEach((l,c)=>{s=this.getOrCreateNextNode(s,l,c,n),i!=null&&i.isRemoveFromAllLeafChildren(s,t)?i==null||i.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,i){var c;const s=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(c=t==null?void 0:t.childrenMapped)==null?void 0:c[s];return l||(l=this.createGroup(e,t,n,i),this.addToParent(l,t)),l}createGroup(t,e,n,i){const s=new b.RowNode(this.beans);return s.group=!0,s.field=t.field,s.rowGroupColumn=t.rowGroupColumn,this.setGroupData(s,t,i),s.key=t.key,s.id=this.createGroupId(s,e,n),s.level=n,s.leafGroup=n===i.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=e,this.setExpandedInitialValue(i,s),s}createGroupId(t,e,n){const i=(s,l)=>{if(!s.rowGroupColumn)return null;const c=l?i(l,l.parent):null;return`${c==null?"":c+"-"}${s.rowGroupColumn.getColId()}-${s.key}`};return b.RowNode.ID_PREFIX_ROW_GROUP+i(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(s=>{const l=t.rowGroupColumn;l!==null&&s.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[s.getColId()]=e.key:t.groupData[s.getColId()]=this.valueService.getValue(l,e.leafNode))})}getChildrenMappedKey(t,e){return e?e.getId()+"-"+t:t}setExpandedInitialValue(t,e){if(t.pivotMode&&e.leafGroup){e.expanded=!1;return}const n=t.isGroupOpenByDefault;if(n){const i={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(i)==!0;return}if(t.expandByDefault===-1){e.expanded=!0;return}e.expanded=e.level<t.expandByDefault}getGroupInfo(t,e){const n=[];return e.groupedCols.forEach(i=>{let s=this.valueService.getKeyForNode(i,t),l=s!=null&&s!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(s="",l=!0),l){const u={key:s,field:i.getColDef().field,rowGroupColumn:i,leafNode:t};n.push(u)}}),n}},cy=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,ct=Object.freeze([]),dy=ct.values(),ds=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},uy=class Hf{constructor(e,n,i){this.parent=e,this.key=n,this.level=i,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=ct,this.allLeafChildren=ct,this.childrenChanged=!1,this.leafChildrenChanged=!1,this.oldSourceRowIndex=-1}isEmptyFillerNode(){var e,n;return!((e=this.row)!=null&&e.data)&&!((n=this.children)!=null&&n.size)}hasChildren(){var e;return!!((e=this.children)!=null&&e.size)}enumChildren(){var e;return((e=this.children)==null?void 0:e.values())??dy}upsertKey(e){var i,s;typeof e!="string"&&(e=String(e));let n=(i=this.children)==null?void 0:i.get(e);return n||(n=new Hf(this,e,this.level+1),(s=this.children??(this.children=new Map))==null||s.set(n.key,n)),n}destroy(){var i;const{row:e,parent:n}=this;n!==null&&((i=n==null?void 0:n.children)==null||i.delete(this.key),e!==null&&ds(e,!0),this.parent=null)}setRow(e){const{level:n,row:i,childrenAfterGroup:s}=this;if(n<0)i!==null&&i!==e&&ds(i,!0);else{if(i===e)return!1;i!==null?(e.allLeafChildren=i.allLeafChildren??this.allLeafChildren??ct,ds(i,!1)):e.allLeafChildren=this.allLeafChildren??ct}return e.level=n,e.childrenAfterGroup=s,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:i,duplicateRows:s,childrenAfterGroup:l}=this;if(i===e){const c=this.popDuplicateRow();c?(this.row=c,c.childrenAfterGroup=l,n>=0&&(c.allLeafChildren=i.allLeafChildren??this.allLeafChildren??ct)):this.row=null}else{if(!(s!=null&&s.delete(e)))return!1;s.size===0&&(this.duplicateRows=null)}return ds(e,n<0),!0}addDuplicateRow(e){const{level:n}=this;let i=this.duplicateRows;if(i===null)i=new Set,this.duplicateRows=i;else if(i.has(e))return!1;return i.add(e),e.treeNode=this,e.level=n,n>=0&&(e.allLeafChildren=ct),e.childrenAfterGroup=ct,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let i=n;for(const s of e)s.sourceRowIndex<i.sourceRowIndex&&(i=s);return i!==n&&(i.childrenAfterGroup=this.childrenAfterGroup,i.allLeafChildren=n.allLeafChildren??this.allLeafChildren??ct,n.childrenAfterGroup=ct,n.allLeafChildren=ct,e.delete(i),e.add(n),this.row=i),i}popDuplicateRow(){let e=null;const n=this.duplicateRows;return n!==null&&(e=n.values().next().value,e!==null&&n.delete(e)&&n.size===0&&(this.duplicateRows=null)),e}dequeueInvalidated(){const e=this.invalidatedHead;return e!==null&&(this.invalidatedHead=e.invalidatedNext??null,e.invalidatedNext=void 0),e}invalidate(){let e=this,n=this.parent;for(;n!==null&&e.invalidatedNext===void 0;)e.invalidatedNext=n.invalidatedHead,n.invalidatedHead=e,e=n,n=e.parent}invalidateOrder(){var n,i;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((i=e.row)!=null&&i.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,i;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((i=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:i.oldSourceRowIndex)??this.oldSourceRowIndex}updateChildrenAfterGroup(){var u;this.childrenChanged=!1;const e=((u=this.children)==null?void 0:u.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=ct,this.row.childrenAfterGroup=ct,!0);let n=!1,i=this.childrenAfterGroup;i===ct?(i=new Array(e),this.childrenAfterGroup=i,this.row.childrenAfterGroup=i,n=!0):i.length!==e&&(i.length=e,n=!0);let s=0,l=-1,c=!1;for(const p of this.enumChildren()){const f=p.getRowPosition();f<l&&(c=!0),l=f,p.oldSourceRowIndex=f;const m=p.row;i[s]!==m&&(i[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(i),n||c}reorderChildrenList(e){const n=e.length,i=this.children;e.sort(cy),i.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;i.set(l.key,l)}}updateAllLeafChildren(){var c,u;const{parent:e,row:n,childrenAfterGroup:i}=this;this.leafChildrenChanged=!1;let s=!1;const l=i.length;if(l===0)s=((c=n.allLeafChildren)==null?void 0:c.length)!==0,n.allLeafChildren=ct,this.allLeafChildren=ct;else if(l===1&&((u=i[0].allLeafChildren)!=null&&u.length))n.allLeafChildren=i[0].allLeafChildren,this.allLeafChildren=null,s=!0;else{let p=this.allLeafChildren;(p===ct||p===null)&&(p=[],this.allLeafChildren=p);const f=p.length;let m=0;for(let y=0;y<l;++y){const k=i[y],S=k.allLeafChildren,M=S.length;if(M)for(let T=0;T<M;++T){const R=S[T];(m>=f||p[m]!==R)&&(p[m]=R,s=!0),++m}else(m>=f||p[m]!==k)&&k&&(p[m]=k,s=!0),++m}f!==m&&(p.length=m,s=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,s=!0)}s&&e&&(e.leafChildrenChanged=!0)}},Vd=t=>(t.treeNodeFlags&1)!==0,Pd=t=>(t.treeNodeFlags&2)!==0,Dd=t=>(t.treeNodeFlags&4)!==0,py=t=>(t.treeNodeFlags&8)!==0,Fd=t=>(t.treeNodeFlags&16)!==0,Rd=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},hy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},fy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},or=t=>{t.treeNodeFlags|=16},Md=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},ro=t=>{t.treeNodeFlags=0},my=class extends b.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new uy(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),ro(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:i}=t,s=t.rowNode,l=this.gos,c={changedPath:i,expandByDefault:l.get("groupDefaultExpanded"),suppressGroupMaintainValueType:l.get("suppressGroupMaintainValueType"),getDataPath:l.get("getDataPath"),isGroupOpenByDefault:l.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:l.getCallback("initialGroupOrderComparator")};this.root.setRow(s),s.leafGroup=!1;const p=s.sibling;p&&(p.childrenAfterGroup=s.childrenAfterGroup,p.childrenMapped=s.childrenMapped),e?this.handleTransaction(c,e,n):this.handleRowData(c,s,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var s,l,c;const i=this.root;if(n||this.oldGroupDisplayColIds===void 0){const u=((l=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==u&&this.checkAllGroupDataAfterColsChanged((c=i.row)==null?void 0:c.childrenAfterGroup);return}this.oldGroupDisplayColIds=u}this.clearTree(i),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:i,update:s,add:l}of e)this.removeRows(i),this.addOrUpdateRows(t,s,!0),this.addOrUpdateRows(t,l,!1);n&&this.handleRowNodesOrderChanged(),this.commitTree(t)}handleRowNodesOrderChanged(){var e;const t=(e=this.root.row)==null?void 0:e.allLeafChildren;if(t)for(let n=0,i=t.length;n<i;++n){const s=t[n].treeNode;s&&s.oldSourceRowIndex!==n&&s.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,i=(t==null?void 0:t.length)??0;n<i;++n){const s=t[n];this.setGroupData(s,((e=s.treeNode)==null?void 0:e.key)??s.key),this.checkAllGroupDataAfterColsChanged(s.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let i=0,s=(e==null?void 0:e.length)??0;i<s;++i){const l=e[i],c=this.upsertPath(this.getDataPath(t,l));c&&this.addOrUpdateRow(c,l,n)}}removeRows(t){for(let e=0,n=(t==null?void 0:t.length)??0;e<n;++e){const i=t[e],s=i.treeNode;s!==null&&this.removeRow(s,i)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||ct;return n.length||b._warnOnce("getDataPath() should not return an empty path",[e]),n}upsertPath(t){let e=this.root;const n=t.length-1;for(let i=0;i<=n;++i){const s=e.upsertKey(t[i]);if(i>=n)return s.invalidate(),s;e=s}return null}addOrUpdateRow(t,e,n){var c;const{level:i,row:s}=t;if(i<0)return;let l=!1;if(s!==e){const u=e.treeNode;u!==null&&u!==t&&(u.removeRow(e),u.invalidate()),s===null?(t.setRow(e),l=!0):s.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(s,!0),l=!0)}n&&!Dd(e)&&(hy(e),l=!0),l&&t.invalidate(),(c=this.rowsPendingDestruction)==null||c.delete(e)}removeRow(t,e){const{parent:n,level:i}=t;if(i<0)return;let s=!1;t.removeRow(e)&&(s=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),s&&t.invalidate()}commitTree(t){var i;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&or(n),n.updateHasChildren(),Fd(n)&&(i=t.changedPath)!=null&&i.isActive()&&t.changedPath.addParentNode(n),Md(n),this.commitDestroyedRows()}commitInvalidatedChildren(t,e){for(;;){const n=e.dequeueInvalidated();if(n===null)break;n.parent===e&&this.commitChild(t,e,n)}}commitChild(t,e,n){if(n.isEmptyFillerNode()){this.clearTree(n);return}this.commitNodePreOrder(e,n),this.commitInvalidatedChildren(t,n),this.commitNodePostOrder(t,e,n)}commitNodePreOrder(t,e){let n=e.row;if(n===null?(n=this.createFillerRow(e),e.setRow(n)):(n=e.sortFirstDuplicateRow(),n.allChildrenCount===void 0&&(n.allChildrenCount=null)),n.parent=t.row,e.oldRow!==n)for(const s of e.enumChildren()){const l=s.row;l!==null&&(l.parent=n)}const i=e.key;n.key!==i?(n.key=i,fy(n),this.setGroupData(n,i)):n.groupData||this.setGroupData(n,i)}commitNodePostOrder(t,e,n){var f,m,y;const i=n.row,s=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&or(i),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const c=!!((f=i.childrenAfterGroup)!=null&&f.length),u=c||!i.data,p=i.group;p!==u?(or(i),i.setGroup(u),!u&&!i.expanded&&Rd(i,!1)):i.hasChildren()!==c&&(or(i),i.updateHasChildren()),i.group&&!Pd(i)&&(s!==i&&s!==null&&s.group&&Pd(s)&&!t.isGroupOpenByDefault?i.expanded=s.expanded:i.expanded=this.getExpandedInitialValue(t,i),Rd(i,!0)),Dd(i)&&(or(e.row),py(i)&&i.setData(i.data)),s!==i&&(n.oldRow=i,s!==null&&(p||n.hasChildren())&&or(i),e.childrenChanged=!0,or(e.row)),Fd(i)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(i):Vd(i)||(i.childrenAfterFilter||(i.childrenAfterFilter=i.childrenAfterGroup.slice()),i.childrenAfterAggFilter||(i.childrenAfterAggFilter=i.childrenAfterFilter.slice()),i.childrenAfterSort||(i.childrenAfterSort=i.childrenAfterAggFilter.slice())),Md(i),(y=n.duplicateRows)!=null&&y.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,b._warnOnce("duplicate group keys for row data, keys should be unique",[i.id,i.data,...Array.from(n.duplicateRows).map(k=>k.data)]))}createFillerRow(t){const e=new b.RowNode(this.beans);e.key=t.key,e.group=!0,e.field=null,e.leafGroup=!1,e.rowGroupIndex=null,e.allChildrenCount=null;let n=t.level+"-"+t.key,i=t.parent;for(;i!==null;){const s=i.parent;if(s===null)break;n=`${i.level}-${i.key}-${n}`,i=s}return e.id=b.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var s;const n={};t.groupData=n;const i=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols();if(i)for(const l of i)n[l.getColId()]=e}getExpandedInitialValue(t,e){const n=t.isGroupOpenByDefault;return n?n({rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn})==!0:t.expandByDefault===-1||e.level<t.expandByDefault}clearTree(t){const{parent:e,oldRow:n,row:i,level:s}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&or(e.row)),i!==null&&s>=0){let l=t.row;for(;l!==null&&t.removeRow(l);)this.destroyRow(l,!l.data),l=t.row}for(const l of t.enumChildren())this.clearTree(l);t.destroy()}destroyTree(t){const{row:e,level:n,duplicateRows:i}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):ro(e)),i)for(const s of i)n>=0&&!s.data?this.destroyRow(s,!0):ro(s);for(const s of t.enumChildren())this.destroyTree(s);t.destroy()}destroyRow(t,e){if(!Vd(t)){ro(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}ro(t),t.setRowIndex(null),t.setRowTop(null),!t.data&&t.isSelected()&&t.setSelectedParams({newValue:!1,source:"rowGroupChanged"})}commitDestroyedRows(){const{rowsPendingDestruction:t}=this;if(t!==null){this.rowsPendingDestruction=null;for(const e of t)this.destroyRow(e,!0)}}},gy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?my:ly;let n=this.strategy;(n==null?void 0:n.constructor)!==e&&(this.destroyBean(n),n=this.createManagedBean(new e),this.strategy=n),n.execute(t),this.selectableService.updateSelectableAfterGrouping()}destroy(){this.destroyBean(this.strategy),this.strategy=void 0,super.destroy()}},Id="PivotRowTotal_",yy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="pivotColDefService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.columnNameService=t.columnNameService}postConstruct(){const t=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=t(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=t()});const e=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=e(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=e()})}createPivotColumnDefs(t){const e=this.createPivotColumnsFromUniqueValues(t);function n(l,c=[]){return l.forEach(u=>{u.children!==void 0?n(u.children,c):c.push(u)}),c}const i=n(e);this.addRowGroupTotals(e,i),this.addExpandablePivotGroups(e,i),this.addPivotTotalsToGroups(e,i);const s=i.map(l=>b._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:s}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,i,s){const l=this.funcColsService.getValueColumns();if(t>=i)return this.buildMeasureCols(n);const c=s[t].getColDef(),u=this.headerNameComparator.bind(this,c.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===i-1){const f=[];return b._iterateObject(e,m=>{const y=[...n,m],k=this.createColDef(l[0],m,y);k.columnGroupShow="open",f.push(k)}),f.sort(u),f}const p=[];return b._iterateObject(e,(f,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,k=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,k,i,s),headerName:f,pivotKeys:k,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(k)})}),p.sort(u),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const i=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,i,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const i=(s,l,c)=>{if("children"in s){const f=new Map;s.children.forEach(y=>{i(y,l,f)});const m=!s.children.some(y=>y.children);this.funcColsService.getValueColumns().forEach(y=>{const k=this.columnNameService.getDisplayNameForColumn(y,"header"),S=this.createColDef(y,k,s.pivotKeys);S.pivotTotalColumnIds=f.get(y.getColId()),S.columnGroupShow=n?"open":"closed",S.aggFunc=y.getAggFunc(),m||(s.children.push(S),l.push(S))}),this.merge(c,f);return}if(!s.pivotValueColumn)return;const u=s.pivotValueColumn.getColId();c.has(u)?c.get(u).push(s.colId):c.set(u,[s.colId])};t.forEach(s=>{i(s,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",i=this.funcColsService.getValueColumns(),s=i.map(c=>c.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=i[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,i){const s=t;if(!s.children){const c=t;return c.colId?[c.colId]:null}let l=[];if(s.children.forEach(c=>{const u=this.recursivelyAddPivotTotal(c,e,n,i);u&&(l=l.concat(u))}),s.children.length>1){const u=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,u,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const f=t.children;i?f.push(p):f.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",s=this.funcColsService.getValueColumns().slice();n||s.reverse();const l=s.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let c=0;c<s.length;c++){const u=s[c],p=this.columnNameService.getDisplayNameForColumn(u,"header"),f=this.createColDef(u,p,[]),m=[];for(let k=0;k<e.length;k++){const S=e[k];S.pivotValueColumn===u&&m.push(S.colId)}f.pivotTotalColumnIds=m,f.colId=Id+f.colId;const y=l?{children:[f],pivotKeys:[],groupId:`${Id}_pivotGroup_${u.getColId()}`}:f;e.push(f),n?t.push(y):t.unshift(y)}}createColDef(t,e,n,i=!1){const s={};if(t){const l=t.getColDef();Object.assign(s,l),s.hide=!1}return s.headerName=e,s.colId=this.generateColumnId(n||[],t&&!i?t.getColId():""),s.field=s.colId,s.valueGetter=l=>{var c;return(c=l.data)==null?void 0:c[l.colDef.field]},s.pivotKeys=n,s.pivotValueColumn=t,s.filter===!0&&(s.filter="agNumberColumnFilter"),s}sameAggFuncs(t){if(t.length==1)return!0;for(let e=1;e<t.length;e++)if(t[e]!==t[0])return!1;return!0}headerNameComparator(t,e,n){return t?t(e.headerName,n.headerName):e.headerName&&!n.headerName?1:!e.headerName&&n.headerName?-1:!e.headerName||!n.headerName?0:e.headerName<n.headerName?-1:e.headerName>n.headerName?1:0}merge(t,e){e.forEach((n,i)=>{const l=[...t.has(i)?t.get(i):[],...n];t.set(i,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(i=>i.getColId()).join("-")}_${t.join("-")}_${e}`}createColDefsFromFields(t){const e={};for(let s=0;s<t.length;s++){const c=t[s].split(this.fieldSeparator);let u=e;for(let p=0;p<c.length;p++){const f=c[p];u[f]==null&&(u[f]={}),u=u[f]}}const n=(s,l,c,u)=>{const p=[];for(const y in c){const k=c[y],S=n(`${s}${this.fieldSeparator}${y}`,y,k,u+1);p.push(S)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const S=this.columnNameService.getDisplayNameForColumn(y,"header")??l,M=this.createColDef(y,S,void 0,!1);return M.colId=s,M.aggFunc=y.getAggFunc(),M.valueGetter=T=>{var R;return(R=T.data)==null?void 0:R[s]},M}return{colId:s,headerName:l,valueGetter:S=>{var M;return(M=S.data)==null?void 0:M[s]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||u<this.pivotDefaultExpanded,groupId:s,headerName:l,children:p}},i=[];for(const s in e){const l=e[s],c=n(s,s,l,0);i.push(c)}return i}},Od="Exceeded maximum allowed pivot column count.",vy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="pivotStage",this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(t){this.valueService=t.valueService,this.columnModel=t.columnModel,this.pivotResultColsService=t.pivotResultColsService,this.funcColsService=t.funcColsService,this.pivotColDefService=t.pivotColDefService}execute(t){const e=t.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(e):this.executePivotOff(e)}executePivotOff(t){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.pivotResultColsService.isPivotResultColsPresent()&&(this.pivotResultColsService.setPivotResultCols(null,"rowModelUpdated"),t&&t.setInactive())}executePivotOn(t){const e=this.funcColsService.getValueColumns().length??1,n=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=n===-1?-1:n/e;let i;try{i=this.bucketUpRowNodes(t)}catch(C){if(C.message===Od){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0;return}throw C}const s=this.setUniqueValues(i),l=this.funcColsService.getValueColumns(),c=l.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),u=l.map(C=>C.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,f=this.aggregationFuncsHashLastTime!==u;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=u;const m=this.funcColsService.getRowGroupColumns().map(C=>C.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const k=this.gos.get("pivotRowTotals"),S=this.gos.get("pivotColumnGroupTotals"),M=this.gos.get("suppressExpandablePivotGroups"),T=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),R=k!==this.pivotRowTotalsLastTime||S!==this.pivotColumnGroupTotalsLastTime||M!==this.suppressExpandablePivotGroupsLastTime||T!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=k,this.pivotColumnGroupTotalsLastTime=S,this.suppressExpandablePivotGroupsLastTime=M,this.removePivotHeaderRowWhenSingleValueColumnLastTime=T,this.lastTimeFailed||s||p||y||f||R){const{pivotColumnGroupDefs:C,pivotColumnDefs:G}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=G,this.pivotResultColsService.setPivotResultCols(C,"rowModelUpdated"),t&&t.setInactive()}this.lastTimeFailed=!1}setUniqueValues(t){const e=JSON.stringify(t),n=JSON.stringify(this.uniqueValues);return e!==n?(this.uniqueValues=t,!0):!1}bucketUpRowNodes(t){this.currentUniqueCount=0;const e={};t.forEachChangedNodeDepthFirst(i=>{i.leafGroup&&(i.childrenMapped=null)});const n=i=>{var s;i.leafGroup?this.bucketRowNode(i,e):(s=i.childrenAfterFilter)==null||s.forEach(n)};return t.executeFromRootNode(n),e}bucketRowNode(t,e){const n=this.funcColsService.getPivotColumns();n.length===0?t.childrenMapped=null:t.childrenMapped=this.bucketChildren(t.childrenAfterFilter,n,0,e),t.sibling&&(t.sibling.childrenMapped=t.childrenMapped)}bucketChildren(t,e,n,i){const s={},l=e[n];if(t.forEach(c=>{let u=this.valueService.getKeyForNode(l,c);if(b._missing(u)&&(u=""),!i[u]){this.currentUniqueCount+=1,i[u]={};const p=this.maxUniqueValues!==-1,f=this.currentUniqueCount>this.maxUniqueValues;if(p&&f)throw Error(Od)}s[u]||(s[u]=[]),s[u].push(c)}),n===e.length-1)return s;{const c={};return b._iterateObject(s,(u,p)=>{c[u]=this.bucketChildren(p,e,n+1,i[u])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function _y(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function Cy(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function wy(t){t.aggFuncService&&t.aggFuncService.clear()}function by(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function xy(t){return t.columnModel.isPivotMode()}function ky(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function Sy(t,e){t.funcColsService.setValueColumns(e,"api")}function Ey(t){return t.funcColsService.getValueColumns()}function Ty(t,e){t.funcColsService.removeValueColumns([e],"api")}function By(t,e){t.funcColsService.removeValueColumns(e,"api")}function Ay(t,e){t.funcColsService.addValueColumns([e],"api")}function Ny(t,e){t.funcColsService.addValueColumns(e,"api")}function Vy(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function Py(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function Dy(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function Fy(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function Ry(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function My(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function Iy(t){return t.funcColsService.getRowGroupColumns()}function Oy(t,e){t.funcColsService.setPivotColumns(e,"api")}function Ly(t,e){t.funcColsService.removePivotColumns([e],"api")}function Gy(t,e){t.funcColsService.removePivotColumns(e,"api")}function zy(t,e){t.funcColsService.addPivotColumns([e],"api")}function Uy(t,e){t.funcColsService.addPivotColumns(e,"api")}function Zy(t){return t.funcColsService.getPivotColumns()}function $y(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function Wy(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var Hy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="showRowGroupColsService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}refresh(){this.showRowGroupCols=[],this.showRowGroupColsMap={},this.columnModel.getCols().forEach(t=>{const n=t.getColDef().showRowGroup,i=typeof n=="string";!i&&!(n===!0)||(this.showRowGroupCols.push(t),i?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(c=>{this.showRowGroupColsMap[c.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},io="32.3.3",Ja=b._defineModule({version:io,moduleName:`${b.ModuleNames.RowGroupingModule}-core`,beans:[Jg,iy,gy,yy,vy,Zg,Xg,Hy,ry],userComponents:[{name:"agGroupRowRenderer",classImp:Re.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Re.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Re.GroupCellRendererCtrl}],dependantModules:[Re.EnterpriseCoreModule]}),jy=b._defineModule({version:io,moduleName:`${b.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:_y,addAggFuncs:Cy,clearAggFuncs:wy,setColumnAggFunc:by,isPivotMode:xy,getPivotResultColumn:ky,setValueColumns:Sy,getValueColumns:Ey,removeValueColumn:Ty,removeValueColumns:By,addValueColumn:Ay,addValueColumns:Ny,setRowGroupColumns:Vy,removeRowGroupColumn:Py,removeRowGroupColumns:Dy,addRowGroupColumn:Fy,addRowGroupColumns:Ry,getRowGroupColumns:Iy,moveRowGroupColumn:My,setPivotColumns:Oy,removePivotColumn:Ly,removePivotColumns:Gy,addPivotColumn:zy,addPivotColumns:Uy,getPivotColumns:Zy,setPivotResultColumns:$y,getPivotResultColumns:Wy},dependantModules:[Ja]}),Ld=b._defineModule({version:io,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:oy}],dependantModules:[Ja,b._ColumnFilterModule]}),qy=b._defineModule({version:io,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:sy}],dependantModules:[Ld,b._FloatingFilterModule]}),Ky=b._defineModule({version:io,moduleName:b.ModuleNames.RowGroupingModule,dependantModules:[Ja,jy,Ld,qy]}),Gd=class extends ja{constructor(t){super(t,"aggregation")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("valueColumnsEmptyMessage","Drag here to aggregate"),n=t("values","Values");super.init({icon:b._createIconNoSpan("valuePanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const t=super.getTooltipParams();return t.location="valueColumnsList",t}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowValue()&&(!t.isValueActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setValueColumns(t,"toolPanelUi")}getExistingItems(){return this.funcColsService.getValueColumns()}},zd=300,Yy=class extends b.Component{constructor(){super(`<div class="ag-column-select-header" role="presentation">
24
+ `),this.eFloatingFilter=b.RefPlaceholder,this.haveAddedColumnListeners=!1}wireBeans(t){this.columnNameService=t.columnNameService,this.filterManager=t.filterManager}init(t){this.params=t;const e=this.gos.get("groupDisplayType")==="multipleColumns";return new b.AgPromise(n=>{this.params.parentFilterInstance(i=>{this.parentFilterInstance=i,e?this.setupUnderlyingFloatingFilterElement().then(()=>n()):(this.setupReadOnlyFloatingFilterElement(),n())})}).then(()=>{this.addManagedListeners(this.parentFilterInstance,{selectedColumnChanged:this.onSelectedColumnChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this)})})}onParamsUpdated(t){this.refresh(t)}refresh(t){this.params=t,this.setParams()}setParams(){var n;const t=this.columnNameService.getDisplayNameForColumn(this.params.column,"header",!0),e=this.localeService.getLocaleTextFunc();(n=this.eFloatingFilterText)==null||n.setInputAriaLabel(`${t} ${e("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new b.AgInputTextField),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,b._clearElement(this.eFloatingFilter);const t=this.parentFilterInstance.getSelectedColumn();if(t&&!t.isVisible()){const e=this.filterManager.getFloatingFilterCompDetails(t,this.params.showParentFilter);if(e)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(t,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),e.newAgStackInstance().then(n=>{var i,s;this.underlyingFloatingFilter=n,(s=this.underlyingFloatingFilter)==null||s.onParentModelChanged((i=this.parentFilterInstance.getSelectedFilter())==null?void 0:i.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),b.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,i,s;if(!t.column)return;const e=this.filterManager.getFloatingFilterCompDetails(t.column,this.params.showParentFilter);e&&((n=this.underlyingFloatingFilter)!=null&&n.refresh?this.underlyingFloatingFilter.refresh(e.params):(s=(i=this.underlyingFloatingFilter)==null?void 0:i.onParamsUpdated)==null||s.call(i,e.params))}onParentModelChanged(t,e){var n,i;this.showingUnderlyingFloatingFilter?(i=this.underlyingFloatingFilter)==null||i.onParentModelChanged((n=this.parentFilterInstance.getSelectedFilter())==null?void 0:n.getModel(),e):this.updateDisplayedValue()}updateDisplayedValue(){if(!this.parentFilterInstance||!this.eFloatingFilterText)return;const t=this.parentFilterInstance.getSelectedFilter();if(!t){this.eFloatingFilterText.setValue(""),this.eFloatingFilterText.setDisplayed(!1);return}if(this.eFloatingFilterText.setDisplayed(!0),t.getModelAsString){const e=t.getModel();this.eFloatingFilterText.setValue(e==null?"":t.getModelAsString(e))}else this.eFloatingFilterText.setValue("")}onSelectedColumnChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}onColumnRowGroupChanged(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}destroy(){super.destroy()}},Ya=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(t,e){const n=this.getSet(t);n.removeFromChildrenAfterGroup[e.id]=!0}isRemoveFromAllLeafChildren(t,e){return!!this.getSet(t).removeFromAllLeafChildren[e.id]}preventRemoveFromAllLeafChildren(t,e){const n=this.getSet(t);delete n.removeFromAllLeafChildren[e.id]}removeFromAllLeafChildren(t,e){const n=this.getSet(t);n.removeFromAllLeafChildren[e.id]=!0}getSet(t){return this.allSets[t.id]||(this.allSets[t.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(t)),this.allSets[t.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(t=>{var i;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(s=>!e.removeFromChildrenAfterGroup[s.id]),t.allLeafChildren=((i=t.allLeafChildren)==null?void 0:i.filter(s=>!e.removeFromAllLeafChildren[s.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function ay(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let i=1;i<e;i++)if(Ad(t[i-1],t[i])>0){n=!0;break}return n?(t.sort(Ad),!0):!1}function Ad(t,e){const n=t.sourceRowIndex,i=e.sourceRowIndex,s=n>=0,l=i>=0,c=s&&l,u=!s&&!l;return c?n-i:u?t.__objectId-e.__objectId:s?1:-1}var ly=class extends b.BeanStub{wireBeans(t){this.beans=t,this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.valueService=t.valueService,this.selectionService=t.selectionService,this.showRowGroupColsService=t.showRowGroupColsService}execute(t){const e=this.createGroupingDetails(t);if(e.transactions)this.handleTransaction(e);else{const n=t.afterColumnsChanged===!0;this.shotgunResetEverything(e,n)}this.positionLeafsAndGroups(t.changedPath),this.orderGroups(e)}positionLeafsAndGroups(t){t.forEachChangedNodeDepthFirst(e=>{if(e.childrenAfterGroup){const n=[],i=[];let s;e.childrenAfterGroup.forEach(l=>{var c;(c=l.childrenAfterGroup)!=null&&c.length?l.key===""&&!s?s=l:i.push(l):n.push(l)}),s&&i.push(s),e.childrenAfterGroup=[...n,...i]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:i,rowNodesOrderChanged:s}=t,l=this.funcColsService.getRowGroupColumns();return{expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:l,rootNode:e,pivotMode:this.columnModel.isPivotMode(),groupedColCount:(l==null?void 0:l.length)??0,transactions:i,rowNodesOrderChanged:!!s,changedPath:n,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),suppressGroupMaintainValueType:this.gos.get("suppressGroupMaintainValueType"),keyCreators:(l==null?void 0:l.map(u=>u.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new Ya;b._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),b._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),b._existsAndNotEmpty(e.add)&&this.insertNodes(e.add,t);const i=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(i,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{ay(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;b._exists(e)&&n(t.rootNode);function n(i){b._exists(i.childrenAfterGroup)&&!i.leafGroup&&(i.childrenAfterGroup.sort((l,c)=>e({nodeA:l,nodeB:c})),i.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let i=t.parent;for(;i&&i!==e.rootNode;)n.push({key:i.key,rowGroupColumn:i.rowGroupColumn,field:i.field}),i=i.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(i=>{e.changedPath.isActive()&&e.changedPath.addParentNode(i.parent);const s=p=>p.key,l=this.getExistingPathForNode(i,e).map(s),c=this.getGroupInfo(i,e).map(s);b._areEqual(l,c)||this.moveNode(i,e,n)})}moveNode(t,e,n){if(this.removeNodesFromParents([t],e,n),this.insertOneNode(t,e,n),t.setData(t.data),e.changedPath.isActive()){const i=t.parent;e.changedPath.addParentNode(i)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(i=>e.changedPath.addParentNode(i.parent))}forEachParentGroup(t,e,n){let i=e;for(;i&&i!==t.rootNode;)n(i),i=i.parent}removeNodesFromParents(t,e,n){const i=n==null,s=n||new Ya;t.forEach(l=>{this.removeFromParent(l,s),this.forEachParentGroup(e,l.parent,c=>{s.removeFromAllLeafChildren(c,l)})}),i&&s.flush()}removeEmptyGroups(t,e){let n=!0;const i=s=>{var p;const l=this.getChildrenMappedKey(s.key,s.rowGroupColumn),c=s.parent;return(c!=null&&c.childrenMapped?!c.childrenMapped[l]:!0)?!1:!!s.group&&(((p=s.childrenAfterGroup)==null?void 0:p.length)??0)===0};for(;n;){n=!1;const s=new Ya;t.forEach(l=>{this.forEachParentGroup(e,l,c=>{i(c)&&(n=!0,this.removeFromParent(c,s),c.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(t,e){var i;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(b._removeFromArray(t.parent.childrenAfterGroup,t),t.parent.updateHasChildren()));const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);(i=t.parent)!=null&&i.childrenMapped&&delete t.parent.childrenMapped[n],t.setRowTop(null),t.setRowIndex(null)}addToParent(t,e){const n=this.getChildrenMappedKey(t.key,t.rowGroupColumn);e!=null&&e.childrenMapped&&e.childrenMapped[n]!==t&&(e.childrenMapped[n]=t,e.childrenAfterGroup.push(t),e.setGroup(!0))}areGroupColsEqual(t,e){return t==null||e==null||t.pivotMode!==e.pivotMode?!1:b._areEqual(t.groupedCols,e.groupedCols)&&b._areEqual(t.keyCreators,e.keyCreators)}checkAllGroupDataAfterColsChanged(t){const e=n=>{n&&n.forEach(i=>{var c;if(!i.group)return;const l={field:i.field,key:i.key,rowGroupColumn:i.rowGroupColumn,leafNode:(c=i.allLeafChildren)==null?void 0:c[0]};this.setGroupData(i,l,t),e(i.childrenAfterGroup)})};e(t.rootNode.childrenAfterGroup)}shotgunResetEverything(t,e){if(this.noChangeInGroupingColumns(t,e))return;this.selectionService.filterFromSelection(l=>l&&!l.group);const{groupedCols:n}=t,i=t.rootNode;i.leafGroup=n.length===0,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren();const s=i.sibling;s&&(s.childrenAfterGroup=i.childrenAfterGroup,s.childrenMapped=i.childrenMapped),this.insertNodes(i.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const i=this.showRowGroupColsService.getShowRowGroupCols(),s=i?i.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==s&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=s,n}insertNodes(t,e){t.forEach(n=>{this.insertOneNode(n,e),e.changedPath.isActive()&&e.changedPath.addParentNode(n.parent)})}insertOneNode(t,e,n){const i=this.getGroupInfo(t,e),s=this.findParentForNode(t,i,e,n);s.group||b._warnOnce("duplicate group keys for row data, keys should be unique",[s.data,t.data]),t.parent=s,t.level=i.length,s.childrenAfterGroup.push(t),s.updateHasChildren()}findParentForNode(t,e,n,i){let s=n.rootNode;return e.forEach((l,c)=>{s=this.getOrCreateNextNode(s,l,c,n),i!=null&&i.isRemoveFromAllLeafChildren(s,t)?i==null||i.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,i){var c;const s=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(c=t==null?void 0:t.childrenMapped)==null?void 0:c[s];return l||(l=this.createGroup(e,t,n,i),this.addToParent(l,t)),l}createGroup(t,e,n,i){const s=new b.RowNode(this.beans);return s.group=!0,s.field=t.field,s.rowGroupColumn=t.rowGroupColumn,this.setGroupData(s,t,i),s.key=t.key,s.id=this.createGroupId(s,e,n),s.level=n,s.leafGroup=n===i.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=e,this.setExpandedInitialValue(i,s),s}createGroupId(t,e,n){const i=(s,l)=>{if(!s.rowGroupColumn)return null;const c=l?i(l,l.parent):null;return`${c==null?"":c+"-"}${s.rowGroupColumn.getColId()}-${s.key}`};return b.RowNode.ID_PREFIX_ROW_GROUP+i(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(s=>{const l=t.rowGroupColumn;l!==null&&s.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[s.getColId()]=e.key:t.groupData[s.getColId()]=this.valueService.getValue(l,e.leafNode))})}getChildrenMappedKey(t,e){return e?e.getId()+"-"+t:t}setExpandedInitialValue(t,e){if(t.pivotMode&&e.leafGroup){e.expanded=!1;return}const n=t.isGroupOpenByDefault;if(n){const i={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(i)==!0;return}if(t.expandByDefault===-1){e.expanded=!0;return}e.expanded=e.level<t.expandByDefault}getGroupInfo(t,e){const n=[];return e.groupedCols.forEach(i=>{let s=this.valueService.getKeyForNode(i,t),l=s!=null&&s!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(s="",l=!0),l){const u={key:s,field:i.getColDef().field,rowGroupColumn:i,leafNode:t};n.push(u)}}),n}},cy=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,ct=Object.freeze([]),dy=ct.values(),ds=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},uy=class Hf{constructor(e,n,i){this.parent=e,this.key=n,this.level=i,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=ct,this.allLeafChildren=ct,this.childrenChanged=!1,this.leafChildrenChanged=!1,this.oldSourceRowIndex=-1}isEmptyFillerNode(){var e,n;return!((e=this.row)!=null&&e.data)&&!((n=this.children)!=null&&n.size)}hasChildren(){var e;return!!((e=this.children)!=null&&e.size)}enumChildren(){var e;return((e=this.children)==null?void 0:e.values())??dy}upsertKey(e){var i,s;typeof e!="string"&&(e=String(e));let n=(i=this.children)==null?void 0:i.get(e);return n||(n=new Hf(this,e,this.level+1),(s=this.children??(this.children=new Map))==null||s.set(n.key,n)),n}destroy(){var i;const{row:e,parent:n}=this;n!==null&&((i=n==null?void 0:n.children)==null||i.delete(this.key),e!==null&&ds(e,!0),this.parent=null)}setRow(e){const{level:n,row:i,childrenAfterGroup:s}=this;if(n<0)i!==null&&i!==e&&ds(i,!0);else{if(i===e)return!1;i!==null?(e.allLeafChildren=i.allLeafChildren??this.allLeafChildren??ct,ds(i,!1)):e.allLeafChildren=this.allLeafChildren??ct}return e.level=n,e.childrenAfterGroup=s,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:i,duplicateRows:s,childrenAfterGroup:l}=this;if(i===e){const c=this.popDuplicateRow();c?(this.row=c,c.childrenAfterGroup=l,n>=0&&(c.allLeafChildren=i.allLeafChildren??this.allLeafChildren??ct)):this.row=null}else{if(!(s!=null&&s.delete(e)))return!1;s.size===0&&(this.duplicateRows=null)}return ds(e,n<0),!0}addDuplicateRow(e){const{level:n}=this;let i=this.duplicateRows;if(i===null)i=new Set,this.duplicateRows=i;else if(i.has(e))return!1;return i.add(e),e.treeNode=this,e.level=n,n>=0&&(e.allLeafChildren=ct),e.childrenAfterGroup=ct,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let i=n;for(const s of e)s.sourceRowIndex<i.sourceRowIndex&&(i=s);return i!==n&&(i.childrenAfterGroup=this.childrenAfterGroup,i.allLeafChildren=n.allLeafChildren??this.allLeafChildren??ct,n.childrenAfterGroup=ct,n.allLeafChildren=ct,e.delete(i),e.add(n),this.row=i),i}popDuplicateRow(){let e=null;const n=this.duplicateRows;return n!==null&&(e=n.values().next().value,e!==null&&n.delete(e)&&n.size===0&&(this.duplicateRows=null)),e}dequeueInvalidated(){const e=this.invalidatedHead;return e!==null&&(this.invalidatedHead=e.invalidatedNext??null,e.invalidatedNext=void 0),e}invalidate(){let e=this,n=this.parent;for(;n!==null&&e.invalidatedNext===void 0;)e.invalidatedNext=n.invalidatedHead,n.invalidatedHead=e,e=n,n=e.parent}invalidateOrder(){var n,i;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((i=e.row)!=null&&i.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,i;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((i=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:i.oldSourceRowIndex)??this.oldSourceRowIndex}updateChildrenAfterGroup(){var u;this.childrenChanged=!1;const e=((u=this.children)==null?void 0:u.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=ct,this.row.childrenAfterGroup=ct,!0);let n=!1,i=this.childrenAfterGroup;i===ct?(i=new Array(e),this.childrenAfterGroup=i,this.row.childrenAfterGroup=i,n=!0):i.length!==e&&(i.length=e,n=!0);let s=0,l=-1,c=!1;for(const p of this.enumChildren()){const f=p.getRowPosition();f<l&&(c=!0),l=f,p.oldSourceRowIndex=f;const m=p.row;i[s]!==m&&(i[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(i),n||c}reorderChildrenList(e){const n=e.length,i=this.children;e.sort(cy),i.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;i.set(l.key,l)}}updateAllLeafChildren(){var c,u;const{parent:e,row:n,childrenAfterGroup:i}=this;this.leafChildrenChanged=!1;let s=!1;const l=i.length;if(l===0)s=((c=n.allLeafChildren)==null?void 0:c.length)!==0,n.allLeafChildren=ct,this.allLeafChildren=ct;else if(l===1&&((u=i[0].allLeafChildren)!=null&&u.length))n.allLeafChildren=i[0].allLeafChildren,this.allLeafChildren=null,s=!0;else{let p=this.allLeafChildren;(p===ct||p===null)&&(p=[],this.allLeafChildren=p);const f=p.length;let m=0;for(let y=0;y<l;++y){const T=i[y],S=T.allLeafChildren,D=S.length;if(D)for(let k=0;k<D;++k){const M=S[k];(m>=f||p[m]!==M)&&(p[m]=M,s=!0),++m}else(m>=f||p[m]!==T)&&T&&(p[m]=T,s=!0),++m}f!==m&&(p.length=m,s=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,s=!0)}s&&e&&(e.leafChildrenChanged=!0)}},Vd=t=>(t.treeNodeFlags&1)!==0,Pd=t=>(t.treeNodeFlags&2)!==0,Dd=t=>(t.treeNodeFlags&4)!==0,py=t=>(t.treeNodeFlags&8)!==0,Fd=t=>(t.treeNodeFlags&16)!==0,Rd=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},hy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},fy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},or=t=>{t.treeNodeFlags|=16},Md=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},ro=t=>{t.treeNodeFlags=0},my=class extends b.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new uy(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),ro(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:i}=t,s=t.rowNode,l=this.gos,c={changedPath:i,expandByDefault:l.get("groupDefaultExpanded"),suppressGroupMaintainValueType:l.get("suppressGroupMaintainValueType"),getDataPath:l.get("getDataPath"),isGroupOpenByDefault:l.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:l.getCallback("initialGroupOrderComparator")};this.root.setRow(s),s.leafGroup=!1;const p=s.sibling;p&&(p.childrenAfterGroup=s.childrenAfterGroup,p.childrenMapped=s.childrenMapped),e?this.handleTransaction(c,e,n):this.handleRowData(c,s,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var s,l,c;const i=this.root;if(n||this.oldGroupDisplayColIds===void 0){const u=((l=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==u&&this.checkAllGroupDataAfterColsChanged((c=i.row)==null?void 0:c.childrenAfterGroup);return}this.oldGroupDisplayColIds=u}this.clearTree(i),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:i,update:s,add:l}of e)this.removeRows(i),this.addOrUpdateRows(t,s,!0),this.addOrUpdateRows(t,l,!1);n&&this.handleRowNodesOrderChanged(),this.commitTree(t)}handleRowNodesOrderChanged(){var e;const t=(e=this.root.row)==null?void 0:e.allLeafChildren;if(t)for(let n=0,i=t.length;n<i;++n){const s=t[n].treeNode;s&&s.oldSourceRowIndex!==n&&s.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,i=(t==null?void 0:t.length)??0;n<i;++n){const s=t[n];this.setGroupData(s,((e=s.treeNode)==null?void 0:e.key)??s.key),this.checkAllGroupDataAfterColsChanged(s.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let i=0,s=(e==null?void 0:e.length)??0;i<s;++i){const l=e[i],c=this.upsertPath(this.getDataPath(t,l));c&&this.addOrUpdateRow(c,l,n)}}removeRows(t){for(let e=0,n=(t==null?void 0:t.length)??0;e<n;++e){const i=t[e],s=i.treeNode;s!==null&&this.removeRow(s,i)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||ct;return n.length||b._warnOnce("getDataPath() should not return an empty path",[e]),n}upsertPath(t){let e=this.root;const n=t.length-1;for(let i=0;i<=n;++i){const s=e.upsertKey(t[i]);if(i>=n)return s.invalidate(),s;e=s}return null}addOrUpdateRow(t,e,n){var c;const{level:i,row:s}=t;if(i<0)return;let l=!1;if(s!==e){const u=e.treeNode;u!==null&&u!==t&&(u.removeRow(e),u.invalidate()),s===null?(t.setRow(e),l=!0):s.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(s,!0),l=!0)}n&&!Dd(e)&&(hy(e),l=!0),l&&t.invalidate(),(c=this.rowsPendingDestruction)==null||c.delete(e)}removeRow(t,e){const{parent:n,level:i}=t;if(i<0)return;let s=!1;t.removeRow(e)&&(s=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),s&&t.invalidate()}commitTree(t){var i;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&or(n),n.updateHasChildren(),Fd(n)&&(i=t.changedPath)!=null&&i.isActive()&&t.changedPath.addParentNode(n),Md(n),this.commitDestroyedRows()}commitInvalidatedChildren(t,e){for(;;){const n=e.dequeueInvalidated();if(n===null)break;n.parent===e&&this.commitChild(t,e,n)}}commitChild(t,e,n){if(n.isEmptyFillerNode()){this.clearTree(n);return}this.commitNodePreOrder(e,n),this.commitInvalidatedChildren(t,n),this.commitNodePostOrder(t,e,n)}commitNodePreOrder(t,e){let n=e.row;if(n===null?(n=this.createFillerRow(e),e.setRow(n)):(n=e.sortFirstDuplicateRow(),n.allChildrenCount===void 0&&(n.allChildrenCount=null)),n.parent=t.row,e.oldRow!==n)for(const s of e.enumChildren()){const l=s.row;l!==null&&(l.parent=n)}const i=e.key;n.key!==i?(n.key=i,fy(n),this.setGroupData(n,i)):n.groupData||this.setGroupData(n,i)}commitNodePostOrder(t,e,n){var f,m,y;const i=n.row,s=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&or(i),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const c=!!((f=i.childrenAfterGroup)!=null&&f.length),u=c||!i.data,p=i.group;p!==u?(or(i),i.setGroup(u),!u&&!i.expanded&&Rd(i,!1)):i.hasChildren()!==c&&(or(i),i.updateHasChildren()),i.group&&!Pd(i)&&(s!==i&&s!==null&&s.group&&Pd(s)&&!t.isGroupOpenByDefault?i.expanded=s.expanded:i.expanded=this.getExpandedInitialValue(t,i),Rd(i,!0)),Dd(i)&&(or(e.row),py(i)&&i.setData(i.data)),s!==i&&(n.oldRow=i,s!==null&&(p||n.hasChildren())&&or(i),e.childrenChanged=!0,or(e.row)),Fd(i)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(i):Vd(i)||(i.childrenAfterFilter||(i.childrenAfterFilter=i.childrenAfterGroup.slice()),i.childrenAfterAggFilter||(i.childrenAfterAggFilter=i.childrenAfterFilter.slice()),i.childrenAfterSort||(i.childrenAfterSort=i.childrenAfterAggFilter.slice())),Md(i),(y=n.duplicateRows)!=null&&y.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,b._warnOnce("duplicate group keys for row data, keys should be unique",[i.id,i.data,...Array.from(n.duplicateRows).map(T=>T.data)]))}createFillerRow(t){const e=new b.RowNode(this.beans);e.key=t.key,e.group=!0,e.field=null,e.leafGroup=!1,e.rowGroupIndex=null,e.allChildrenCount=null;let n=t.level+"-"+t.key,i=t.parent;for(;i!==null;){const s=i.parent;if(s===null)break;n=`${i.level}-${i.key}-${n}`,i=s}return e.id=b.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var s;const n={};t.groupData=n;const i=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols();if(i)for(const l of i)n[l.getColId()]=e}getExpandedInitialValue(t,e){const n=t.isGroupOpenByDefault;return n?n({rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn})==!0:t.expandByDefault===-1||e.level<t.expandByDefault}clearTree(t){const{parent:e,oldRow:n,row:i,level:s}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&or(e.row)),i!==null&&s>=0){let l=t.row;for(;l!==null&&t.removeRow(l);)this.destroyRow(l,!l.data),l=t.row}for(const l of t.enumChildren())this.clearTree(l);t.destroy()}destroyTree(t){const{row:e,level:n,duplicateRows:i}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):ro(e)),i)for(const s of i)n>=0&&!s.data?this.destroyRow(s,!0):ro(s);for(const s of t.enumChildren())this.destroyTree(s);t.destroy()}destroyRow(t,e){if(!Vd(t)){ro(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}ro(t),t.setRowIndex(null),t.setRowTop(null),!t.data&&t.isSelected()&&t.setSelectedParams({newValue:!1,source:"rowGroupChanged"})}commitDestroyedRows(){const{rowsPendingDestruction:t}=this;if(t!==null){this.rowsPendingDestruction=null;for(const e of t)this.destroyRow(e,!0)}}},gy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?my:ly;let n=this.strategy;(n==null?void 0:n.constructor)!==e&&(this.destroyBean(n),n=this.createManagedBean(new e),this.strategy=n),n.execute(t),this.selectableService.updateSelectableAfterGrouping()}destroy(){this.destroyBean(this.strategy),this.strategy=void 0,super.destroy()}},Id="PivotRowTotal_",yy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="pivotColDefService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService,this.columnNameService=t.columnNameService}postConstruct(){const t=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=t(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=t()});const e=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=e(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=e()})}createPivotColumnDefs(t){const e=this.createPivotColumnsFromUniqueValues(t);function n(l,c=[]){return l.forEach(u=>{u.children!==void 0?n(u.children,c):c.push(u)}),c}const i=n(e);this.addRowGroupTotals(e,i),this.addExpandablePivotGroups(e,i),this.addPivotTotalsToGroups(e,i);const s=i.map(l=>b._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:s}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,i,s){const l=this.funcColsService.getValueColumns();if(t>=i)return this.buildMeasureCols(n);const c=s[t].getColDef(),u=this.headerNameComparator.bind(this,c.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===i-1){const f=[];return b._iterateObject(e,m=>{const y=[...n,m],T=this.createColDef(l[0],m,y);T.columnGroupShow="open",f.push(T)}),f.sort(u),f}const p=[];return b._iterateObject(e,(f,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,T=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,T,i,s),headerName:f,pivotKeys:T,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(T)})}),p.sort(u),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const i=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,i,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const i=(s,l,c)=>{if("children"in s){const f=new Map;s.children.forEach(y=>{i(y,l,f)});const m=!s.children.some(y=>y.children);this.funcColsService.getValueColumns().forEach(y=>{const T=this.columnNameService.getDisplayNameForColumn(y,"header"),S=this.createColDef(y,T,s.pivotKeys);S.pivotTotalColumnIds=f.get(y.getColId()),S.columnGroupShow=n?"open":"closed",S.aggFunc=y.getAggFunc(),m||(s.children.push(S),l.push(S))}),this.merge(c,f);return}if(!s.pivotValueColumn)return;const u=s.pivotValueColumn.getColId();c.has(u)?c.get(u).push(s.colId):c.set(u,[s.colId])};t.forEach(s=>{i(s,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",i=this.funcColsService.getValueColumns(),s=i.map(c=>c.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=i[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,i){const s=t;if(!s.children){const c=t;return c.colId?[c.colId]:null}let l=[];if(s.children.forEach(c=>{const u=this.recursivelyAddPivotTotal(c,e,n,i);u&&(l=l.concat(u))}),s.children.length>1){const u=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,u,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const f=t.children;i?f.push(p):f.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",s=this.funcColsService.getValueColumns().slice();n||s.reverse();const l=s.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let c=0;c<s.length;c++){const u=s[c],p=this.columnNameService.getDisplayNameForColumn(u,"header"),f=this.createColDef(u,p,[]),m=[];for(let T=0;T<e.length;T++){const S=e[T];S.pivotValueColumn===u&&m.push(S.colId)}f.pivotTotalColumnIds=m,f.colId=Id+f.colId;const y=l?{children:[f],pivotKeys:[],groupId:`${Id}_pivotGroup_${u.getColId()}`}:f;e.push(f),n?t.push(y):t.unshift(y)}}createColDef(t,e,n,i=!1){const s={};if(t){const l=t.getColDef();Object.assign(s,l),s.hide=!1}return s.headerName=e,s.colId=this.generateColumnId(n||[],t&&!i?t.getColId():""),s.field=s.colId,s.valueGetter=l=>{var c;return(c=l.data)==null?void 0:c[l.colDef.field]},s.pivotKeys=n,s.pivotValueColumn=t,s.filter===!0&&(s.filter="agNumberColumnFilter"),s}sameAggFuncs(t){if(t.length==1)return!0;for(let e=1;e<t.length;e++)if(t[e]!==t[0])return!1;return!0}headerNameComparator(t,e,n){return t?t(e.headerName,n.headerName):e.headerName&&!n.headerName?1:!e.headerName&&n.headerName?-1:!e.headerName||!n.headerName?0:e.headerName<n.headerName?-1:e.headerName>n.headerName?1:0}merge(t,e){e.forEach((n,i)=>{const l=[...t.has(i)?t.get(i):[],...n];t.set(i,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(i=>i.getColId()).join("-")}_${t.join("-")}_${e}`}createColDefsFromFields(t){const e={};for(let s=0;s<t.length;s++){const c=t[s].split(this.fieldSeparator);let u=e;for(let p=0;p<c.length;p++){const f=c[p];u[f]==null&&(u[f]={}),u=u[f]}}const n=(s,l,c,u)=>{const p=[];for(const y in c){const T=c[y],S=n(`${s}${this.fieldSeparator}${y}`,y,T,u+1);p.push(S)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const S=this.columnNameService.getDisplayNameForColumn(y,"header")??l,D=this.createColDef(y,S,void 0,!1);return D.colId=s,D.aggFunc=y.getAggFunc(),D.valueGetter=k=>{var M;return(M=k.data)==null?void 0:M[s]},D}return{colId:s,headerName:l,valueGetter:S=>{var D;return(D=S.data)==null?void 0:D[s]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||u<this.pivotDefaultExpanded,groupId:s,headerName:l,children:p}},i=[];for(const s in e){const l=e[s],c=n(s,s,l,0);i.push(c)}return i}},Ld="Exceeded maximum allowed pivot column count.",vy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="pivotStage",this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(t){this.valueService=t.valueService,this.columnModel=t.columnModel,this.pivotResultColsService=t.pivotResultColsService,this.funcColsService=t.funcColsService,this.pivotColDefService=t.pivotColDefService}execute(t){const e=t.changedPath;this.columnModel.isPivotActive()?this.executePivotOn(e):this.executePivotOff(e)}executePivotOff(t){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.pivotResultColsService.isPivotResultColsPresent()&&(this.pivotResultColsService.setPivotResultCols(null,"rowModelUpdated"),t&&t.setInactive())}executePivotOn(t){const e=this.funcColsService.getValueColumns().length??1,n=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=n===-1?-1:n/e;let i;try{i=this.bucketUpRowNodes(t)}catch(C){if(C.message===Ld){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0;return}throw C}const s=this.setUniqueValues(i),l=this.funcColsService.getValueColumns(),c=l.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),u=l.map(C=>C.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,f=this.aggregationFuncsHashLastTime!==u;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=u;const m=this.funcColsService.getRowGroupColumns().map(C=>C.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const T=this.gos.get("pivotRowTotals"),S=this.gos.get("pivotColumnGroupTotals"),D=this.gos.get("suppressExpandablePivotGroups"),k=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),M=T!==this.pivotRowTotalsLastTime||S!==this.pivotColumnGroupTotalsLastTime||D!==this.suppressExpandablePivotGroupsLastTime||k!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=T,this.pivotColumnGroupTotalsLastTime=S,this.suppressExpandablePivotGroupsLastTime=D,this.removePivotHeaderRowWhenSingleValueColumnLastTime=k,this.lastTimeFailed||s||p||y||f||M){const{pivotColumnGroupDefs:C,pivotColumnDefs:G}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=G,this.pivotResultColsService.setPivotResultCols(C,"rowModelUpdated"),t&&t.setInactive()}this.lastTimeFailed=!1}setUniqueValues(t){const e=JSON.stringify(t),n=JSON.stringify(this.uniqueValues);return e!==n?(this.uniqueValues=t,!0):!1}bucketUpRowNodes(t){this.currentUniqueCount=0;const e={};t.forEachChangedNodeDepthFirst(i=>{i.leafGroup&&(i.childrenMapped=null)});const n=i=>{var s;i.leafGroup?this.bucketRowNode(i,e):(s=i.childrenAfterFilter)==null||s.forEach(n)};return t.executeFromRootNode(n),e}bucketRowNode(t,e){const n=this.funcColsService.getPivotColumns();n.length===0?t.childrenMapped=null:t.childrenMapped=this.bucketChildren(t.childrenAfterFilter,n,0,e),t.sibling&&(t.sibling.childrenMapped=t.childrenMapped)}bucketChildren(t,e,n,i){const s={},l=e[n];if(t.forEach(c=>{let u=this.valueService.getKeyForNode(l,c);if(b._missing(u)&&(u=""),!i[u]){this.currentUniqueCount+=1,i[u]={};const p=this.maxUniqueValues!==-1,f=this.currentUniqueCount>this.maxUniqueValues;if(p&&f)throw Error(Ld)}s[u]||(s[u]=[]),s[u].push(c)}),n===e.length-1)return s;{const c={};return b._iterateObject(s,(u,p)=>{c[u]=this.bucketChildren(p,e,n+1,i[u])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function _y(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function Cy(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function wy(t){t.aggFuncService&&t.aggFuncService.clear()}function by(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function xy(t){return t.columnModel.isPivotMode()}function ky(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function Sy(t,e){t.funcColsService.setValueColumns(e,"api")}function Ey(t){return t.funcColsService.getValueColumns()}function Ty(t,e){t.funcColsService.removeValueColumns([e],"api")}function By(t,e){t.funcColsService.removeValueColumns(e,"api")}function Ny(t,e){t.funcColsService.addValueColumns([e],"api")}function Ay(t,e){t.funcColsService.addValueColumns(e,"api")}function Vy(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function Py(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function Dy(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function Fy(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function Ry(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function My(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function Iy(t){return t.funcColsService.getRowGroupColumns()}function Ly(t,e){t.funcColsService.setPivotColumns(e,"api")}function Oy(t,e){t.funcColsService.removePivotColumns([e],"api")}function Gy(t,e){t.funcColsService.removePivotColumns(e,"api")}function zy(t,e){t.funcColsService.addPivotColumns([e],"api")}function $y(t,e){t.funcColsService.addPivotColumns(e,"api")}function Uy(t){return t.funcColsService.getPivotColumns()}function Zy(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function Wy(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var Hy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="showRowGroupColsService"}wireBeans(t){this.columnModel=t.columnModel,this.funcColsService=t.funcColsService}refresh(){this.showRowGroupCols=[],this.showRowGroupColsMap={},this.columnModel.getCols().forEach(t=>{const n=t.getColDef().showRowGroup,i=typeof n=="string";!i&&!(n===!0)||(this.showRowGroupCols.push(t),i?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(c=>{this.showRowGroupColsMap[c.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},io="32.3.3",Ja=b._defineModule({version:io,moduleName:`${b.ModuleNames.RowGroupingModule}-core`,beans:[Jg,iy,gy,yy,vy,Ug,Xg,Hy,ry],userComponents:[{name:"agGroupRowRenderer",classImp:Re.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Re.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Re.GroupCellRendererCtrl}],dependantModules:[Re.EnterpriseCoreModule]}),jy=b._defineModule({version:io,moduleName:`${b.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:_y,addAggFuncs:Cy,clearAggFuncs:wy,setColumnAggFunc:by,isPivotMode:xy,getPivotResultColumn:ky,setValueColumns:Sy,getValueColumns:Ey,removeValueColumn:Ty,removeValueColumns:By,addValueColumn:Ny,addValueColumns:Ay,setRowGroupColumns:Vy,removeRowGroupColumn:Py,removeRowGroupColumns:Dy,addRowGroupColumn:Fy,addRowGroupColumns:Ry,getRowGroupColumns:Iy,moveRowGroupColumn:My,setPivotColumns:Ly,removePivotColumn:Oy,removePivotColumns:Gy,addPivotColumn:zy,addPivotColumns:$y,getPivotColumns:Uy,setPivotResultColumns:Zy,getPivotResultColumns:Wy},dependantModules:[Ja]}),Od=b._defineModule({version:io,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:oy}],dependantModules:[Ja,b._ColumnFilterModule]}),qy=b._defineModule({version:io,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:sy}],dependantModules:[Od,b._FloatingFilterModule]}),Ky=b._defineModule({version:io,moduleName:b.ModuleNames.RowGroupingModule,dependantModules:[Ja,jy,Od,qy]}),Gd=class extends ja{constructor(t){super(t,"aggregation")}postConstruct(){const t=this.localeService.getLocaleTextFunc(),e=t("valueColumnsEmptyMessage","Drag here to aggregate"),n=t("values","Values");super.init({icon:b._createIconNoSpan("valuePanel",this.gos,null),emptyMessage:e,title:n}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.localeService.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getTooltipParams(){const t=super.getTooltipParams();return t.location="valueColumnsList",t}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(t,e){return this.gos.get("functionsReadOnly")||!t.isPrimary()?!1:t.isAllowValue()&&(!t.isValueActive()||this.isSourceEventFromTarget(e))}updateItems(t){this.funcColsService.setValueColumns(t,"toolPanelUi")}getExistingItems(){return this.funcColsService.getValueColumns()}},zd=300,Yy=class extends b.Component{constructor(){super(`<div class="ag-column-select-header" role="presentation">
25
25
  <div data-ref="eExpand" class="ag-column-select-header-icon"></div>
26
26
  <ag-checkbox data-ref="eSelect" class="ag-column-select-header-checkbox"></ag-checkbox>
27
27
  <ag-input-text-field class="ag-column-select-header-filter-wrapper" data-ref="eFilterTextField"></ag-input-text-field>
28
- </div>`,[b.AgCheckboxSelector,b.AgInputTextFieldSelector]),this.eExpand=b.RefPlaceholder,this.eSelect=b.RefPlaceholder,this.eFilterTextField=b.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===b.KeyCode.SPACE&&(e.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedElementListeners(this.eFilterTextField.getInputElement(),{keydown:this.onMiniFilterKeyDown.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const t=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(t("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(t("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t)}init(t){this.params=t;const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=b._createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=b._createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=b._createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const t=!this.params.suppressColumnFilter,e=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,i=this.columnModel.isProvidedColGroupsPresent(),s=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(s("searchOoo","Search...")),b._setDisplayed(this.eFilterTextField.getGui(),t),b._setDisplayed(this.eSelect.getGui(),e),b._setDisplayed(this.eExpand,n&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=b._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},zd)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===b.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),zd)}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(t){this.expandState=t,b._setDisplayed(this.eExpandChecked,this.expandState===0),b._setDisplayed(this.eExpandUnchecked,this.expandState===1),b._setDisplayed(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(t){this.selectState=t,this.eSelect.setValue(this.selectState)}},Jy={selector:"AG-PRIMARY-COLS-HEADER",component:Yy},Ud=class{constructor(t,e,n,i=!1,s){this.localEventService=new b.LocalEventService,this.displayName=t,this.dept=n,this.group=i,i?(this.columnGroup=e,this.expanded=s,this.children=[]):this.column=e}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(t){t!==this.expanded&&(this.expanded=t,this.localEventService.dispatchEvent({type:"expandedChanged"}))}setPassesFilter(t){this.passesFilter=t}addEventListener(t,e){this.localEventService.addEventListener(t,e)}removeEventListener(t,e){this.localEventService.removeEventListener(t,e)}},Zd=class extends b.Component{constructor(t,e,n){super('<div class="ag-menu"></div>'),this.column=t,this.mouseEvent=e,this.parentEl=n,this.displayName=null}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.popupService=t.popupService,this.focusService=t.focusService}postConstruct(){if(this.initializeProperties(this.column),this.buildMenuItemMap(),b.isColumn(this.column)?this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()){this.mouseEvent.preventDefault();const t=this.getMappedMenuItems();if(t.length===0)return;this.displayContextMenu(t)}}initializeProperties(t){b.isProvidedColumnGroup(t)?this.columns=t.getLeafColumns():this.columns=[t],this.allowGrouping=this.columns.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=this.columns.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const t=this.localeService.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:e=>e.isPrimary()&&e.isAllowRowGroup()&&!this.columnModel.isColGroupLocked(e),activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>`${t("groupBy","Group by")} ${this.displayName}`,deactivateLabel:()=>`${t("ungroupBy","Un-Group by")} ${this.displayName}`,activateFunction:()=>{const e=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:e=>e.isPrimary()&&e.isAllowValue(),activeFunction:e=>e.isValueActive(),activateLabel:()=>t("addToValues",`Add ${this.displayName} to values`,[this.displayName]),deactivateLabel:()=>t("removeFromValues",`Remove ${this.displayName} from values`,[this.displayName]),activateFunction:()=>{const e=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:e=>this.columnModel.isPivotMode()&&e.isPrimary()&&e.isAllowPivot(),activeFunction:e=>e.isPivotActive(),activateLabel:()=>t("addToLabels",`Add ${this.displayName} to labels`,[this.displayName]),deactivateLabel:()=>t("removeFromLabels",`Remove ${this.displayName} from labels`,[this.displayName]),activateFunction:()=>{const e=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(t){return[...t].concat(this.columns.filter(e=>t.indexOf(e)===-1))}removeColumnsFromList(t){return t.filter(e=>this.columns.indexOf(e)===-1)}displayContextMenu(t){const e=this.getGui(),n=this.createBean(new Re.AgMenuList),i=this.localeService.getLocaleTextFunc();let s=()=>{};e.appendChild(n.getGui()),n.addMenuItems(t),n.addManagedListeners(n,{closeMenu:()=>{this.parentEl.focus(),s()}});const l=this.popupService.addPopup({modal:!0,eChild:e,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(n.getGui()),ariaLabel:i("ariaLabelContextMenu","Context Menu"),closedCallback:c=>{c instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(n)}});l&&(s=l.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:e})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const t=[];for(const e of this.menuItemMap.values()){const n=this.columns.some(s=>e.allowedFunction(s)&&!e.activeFunction(s)),i=this.columns.some(s=>e.allowedFunction(s)&&e.activeFunction(s));n&&t.push({name:e.activateLabel(this.displayName),icon:b._createIconNoSpan(e.addIcon,this.gos,null),action:()=>e.activateFunction()}),i&&t.push({name:e.deactivateLabel(this.displayName),icon:b._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},$d=class extends b.Component{constructor(t,e,n,i){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=i,this.cbSelect=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.eGroupOpenedIcon=b.RefPlaceholder,this.eGroupClosedIcon=b.RefPlaceholder,this.eColumnGroupIcons=b.RefPlaceholder,this.processingColumnStateChange=!1,this.modelItem=t,this.columnGroup=t.getColumnGroup(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName(),this.allowDragging=e}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column-group">
28
+ </div>`,[b.AgCheckboxSelector,b.AgInputTextFieldSelector]),this.eExpand=b.RefPlaceholder,this.eSelect=b.RefPlaceholder,this.eFilterTextField=b.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===b.KeyCode.SPACE&&(e.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedElementListeners(this.eFilterTextField.getInputElement(),{keydown:this.onMiniFilterKeyDown.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const t=this.localeService.getLocaleTextFunc();this.eSelect.setInputAriaLabel(t("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(t("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t)}init(t){this.params=t;const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e),this.columnModel.isReady()&&this.showOrHideOptions()}createExpandIcons(){this.eExpand.appendChild(this.eExpandChecked=b._createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=b._createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=b._createIconNoSpan("columnSelectIndeterminate",this.gos)),this.setExpandState(0)}showOrHideOptions(){const t=!this.params.suppressColumnFilter,e=!this.params.suppressColumnSelectAll,n=!this.params.suppressColumnExpandAll,i=this.columnModel.isProvidedColGroupsPresent(),s=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(s("searchOoo","Search...")),b._setDisplayed(this.eFilterTextField.getGui(),t),b._setDisplayed(this.eSelect.getGui(),e),b._setDisplayed(this.eExpand,n&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=b._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},zd)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===b.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),zd)}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(t){this.expandState=t,b._setDisplayed(this.eExpandChecked,this.expandState===0),b._setDisplayed(this.eExpandUnchecked,this.expandState===1),b._setDisplayed(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(t){this.selectState=t,this.eSelect.setValue(this.selectState)}},Jy={selector:"AG-PRIMARY-COLS-HEADER",component:Yy},$d=class{constructor(t,e,n,i=!1,s){this.localEventService=new b.LocalEventService,this.displayName=t,this.dept=n,this.group=i,i?(this.columnGroup=e,this.expanded=s,this.children=[]):this.column=e}isGroup(){return this.group}getDisplayName(){return this.displayName}getColumnGroup(){return this.columnGroup}getColumn(){return this.column}getDept(){return this.dept}isExpanded(){return!!this.expanded}getChildren(){return this.children}isPassesFilter(){return this.passesFilter}setExpanded(t){t!==this.expanded&&(this.expanded=t,this.localEventService.dispatchEvent({type:"expandedChanged"}))}setPassesFilter(t){this.passesFilter=t}addEventListener(t,e){this.localEventService.addEventListener(t,e)}removeEventListener(t,e){this.localEventService.removeEventListener(t,e)}},Ud=class extends b.Component{constructor(t,e,n){super('<div class="ag-menu"></div>'),this.column=t,this.mouseEvent=e,this.parentEl=n,this.displayName=null}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.funcColsService=t.funcColsService,this.popupService=t.popupService,this.focusService=t.focusService}postConstruct(){if(this.initializeProperties(this.column),this.buildMenuItemMap(),b.isColumn(this.column)?this.displayName=this.columnNameService.getDisplayNameForColumn(this.column,"columnToolPanel"):this.displayName=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,this.column,"columnToolPanel"),this.isActive()){this.mouseEvent.preventDefault();const t=this.getMappedMenuItems();if(t.length===0)return;this.displayContextMenu(t)}}initializeProperties(t){b.isProvidedColumnGroup(t)?this.columns=t.getLeafColumns():this.columns=[t],this.allowGrouping=this.columns.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=this.columns.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=this.columnModel.isPivotMode()&&this.columns.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const t=this.localeService.getLocaleTextFunc();this.menuItemMap=new Map,this.menuItemMap.set("rowGroup",{allowedFunction:e=>e.isPrimary()&&e.isAllowRowGroup()&&!this.columnModel.isColGroupLocked(e),activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>`${t("groupBy","Group by")} ${this.displayName}`,deactivateLabel:()=>`${t("ungroupBy","Un-Group by")} ${this.displayName}`,activateFunction:()=>{const e=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getRowGroupColumns();this.funcColsService.setRowGroupColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),this.menuItemMap.set("value",{allowedFunction:e=>e.isPrimary()&&e.isAllowValue(),activeFunction:e=>e.isValueActive(),activateLabel:()=>t("addToValues",`Add ${this.displayName} to values`,[this.displayName]),deactivateLabel:()=>t("removeFromValues",`Remove ${this.displayName} from values`,[this.displayName]),activateFunction:()=>{const e=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getValueColumns();this.funcColsService.setValueColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"valuePanel",removeIcon:"valuePanel"}),this.menuItemMap.set("pivot",{allowedFunction:e=>this.columnModel.isPivotMode()&&e.isPrimary()&&e.isAllowPivot(),activeFunction:e=>e.isPivotActive(),activateLabel:()=>t("addToLabels",`Add ${this.displayName} to labels`,[this.displayName]),deactivateLabel:()=>t("removeFromLabels",`Remove ${this.displayName} from labels`,[this.displayName]),activateFunction:()=>{const e=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.addColumnsToList(e),"toolPanelUi")},deActivateFunction:()=>{const e=this.funcColsService.getPivotColumns();this.funcColsService.setPivotColumns(this.removeColumnsFromList(e),"toolPanelUi")},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(t){return[...t].concat(this.columns.filter(e=>t.indexOf(e)===-1))}removeColumnsFromList(t){return t.filter(e=>this.columns.indexOf(e)===-1)}displayContextMenu(t){const e=this.getGui(),n=this.createBean(new Re.AgMenuList),i=this.localeService.getLocaleTextFunc();let s=()=>{};e.appendChild(n.getGui()),n.addMenuItems(t),n.addManagedListeners(n,{closeMenu:()=>{this.parentEl.focus(),s()}});const l=this.popupService.addPopup({modal:!0,eChild:e,closeOnEsc:!0,afterGuiAttached:()=>this.focusService.focusInto(n.getGui()),ariaLabel:i("ariaLabelContextMenu","Context Menu"),closedCallback:c=>{c instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(n)}});l&&(s=l.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:e})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const t=[];for(const e of this.menuItemMap.values()){const n=this.columns.some(s=>e.allowedFunction(s)&&!e.activeFunction(s)),i=this.columns.some(s=>e.allowedFunction(s)&&e.activeFunction(s));n&&t.push({name:e.activateLabel(this.displayName),icon:b._createIconNoSpan(e.addIcon,this.gos,null),action:()=>e.activateFunction()}),i&&t.push({name:e.deactivateLabel(this.displayName),icon:b._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},Zd=class extends b.Component{constructor(t,e,n,i){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=i,this.cbSelect=b.RefPlaceholder,this.eLabel=b.RefPlaceholder,this.eGroupOpenedIcon=b.RefPlaceholder,this.eGroupClosedIcon=b.RefPlaceholder,this.eColumnGroupIcons=b.RefPlaceholder,this.processingColumnStateChange=!1,this.modelItem=t,this.columnGroup=t.getColumnGroup(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName(),this.allowDragging=e}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column-group">
29
29
  <span class="ag-column-group-icons" data-ref="eColumnGroupIcons" >
30
30
  <span class="ag-column-group-closed-icon" data-ref="eGroupClosedIcon"></span>
31
31
  <span class="ag-column-group-opened-icon" data-ref="eGroupOpenedIcon"></span>
32
32
  </span>
33
33
  <ag-checkbox data-ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>
34
34
  <span class="ag-column-select-column-label" data-ref="eLabel"></span>
35
- </div>`,[b.AgCheckboxSelector]),this.eDragHandle=b._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.getGui().style.setProperty("--ag-indentation-level",String(this.columnDept)),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(this.modelItem,{expandedChanged:this.onExpandChanged.bind(this)}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),b._getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(i=>this.addOrRemoveCssClass(i,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const t=this.columnGroup.getColGroupDef();if(!t)return;const e=this.gos.get("tooltipShowMode")==="whenTruncated";let n;e&&(n=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const i=()=>{const s=t.headerTooltip;this.setTooltip({newTooltipText:s,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:n})};i(),this.addManagedEventListeners({newColumnsLoaded:i})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumnGroup",t}handleKeyDown(t){switch(t.key){case b.KeyCode.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case b.KeyCode.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case b.KeyCode.SPACE:t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(t){const{columnGroup:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const i=this.createBean(new Zd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}addVisibilityListenersToAllChildren(){const t=this.onColumnStateChanged.bind(this);this.columnGroup.getLeafColumns().forEach(e=>{this.addManagedListeners(e,{visibleChanged:t,columnValueChanged:t,columnPivotChanged:t,columnRowGroupChanged:t})})}setupDragging(){if(!this.allowDragging){b._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:b.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:this.eventType})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.columnGroup.getLeafColumns(),e={},n={};return t.forEach(i=>{const s=i.getId();e[s]=i.isVisible(),n[s]=this.modelItemUtils.createPivotState(i)}),{columns:t,visibleState:e,pivotState:n}}setupExpandContract(){this.eGroupClosedIcon.appendChild(b._createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(b._createIcon("columnSelectOpen",this.gos,null));const t=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(this.eGroupClosedIcon,{click:t}),this.addManagedElementListeners(this.eGroupOpenedIcon,{click:t});const e=new b.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListeners(e,{tap:t}),this.addDestroyFunc(e.destroy.bind(e))}onLabelClicked(){const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}getVisibleLeafColumns(){const t=[],e=n=>{n.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?e(i.getChildren()):t.push(i.getColumn()))})};return e(this.modelItem.getChildren()),t}onChangeCommon(t){this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),t,this.eventType)}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnGroup","Column Group"),n=this.cbSelect.getValue(),i=n===void 0?t("ariaIndeterminate","indeterminate"):n?t("ariaVisible","visible"):t("ariaHidden","hidden"),s=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${s} (${i})`),b._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const t=this.workOutSelectedValue(),e=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(t),this.cbSelect.setReadOnly(e),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",e),this.processingColumnStateChange=!1}workOutSelectedValue(){const t=this.columnModel.isPivotMode(),e=this.getVisibleLeafColumns();let n=0,i=0;if(e.forEach(s=>{!t&&s.getColDef().lockVisible||(this.isColumnChecked(s,t)?n++:i++)}),!(n>0&&i>0))return n>0}workOutReadOnlyValue(){const t=this.columnModel.isPivotMode();let e=0;return this.columnGroup.getLeafColumns().forEach(n=>{t?n.isAnyFunctionAllowed()&&e++:n.getColDef().lockVisible||e++}),e===0}isColumnChecked(t,e){if(e){const n=t.isPivotActive(),i=t.isRowGroupActive(),s=t.isValueActive();return n||i||s}return t.isVisible()}onExpandOrContractClicked(){const t=this.modelItem.isExpanded();this.modelItem.setExpanded(!t)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const t=this.modelItem.isExpanded();b._setDisplayed(this.eGroupClosedIcon,!t),b._setDisplayed(this.eGroupOpenedIcon,t)}refreshAriaExpanded(){b._setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())}getDisplayName(){return this.displayName}onSelectAllChanged(t){const e=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(t&&!e||!t&&e)&&this.cbSelect.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(t){this.cbSelect.setValue(t,!0)}},Xy=class extends b.BeanStub{constructor(t,e){super(),this.comp=t,this.virtualList=e}wireBeans(t){this.columnMoveService=t.columnMoveService,this.columnModel=t.columnModel}postConstruct(){this.createManagedBean(new Re.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:b.DragSourceType.ToolPanel,listItemDragStartEvent:"columnPanelItemDragStart",listItemDragEndEvent:"columnPanelItemDragEnd",eventSource:this.eventService,getCurrentDragValue:t=>this.getCurrentDragValue(t),isMoveBlocked:t=>this.isMoveBlocked(t),getNumRows:t=>t.getDisplayedColsList().length,moveItem:(t,e)=>this.moveItem(this.getCurrentColumnsBeingMoved(t),e)}))}getCurrentDragValue(t){return t.column}getCurrentColumnsBeingMoved(t){return b.isProvidedColumnGroup(t)?t.getLeafColumns():t?[t]:[]}isMoveBlocked(t){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumnsBeingMoved(t).find(s=>{const l=s.getColDef();return!!l.suppressMovable||!!l.lockPosition})}moveItem(t,e){if(!e)return;const{component:n}=e;let i=null,s=e.position==="top";if(n instanceof $d?(i=n.getColumns()[0],s=!0):n&&(i=n.getColumn()),!i)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:i,isBefore:s});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:i}=t;if(!n||!e)return null;const s=this.columnModel.getCols().indexOf(n),l=i?s:s+1,c=this.getMoveDiff(e,l);return l-c}getMoveDiff(t,e){const n=this.columnModel.getCols();if(!t)return 0;const i=t[0],s=t.length;return n.indexOf(i)<e?s:0}},Qy=class extends b.Component{constructor(t,e,n,i){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=i,this.eLabel=b.RefPlaceholder,this.cbSelect=b.RefPlaceholder,this.processingColumnStateChange=!1,this.column=t.getColumn(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName()}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column">
35
+ </div>`,[b.AgCheckboxSelector]),this.eDragHandle=b._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1"),this.eLabel.innerHTML=this.displayName?this.displayName:"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+this.columnDept),this.getGui().style.setProperty("--ag-indentation-level",String(this.columnDept)),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(this.modelItem,{expandedChanged:this.onExpandChanged.bind(this)}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),b._getToolPanelClassesFromColDef(this.columnGroup.getColGroupDef(),this.gos,null,this.columnGroup).forEach(i=>this.addOrRemoveCssClass(i,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const t=this.columnGroup.getColGroupDef();if(!t)return;const e=this.gos.get("tooltipShowMode")==="whenTruncated";let n;e&&(n=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const i=()=>{const s=t.headerTooltip;this.setTooltip({newTooltipText:s,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:n})};i(),this.addManagedEventListeners({newColumnsLoaded:i})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumnGroup",t}handleKeyDown(t){switch(t.key){case b.KeyCode.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case b.KeyCode.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case b.KeyCode.SPACE:t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(t){const{columnGroup:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const i=this.createBean(new Ud(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}addVisibilityListenersToAllChildren(){const t=this.onColumnStateChanged.bind(this);this.columnGroup.getLeafColumns().forEach(e=>{this.addManagedListeners(e,{visibleChanged:t,columnValueChanged:t,columnPivotChanged:t,columnRowGroupChanged:t})})}setupDragging(){if(!this.allowDragging){b._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:b.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:this.columnGroup.getLeafColumns(),visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:this.eventType})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.columnGroup.getLeafColumns(),e={},n={};return t.forEach(i=>{const s=i.getId();e[s]=i.isVisible(),n[s]=this.modelItemUtils.createPivotState(i)}),{columns:t,visibleState:e,pivotState:n}}setupExpandContract(){this.eGroupClosedIcon.appendChild(b._createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(b._createIcon("columnSelectOpen",this.gos,null));const t=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(this.eGroupClosedIcon,{click:t}),this.addManagedElementListeners(this.eGroupOpenedIcon,{click:t});const e=new b.TouchListener(this.eColumnGroupIcons,!0);this.addManagedListeners(e,{tap:t}),this.addDestroyFunc(e.destroy.bind(e))}onLabelClicked(){const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}getVisibleLeafColumns(){const t=[],e=n=>{n.forEach(i=>{i.isPassesFilter()&&(i.isGroup()?e(i.getChildren()):t.push(i.getColumn()))})};return e(this.modelItem.getChildren()),t}onChangeCommon(t){this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.selectAllChildren(this.modelItem.getChildren(),t,this.eventType)}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnGroup","Column Group"),n=this.cbSelect.getValue(),i=n===void 0?t("ariaIndeterminate","indeterminate"):n?t("ariaVisible","visible"):t("ariaHidden","hidden"),s=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${s} (${i})`),b._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}onColumnStateChanged(){const t=this.workOutSelectedValue(),e=this.workOutReadOnlyValue();this.processingColumnStateChange=!0,this.cbSelect.setValue(t),this.cbSelect.setReadOnly(e),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",e),this.processingColumnStateChange=!1}workOutSelectedValue(){const t=this.columnModel.isPivotMode(),e=this.getVisibleLeafColumns();let n=0,i=0;if(e.forEach(s=>{!t&&s.getColDef().lockVisible||(this.isColumnChecked(s,t)?n++:i++)}),!(n>0&&i>0))return n>0}workOutReadOnlyValue(){const t=this.columnModel.isPivotMode();let e=0;return this.columnGroup.getLeafColumns().forEach(n=>{t?n.isAnyFunctionAllowed()&&e++:n.getColDef().lockVisible||e++}),e===0}isColumnChecked(t,e){if(e){const n=t.isPivotActive(),i=t.isRowGroupActive(),s=t.isValueActive();return n||i||s}return t.isVisible()}onExpandOrContractClicked(){const t=this.modelItem.isExpanded();this.modelItem.setExpanded(!t)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const t=this.modelItem.isExpanded();b._setDisplayed(this.eGroupClosedIcon,!t),b._setDisplayed(this.eGroupOpenedIcon,t)}refreshAriaExpanded(){b._setAriaExpanded(this.focusWrapper,this.modelItem.isExpanded())}getDisplayName(){return this.displayName}onSelectAllChanged(t){const e=this.cbSelect.getValue();!this.cbSelect.isReadOnly()&&(t&&!e||!t&&e)&&this.cbSelect.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(t){this.cbSelect.setValue(t,!0)}},Xy=class extends b.BeanStub{constructor(t,e){super(),this.comp=t,this.virtualList=e}wireBeans(t){this.columnMoveService=t.columnMoveService,this.columnModel=t.columnModel}postConstruct(){this.createManagedBean(new Re.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:b.DragSourceType.ToolPanel,listItemDragStartEvent:"columnPanelItemDragStart",listItemDragEndEvent:"columnPanelItemDragEnd",eventSource:this.eventService,getCurrentDragValue:t=>this.getCurrentDragValue(t),isMoveBlocked:t=>this.isMoveBlocked(t),getNumRows:t=>t.getDisplayedColsList().length,moveItem:(t,e)=>this.moveItem(this.getCurrentColumnsBeingMoved(t),e)}))}getCurrentDragValue(t){return t.column}getCurrentColumnsBeingMoved(t){return b.isProvidedColumnGroup(t)?t.getLeafColumns():t?[t]:[]}isMoveBlocked(t){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumnsBeingMoved(t).find(s=>{const l=s.getColDef();return!!l.suppressMovable||!!l.lockPosition})}moveItem(t,e){if(!e)return;const{component:n}=e;let i=null,s=e.position==="top";if(n instanceof Zd?(i=n.getColumns()[0],s=!0):n&&(i=n.getColumn()),!i)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:i,isBefore:s});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:i}=t;if(!n||!e)return null;const s=this.columnModel.getCols().indexOf(n),l=i?s:s+1,c=this.getMoveDiff(e,l);return l-c}getMoveDiff(t,e){const n=this.columnModel.getCols();if(!t)return 0;const i=t[0],s=t.length;return n.indexOf(i)<e?s:0}},Qy=class extends b.Component{constructor(t,e,n,i){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=i,this.eLabel=b.RefPlaceholder,this.cbSelect=b.RefPlaceholder,this.processingColumnStateChange=!1,this.column=t.getColumn(),this.columnDept=t.getDept(),this.displayName=t.getDisplayName()}wireBeans(t){this.columnModel=t.columnModel,this.dragAndDropService=t.dragAndDropService,this.modelItemUtils=t.modelItemUtils}postConstruct(){this.setTemplate(`<div class="ag-column-select-column">
36
36
  <ag-checkbox data-ref="cbSelect" class="ag-column-select-checkbox"></ag-checkbox>
37
37
  <span class="ag-column-select-column-label" data-ref="eLabel"></span>
38
- </div>`,[b.AgCheckboxSelector]),this.eDragHandle=b._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1");const n=b._escapeString(this.displayName);this.eLabel.innerHTML=n;const i=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${i}`),this.getGui().style.setProperty("--ag-indentation-level",String(i)),this.setupDragging();const s=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:s}),this.addManagedListeners(this.column,{columnValueChanged:s,columnPivotChanged:s,columnRowGroupChanged:s,visibleChanged:s}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),b._getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(c=>this.addOrRemoveCssClass(c,!0))}getColumn(){return this.column}setupTooltip(){const t=this.gos.get("tooltipShowMode")==="whenTruncated";let e;t&&(e=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const n=()=>{const i=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};n(),this.addManagedEventListeners({newColumnsLoaded:n})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumn",t.colDef=this.column.getColDef(),t}onContextMenu(t){const{column:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const i=this.createBean(new Zd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}handleKeyDown(t){t.key===b.KeyCode.SPACE&&(t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}onChangeCommon(t){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.setColumn(this.column,t,"toolPanelUi"))}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumn","Column"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),i=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${i} (${n})`),b._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){b._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:b.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.column.getColId(),e={[t]:this.column.isVisible()},n={[t]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:e,pivotState:n}}onColumnStateChanged(){this.processingColumnStateChange=!0;const t=this.columnModel.isPivotMode();if(t){const i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const i=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();e=!i&&!s,n=e}else{const{enableRowGroup:i,enableValue:s,lockPosition:l,suppressMovable:c,lockVisible:u}=this.column.getColDef(),p=!!i||!!s,f=!!l||!!c;e=!u,n=p||!f}this.cbSelect.setReadOnly(!e),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!n),this.addOrRemoveCssClass("ag-column-select-column-readonly",!n&&!e),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(t){t!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(t){b._warnOnce("can not expand a column item that does not represent a column group header")}},ev=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},tv="ag-column-select-list",nv=class extends b.Component{constructor(){super(`<div class="${tv}" role="presentation"></div>`),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.colDefService=t.toolPanelColDefService,this.modelItemUtils=t.modelItemUtils}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(t=>t()),this.destroyColumnItemFuncs=[]}init(t,e,n){this.params=t,this.allowDragging=e,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const i=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:i,columnPivotModeChanged:i,columnRowGroupChanged:i,columnValueChanged:i,columnVisible:i,newColumnsLoaded:i}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new Re.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((s,l)=>(b._setAriaLevel(l,s.getDept()+1),this.createComponentFromItem(s,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new Xy(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const i=new $d(t,this.allowDragging,this.eventType,e);return this.createBean(i),i}const n=new Qy(t,this.allowDragging,this.groupsExist,e);return this.createBean(n),n}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const t=this.getExpandedStates(),e=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const t={};if(this.isInitialState){const{expandedGroupIds:e}=this.params.initialState;return e.forEach(n=>{t[n]=!0}),t}return this.allColsTree?(this.forEachItem(e=>{if(!e.isGroup())return;const n=e.getColumnGroup();n&&(t[n.getId()]=e.isExpanded())}),t):{}}setExpandedStates(t){if(!this.allColsTree)return;const{isInitialState:e}=this;this.forEachItem(n=>{if(!n.isGroup())return;const i=n.getColumnGroup();if(i){const s=t[i.getId()];(s!=null||e)&&n.setExpanded(!!s)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(t){const e=this.colDefService.createColumnTree(t);this.buildListModel(e),this.groupsExist=t.some(n=>n&&typeof n.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getColDefColTree()),this.groupsExist=this.columnModel.isProvidedColGroupsPresent()}buildListModel(t){const e=this.onColumnExpanded.bind(this),n=c=>{c.addEventListener("expandedChanged",e);const u=c.removeEventListener.bind(c,"expandedChanged",e);this.destroyColumnItemFuncs.push(u)},i=(c,u,p)=>{c.forEach(f=>{b.isProvidedColumnGroup(f)?s(f,u,p):l(f,u,p)})},s=(c,u,p)=>{const f=c.getColGroupDef();if(f&&f.suppressColumnsToolPanel)return;if(c.isPadding()){i(c.getChildren(),u,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),k=new Ud(y,c,u,!0,this.expandGroupsByDefault);p.push(k),n(k),i(c.getChildren(),u+1,k.getChildren())},l=(c,u,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new Ud(m,c,u))};this.destroyColumnTree(),i(t,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const t=n=>{n.isPassesFilter()&&(this.displayedColsList.push(n),n.isGroup()&&n.isExpanded()&&n.getChildren().forEach(t))};this.allColsTree.forEach(t),this.virtualList.setModel(new ev(this.displayedColsList));const e=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),e!=null&&this.focusRowIfAlive(e),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnPanelList","Column List"),n=t("columns","Columns"),i=this.displayedColsList.length;b._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${i} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(i=>{t(i),i.isGroup()&&e(i.getChildren())})};this.allColsTree&&e(this.allColsTree)}doSetExpandedAll(t){this.forEachItem(e=>{e.isGroup()&&e.setExpanded(t)})}setGroupsExpanded(t,e){if(!e){this.doSetExpandedAll(t);return}const n=[];this.forEachItem(s=>{if(!s.isGroup())return;const l=s.getColumnGroup().getId();e.indexOf(l)>=0&&(s.setExpanded(t),n.push(l))});const i=e.filter(s=>!b._includes(n,s));i.length>0&&b._warnOnce("unable to find group(s) for supplied groupIds:",i)}getExpandState(){let t=0,e=0;return this.forEachItem(n=>{n.isGroup()&&(n.isExpanded()?t++:e++)}),t>0&&e>0?2:e>0?1:0}doSetSelectedAll(t){this.modelItemUtils.selectAllChildren(this.allColsTree,t,this.eventType)}getSelectionState(){let t=0,e=0;const n=this.columnModel.isPivotMode();if(this.forEachItem(i=>{if(i.isGroup()||!i.isPassesFilter())return;const s=i.getColumn(),l=s.getColDef();let c;if(n){if(!s.isAllowPivot()&&!s.isAllowRowGroup()&&!s.isAllowValue())return;c=s.isValueActive()||s.isPivotActive()||s.isRowGroupActive()}else{if(l.lockVisible)return;c=s.isVisible()}c?t++:e++}),!(t>0&&e>0))return!(t===0||e>0)}setFilterText(t){this.filterText=b._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!b._exists(this.filterText))return!0;const i=n.getDisplayName();return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},e=(n,i)=>{let s=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(u=>{const p=e(u,c||i);p&&(s=p)})}const l=i||s?!0:t(n);return n.setPassesFilter(l),l};this.allColsTree.forEach(n=>e(n,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const t=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:t})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const t=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:t})}getExpandedGroups(){const t=[];return this.allColsTree&&this.forEachItem(e=>{e.isGroup()&&e.isExpanded()&&t.push(e.getColumnGroup().getId())}),t}},rv={selector:"AG-PRIMARY-COLS-LIST",component:nv},iv=class extends b.Component{constructor(){super(`<div class="ag-column-select">
38
+ </div>`,[b.AgCheckboxSelector]),this.eDragHandle=b._createIconNoSpan("columnDrag",this.gos),this.eDragHandle.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const t=this.cbSelect.getGui(),e=this.cbSelect.getInputElement();t.insertAdjacentElement("afterend",this.eDragHandle),e.setAttribute("tabindex","-1");const n=b._escapeString(this.displayName);this.eLabel.innerHTML=n;const i=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${i}`),this.getGui().style.setProperty("--ag-indentation-level",String(i)),this.setupDragging();const s=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:s}),this.addManagedListeners(this.column,{columnValueChanged:s,columnPivotChanged:s,columnRowGroupChanged:s,visibleChanged:s}),this.addManagedListeners(this.focusWrapper,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(this.cbSelect,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),b._getToolPanelClassesFromColDef(this.column.getColDef(),this.gos,this.column,null).forEach(c=>this.addOrRemoveCssClass(c,!0))}getColumn(){return this.column}setupTooltip(){const t=this.gos.get("tooltipShowMode")==="whenTruncated";let e;t&&(e=()=>this.eLabel.scrollWidth>this.eLabel.clientWidth);const n=()=>{const i=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:i,location:"columnToolPanelColumn",shouldDisplayTooltip:e})};n(),this.addManagedEventListeners({newColumnsLoaded:n})}getTooltipParams(){const t=super.getTooltipParams();return t.location="columnToolPanelColumn",t.colDef=this.column.getColDef(),t}onContextMenu(t){const{column:e,gos:n}=this;if(n.get("functionsReadOnly"))return;const i=this.createBean(new Ud(e,t,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}handleKeyDown(t){t.key===b.KeyCode.SPACE&&(t.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const t=!this.cbSelect.getValue();this.onChangeCommon(t)}onCheckboxChanged(t){this.onChangeCommon(t.selected)}onChangeCommon(t){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&this.modelItemUtils.setColumn(this.column,t,"toolPanelUi"))}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumn","Column"),n=this.cbSelect.getValue()?t("ariaVisible","visible"):t("ariaHidden","hidden"),i=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${i} (${n})`),b._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){b._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:b.DragSourceType.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>t?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{t=!this.gos.get("suppressDragLeaveHidesColumns"),this.eventService.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{this.eventService.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{t&&this.modelItemUtils.updateColumns({columns:[this.column],visibleState:n==null?void 0:n.visibleState,pivotState:n==null?void 0:n.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{t&&this.onChangeCommon(!1)}};this.dragAndDropService.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(e))}createDragItem(){const t=this.column.getColId(),e={[t]:this.column.isVisible()},n={[t]:this.modelItemUtils.createPivotState(this.column)};return{columns:[this.column],visibleState:e,pivotState:n}}onColumnStateChanged(){this.processingColumnStateChange=!0;const t=this.columnModel.isPivotMode();if(t){const i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const i=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();e=!i&&!s,n=e}else{const{enableRowGroup:i,enableValue:s,lockPosition:l,suppressMovable:c,lockVisible:u}=this.column.getColDef(),p=!!i||!!s,f=!!l||!!c;e=!u,n=p||!f}this.cbSelect.setReadOnly(!e),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!n),this.addOrRemoveCssClass("ag-column-select-column-readonly",!n&&!e),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(t){t!==this.cbSelect.getValue()&&(this.cbSelect.isReadOnly()||this.cbSelect.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(t){b._warnOnce("can not expand a column item that does not represent a column group header")}},ev=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},tv="ag-column-select-list",nv=class extends b.Component{constructor(){super(`<div class="${tv}" role="presentation"></div>`),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}wireBeans(t){this.columnModel=t.columnModel,this.columnNameService=t.columnNameService,this.colDefService=t.toolPanelColDefService,this.modelItemUtils=t.modelItemUtils}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(t=>t()),this.destroyColumnItemFuncs=[]}init(t,e,n){this.params=t,this.allowDragging=e,this.eventType=n,this.params.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const i=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:i,columnPivotModeChanged:i,columnRowGroupChanged:i,columnValueChanged:i,columnVisible:i,newColumnsLoaded:i}),this.expandGroupsByDefault=!this.params.contractColumnSelection,this.virtualList=this.createManagedBean(new Re.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((s,l)=>(b._setAriaLevel(l,s.getDept()+1),this.createComponentFromItem(s,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new Xy(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const i=new Zd(t,this.allowDragging,this.eventType,e);return this.createBean(i),i}const n=new Qy(t,this.allowDragging,this.groupsExist,e);return this.createBean(n),n}onColumnsChanged(){this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const t=this.getExpandedStates(),e=this.columnModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const t={};if(this.isInitialState){const{expandedGroupIds:e}=this.params.initialState;return e.forEach(n=>{t[n]=!0}),t}return this.allColsTree?(this.forEachItem(e=>{if(!e.isGroup())return;const n=e.getColumnGroup();n&&(t[n.getId()]=e.isExpanded())}),t):{}}setExpandedStates(t){if(!this.allColsTree)return;const{isInitialState:e}=this;this.forEachItem(n=>{if(!n.isGroup())return;const i=n.getColumnGroup();if(i){const s=t[i.getId()];(s!=null||e)&&n.setExpanded(!!s)}})}buildTreeFromWhatGridIsDisplaying(){this.colDefService.syncLayoutWithGrid(this.setColumnLayout.bind(this))}setColumnLayout(t){const e=this.colDefService.createColumnTree(t);this.buildListModel(e),this.groupsExist=t.some(n=>n&&typeof n.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){this.buildListModel(this.columnModel.getColDefColTree()),this.groupsExist=this.columnModel.isProvidedColGroupsPresent()}buildListModel(t){const e=this.onColumnExpanded.bind(this),n=c=>{c.addEventListener("expandedChanged",e);const u=c.removeEventListener.bind(c,"expandedChanged",e);this.destroyColumnItemFuncs.push(u)},i=(c,u,p)=>{c.forEach(f=>{b.isProvidedColumnGroup(f)?s(f,u,p):l(f,u,p)})},s=(c,u,p)=>{const f=c.getColGroupDef();if(f&&f.suppressColumnsToolPanel)return;if(c.isPadding()){i(c.getChildren(),u,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),T=new $d(y,c,u,!0,this.expandGroupsByDefault);p.push(T),n(T),i(c.getChildren(),u+1,T.getChildren())},l=(c,u,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new $d(m,c,u))};this.destroyColumnTree(),i(t,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const t=n=>{n.isPassesFilter()&&(this.displayedColsList.push(n),n.isGroup()&&n.isExpanded()&&n.getChildren().forEach(t))};this.allColsTree.forEach(t),this.virtualList.setModel(new ev(this.displayedColsList));const e=this.virtualList.getLastFocusedRow();this.virtualList.refresh(),e!=null&&this.focusRowIfAlive(e),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const t=this.localeService.getLocaleTextFunc(),e=t("ariaColumnPanelList","Column List"),n=t("columns","Columns"),i=this.displayedColsList.length;b._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${i} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(i=>{t(i),i.isGroup()&&e(i.getChildren())})};this.allColsTree&&e(this.allColsTree)}doSetExpandedAll(t){this.forEachItem(e=>{e.isGroup()&&e.setExpanded(t)})}setGroupsExpanded(t,e){if(!e){this.doSetExpandedAll(t);return}const n=[];this.forEachItem(s=>{if(!s.isGroup())return;const l=s.getColumnGroup().getId();e.indexOf(l)>=0&&(s.setExpanded(t),n.push(l))});const i=e.filter(s=>!b._includes(n,s));i.length>0&&b._warnOnce("unable to find group(s) for supplied groupIds:",i)}getExpandState(){let t=0,e=0;return this.forEachItem(n=>{n.isGroup()&&(n.isExpanded()?t++:e++)}),t>0&&e>0?2:e>0?1:0}doSetSelectedAll(t){this.modelItemUtils.selectAllChildren(this.allColsTree,t,this.eventType)}getSelectionState(){let t=0,e=0;const n=this.columnModel.isPivotMode();if(this.forEachItem(i=>{if(i.isGroup()||!i.isPassesFilter())return;const s=i.getColumn(),l=s.getColDef();let c;if(n){if(!s.isAllowPivot()&&!s.isAllowRowGroup()&&!s.isAllowValue())return;c=s.isValueActive()||s.isPivotActive()||s.isRowGroupActive()}else{if(l.lockVisible)return;c=s.isVisible()}c?t++:e++}),!(t>0&&e>0))return!(t===0||e>0)}setFilterText(t){this.filterText=b._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!b._exists(this.filterText))return!0;const i=n.getDisplayName();return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},e=(n,i)=>{let s=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(u=>{const p=e(u,c||i);p&&(s=p)})}const l=i||s?!0:t(n);return n.setPassesFilter(l),l};this.allColsTree.forEach(n=>e(n,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const t=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:t})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const t=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:t})}getExpandedGroups(){const t=[];return this.allColsTree&&this.forEachItem(e=>{e.isGroup()&&e.isExpanded()&&t.push(e.getColumnGroup().getId())}),t}},rv={selector:"AG-PRIMARY-COLS-LIST",component:nv},iv=class extends b.Component{constructor(){super(`<div class="ag-column-select">
39
39
  <ag-primary-cols-header data-ref="primaryColsHeaderPanel"></ag-primary-cols-header>
40
40
  <ag-primary-cols-list data-ref="primaryColsListPanel"></ag-primary-cols-list>
41
41
  </div>`,[Jy,rv]),this.primaryColsHeaderPanel=b.RefPlaceholder,this.primaryColsListPanel=b.RefPlaceholder}init(t,e,n){this.allowDragging=t,this.params=e,this.eventType=n,this.primaryColsHeaderPanel.init(this.params);const i=this.params.suppressColumnFilter,s=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&i&&s&&this.primaryColsHeaderPanel.setDisplayed(!1),this.addManagedListeners(this.primaryColsListPanel,{groupExpanded:this.onGroupExpanded.bind(this),selectionChanged:this.onSelectionChange.bind(this)}),this.primaryColsListPanel.init(this.params,this.allowDragging,this.eventType),this.addManagedListeners(this.primaryColsHeaderPanel,{expandAll:this.onExpandAll.bind(this),collapseAll:this.onCollapseAll.bind(this),selectAll:this.onSelectAll.bind(this),unselectAll:this.onUnselectAll.bind(this),filterChanged:this.onFilterChanged.bind(this)}),this.positionableFeature=new b.PositionableFeature(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature)}toggleResizable(t){this.positionableFeature.setResizable(t?{bottom:!0}:!1)}onExpandAll(){this.primaryColsListPanel.doSetExpandedAll(!0)}onCollapseAll(){this.primaryColsListPanel.doSetExpandedAll(!1)}expandGroups(t){this.primaryColsListPanel.setGroupsExpanded(!0,t)}collapseGroups(t){this.primaryColsListPanel.setGroupsExpanded(!1,t)}setColumnLayout(t){this.primaryColsListPanel.setColumnLayout(t)}onFilterChanged(t){this.primaryColsListPanel.setFilterText(t.filterText)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}onSelectAll(){this.primaryColsListPanel.doSetSelectedAll(!0)}onUnselectAll(){this.primaryColsListPanel.doSetSelectedAll(!1)}onGroupExpanded(t){this.primaryColsHeaderPanel.setExpandState(t.state),this.params.onStateUpdated()}onSelectionChange(t){this.primaryColsHeaderPanel.setSelectionState(t.state)}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},Wd=class extends b.Component{constructor(){super(...arguments),this.cbPivotMode=b.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel,this.ctrlsService=t.ctrlsService}createTemplate(){return`<div class="ag-pivot-mode-panel">
42
42
  <ag-toggle-button data-ref="cbPivotMode" class="ag-pivot-mode-select"></ag-toggle-button>
43
- </div>`}postConstruct(){this.setTemplate(this.createTemplate(),[b.AgToggleButtonSelector]),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const t=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(t("pivotMode","Pivot Mode")),this.addManagedListeners(this.cbPivotMode,{fieldValueChanged:this.onBtPivotMode.bind(this)});const e=this.onPivotModeChanged.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnPivotModeChanged:e})}onBtPivotMode(){const t=!!this.cbPivotMode.getValue();t!==this.columnModel.isPivotMode()&&(this.gos.updateGridOptions({options:{pivotMode:t},source:"toolPanelUi"}),this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}onPivotModeChanged(){const t=this.columnModel.isPivotMode();this.cbPivotMode.setValue(t)}},ov=class extends b.Component{constructor(){super('<div class="ag-column-panel"></div>'),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(t){super.setDisplayed(t),t&&!this.initialised&&this.init(this.params)}init(t){const e=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params={...e,...t},this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new Wd),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new iv),this.childDestroyFuncs.push(()=>this.destroyBean(this.primaryColsPanel)),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new Ka(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new Gd(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new qa(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const[n]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});this.childDestroyFuncs.push(()=>n())}this.initialised=!0}setPivotModeSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(t):t&&(this.pivotModePanel=this.createBean(new Wd),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(t):t&&(this.rowGroupDropZonePanel=this.createManagedBean(new Ka(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new Gd(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new qa(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(t)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(t=>{if(!t)return;const e=t.getGui();t.toggleResizable(!e.classList.contains("ag-last-column-drop")&&!e.classList.contains("ag-hidden"))})}setLastVisible(){const t=this.getGui();Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop")).forEach(s=>s.classList.remove("ag-last-column-drop"));const n=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=b._last(n);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let n=0;n<e.length;n++){const i=e[n];i.style.removeProperty("height"),i.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return this.gos.assertModuleRegistered(b.ModuleNames.RowGroupingModule,"Row Grouping")}expandColumnGroups(t){this.primaryColsPanel.expandGroups(t)}collapseColumnGroups(t){this.primaryColsPanel.collapseGroups(t)}setColumnLayout(t){this.primaryColsPanel.setColumnLayout(t)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(t=>t()),this.childDestroyFuncs.length=0,b._clearElement(this.getGui())}refresh(t){return this.destroyChildren(),this.init(t),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},sv=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="modelItemUtils"}wireBeans(t){this.aggFuncService=t.aggFuncService,this.columnModel=t.columnModel,this.columnApplyStateService=t.columnApplyStateService}selectAllChildren(t,e,n){const i=this.extractAllLeafColumns(t);this.setAllColumns(i,e,n)}setColumn(t,e,n){this.setAllColumns([t],e,n)}setAllColumns(t,e,n){this.columnModel.isPivotMode()?this.setAllPivot(t,e,n):this.setAllVisible(t,e,n)}extractAllLeafColumns(t){const e=[],n=i=>{i.forEach(s=>{s.isPassesFilter()&&(s.isGroup()?n(s.getChildren()):e.push(s.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const i=[];t.forEach(s=>{s.getColDef().lockVisible||s.isVisible()!=e&&i.push({colId:s.getId(),hide:!e})}),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}setAllPivot(t,e,n){this.setAllPivotActive(t,e,n)}setAllPivotActive(t,e,n){const i=[],c=e?u=>{var p;if(!u.isAnyFunctionActive())if(u.isAllowValue()){const f=typeof u.getAggFunc()=="string"?u.getAggFunc():(p=this.aggFuncService)==null?void 0:p.getDefaultAggFunc(u);i.push({colId:u.getId(),aggFunc:f})}else u.isAllowRowGroup()?i.push({colId:u.getId(),rowGroup:!0}):u.isAllowPivot()&&i.push({colId:u.getId(),pivot:!0})}:u=>{(u.isPivotActive()||u.isRowGroupActive()||u.isValueActive())&&i.push({colId:u.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(c),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:i,eventType:s}=t,l=e.map(c=>{const u=c.getColId();if(this.columnModel.isPivotMode()){const p=i==null?void 0:i[u];return{colId:u,pivot:p==null?void 0:p.pivot,rowGroup:p==null?void 0:p.rowGroup,aggFunc:p==null?void 0:p.aggFunc}}else return{colId:u,hide:!(n!=null&&n[u])}});this.columnApplyStateService.applyColumnState({state:l},s)}createPivotState(t){return{pivot:t.isPivotActive(),rowGroup:t.isRowGroupActive(),aggFunc:t.isValueActive()?t.getAggFunc():void 0}}},av="32.3.3",Hd=b._defineModule({version:av,moduleName:b.ModuleNames.ColumnsToolPanelModule,beans:[sv],userComponents:[{name:"agColumnsToolPanel",classImp:ov},{name:"agMenuItem",classImp:Re.AgMenuItemRenderer}],dependantModules:[Re.EnterpriseCoreModule,Ky,Ha]});function jd(){b.ModuleRegistry.registerModules([Qo.ClientSideRowModelModule,qf.InfiniteRowModelModule,od.ServerSideRowModelModule,Kf.CsvExportModule,sd.ClipboardModule,ad.RangeSelectionModule,Yf.RichSelectModule,Jf.MenuModule,Xf.ExcelExportModule,Ha,Hd]);const t=_g("AGGRID_LICENSE");t?(Re.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const qd=Qf.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#110529",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",checkboxUncheckedBorderColor:"#CFD1DB",columnBorder:!0,columnHoverColor:"#9BABCC16",fontFamily:"inherit",foregroundColor:"#110529",headerBackgroundColor:"#F7F8FA",headerColumnBorder:!0,headerFontWeight:600,headerRowBorder:!0,headerVerticalPaddingScale:.8,iconButtonHoverColor:"#9BABCC32",iconSize:"16px",menuBackgroundColor:"#FFFFFF",menuBorder:!0,menuTextColor:"#110529",rowHoverColor:"#9BABCC16",rowVerticalPaddingScale:1,selectedRowBackgroundColor:"#63E02424",sidePanelBorder:!1,spacing:"8px",tooltipBackgroundColor:"#110529",tooltipTextColor:"#FFFFFF",wrapperBorderRadius:"6px"}),Kd=Symbol("sdk-vue");function Xa(){return r.inject(Kd)}function lv(t,e){let n;jd();const i=()=>{t.loadBlockState().then(l=>{s.loaded=!0;const c=um(l,t),u=e(c),p=Object.fromEntries(Object.entries(u.routes).map(([f,m])=>{const y=typeof m=="function"?m():m;return[f,r.markRaw(y)]}));n=Object.assign(c,{...u,getRoute(f){return p[f]}})}).catch(l=>{console.error("load initial state error",l),s.error=l})},s=r.reactive({loaded:!1,error:void 0,useApp(){return tm(n,"App is not loaded")},install(l){l.provide(Kd,this),i()}});return s}var cv=Object.defineProperty,dv=(t,e,n)=>e in t?cv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,uv=(t,e,n)=>dv(t,e+"",n);function Yd(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function pv(t,e,n){const i=Math.min(e,n),s=Math.max(e,n);return t>=i&&t<=s}function hv(t){return new Promise(e=>setTimeout(e,t))}function fv(t){return t()}function us(t,e,n){return e>t?e:t>n?n:t}function Jd(t,e){return e(t)}function Mr(t,e){if(t!=null)return e(t)}function mv(t){if(t&&t.ok)return t.value}async function gv(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const Xd=t=>t;function yv(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function vv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(yv(65,91));return e}function _v(){return vv(42)}function oo(t){return t!==null&&typeof t=="object"}function Cv(t,e){return Object.keys(t).map(n=>e(t[n],n))}function so(t,e){return oo(t)&&oo(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>so(t[n],e[n])):t===e}function ao(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=ao(t[n]);return e}else if(oo(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=ao(t[n])}),e}else return t}function wv(t){return Array.isArray(t)?Object.assign([],t):oo(t)?Object.assign({},t):t}function bv(t,e){const n={};for(const i in e)e[i]!==t[i]&&(n[i]=t[i]);return n}function xv(t,e,n){return Object.assign({},t,{[e]:n})}function kv(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function Sv(t,e,n){return t[e]=n,t}function Ev(t,e){return t[e]}function Tv(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function Bv(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function Av(t,...e){return e.map(n=>t[n])}function Nv(t,...e){const n=Object.assign({},t);return e.forEach(i=>delete n[i]),n}const Qa=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:kv,deepClone:ao,deepEqual:so,getProp:Ev,iSet:xv,isObject:oo,map:Cv,omit:Nv,pick:Bv,pickValues:Av,setProp:Sv,shallowClone:wv,shallowDiff:bv,shiftProp:Tv},Symbol.toStringTag,{value:"Module"}));function Vv(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}function Qd(t,e,n){let i;return function(...s){i&&clearTimeout(i),i=setTimeout(()=>{i=void 0,t.apply(this,s)},e)}}const Pv=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Dv=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Fv=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Rv=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],eu=(t,e)=>{let n=String(t);return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e):e===!0&&(n=t.toLocaleString(void 0)),n};function el(t,e){if(t=typeof t=="bigint"?Number(t):t,!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);Object.assign(e,{bits:!1,binary:!1});const n=e.bits?e.binary?Rv:Fv:e.binary?Dv:Pv;if(e.signed&&t===0)return` 0 ${n[0]}`;const i=t<0,s=i?"-":e.signed?"+":"";if(i&&(t=-t),t<1){const p=eu(t,e.locale);return s+p+" "+n[0]}const l=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),n.length-1);t/=(e.binary?1024:1e3)**l,t=Number(t.toPrecision(3));const c=eu(Number(t),e.locale),u=n[l];return s+c+" "+u}const Mv={class:"context-menu"},Iv=["onClick"],Ov=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,i=s=>{s.cb(),n("close")};return(s,l)=>(r.openBlock(),r.createElementBlock("div",Mv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createElementBlock("div",{key:u,onClick:r.withModifiers(p=>i(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,Iv))),128))]))}}),Tn=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},Lv=Tn(Ov,[["__scopeId","data-v-12530966"]]);function tl(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},i=r.h(Lv,{options:e,onClose:()=>{n()}});r.render(i,document.body);const s=i.el;return s.style.top=t.clientY+"px",s.style.left=t.clientX+"px",document.addEventListener("click",l=>{s.contains(l.target)||n()}),n}const tu=Symbol(),ps=()=>r.inject(tu),Gv=["value"],zv={key:1},Uv=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.reactive({edit:!1}),l=r.computed(()=>i.valueType),c=f=>{var m;let y=(m=f.target)==null?void 0:m.value;const k=r.unref(l),S=fv(()=>k==="integer"?parseInt(y,10):k==="float"?Number(y):y);n("update:modelValue",S),s.edit=!1},u=r.ref(),p=f=>{!f.metaKey&&i.editable&&(s.edit=!0,requestAnimationFrame(()=>{var m,y;(y=(m=u.value)==null?void 0:m.querySelector("input"))==null||y.focus()}))};return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"baseRef",ref:u,class:r.normalizeClass(["base-cell",{"base-cell__edit":s.edit}]),onClick:p},[s.edit?(r.openBlock(),r.createElementBlock("input",{key:0,value:f.modelValue,onFocusout:m[0]||(m[0]=y=>s.edit=!1),onChange:c},null,40,Gv)):(r.openBlock(),r.createElementBlock("div",zv,r.toDisplayString(f.modelValue),1))],2))}}),Zv=["^data-row-index"],$v={key:0,class:"control-cell"},Wv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=ps(),i=r.computed(()=>e.cell.column.valueType),s=f=>{Mr(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,k={...y.dataRow,[e.cell.id]:f};m({...y,dataRow:k})})},l=f=>{f.metaKey&&n.selectRow(e.cell.row.primaryKey)},c=(f,m)=>{if(f.type==="contextmenu")f.preventDefault();else return;const y=n.settings??{},k=[],{onSelectedRows:S,onSelectedColumns:M}=y.value,T=n.data.selectedRows.has(m.primaryKey);S&&S.length&&(T?k.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):k.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),M&&M.length&&(k.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),k.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),k.length&&tl(f,k)},u=r.ref(),p=r.computed(()=>e.cell.column.component?e.cell.column.component():void 0);return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"cellRef",ref:u,class:r.normalizeClass(["td-cell",{[f.cell.class]:!0}]),"^data-row-index":f.cell.row.index,onClick:l,onContextmenu:m[0]||(m[0]=y=>c(y,f.cell.row))},[f.cell.control?(r.openBlock(),r.createElementBlock("div",$v,r.toDisplayString(f.cell.row.index),1)):p.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.value),{key:1,"model-value":f.cell.value,"onUpdate:modelValue":s},null,8,["model-value"])):(r.openBlock(),r.createBlock(Uv,{key:2,"model-value":f.cell.value,"value-type":i.value,editable:f.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,Zv))}}),Hv={},jv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qv(t,e){return r.openBlock(),r.createElementBlock("svg",jv,e[0]||(e[0]=[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 41.5H9C7.61929 41.5 6.5 40.3807 6.5 39V24H9.5V38.5H24V41.5Z",fill:"#CFD1DB"},null,-1),r.createTextVNode(),r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M41.5 9C41.5 7.61929 40.3807 6.5 39 6.5H9C7.61929 6.5 6.5 7.61929 6.5 9V19.5H9.5H28.5V38.5V41.5H39C40.3807 41.5 41.5 40.3807 41.5 39V9ZM38.5 9.5V16.5H31.5V9.5H38.5ZM38.5 38.5V19.5H31.5V38.5H38.5ZM9.5 9.5V16.5H28.5V9.5H9.5Z",fill:"#CFD1DB"},null,-1)]))}const Kv=Tn(Hv,[["render",qv]]),Yv={class:"tr-head"},Jv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Yv,[r.renderSlot(e.$slots,"default")]))}});function Xv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function Qv(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}const e_=["^data-col-id"],t_=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function i(l){l.preventDefault();const c=[];c.length&&tl(l,c)}function s(l){var c;const u=((c=l.sort)==null?void 0:c.direction)??"DESC";n("change:sort",{colId:l.id,direction:Xv(u,["DESC","ASC"])})}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["cell th-cell",{"justify-center":l.col.justify,frozen:l.col.frozen}]),"^data-col-id":l.col.id,onContextmenu:i},[l.col.valueType?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(l.col.valueType)},null,2)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(l.col.label)+" ",1),l.col.sort?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["sort",l.col.sort.direction]),onClick:c[0]||(c[0]=r.withModifiers(()=>s(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,e_))}}),n_=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Mr(e.value,i=>i.scrollLeft=0)})};return(i,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:i.row.selected}]),scroll:"no",style:r.normalizeStyle(i.row.style),onScroll:n},[r.renderSlot(i.$slots,"default")],38))}}),r_=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=ps(),n=t,i=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:i.value,frozen:s.column.frozen}])},null,2))}});function tt(t,e,n,i){r.onMounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.addEventListener(e,n,i)}),r.onUnmounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.removeEventListener(e,n,i)})}function i_(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function o_(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function s_(t,e){let n;function i(l){n={...l}}i_(()=>{n=void 0,e()});const s=o_(t);return tt(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:i}}const ci=1,a_=10,l_=30,nu=60;function ru(){const t=r.reactive({x:0,y:0});function e(n){t.x=n.pageX,t.y=n.pageY}return r.onMounted(()=>window.addEventListener("mousemove",e)),r.onUnmounted(()=>window.removeEventListener("mousemove",e)),t}function iu(t,e={}){const{delayEnter:n=0,delayLeave:i=0}=e,s=r.ref(!1);let l;const c=u=>{const p=u?n:i;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>s.value=u,p):s.value=u};return window&&(tt(t,"mouseenter",()=>c(!0)),tt(t,"mouseleave",()=>c(!1))),s}function c_(t){var e;const n=Mr((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),i=>[...i])??[];return n.map(i=>{const{width:s,x:l}=i.getBoundingClientRect(),c=i.getAttribute("data-col-id");return Xd({colId:c,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function d_(t,e){const n=ru(),i=iu(e,{}),{data:s}=t,l=s_(u=>{Mr(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=us(u.width+u.diff,l_,1e4),t.adjustWidth())})},()=>{s.resize=!1,s.resizeTh=void 0,document.body.style.cursor=""}),c=u=>{s.resizeTh&&(s.resize=!0,l.start({x:u.x,width:s.resizeTh.width}))};return r.watchEffect(()=>{if(!i.value){document.body.style.cursor="";return}if(s.resize)return;const u=c_(e).find(p=>Math.abs(n.x-p.right)<a_);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const u_={key:0,class:"command-menu"},p_={key:0},h_=["onClick"],f_=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=ps(),n=r.computed(()=>e.getSelectedRows()),i=r.computed(()=>n.value.length>0),s=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedRows)??[]}),l=r.computed(()=>s.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(c,u)=>i.value?(r.openBlock(),r.createElementBlock("div",u_,[n.value.length?(r.openBlock(),r.createElementBlock("span",p_,r.toDisplayString(n.value.length)+" rows selected",1)):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),u[1]||(u[1]=r.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,f)=>(r.openBlock(),r.createElementBlock("span",{key:f,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,h_))),128))])):r.createCommentVNode("",!0)}}),m_={key:0,class:"command-menu"},g_={key:0},y_=["onClick"],v_=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=ps(),n=r.computed(()=>e.getSelectedColumns()),i=r.computed(()=>n.value.length>0),s=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedColumns)??[]}),l=r.computed(()=>s.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedColumns.clear()}})));return(c,u)=>i.value?(r.openBlock(),r.createElementBlock("div",m_,[n.value.length?(r.openBlock(),r.createElementBlock("span",g_,"selected columns "+r.toDisplayString(n.value.length),1)):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),u[1]||(u[1]=r.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,f)=>(r.openBlock(),r.createElementBlock("span",{key:f,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,y_))),128))])):r.createCommentVNode("",!0)}});function sr(t,e){const n={el:void 0,x:0,y:0},i=s=>({x:s.x,y:s.y,dx:s.x-n.x,dy:s.y-n.y});tt(document,"mousedown",s=>{s.target===r.unref(t)&&(s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault(),n.el=r.unref(t),n.x=s.x,n.y=s.y)}),tt(document,"mouseup",s=>{n.el&&(n.el=void 0,e({...i(s),stop:!0},n))}),tt(document,"mousemove",s=>{n.el&&e(i(s),n)})}const __=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.windowSize-12),c=r.computed(()=>i.windowSize<i.dataSize),u=r.computed(()=>Math.ceil(i.offset*(l.value/i.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/i.dataSize)),f=r.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return sr(s,(m,y)=>{const k=(u.value+m.dy)*i.dataSize/l.value;n("change:offset",k),y.x=m.x,y.y=m.y}),(m,y)=>(r.openBlock(),r.createElementBlock("div",{class:"t-scroll",style:r.normalizeStyle({height:`${m.windowSize}px`})},[r.createElementVNode("div",null,[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"handleRef",ref:s,class:"t-scroll__handle",style:r.normalizeStyle(f.value)},null,4)):r.createCommentVNode("",!0)])],4))}});function C_(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:i,scrollLeft:s}=e,l=[...e.columns],c=_v();n.value.controlColumn&&l.unshift({id:c,label:"#",width:60,frozen:!0});let u=0;const p=l.map(m=>{const y={...m,offset:u};return u+=m.width+ci,y}),f=p.filter(m=>m.frozen);return Vv(p,m=>m.frozen?!1:s<m.offset+m.width&&m.offset<i+s).concat(f).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===c}))})}function w_(t,e){const n=r.computed(()=>e.value.reduce((i,s)=>(i[s.id]=s.justify?"justify-"+s.justify:"",i),{}));return r.computed(()=>t.rows.map(i=>{const s=n.value,{primaryKey:l,offset:c,dataRow:u,height:p}=i,f=e.value.map(m=>({id:m.id,column:m,row:i,value:u[m.id],class:s[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return Xd({style:{top:`${c-t.scrollTop}px`,height:`${i.height}px`},primaryKey:l,offset:c,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const b_=async(t,e)=>{const{scrollTop:n,bodyHeight:i}=t;return await hv(0),gv({rows:e.getRows(n,i),dataWindow:t})};function x_(t){const e=r.reactive({rowIndex:-1,columns:[],pendingLoads:0,currentWindow:void 0,rows:[],resize:!1,resizeTh:void 0,dataHeight:0,bodyHeight:t.settings.height,bodyWidth:0,scrollTop:0,scrollLeft:0,selectedRows:new Set,selectedColumns:new Set});r.watch(()=>t.settings,m=>{e.columns=ao(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(y=>{e.dataHeight=y,f.updateBodyHeight()}).catch(y=>e.error=y)},{immediate:!0});const n=r.computed(()=>t.settings),i=r.computed(()=>e.columns.reduce((m,y)=>m+y.width+ci,0)),s=r.computed(()=>Jd(f.data.dataHeight-f.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>Jd(i.value-f.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=C_({data:e,settings:n}),p=w_(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((k,S)=>k+S.width+ci,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const k=e.columns[e.columns.length-1];k.width=k.width+(y-m)}},updateOffsets(m){this.updateScrollTop(e.scrollTop+m.deltaY),this.updateScrollLeft(e.scrollLeft+m.deltaX)},getSelectedRows(){return e.rows.filter(m=>e.selectedRows.has(m.primaryKey))},getSelectedColumns(){return e.columns.filter(m=>e.selectedColumns.has(m.id))},selectRow(m){e.selectedRows.add(m)},unselectRow(m){e.selectedRows.delete(m)},selectColumn(m){e.selectedColumns.add(m)},unselectColumn(m){e.selectedColumns.delete(m)},updateScrollTop(m){e.scrollTop=us(m,0,s.value)},updateScrollLeft(m){e.scrollLeft=us(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:y}=e,k=m>y?y:m;e.bodyHeight=k},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,y)=>{const k=m.current;(!k||m.scrollTop<k.scrollTop||m.scrollTop+m.bodyHeight>k.bodyHeight+k.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-nu,bodyHeight:m.bodyHeight+nu*2},b_(ao(e.currentWindow),n.value.dataSource).then(({rows:S,dataWindow:M})=>{so(e.currentWindow,M)&&(e.rows=S)}))},{deep:!0,immediate:!0}),r.provide(tu,f),f}const k_={class:"command-menu__container"},S_={key:0,class:"table-body__no-data"},E_={class:"carets"},nl=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,i=t,s=x_(i),l=r.computed(()=>s.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,T=>n("update:data",T),{deep:!0}),r.watch(i,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Mr(f.value,T=>{s.updateDimensions(T.getBoundingClientRect())})},y=s.tableColumns,k=s.tableRows,{mouseDown:S}=d_(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(i.settings),r.nextTick(m)}),tt(window,"resize",()=>r.nextTick(m));const M=T=>{T.preventDefault(),s.updateOffsets(T)};return(T,R)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:R[2]||(R[2]=(...C)=>r.unref(S)&&r.unref(S)(...C))},[r.createElementVNode("div",k_,[r.createVNode(f_),R[3]||(R[3]=r.createTextVNode()),r.createVNode(v_)]),R[7]||(R[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(Jv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,G)=>(r.openBlock(),r.createBlock(t_,{key:G,col:C,style:r.normalizeStyle(C.style),"onChange:sort":R[0]||(R[0]=X=>T.$emit("change:sort",X))},null,8,["col","style"]))),128))]),_:1})],512),R[8]||(R[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(c.value),onWheel:M},[l.value?(r.openBlock(),r.createElementBlock("div",S_,[r.createElementVNode("div",null,[r.createVNode(Kv),R[4]||(R[4]=r.createTextVNode()),R[5]||(R[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),R[6]||(R[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(k),(C,G)=>(r.openBlock(),r.createBlock(n_,{key:G,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,X=>(r.openBlock(),r.createBlock(Wv,{key:X.column.id+":"+G,cell:X,style:r.normalizeStyle(X.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),R[9]||(R[9]=r.createTextVNode()),r.createElementVNode("div",E_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,G)=>(r.openBlock(),r.createBlock(r_,{key:G,column:C,style:r.normalizeStyle(C.style),"onChange:sort":R[1]||(R[1]=X=>T.$emit("change:sort",X))},null,8,["column","style"]))),128))]),R[10]||(R[10]=r.createTextVNode()),r.createVNode(__,{offset:r.unref(s).data.scrollTop,"window-size":r.unref(s).data.bodyHeight,"data-size":r.unref(s).data.dataHeight,"onChange:offset":r.unref(s).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),ou=new WeakMap;class T_{constructor(e,n,i){uv(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=i;const s=e.reduce((c,u,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(u,p)+ci,c),{total:0,indices:new Map});this.dataHeight=s.total;const l=e.map((c,u)=>({dataRow:c,index:u,primaryKey:this.resolvePrimaryKey(c,u),offset:Yd(s.indices.get(u)),height:this.resolveHeight(c,u)}));ou.set(this,l)}get rows(){return ou.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return Qv(this.rows,i=>{const s=i.offset;return e<s+i.height&&s<n+e})}}class B_{constructor(e,n,i){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=i}get height(){return this.rowHeight+ci}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const i=us(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(n+40/this.height);return(await this.api.query({offset:i,limit:s})).map((l,c)=>({dataRow:l,index:i+c,primaryKey:this.resolvePrimaryKey(l,i+c),offset:(i+c)*(this.rowHeight+ci),height:this.rowHeight}))}}function A_(t){return Object.freeze(t)}function N_(t){return r.h(nl,{settings:Object.freeze(t)})}function rl(t,e){const n=new T_(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function V_(t,e){return r.computed(()=>{const n=r.unref(t);return rl(n,r.unref(e))})}function P_(t,e){const n=r.computed(()=>{const s=r.unref(t);return rl(s,r.unref(e))}),i=r.reactive({settings:n});return r.computed(()=>r.h(nl,i))}const D_=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:B_,Component:nl,factory:N_,rawDataSettings:rl,settings:A_,useRawData:V_,useRawDataComponent:P_},Symbol.toStringTag,{value:"Module"}));function*F_(t,e){for(const n of t)yield e(n)}function R_(t){const e=[];for(const n of t)e.push(n);return e}function su(t){return t()}function il(t,e){if(t==null)throw Error(e);return t}function ol(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function au(t){return new Promise(e=>setTimeout(e,t))}function lu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function cu(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function M_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(cu(65,91));return e}function du(t){return function(e){return 1-t(1-e)}}function I_(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function uu(t){const{duration:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function O_(t){const{getFraction:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=e(u-s);if(l)return;p>1&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function pu(t,e){let n=-1;return(...i)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...i),e)}}function hu(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function L_(t){return t.map(e=>({text:String(e),value:e}))}function ar(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const sl=new Map;function G_(t){return sl.has(t)||sl.set(t,r.ref(localStorage.getItem(t))),il(sl.get(t),"...")}function z_(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function fu(t){const e=G_(t);return r.watch(e,n=>z_(t,n)),e}const al=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{R_(F_(al.values(),e=>e(t.matches?"dark":"light")))});const U_=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",mu=r.ref(U_),ll=fu("theme");function gu(t){const e=r.computed(()=>ll.value?ll.value:mu.value),n=s=>{mu.value=s,t&&t(s)};function i(){ll.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,s=>{t&&t(r.unref(s))}),r.onMounted(()=>{al.add(n)}),r.onUnmounted(()=>{al.delete(n)}),[e,i]}const Z_=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=gu();return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:s[0]||(s[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},s[1]||(s[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),$_={class:"pl-layout-component pl-block-page"},W_={key:0,class:"pl-block-page__title"},H_={class:"pl-block-page__title__append"},j_={key:1},q_={class:"pl-block-page__body"},K_={name:"PlBlockPage"},Y_=r.defineComponent({...K_,setup(t){const e=r.useSlots();return(n,i)=>(r.openBlock(),r.createElementBlock("div",$_,[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",W_,[r.createElementVNode("h1",null,[r.renderSlot(n.$slots,"title")]),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",H_,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",j_)),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",q_,[r.renderSlot(n.$slots,"default")])]))}}),J_={name:"PlContainer"},X_=r.defineComponent({...J_,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),Q_={name:"PlRow"},eC=r.defineComponent({...Q_,props:{wrap:{type:Boolean},alignCenter:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-row",{wrap:e.wrap,"align-center":e.alignCenter}])},[r.renderSlot(e.$slots,"default")],2))}}),tC={class:"pl-layout-component",style:{"flex-grow":"1"}},nC={name:"PlSpacer"},yu=r.defineComponent({...nC,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",tC))}}),rC={name:"PlGrid"},iC=r.defineComponent({...rC,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),oC={key:0,class:"pl-alert__icon"},sC={class:"pl-alert__main"},aC={key:0},lC={class:"pl-alert__main__text"},cC={name:"PlAlert"},dC=r.defineComponent({...cC,props:{modelValue:{type:Boolean,default:!0},type:{default:void 0},label:{default:void 0},icon:{type:Boolean,default:void 0},closeable:{type:Boolean,default:void 0},monospace:{type:Boolean,default:void 0},whiteSpacePre:{type:Boolean,default:void 0},maxHeight:{default:void 0}},emits:["update:modelValue"],setup(t){const e={success:"success",warn:"warning",info:"edit",error:"error"};return(n,i)=>n.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-alert",[{monospace:n.monospace,whiteSpacePre:n.whiteSpacePre},n.type?`pl-alert__${n.type}`:""]]),style:r.normalizeStyle({maxHeight:n.maxHeight})},[n.icon&&n.type?(r.openBlock(),r.createElementBlock("div",oC,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),i[2]||(i[2]=r.createTextVNode()),r.createElementVNode("div",sC,[n.label?(r.openBlock(),r.createElementBlock("label",aC,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",lC,[r.renderSlot(n.$slots,"default")])]),i[3]||(i[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:i[0]||(i[0]=s=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),uC=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
43
+ </div>`}postConstruct(){this.setTemplate(this.createTemplate(),[b.AgToggleButtonSelector]),this.cbPivotMode.setValue(this.columnModel.isPivotMode());const t=this.localeService.getLocaleTextFunc();this.cbPivotMode.setLabel(t("pivotMode","Pivot Mode")),this.addManagedListeners(this.cbPivotMode,{fieldValueChanged:this.onBtPivotMode.bind(this)});const e=this.onPivotModeChanged.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnPivotModeChanged:e})}onBtPivotMode(){const t=!!this.cbPivotMode.getValue();t!==this.columnModel.isPivotMode()&&(this.gos.updateGridOptions({options:{pivotMode:t},source:"toolPanelUi"}),this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}onPivotModeChanged(){const t=this.columnModel.isPivotMode();this.cbPivotMode.setValue(t)}},ov=class extends b.Component{constructor(){super('<div class="ag-column-panel"></div>'),this.initialised=!1,this.childDestroyFuncs=[]}setVisible(t){super.setDisplayed(t),t&&!this.initialised&&this.init(this.params)}init(t){const e=this.gos.addGridCommonParams({suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1});if(this.params={...e,...t},this.isRowGroupingModuleLoaded()&&!this.params.suppressPivotMode&&(this.pivotModePanel=this.createBean(new Wd),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new iv),this.childDestroyFuncs.push(()=>this.destroyBean(this.primaryColsPanel)),this.primaryColsPanel.init(!0,this.params,"toolPanelUi"),this.primaryColsPanel.addCssClass("ag-column-panel-column-select"),this.appendChild(this.primaryColsPanel),this.isRowGroupingModuleLoaded()){this.params.suppressRowGroups||(this.rowGroupDropZonePanel=this.createBean(new Ka(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new Gd(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new qa(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotDropZonePanel)),this.appendChild(this.pivotDropZonePanel)),this.setLastVisible();const[n]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});this.childDestroyFuncs.push(()=>n())}this.initialised=!0}setPivotModeSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotModePanel?this.pivotModePanel.setDisplayed(t):t&&(this.pivotModePanel=this.createBean(new Wd),this.getGui().insertBefore(this.pivotModePanel.getGui(),this.getGui().firstChild),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel))),this.setLastVisible())}setRowGroupsSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.rowGroupDropZonePanel?this.rowGroupDropZonePanel.setDisplayed(t):t&&(this.rowGroupDropZonePanel=this.createManagedBean(new Ka(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new Gd(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new qa(!1)),this.appendChild(this.pivotDropZonePanel),this.pivotDropZonePanel.setDisplayed(t)),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(t=>{if(!t)return;const e=t.getGui();t.toggleResizable(!e.classList.contains("ag-last-column-drop")&&!e.classList.contains("ag-hidden"))})}setLastVisible(){const t=this.getGui();Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop")).forEach(s=>s.classList.remove("ag-last-column-drop"));const n=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=b._last(n);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let n=0;n<e.length;n++){const i=e[n];i.style.removeProperty("height"),i.style.removeProperty("flex")}}isRowGroupingModuleLoaded(){return this.gos.assertModuleRegistered(b.ModuleNames.RowGroupingModule,"Row Grouping")}expandColumnGroups(t){this.primaryColsPanel.expandGroups(t)}collapseColumnGroups(t){this.primaryColsPanel.collapseGroups(t)}setColumnLayout(t){this.primaryColsPanel.setColumnLayout(t)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){this.childDestroyFuncs.forEach(t=>t()),this.childDestroyFuncs.length=0,b._clearElement(this.getGui())}refresh(t){return this.destroyChildren(),this.init(t),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},sv=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="modelItemUtils"}wireBeans(t){this.aggFuncService=t.aggFuncService,this.columnModel=t.columnModel,this.columnApplyStateService=t.columnApplyStateService}selectAllChildren(t,e,n){const i=this.extractAllLeafColumns(t);this.setAllColumns(i,e,n)}setColumn(t,e,n){this.setAllColumns([t],e,n)}setAllColumns(t,e,n){this.columnModel.isPivotMode()?this.setAllPivot(t,e,n):this.setAllVisible(t,e,n)}extractAllLeafColumns(t){const e=[],n=i=>{i.forEach(s=>{s.isPassesFilter()&&(s.isGroup()?n(s.getChildren()):e.push(s.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const i=[];t.forEach(s=>{s.getColDef().lockVisible||s.isVisible()!=e&&i.push({colId:s.getId(),hide:!e})}),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}setAllPivot(t,e,n){this.setAllPivotActive(t,e,n)}setAllPivotActive(t,e,n){const i=[],c=e?u=>{var p;if(!u.isAnyFunctionActive())if(u.isAllowValue()){const f=typeof u.getAggFunc()=="string"?u.getAggFunc():(p=this.aggFuncService)==null?void 0:p.getDefaultAggFunc(u);i.push({colId:u.getId(),aggFunc:f})}else u.isAllowRowGroup()?i.push({colId:u.getId(),rowGroup:!0}):u.isAllowPivot()&&i.push({colId:u.getId(),pivot:!0})}:u=>{(u.isPivotActive()||u.isRowGroupActive()||u.isValueActive())&&i.push({colId:u.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(c),i.length>0&&this.columnApplyStateService.applyColumnState({state:i},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:i,eventType:s}=t,l=e.map(c=>{const u=c.getColId();if(this.columnModel.isPivotMode()){const p=i==null?void 0:i[u];return{colId:u,pivot:p==null?void 0:p.pivot,rowGroup:p==null?void 0:p.rowGroup,aggFunc:p==null?void 0:p.aggFunc}}else return{colId:u,hide:!(n!=null&&n[u])}});this.columnApplyStateService.applyColumnState({state:l},s)}createPivotState(t){return{pivot:t.isPivotActive(),rowGroup:t.isRowGroupActive(),aggFunc:t.isValueActive()?t.getAggFunc():void 0}}},av="32.3.3",Hd=b._defineModule({version:av,moduleName:b.ModuleNames.ColumnsToolPanelModule,beans:[sv],userComponents:[{name:"agColumnsToolPanel",classImp:ov},{name:"agMenuItem",classImp:Re.AgMenuItemRenderer}],dependantModules:[Re.EnterpriseCoreModule,Ky,Ha]});function jd(){b.ModuleRegistry.registerModules([Qo.ClientSideRowModelModule,qf.InfiniteRowModelModule,od.ServerSideRowModelModule,Kf.CsvExportModule,sd.ClipboardModule,ad.RangeSelectionModule,Yf.RichSelectModule,Jf.MenuModule,Xf.ExcelExportModule,Ha,Hd]);const t=_g("AGGRID_LICENSE");t?(Re.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const qd=Qf.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#110529",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",checkboxUncheckedBorderColor:"#CFD1DB",columnBorder:!0,columnHoverColor:"#9BABCC16",fontFamily:"inherit",foregroundColor:"#110529",headerBackgroundColor:"#F7F8FA",headerColumnBorder:!0,headerFontWeight:600,headerRowBorder:!0,headerVerticalPaddingScale:.8,iconButtonHoverColor:"#9BABCC32",iconSize:"16px",menuBackgroundColor:"#FFFFFF",menuBorder:!0,menuTextColor:"#110529",rowHoverColor:"#9BABCC16",rowVerticalPaddingScale:1,selectedRowBackgroundColor:"#63E02424",sidePanelBorder:!1,spacing:"8px",tooltipBackgroundColor:"#110529",tooltipTextColor:"#FFFFFF",wrapperBorderRadius:"6px"}),Kd=Symbol("sdk-vue");function Xa(){return r.inject(Kd)}function lv(t,e){let n;jd();const i=()=>{t.loadBlockState().then(l=>{s.loaded=!0;const c=um(l,t),u=e(c),p=Object.fromEntries(Object.entries(u.routes).map(([f,m])=>{const y=typeof m=="function"?m():m;return[f,r.markRaw(y)]}));n=Object.assign(c,{...u,getRoute(f){return p[f]}})}).catch(l=>{console.error("load initial state error",l),s.error=l})},s=r.reactive({loaded:!1,error:void 0,useApp(){return tm(n,"App is not loaded")},install(l){l.provide(Kd,this),i()}});return s}var cv=Object.defineProperty,dv=(t,e,n)=>e in t?cv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,uv=(t,e,n)=>dv(t,e+"",n);function Yd(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function pv(t,e,n){const i=Math.min(e,n),s=Math.max(e,n);return t>=i&&t<=s}function hv(t){return new Promise(e=>setTimeout(e,t))}function fv(t){return t()}function us(t,e,n){return e>t?e:t>n?n:t}function Jd(t,e){return e(t)}function Mr(t,e){if(t!=null)return e(t)}function mv(t){if(t&&t.ok)return t.value}async function gv(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const Xd=t=>t;function yv(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function vv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(yv(65,91));return e}function _v(){return vv(42)}function oo(t){return t!==null&&typeof t=="object"}function Cv(t,e){return Object.keys(t).map(n=>e(t[n],n))}function so(t,e){return oo(t)&&oo(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>so(t[n],e[n])):t===e}function ao(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=ao(t[n]);return e}else if(oo(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=ao(t[n])}),e}else return t}function wv(t){return Array.isArray(t)?Object.assign([],t):oo(t)?Object.assign({},t):t}function bv(t,e){const n={};for(const i in e)e[i]!==t[i]&&(n[i]=t[i]);return n}function xv(t,e,n){return Object.assign({},t,{[e]:n})}function kv(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function Sv(t,e,n){return t[e]=n,t}function Ev(t,e){return t[e]}function Tv(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function Bv(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function Nv(t,...e){return e.map(n=>t[n])}function Av(t,...e){const n=Object.assign({},t);return e.forEach(i=>delete n[i]),n}const Qa=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:kv,deepClone:ao,deepEqual:so,getProp:Ev,iSet:xv,isObject:oo,map:Cv,omit:Av,pick:Bv,pickValues:Nv,setProp:Sv,shallowClone:wv,shallowDiff:bv,shiftProp:Tv},Symbol.toStringTag,{value:"Module"}));function Vv(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}function Qd(t,e,n){let i;return function(...s){i&&clearTimeout(i),i=setTimeout(()=>{i=void 0,t.apply(this,s)},e)}}const Pv=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Dv=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Fv=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Rv=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],eu=(t,e)=>{let n=String(t);return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e):e===!0&&(n=t.toLocaleString(void 0)),n};function el(t,e){if(t=typeof t=="bigint"?Number(t):t,!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);Object.assign(e,{bits:!1,binary:!1});const n=e.bits?e.binary?Rv:Fv:e.binary?Dv:Pv;if(e.signed&&t===0)return` 0 ${n[0]}`;const i=t<0,s=i?"-":e.signed?"+":"";if(i&&(t=-t),t<1){const p=eu(t,e.locale);return s+p+" "+n[0]}const l=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),n.length-1);t/=(e.binary?1024:1e3)**l,t=Number(t.toPrecision(3));const c=eu(Number(t),e.locale),u=n[l];return s+c+" "+u}const Mv={class:"context-menu"},Iv=["onClick"],Lv=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,i=s=>{s.cb(),n("close")};return(s,l)=>(r.openBlock(),r.createElementBlock("div",Mv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createElementBlock("div",{key:u,onClick:r.withModifiers(p=>i(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,Iv))),128))]))}}),Tn=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},Ov=Tn(Lv,[["__scopeId","data-v-12530966"]]);function tl(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},i=r.h(Ov,{options:e,onClose:()=>{n()}});r.render(i,document.body);const s=i.el;return s.style.top=t.clientY+"px",s.style.left=t.clientX+"px",document.addEventListener("click",l=>{s.contains(l.target)||n()}),n}const tu=Symbol(),ps=()=>r.inject(tu),Gv=["value"],zv={key:1},$v=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.reactive({edit:!1}),l=r.computed(()=>i.valueType),c=f=>{var m;let y=(m=f.target)==null?void 0:m.value;const T=r.unref(l),S=fv(()=>T==="integer"?parseInt(y,10):T==="float"?Number(y):y);n("update:modelValue",S),s.edit=!1},u=r.ref(),p=f=>{!f.metaKey&&i.editable&&(s.edit=!0,requestAnimationFrame(()=>{var m,y;(y=(m=u.value)==null?void 0:m.querySelector("input"))==null||y.focus()}))};return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"baseRef",ref:u,class:r.normalizeClass(["base-cell",{"base-cell__edit":s.edit}]),onClick:p},[s.edit?(r.openBlock(),r.createElementBlock("input",{key:0,value:f.modelValue,onFocusout:m[0]||(m[0]=y=>s.edit=!1),onChange:c},null,40,Gv)):(r.openBlock(),r.createElementBlock("div",zv,r.toDisplayString(f.modelValue),1))],2))}}),Uv=["^data-row-index"],Zv={key:0,class:"control-cell"},Wv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=ps(),i=r.computed(()=>e.cell.column.valueType),s=f=>{Mr(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,T={...y.dataRow,[e.cell.id]:f};m({...y,dataRow:T})})},l=f=>{f.metaKey&&n.selectRow(e.cell.row.primaryKey)},c=(f,m)=>{if(f.type==="contextmenu")f.preventDefault();else return;const y=n.settings??{},T=[],{onSelectedRows:S,onSelectedColumns:D}=y.value,k=n.data.selectedRows.has(m.primaryKey);S&&S.length&&(k?T.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):T.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),D&&D.length&&(T.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),T.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),T.length&&tl(f,T)},u=r.ref(),p=r.computed(()=>e.cell.column.component?e.cell.column.component():void 0);return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"cellRef",ref:u,class:r.normalizeClass(["td-cell",{[f.cell.class]:!0}]),"^data-row-index":f.cell.row.index,onClick:l,onContextmenu:m[0]||(m[0]=y=>c(y,f.cell.row))},[f.cell.control?(r.openBlock(),r.createElementBlock("div",Zv,r.toDisplayString(f.cell.row.index),1)):p.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.value),{key:1,"model-value":f.cell.value,"onUpdate:modelValue":s},null,8,["model-value"])):(r.openBlock(),r.createBlock($v,{key:2,"model-value":f.cell.value,"value-type":i.value,editable:f.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,Uv))}}),Hv={},jv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qv(t,e){return r.openBlock(),r.createElementBlock("svg",jv,e[0]||(e[0]=[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 41.5H9C7.61929 41.5 6.5 40.3807 6.5 39V24H9.5V38.5H24V41.5Z",fill:"#CFD1DB"},null,-1),r.createTextVNode(),r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M41.5 9C41.5 7.61929 40.3807 6.5 39 6.5H9C7.61929 6.5 6.5 7.61929 6.5 9V19.5H9.5H28.5V38.5V41.5H39C40.3807 41.5 41.5 40.3807 41.5 39V9ZM38.5 9.5V16.5H31.5V9.5H38.5ZM38.5 38.5V19.5H31.5V38.5H38.5ZM9.5 9.5V16.5H28.5V9.5H9.5Z",fill:"#CFD1DB"},null,-1)]))}const Kv=Tn(Hv,[["render",qv]]),Yv={class:"tr-head"},Jv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Yv,[r.renderSlot(e.$slots,"default")]))}});function Xv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function Qv(t,e){const n=t.findIndex(e);if(n<0)return[];const i=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,i)}const e_=["^data-col-id"],t_=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function i(l){l.preventDefault();const c=[];c.length&&tl(l,c)}function s(l){var c;const u=((c=l.sort)==null?void 0:c.direction)??"DESC";n("change:sort",{colId:l.id,direction:Xv(u,["DESC","ASC"])})}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["cell th-cell",{"justify-center":l.col.justify,frozen:l.col.frozen}]),"^data-col-id":l.col.id,onContextmenu:i},[l.col.valueType?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(l.col.valueType)},null,2)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(l.col.label)+" ",1),l.col.sort?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["sort",l.col.sort.direction]),onClick:c[0]||(c[0]=r.withModifiers(()=>s(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,e_))}}),n_=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Mr(e.value,i=>i.scrollLeft=0)})};return(i,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:i.row.selected}]),scroll:"no",style:r.normalizeStyle(i.row.style),onScroll:n},[r.renderSlot(i.$slots,"default")],38))}}),r_=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=ps(),n=t,i=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:i.value,frozen:s.column.frozen}])},null,2))}});function tt(t,e,n,i){r.onMounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.addEventListener(e,n,i)}),r.onUnmounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.removeEventListener(e,n,i)})}function i_(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function o_(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function s_(t,e){let n;function i(l){n={...l}}i_(()=>{n=void 0,e()});const s=o_(t);return tt(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:i}}const ci=1,a_=10,l_=30,nu=60;function ru(){const t=r.reactive({x:0,y:0});function e(n){t.x=n.pageX,t.y=n.pageY}return r.onMounted(()=>window.addEventListener("mousemove",e)),r.onUnmounted(()=>window.removeEventListener("mousemove",e)),t}function iu(t,e={}){const{delayEnter:n=0,delayLeave:i=0}=e,s=r.ref(!1);let l;const c=u=>{const p=u?n:i;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>s.value=u,p):s.value=u};return window&&(tt(t,"mouseenter",()=>c(!0)),tt(t,"mouseleave",()=>c(!1))),s}function c_(t){var e;const n=Mr((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),i=>[...i])??[];return n.map(i=>{const{width:s,x:l}=i.getBoundingClientRect(),c=i.getAttribute("data-col-id");return Xd({colId:c,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function d_(t,e){const n=ru(),i=iu(e,{}),{data:s}=t,l=s_(u=>{Mr(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=us(u.width+u.diff,l_,1e4),t.adjustWidth())})},()=>{s.resize=!1,s.resizeTh=void 0,document.body.style.cursor=""}),c=u=>{s.resizeTh&&(s.resize=!0,l.start({x:u.x,width:s.resizeTh.width}))};return r.watchEffect(()=>{if(!i.value){document.body.style.cursor="";return}if(s.resize)return;const u=c_(e).find(p=>Math.abs(n.x-p.right)<a_);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const u_={key:0,class:"command-menu"},p_={key:0},h_=["onClick"],f_=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=ps(),n=r.computed(()=>e.getSelectedRows()),i=r.computed(()=>n.value.length>0),s=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedRows)??[]}),l=r.computed(()=>s.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(c,u)=>i.value?(r.openBlock(),r.createElementBlock("div",u_,[n.value.length?(r.openBlock(),r.createElementBlock("span",p_,r.toDisplayString(n.value.length)+" rows selected",1)):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),u[1]||(u[1]=r.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,f)=>(r.openBlock(),r.createElementBlock("span",{key:f,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,h_))),128))])):r.createCommentVNode("",!0)}}),m_={key:0,class:"command-menu"},g_={key:0},y_=["onClick"],v_=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=ps(),n=r.computed(()=>e.getSelectedColumns()),i=r.computed(()=>n.value.length>0),s=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedColumns)??[]}),l=r.computed(()=>s.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedColumns.clear()}})));return(c,u)=>i.value?(r.openBlock(),r.createElementBlock("div",m_,[n.value.length?(r.openBlock(),r.createElementBlock("span",g_,"selected columns "+r.toDisplayString(n.value.length),1)):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),u[1]||(u[1]=r.createElementVNode("hr",null,null,-1)),u[2]||(u[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,f)=>(r.openBlock(),r.createElementBlock("span",{key:f,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,y_))),128))])):r.createCommentVNode("",!0)}});function sr(t,e){const n={el:void 0,x:0,y:0},i=s=>({x:s.x,y:s.y,dx:s.x-n.x,dy:s.y-n.y});tt(document,"mousedown",s=>{s.target===r.unref(t)&&(s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault(),n.el=r.unref(t),n.x=s.x,n.y=s.y)}),tt(document,"mouseup",s=>{n.el&&(n.el=void 0,e({...i(s),stop:!0},n))}),tt(document,"mousemove",s=>{n.el&&e(i(s),n)})}const __=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.windowSize-12),c=r.computed(()=>i.windowSize<i.dataSize),u=r.computed(()=>Math.ceil(i.offset*(l.value/i.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/i.dataSize)),f=r.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return sr(s,(m,y)=>{const T=(u.value+m.dy)*i.dataSize/l.value;n("change:offset",T),y.x=m.x,y.y=m.y}),(m,y)=>(r.openBlock(),r.createElementBlock("div",{class:"t-scroll",style:r.normalizeStyle({height:`${m.windowSize}px`})},[r.createElementVNode("div",null,[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"handleRef",ref:s,class:"t-scroll__handle",style:r.normalizeStyle(f.value)},null,4)):r.createCommentVNode("",!0)])],4))}});function C_(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:i,scrollLeft:s}=e,l=[...e.columns],c=_v();n.value.controlColumn&&l.unshift({id:c,label:"#",width:60,frozen:!0});let u=0;const p=l.map(m=>{const y={...m,offset:u};return u+=m.width+ci,y}),f=p.filter(m=>m.frozen);return Vv(p,m=>m.frozen?!1:s<m.offset+m.width&&m.offset<i+s).concat(f).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===c}))})}function w_(t,e){const n=r.computed(()=>e.value.reduce((i,s)=>(i[s.id]=s.justify?"justify-"+s.justify:"",i),{}));return r.computed(()=>t.rows.map(i=>{const s=n.value,{primaryKey:l,offset:c,dataRow:u,height:p}=i,f=e.value.map(m=>({id:m.id,column:m,row:i,value:u[m.id],class:s[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return Xd({style:{top:`${c-t.scrollTop}px`,height:`${i.height}px`},primaryKey:l,offset:c,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const b_=async(t,e)=>{const{scrollTop:n,bodyHeight:i}=t;return await hv(0),gv({rows:e.getRows(n,i),dataWindow:t})};function x_(t){const e=r.reactive({rowIndex:-1,columns:[],pendingLoads:0,currentWindow:void 0,rows:[],resize:!1,resizeTh:void 0,dataHeight:0,bodyHeight:t.settings.height,bodyWidth:0,scrollTop:0,scrollLeft:0,selectedRows:new Set,selectedColumns:new Set});r.watch(()=>t.settings,m=>{e.columns=ao(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(y=>{e.dataHeight=y,f.updateBodyHeight()}).catch(y=>e.error=y)},{immediate:!0});const n=r.computed(()=>t.settings),i=r.computed(()=>e.columns.reduce((m,y)=>m+y.width+ci,0)),s=r.computed(()=>Jd(f.data.dataHeight-f.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>Jd(i.value-f.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=C_({data:e,settings:n}),p=w_(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((T,S)=>T+S.width+ci,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const T=e.columns[e.columns.length-1];T.width=T.width+(y-m)}},updateOffsets(m){this.updateScrollTop(e.scrollTop+m.deltaY),this.updateScrollLeft(e.scrollLeft+m.deltaX)},getSelectedRows(){return e.rows.filter(m=>e.selectedRows.has(m.primaryKey))},getSelectedColumns(){return e.columns.filter(m=>e.selectedColumns.has(m.id))},selectRow(m){e.selectedRows.add(m)},unselectRow(m){e.selectedRows.delete(m)},selectColumn(m){e.selectedColumns.add(m)},unselectColumn(m){e.selectedColumns.delete(m)},updateScrollTop(m){e.scrollTop=us(m,0,s.value)},updateScrollLeft(m){e.scrollLeft=us(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:y}=e,T=m>y?y:m;e.bodyHeight=T},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,y)=>{const T=m.current;(!T||m.scrollTop<T.scrollTop||m.scrollTop+m.bodyHeight>T.bodyHeight+T.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-nu,bodyHeight:m.bodyHeight+nu*2},b_(ao(e.currentWindow),n.value.dataSource).then(({rows:S,dataWindow:D})=>{so(e.currentWindow,D)&&(e.rows=S)}))},{deep:!0,immediate:!0}),r.provide(tu,f),f}const k_={class:"command-menu__container"},S_={key:0,class:"table-body__no-data"},E_={class:"carets"},nl=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,i=t,s=x_(i),l=r.computed(()=>s.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,k=>n("update:data",k),{deep:!0}),r.watch(i,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Mr(f.value,k=>{s.updateDimensions(k.getBoundingClientRect())})},y=s.tableColumns,T=s.tableRows,{mouseDown:S}=d_(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(i.settings),r.nextTick(m)}),tt(window,"resize",()=>r.nextTick(m));const D=k=>{k.preventDefault(),s.updateOffsets(k)};return(k,M)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:M[2]||(M[2]=(...C)=>r.unref(S)&&r.unref(S)(...C))},[r.createElementVNode("div",k_,[r.createVNode(f_),M[3]||(M[3]=r.createTextVNode()),r.createVNode(v_)]),M[7]||(M[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(Jv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,G)=>(r.openBlock(),r.createBlock(t_,{key:G,col:C,style:r.normalizeStyle(C.style),"onChange:sort":M[0]||(M[0]=X=>k.$emit("change:sort",X))},null,8,["col","style"]))),128))]),_:1})],512),M[8]||(M[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(c.value),onWheel:D},[l.value?(r.openBlock(),r.createElementBlock("div",S_,[r.createElementVNode("div",null,[r.createVNode(Kv),M[4]||(M[4]=r.createTextVNode()),M[5]||(M[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),M[6]||(M[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(T),(C,G)=>(r.openBlock(),r.createBlock(n_,{key:G,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,X=>(r.openBlock(),r.createBlock(Wv,{key:X.column.id+":"+G,cell:X,style:r.normalizeStyle(X.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),M[9]||(M[9]=r.createTextVNode()),r.createElementVNode("div",E_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,G)=>(r.openBlock(),r.createBlock(r_,{key:G,column:C,style:r.normalizeStyle(C.style),"onChange:sort":M[1]||(M[1]=X=>k.$emit("change:sort",X))},null,8,["column","style"]))),128))]),M[10]||(M[10]=r.createTextVNode()),r.createVNode(__,{offset:r.unref(s).data.scrollTop,"window-size":r.unref(s).data.bodyHeight,"data-size":r.unref(s).data.dataHeight,"onChange:offset":r.unref(s).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),ou=new WeakMap;class T_{constructor(e,n,i){uv(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=i;const s=e.reduce((c,u,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(u,p)+ci,c),{total:0,indices:new Map});this.dataHeight=s.total;const l=e.map((c,u)=>({dataRow:c,index:u,primaryKey:this.resolvePrimaryKey(c,u),offset:Yd(s.indices.get(u)),height:this.resolveHeight(c,u)}));ou.set(this,l)}get rows(){return ou.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return Qv(this.rows,i=>{const s=i.offset;return e<s+i.height&&s<n+e})}}class B_{constructor(e,n,i){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=i}get height(){return this.rowHeight+ci}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const i=us(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(n+40/this.height);return(await this.api.query({offset:i,limit:s})).map((l,c)=>({dataRow:l,index:i+c,primaryKey:this.resolvePrimaryKey(l,i+c),offset:(i+c)*(this.rowHeight+ci),height:this.rowHeight}))}}function N_(t){return Object.freeze(t)}function A_(t){return r.h(nl,{settings:Object.freeze(t)})}function rl(t,e){const n=new T_(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function V_(t,e){return r.computed(()=>{const n=r.unref(t);return rl(n,r.unref(e))})}function P_(t,e){const n=r.computed(()=>{const s=r.unref(t);return rl(s,r.unref(e))}),i=r.reactive({settings:n});return r.computed(()=>r.h(nl,i))}const D_=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:B_,Component:nl,factory:A_,rawDataSettings:rl,settings:N_,useRawData:V_,useRawDataComponent:P_},Symbol.toStringTag,{value:"Module"}));function*F_(t,e){for(const n of t)yield e(n)}function R_(t){const e=[];for(const n of t)e.push(n);return e}function su(t){return t()}function il(t,e){if(t==null)throw Error(e);return t}function ol(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function au(t){return new Promise(e=>setTimeout(e,t))}function lu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function cu(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function M_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(cu(65,91));return e}function du(t){return function(e){return 1-t(1-e)}}function I_(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function uu(t){const{duration:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function L_(t){const{getFraction:e,draw:n,timing:i}=t,s=performance.now();let l=!1;return requestAnimationFrame(function c(u){let p=e(u-s);if(l)return;p>1&&(p=1);const f=i(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function pu(t,e){let n=-1;return(...i)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...i),e)}}function hu(t,e,n=!0){let i=0,s;return function(...l){s=()=>{t.apply(this,l),i=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>i&&s()}}function O_(t){return t.map(e=>({text:String(e),value:e}))}function ar(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const sl=new Map;function G_(t){return sl.has(t)||sl.set(t,r.ref(localStorage.getItem(t))),il(sl.get(t),"...")}function z_(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function fu(t){const e=G_(t);return r.watch(e,n=>z_(t,n)),e}const al=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{R_(F_(al.values(),e=>e(t.matches?"dark":"light")))});const $_=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",mu=r.ref($_),ll=fu("theme");function gu(t){const e=r.computed(()=>ll.value?ll.value:mu.value),n=s=>{mu.value=s,t&&t(s)};function i(){ll.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,s=>{t&&t(r.unref(s))}),r.onMounted(()=>{al.add(n)}),r.onUnmounted(()=>{al.delete(n)}),[e,i]}const U_=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=gu();return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:s[0]||(s[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},s[1]||(s[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),Z_={class:"pl-layout-component pl-block-page"},W_={key:0,class:"pl-block-page__title"},H_={class:"pl-block-page__title__append"},j_={key:1},q_={class:"pl-block-page__body"},K_={name:"PlBlockPage"},Y_=r.defineComponent({...K_,setup(t){const e=r.useSlots();return(n,i)=>(r.openBlock(),r.createElementBlock("div",Z_,[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",W_,[r.createElementVNode("h1",null,[r.renderSlot(n.$slots,"title")]),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",H_,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",j_)),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",q_,[r.renderSlot(n.$slots,"default")])]))}}),J_={name:"PlContainer"},X_=r.defineComponent({...J_,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),Q_={name:"PlRow"},eC=r.defineComponent({...Q_,props:{wrap:{type:Boolean},alignCenter:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-row",{wrap:e.wrap,"align-center":e.alignCenter}])},[r.renderSlot(e.$slots,"default")],2))}}),tC={class:"pl-layout-component",style:{"flex-grow":"1"}},nC={name:"PlSpacer"},yu=r.defineComponent({...nC,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",tC))}}),rC={name:"PlGrid"},iC=r.defineComponent({...rC,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(i.$slots,"default")],4))}}),oC={key:0,class:"pl-alert__icon"},sC={class:"pl-alert__main"},aC={key:0},lC={class:"pl-alert__main__text"},cC={name:"PlAlert"},dC=r.defineComponent({...cC,props:{modelValue:{type:Boolean,default:!0},type:{default:void 0},label:{default:void 0},icon:{type:Boolean,default:void 0},closeable:{type:Boolean,default:void 0},monospace:{type:Boolean,default:void 0},whiteSpacePre:{type:Boolean,default:void 0},maxHeight:{default:void 0}},emits:["update:modelValue"],setup(t){const e={success:"success",warn:"warning",info:"edit",error:"error"};return(n,i)=>n.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-alert",[{monospace:n.monospace,whiteSpacePre:n.whiteSpacePre},n.type?`pl-alert__${n.type}`:""]]),style:r.normalizeStyle({maxHeight:n.maxHeight})},[n.icon&&n.type?(r.openBlock(),r.createElementBlock("div",oC,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),i[2]||(i[2]=r.createTextVNode()),r.createElementVNode("div",sC,[n.label?(r.openBlock(),r.createElementBlock("label",aC,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",lC,[r.renderSlot(n.$slots,"default")])]),i[3]||(i[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:i[0]||(i[0]=s=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),uC=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
44
44
  <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 4.5H4.5L4.5 19.5H19.5V4.5ZM4.5 3C3.67157 3 3 3.67157 3 4.5V19.5C3 20.3284 3.67157 21 4.5 21H19.5C20.3284 21 21 20.3284 21 19.5V4.5C21 3.67157 20.3284 3 19.5 3H4.5Z" fill="#110529"/>
45
45
  </svg>
46
46
  `,pC=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
47
47
  <rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
48
48
  <path fill-rule="evenodd" clip-rule="evenodd" d="M17.5431 8.51724L10.3333 16.0875L6.45691 12.0172L7.54312 10.9828L10.3333 13.9125L16.4569 7.48276L17.5431 8.51724Z" fill="white"/>
49
49
  </svg>
50
- `,hC=["innerHTML"],fC={class:"dropdown-list-item__title-container"},mC={class:"dropdown-list-item__title text-s"},gC={key:0,class:"dropdown-list-item__description text-description"},yC={key:1,class:"dropdown-list-item__icon flex-self-start"},di=r.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{const l=[];return e.size==="small"&&l.push("dropdown-list-item__small"),e.isSelected&&l.push("dropdown-list-item__selected"),e.isHovered&&l.push("hovered-item"),l.join(" ")}),i=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),s=r.computed(()=>e.isSelected?pC:uC);return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([n.value,"dropdown-list-item"])},[e.useCheckbox?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(i.value),innerHTML:s.value},null,10,hC)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",fC,[r.createElementVNode("div",mC,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",gC,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",yC)):r.createCommentVNode("",!0)],2))}});function ui(t,e){const n=ol(()=>{if(t.value){const{scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p,offsetY:i+f.y,offsetX:s+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});r.onMounted(n),tt(window,"scroll",n,{capture:!0,passive:!0}),tt(window,"resize",n,{passive:!0}),tt(window,"adjust",n,!0)}const vC=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),i=r.computed(()=>`mask-16 mask-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([i.value,s.$style.icon])},null,6))}}),_C="_icon_1ugxm_2",CC={icon:_C},wC={$style:CC},pi=Tn(vC,[["__cssModules",wC]]),bC=["onKeyup"],xC=r.defineComponent({__name:"PlBtnSplit",props:r.mergeModels({options:{},disabled:{type:Boolean},loading:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:r.mergeModels(["click"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const i=t,s=n,l=r.useModel(t,"modelValue"),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.reactive({open:!1,optionsHeight:0,activeIndex:-1});e({data:m});const y=r.reactive({top:"0px",left:"0px",width:"0px"});r.watch(u,P=>{if(P){const O=P.getBoundingClientRect();m.optionsHeight=O.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const k=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),S=r.computed(()=>(i.options??[]).findIndex(P=>so(P.value,l.value))),M=r.computed(()=>ar(i.options??[]).map((P,O)=>({...P,index:O,isSelected:O===S.value,isActive:O===m.activeIndex}))),T=r.computed(()=>i.loading||i.options===void 0),R=r.computed(()=>{var P;return((P=M.value.find(O=>so(O.value,l.value)))==null?void 0:P.label)??(i.options===void 0?"...":"")});ui(c,P=>{const O=P.top+P.height+3;O+m.optionsHeight>P.clientHeight?y.top=P.top-m.optionsHeight-3+"px":y.top=O+"px",y.left=P.left+"px",y.width=P.width+"px",console.log(P.top,y)});const C=P=>{var O;l.value=P,m.open=!1,(O=c==null?void 0:c.value)==null||O.focus()};function G(){s("click")}const X=P=>{var O,z;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(P.code))P.preventDefault();else return;if(P.target===f.value&&P.code==="Enter"){G();return}const{open:N,activeIndex:E}=m;if(!N&&P.target===p.value){P.code==="Enter"&&(m.open=!0);return}P.code==="Escape"&&(m.open=!1,(O=c.value)==null||O.focus());const V=r.unref(M),{length:W}=V;if(!W)return;P.code==="Enter"&&C((z=V.find(Z=>Z.index===E))==null?void 0:z.value);const q=V.findIndex(Z=>Z.index===E)??-1,$=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0,A=Math.abs(q+$+W)%W;m.activeIndex=M.value[A].index??-1},L=P=>{var O,z;const N=P.relatedTarget;!((O=c.value)!=null&&O.contains(N))&&!((z=u.value)!=null&&z.contains(N))&&(m.open=!1)};return(P,O)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass([{disabled:P.disabled||T.value,loading:T.value},"pl-btn-split d-flex"]),onFocusout:L,onKeydown:X},[r.createElementVNode("div",{ref_key:"buttonAction",ref:f,class:"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn",tabindex:"0",onClick:G,onKeyup:r.withKeys(r.withModifiers(G,["stop"]),["enter"])},r.toDisplayString(R.value),41,bC),O[1]||(O[1]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"menuActivator",ref:p,class:"pl-btn-split__icon-container d-flex align-center justify-center",tabindex:"0",onClick:O[0]||(O[0]=z=>m.open=!m.open)},[T.value?(r.openBlock(),r.createBlock(pi,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([k.value,"pl-btn-split__icon"])},null,2))],512),O[2]||(O[2]=r.createTextVNode()),m.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-dropdown__options",style:r.normalizeStyle(y),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(M.value,(z,N)=>(r.openBlock(),r.createBlock(di,{key:N,option:z,"is-selected":z.isSelected,"is-hovered":z.isActive,size:"medium",onClick:r.withModifiers(E=>C(z.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function vu(t){function e(n){const i=n.currentTarget,s=document.createElement("span"),l=Math.max(i.clientWidth,i.clientHeight),c=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-i.offsetLeft-c}px`,s.style.top=`${n.clientY-i.offsetTop-c}px`,s.classList.add("ripple");const u=i.getElementsByClassName("ripple")[0];u&&u.remove(),i.appendChild(s)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const kC={key:0},SC={inheritAttrs:!1},hs=r.defineComponent({...SC,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t,n=r.ref(),i=r.computed(()=>e.small||e.size==="small"),s=r.computed(()=>e.large||e.size==="large");return vu(n),(l,c)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:i.value,large:s.value,round:l.round,reverse:l.reverse,justifyCenter:l.justifyCenter,[l.$attrs.class+""]:!0}},{...l.$attrs,disabled:!!l.$attrs.disabled||l.loading}),[l.round?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",kC,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(pi),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(pi),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),EC={name:"PlBtnPrimary"},cl=r.defineComponent({...EC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(hs,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),TC={name:"PlBtnAccent"},BC=r.defineComponent({...TC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(hs,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),AC={name:"PlBtnDanger"},NC=r.defineComponent({...AC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(hs,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),VC={name:"PlBtnSecondary"},dl=r.defineComponent({...VC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(hs,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),PC={key:0},DC={name:"PlBtnGhost"},ul=r.defineComponent({...DC,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.size==="small"),i=r.computed(()=>e.size==="large"),s=r.ref(),l=r.useSlots();return vu(s),(c,u)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:s,tabindex:"0",class:["pl-btn-ghost",{loading:c.loading,small:n.value,large:i.value,round:c.round,reverse:c.reverse,justifyCenter:c.justifyCenter,[c.$attrs.class+""]:!0}]},{...c.$attrs,disabled:!!c.$attrs.disabled||c.loading}),[r.unref(l).default&&!c.round?(r.openBlock(),r.createElementBlock("span",PC,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(pi),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(pi),{key:2,name:c.icon,size:c.size},null,8,["name","size"])):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),r.renderSlot(c.$slots,"append")],16))}}),FC=r.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(t){const e=t,n=r.ref(!1);return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:i.disabled,loading:i.loading,hover:n.value}]),onMouseover:s[0]||(s[0]=l=>n.value=!0),onMouseleave:s[1]||(s[1]=l=>n.value=!1)},[r.createVNode(dl,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),s[2]||(s[2]=r.createTextVNode()),r.renderSlot(i.$slots,"default")],34))}});function RC(t,e){const n=r.ref();return ui(t,i=>{n.value=i}),r.computed(()=>{const i=r.unref(n),s=r.unref(e),l=s.position??"top",c=s.gap??8;if(!i)return"";const u=i.offsetY+Math.floor(i.height/2),p=i.offsetX+Math.floor(i.width/2);return l==="top-left"?`left: ${i.offsetX}px; top: ${i.offsetY-c}px;`:l==="top"?`left: ${p}px; top: ${i.offsetY-c}px;`:l==="right"?`left: ${i.offsetX+i.width+c}px; top: ${u}px;`:l==="left"?`right: ${i.scrollWidth-i.x+c}px; top: ${u}px;`:""})}function lo(t,e){return e(t)}function ot(t,e){if(t!=null)return e(t)}function MC(t){return Array.isArray(t)?t:[t]}function IC(t,e,...n){n.forEach(i=>{t[i]=e[i]})}function fs(t,e){tt(document,"click",n=>{document.contains(n.target)&&(MC(t).map(i=>i.value).filter(i=>!!i).some(i=>i==null?void 0:i.contains(n.target))||e())})}const OC={},LC={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function GC(t,e){return r.openBlock(),r.createElementBlock("svg",LC,e[0]||(e[0]=[r.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const zC=Tn(OC,[["render",GC]]),pl=new Map,UC={name:"PlTooltip"},Vt=r.defineComponent({...UC,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"}},emits:["tooltip:close"],setup(t,{emit:e}){const n=e,i=Symbol(),s=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});pl.set(i,()=>f()),r.watch(()=>l.open,T=>{requestAnimationFrame(()=>{l.tooltipOpen=T})});let c=()=>{};const u=hu(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[T,R]of pl.entries())T!==i&&R()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,c(),await au(100),l.over&&p())},y=()=>{l.over=!1,c=lu(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,T=>{T&&f()});const k=r.ref(),S=r.ref(),M=RC(k,r.toRef(s));return fs([k,S],()=>f()),r.onUnmounted(()=>{pl.delete(i)}),(T,R)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(T.element),r.mergeProps(T.$attrs,{ref_key:"rootRef",ref:k,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(T.$slots,"default"),R[1]||(R[1]=r.createTextVNode()),T.$slots.tooltip&&l.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createVNode(r.Transition,{name:"tooltip-transition"},{default:r.withCtx(()=>[l.tooltipOpen?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:r.normalizeStyle(r.unref(M))},[r.createElementVNode("div",{ref_key:"tooltip",ref:S,class:r.normalizeClass(["pl-tooltip",T.position]),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(T.$slots,"tooltip")]),R[0]||(R[0]=r.createTextVNode()),r.createVNode(zC)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),ZC={},$C={class:"inner-border"};function WC(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",$C,[r.renderSlot(t.$slots,"default")])}const HC=Tn(ZC,[["render",WC]]),jC={key:0},qC=["tabindex","onKeydown","onClick"],KC={key:1,class:"ui-btn-group__helper"},YC={key:2,class:"ui-btn-group__error"},JC={name:"PlBtnGroup"},XC=r.defineComponent({...JC,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=u=>i("update:modelValue",u),l=t,c=r.computed(()=>l.options.map(u=>({label:"label"in u?u.label:u.text,value:u.value})));return(u,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-group",{disabled:u.disabled}])},[u.label?(r.openBlock(),r.createElementBlock("label",jC,[r.createElementVNode("span",null,r.toDisplayString(u.label),1),p[0]||(p[0]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(u.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),p[1]||(p[1]=r.createTextVNode()),r.createVNode(HC,{class:"ui-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(f,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["ui-btn-group__option text-s",{active:u.modelValue===f.value}]),tabindex:u.modelValue===f.value||u.disabled?void 0:0,onKeydown:r.withKeys(y=>s(f.value),["enter"]),onClick:y=>s(f.value)},r.toDisplayString(f.label),43,qC))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",KC,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",YC,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}}),QC={inheritAttrs:!1},e0={class:"double-contour"};function t0(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",e0,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const lr=Tn(QC,[["render",t0]]);function _u(t){r.onMounted(t),r.onUpdated(t)}const hl=new WeakMap,fl=new ResizeObserver(t=>{for(const e of t)ot(hl.get(e.target),n=>n(e))});function Cu(t,e){hl.set(t,e),fl.unobserve(t),fl.observe(t)}function wu(t){fl.unobserve(t),hl.delete(t)}const n0=8,bu=4;function On(t,e="label"){const n=new Set;_u(()=>{ot(t==null?void 0:t.value,i=>{const s=i.querySelector(e);s&&(n.add(s),Cu(s,()=>{const l=su(()=>s.getBoundingClientRect().width+lo(n0,c=>Number.isNaN(c)?bu:c+bu));i.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&i.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(i=>wu(i))})}function r0(t,e){const n=[];return e&&e.length>0&&e.forEach(i=>{const s=i(t);typeof s=="string"&&n.push(s)}),{isValid:n.length===0,errors:n}}function xu(t,e){return r.computed(()=>r0(t.value,e))}const i0=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),i=r.computed(()=>`icon-16 icon-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([i.value,s.$style.icon])},null,6))}}),o0="_icon_1ugxm_2",s0={icon:o0},a0={$style:s0},ms=Tn(i0,[["__cssModules",a0]]),l0=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,i.$style.icon])},null,2))}}),c0="_icon_1ugxm_2",d0={icon:c0},u0={$style:d0},ku=Tn(l0,[["__cssModules",u0]]),p0={class:"pl-text-field__envelope"},h0={key:0,ref:"label"},f0={key:0,class:"required-icon"},m0={key:1,class:"pl-text-field__prefix"},g0=["disabled","placeholder","type"],y0={class:"pl-text-field__append"},v0={key:0,class:"pl-text-field__error"},_0={key:1,class:"pl-text-field__helper"},C0={name:"PlTextField"},Ir=r.defineComponent({...C0,props:r.mergeModels({label:{},clearable:{type:[Boolean,Function]},parse:{type:Function},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useSlots(),n=r.useModel(t,"modelValue"),i=t,s=r.ref(void 0),l=r.ref(),c=r.ref(!1),u=r.reactive({cached:void 0}),p=r.computed({get(){return u.cached?u.cached.value:n.value===void 0||n.value===null?"":String(n.value)},set(L){if(u.cached=void 0,i.parse)try{n.value=i.parse(L)}catch(P){u.cached={error:P instanceof Error?P.message:String(P),value:L}}else n.value=L}}),f=r.computed(()=>i.type&&i.type==="password"?c.value?"text":i.type:"text"),m=r.computed(()=>c.value?"view-show":"view-hide"),y=()=>{i.clearable&&(u.cached=void 0,n.value=i.clearable===!0?"":i.clearable())},k=xu(p,i.rules||[]),S=r.computed(()=>i.clearable?i.clearable===!0?n.value==="":n.value===i.clearable():n.value===""),M=r.computed(()=>!S.value),T=r.computed(()=>{const L=[];return i.error&&L.push(i.error),u.cached&&L.push(u.cached.error),k.value.isValid||L.push(...k.value.errors),L}),R=r.computed(()=>T.value.length>0),C=r.computed(()=>i.clearable&&M.value&&i.type!=="password"),G=()=>c.value=!c.value,X=()=>{u.cached=void 0};return On(s),(L,P)=>(r.openBlock(),r.createElementBlock("div",p0,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:R.value,disabled:L.disabled,dashed:L.dashed,nonEmpty:M.value}])},[L.label?(r.openBlock(),r.createElementBlock("label",h0,[L.required?(r.openBlock(),r.createElementBlock("i",f0)):r.createCommentVNode("",!0),P[1]||(P[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(L.label),1),P[2]||(P[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(L.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),P[5]||(P[5]=r.createTextVNode()),L.prefix?(r.openBlock(),r.createElementBlock("div",m0,r.toDisplayString(L.prefix),1)):r.createCommentVNode("",!0),P[6]||(P[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":P[0]||(P[0]=O=>p.value=O),disabled:L.disabled,placeholder:L.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:X},null,40,g0),[[r.vModelDynamic,p.value]]),P[7]||(P[7]=r.createTextVNode()),r.createElementVNode("div",y0,[C.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:0,name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),P[3]||(P[3]=r.createTextVNode()),L.type==="password"?(r.openBlock(),r.createBlock(r.unref(ku),{key:1,name:m.value,style:{cursor:"pointer"},onClick:G},null,8,["name"])):r.createCommentVNode("",!0),P[4]||(P[4]=r.createTextVNode()),r.renderSlot(L.$slots,"append")]),P[8]||(P[8]=r.createTextVNode()),r.createVNode(lr,{class:"pl-text-field__contour"})],2),P[9]||(P[9]=r.createTextVNode()),R.value?(r.openBlock(),r.createElementBlock("div",v0,r.toDisplayString(T.value.join(" ")),1)):L.helper?(r.openBlock(),r.createElementBlock("div",_0,r.toDisplayString(L.helper),1)):r.createCommentVNode("",!0)]))}}),w0={class:"ui-text-area__envelope"},b0={key:0,ref:"label"},x0={key:0,class:"required-icon"},k0=["readonly","rows","disabled","placeholder"],S0={class:"ui-text-area__append"},E0={key:0,class:"ui-text-area__error"},T0={key:1,class:"ui-text-area__helper"},B0={name:"PlTextArea"},A0=r.defineComponent({...B0,props:{modelValue:{},label:{},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},dashed:{type:Boolean},rows:{},autogrow:{type:Boolean},rules:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.ref(),u=r.computed({get(){return s.modelValue??""},set(S){i("update:modelValue",S)}}),p=r.computed(()=>!!s.modelValue),f=xu(u,s.rules||[]);On(l);const m=r.computed(()=>{const S=[];return s.error&&S.push(s.error),S.push(...f.value.errors),S}),y=r.computed(()=>m.value.length>0),k=()=>{if(!s.autogrow)return;const S=c.value;S&&(S.style.height="auto",S.style.height=`${S.scrollHeight}px`)};return r.onMounted(()=>{k()}),(S,M)=>(r.openBlock(),r.createElementBlock("div",w0,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:S.disabled,dashed:S.dashed,nonEmpty:p.value}])},[S.label?(r.openBlock(),r.createElementBlock("label",b0,[S.required?(r.openBlock(),r.createElementBlock("i",x0)):r.createCommentVNode("",!0),M[1]||(M[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(S.label),1),M[2]||(M[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(S.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),M[3]||(M[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":M[0]||(M[0]=T=>u.value=T),readonly:S.readonly,rows:S.rows,disabled:S.disabled,placeholder:S.placeholder??"...",spellcheck:"false",onInput:k},null,40,k0),[[r.vModelText,u.value]]),M[4]||(M[4]=r.createTextVNode()),r.createElementVNode("div",S0,[r.renderSlot(S.$slots,"append")]),M[5]||(M[5]=r.createTextVNode()),r.createVNode(lr,{class:"ui-text-area__contour"})],2),M[6]||(M[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",E0,r.toDisplayString(m.value.join(" ")),1)):S.helper?(r.openBlock(),r.createElementBlock("div",T0,r.toDisplayString(S.helper),1)):r.createCommentVNode("",!0)]))}});function Su(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n&&s>n}function Eu(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n?"ceil":s>n?"floor":"visible"}function co(t,e,n={}){const i=t.scrollTop,s=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,u=Eu(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?c-(s-l):c;t.scrollTop=i+f*(m-i)};Su(t,e)||uu({duration:n.duration||100,timing:du(f=>f),draw:p})}function ml(t,e,n,i){return t.addEventListener(e,n,i),function(){t.removeEventListener(e,n)}}function N0(t,e){const n=e.getBoundingClientRect();return t.x<n.x||t.x>n.x+n.width||t.y<n.y||t.y>n.y+n.height}function Tu(t){return t!==null&&typeof t=="object"}function Pt(t,e){return Tu(t)&&Tu(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Pt(t[n],e[n])):t===e}function gl(t,e){return t.some(n=>Pt(n,e))}const yl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),i=r.ref(!1),s=r.computed(()=>i.value&&e.value?"ui-lt-animate":""),l=pu(m=>i.value=m,500),c=r.computed(()=>{var m;return n.value?`${((m=n.value)==null?void 0:m.innerHTML.length)*.4}s`:"5s"});function u(){const m=il(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){u(),l(!0)}function f(){l(!1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(m.$attrs,{class:"ui-lt-container"}),[r.createElementVNode("span",{onMouseover:p,onMouseleave:f},[r.createElementVNode("span",{ref_key:"span",ref:n,class:r.normalizeClass(s.value)},[r.renderSlot(m.$slots,"default")],2)],32)],16))}}),V0=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,i.$style.icon])},null,2))}}),P0="_icon_1ugxm_2",D0={icon:P0},F0={$style:D0},Ln=Tn(V0,[["__cssModules",F0]]),R0={class:"pl-dropdown__envelope"},M0=["tabindex"],I0={class:"pl-dropdown__container"},O0={class:"pl-dropdown__field"},L0=["disabled","placeholder"],G0={class:"pl-dropdown__controls"},z0={key:0},U0={key:0,class:"required-icon"},Z0={key:0,class:"nothing-found"},$0={key:0,class:"pl-dropdown__error"},W0={key:1,class:"pl-dropdown__helper"},H0={key:2,class:"pl-dropdown__helper"},j0={name:"PlDropdown"},uo=r.defineComponent({...j0,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>lo(X.value.findIndex(A=>Pt(A.value,i.modelValue)),A=>A<0?0:A),m=()=>p.activeIndex=f(),y=r.computed(()=>i.options===void 0),k=r.computed(()=>y.value?!0:i.disabled),S=r.computed(()=>(i.options??[]).findIndex(A=>Pt(A.value,i.modelValue))),M=r.computed(()=>{if(!y.value){if(i.error)return i.error;if(i.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),T=r.computed(()=>ar(i.options??[]).map((A,Z)=>({...A,index:Z,isSelected:Z===S.value,isActive:Z===p.activeIndex}))),R=r.computed(()=>{const A=r.unref(T).find(Z=>Pt(Z.value,i.modelValue));return(A==null?void 0:A.label)||i.modelValue}),C=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(R.value):i.placeholder),G=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),X=r.computed(()=>{const A=T.value;return p.search?A.filter(Z=>{const J=p.search.toLowerCase();return Z.label.toLowerCase().includes(J)||Z.description&&Z.description.toLowerCase().includes(J)?!0:typeof Z.value=="string"?Z.value.toLowerCase().includes(J):Z.value===p.search}):A}),L=r.computed(()=>k.value?void 0:"0"),P=A=>{var Z;n("update:modelValue",A),p.search="",p.open=!1,(Z=l==null?void 0:l.value)==null||Z.focus()},O=()=>n("update:modelValue",void 0),z=()=>{var A;return(A=u.value)==null?void 0:A.focus()},N=()=>p.open=!p.open,E=()=>p.open=!0,V=A=>{var Z,J;const pe=A.relatedTarget;!((Z=l.value)!=null&&Z.contains(pe))&&!((J=c.value)!=null&&J.contains(pe))&&(p.search="",p.open=!1)},W=()=>{const A=c.value;A&&ot(A.querySelector(".hovered-item"),Z=>{co(A,Z)})},q=A=>{var Z,J;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(A.code))A.preventDefault();else return;const{open:pe,activeIndex:we}=p;if(!pe){A.code==="Enter"&&(p.open=!0);return}A.code==="Escape"&&(p.open=!1,(Z=l.value)==null||Z.focus());const Ct=r.unref(X),{length:Tt}=Ct;if(!Tt)return;A.code==="Enter"&&P((J=Ct.find(_r=>_r.index===we))==null?void 0:J.value);const ht=Ct.findIndex(_r=>_r.index===we)??-1,vr=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0,Vn=Math.abs(ht+vr+Tt)%Tt;p.activeIndex=X.value[Vn].index??-1};On(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,A=>{var Z;return A?(Z=u.value)==null?void 0:Z.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&W()});const $=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(c,A=>{if(A){const Z=A.getBoundingClientRect();p.optionsHeight=Z.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ui(l,A=>{const Z=A.top+A.height+3;Z+p.optionsHeight>A.clientHeight?$.top=A.top-p.optionsHeight-3+"px":$.top=Z+"px",$.left=A.left+"px",$.width=A.width+"px"}),(A,Z)=>(r.openBlock(),r.createElementBlock("div",R0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:L.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:A.error,disabled:k.value}]),onKeydown:q,onFocusout:V},[r.createElementVNode("div",I0,[r.createElementVNode("div",O0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":Z[0]||(Z[0]=J=>p.search=J),type:"text",tabindex:"-1",disabled:k.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:E},null,40,L0),[[r.vModelText,p.search]]),Z[4]||(Z[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:z},[r.createVNode(yl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(R.value),1)]),_:1})])),Z[5]||(Z[5]=r.createTextVNode()),r.createElementVNode("div",G0,[y.value?(r.openBlock(),r.createBlock(r.unref(Ln),{key:0,name:"loading"})):r.createCommentVNode("",!0),Z[1]||(Z[1]=r.createTextVNode()),A.clearable&&G.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:1,name:"delete-clear",onClick:r.withModifiers(O,["stop"])})):r.createCommentVNode("",!0),Z[2]||(Z[2]=r.createTextVNode()),r.renderSlot(A.$slots,"append"),Z[3]||(Z[3]=r.createTextVNode()),A.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${A.arrowIconLarge}`]]),onClick:r.withModifiers(N,["stop"])},null,2)):A.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${A.arrowIcon}`]]),onClick:r.withModifiers(N,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(N,["stop"])}))])]),Z[9]||(Z[9]=r.createTextVNode()),A.label?(r.openBlock(),r.createElementBlock("label",z0,[A.required?(r.openBlock(),r.createElementBlock("i",U0)):r.createCommentVNode("",!0),Z[6]||(Z[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(A.label),1),Z[7]||(Z[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(A.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),Z[10]||(Z[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:c,class:"pl-dropdown__options",style:r.normalizeStyle($),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(X.value,(J,pe)=>(r.openBlock(),r.createBlock(di,{key:pe,option:J,"is-selected":J.isSelected,"is-hovered":J.isActive,size:A.optionSize,onClick:r.withModifiers(we=>P(J.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),Z[8]||(Z[8]=r.createTextVNode()),X.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Z0,"Nothing found"))],4)])):r.createCommentVNode("",!0),Z[11]||(Z[11]=r.createTextVNode()),r.createVNode(lr,{class:"pl-dropdown__contour"})])],42,M0),Z[12]||(Z[12]=r.createTextVNode()),M.value?(r.openBlock(),r.createElementBlock("div",$0,r.toDisplayString(M.value),1)):y.value&&A.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",W0,r.toDisplayString(A.loadingOptionsHelper),1)):A.helper?(r.openBlock(),r.createElementBlock("div",H0,r.toDisplayString(A.helper),1)):r.createCommentVNode("",!0)]))}}),q0={name:"PlDropdownRef"},K0=r.defineComponent({...q0,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>{var s;return(s=e.options)==null?void 0:s.map(l=>({label:l.label,value:l.ref}))}),i=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,l)=>(r.openBlock(),r.createBlock(r.unref(uo),r.mergeProps(e,{options:n.value,"loading-options-helper":s.loadingOptionsHelper,"arrow-icon-large":i.value,"onUpdate:modelValue":l[0]||(l[0]=c=>s.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function Y0(t,e){return r.computed(()=>{const n=ar(t.value);return e.value?n.filter(i=>i.label.toLowerCase().includes(e.value.toLowerCase())):n})}const J0={class:"resizable-input"},X0=["placeholder","value","disabled"],Q0=r.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,i=e,s=r.computed(()=>{var u;return n.placeholder?n.placeholder:(u=n.modelValue||n.value)==null?void 0:u.replace('"',"")}),l=r.computed(()=>{const u={};return n.width&&(u.width=n.width),n.maxWidth&&(u.maxWidth=n.maxWidth),u});function c(u){const p=u.target.value;i("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",J0,[r.createElementVNode("span",{style:r.normalizeStyle(l.value),class:"resizable-input__size-span"},r.toDisplayString(s.value),5),p[0]||(p[0]=r.createTextVNode()),r.createElementVNode("input",r.mergeProps(u.$attrs,{placeholder:u.placeholder,value:n.modelValue,disabled:n.disabled,style:l.value,onInput:c}),null,16,X0)]))}}),ew={class:"dropdown-tab-item__title text-caps13"},tw=r.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.option.label),i=r.computed(()=>{const s=[];return e.isSelected&&s.push("dropdown-tab-item__selected"),e.isHovered&&s.push("hovered-item"),s.join(" ")});return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.value,"dropdown-tab-item"])},[r.createElementVNode("div",ew,r.toDisplayString(n.value),1)],2))}}),nw={class:"pl-line-dropdown__prefix"},rw={class:"pl-line-dropdown__icon-wrapper"},iw={class:"pl-line-dropdown__icon"},ow={key:0,class:"pl-line-dropdown__no-item"},sw={key:0,class:"pl-line-dropdown__no-item"},Bu=r.defineComponent({__name:"PlDropdownLine",props:{modelValue:{},disabled:{type:Boolean},prefix:{default:""},options:{},placeholder:{default:"Select.."},mode:{default:"list"},tabsContainerStyles:{type:[Boolean,null,String,Object,Array],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),c=r.ref(),u=r.computed(()=>{const V=[];return s.isOpen&&V.push("open"),i.disabled&&V.push("disabled"),V.join(" ")}),p=r.ref(""),f=Y0(r.toRef(i,"options"),p),m=r.computed(()=>!!(i.clearable&&s.isOpen&&i.modelValue&&y.value)),y=r.computed(()=>{if(i.modelValue){const V=M();if(V!==-1){const W=ar(i.options)[V];return typeof W.label=="object"?W.label.title:W.label}}return""}),k=r.ref(y.value),S=r.computed(()=>s.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");fs(l,()=>{i.mode==="list"&&(s.isOpen=!1)}),r.watch(()=>k.value,V=>{y.value!==V?p.value=V:p.value=""}),r.watch(()=>s.isOpen,V=>{var W;V&&l.value&&((W=l.value.querySelector("input"))==null||W.focus(),r.nextTick(()=>z()))}),r.watch(()=>i.modelValue,()=>T(),{immediate:!0});function M(){return i.options.findIndex(V=>Pt(V.value,i.modelValue))}function T(){s.activeOption=lo(f.value.findIndex(V=>Pt(V.value,i.modelValue)),V=>V<0?0:V),k.value=y.value}function R(){p.value=""}function C(){i.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function G(){i.mode==="list"&&(s.isOpen=!1)}function X(V){V&&(n("update:modelValue",V.value),G(),R())}function L(V){return Pt(V.value,i.modelValue)}const P=V=>{var W,q;const $=V.relatedTarget;!((W=l.value)!=null&&W.contains($))&&!((q=c.value)!=null&&q.contains($))&&(p.value="",s.isOpen=!1)};function O(V){const{activeOption:W}=s;if(!s.isOpen&&V.code==="Enter"){s.isOpen=!0;return}const{length:q}=f.value;if(!q)return;["ArrowDown","ArrowUp","Enter"].includes(V.code)&&V.preventDefault(),V.code==="Enter"&&X(f.value[W]);const $=V.code==="ArrowDown"?1:V.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(W+$+q)%q,requestAnimationFrame(z)}function z(){const V=c.value;V&&ot(V.querySelector(".hovered-item"),W=>{i.mode==="list"?co(V,W):W.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function N(){n("update:modelValue",void 0)}const E=r.reactive({top:"0px",left:"0px"});return r.watch(c,V=>{if(V){const W=V.getBoundingClientRect();s.optionsHeight=W.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ui(l,V=>{const W=V.top+V.height+2;W+s.optionsHeight>V.clientHeight?E.top=V.top-s.optionsHeight-2+"px":E.top=W+"px",E.left=V.left+"px"}),(V,W)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:O,onFocusout:P,onClick:C},[r.createElementVNode("div",nw,r.toDisplayString(i==null?void 0:i.prefix),1),W[6]||(W[6]=r.createTextVNode()),r.createVNode(Q0,{modelValue:k.value,"onUpdate:modelValue":W[0]||(W[0]=q=>k.value=q),placeholder:S.value,disabled:i.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),W[7]||(W[7]=r.createTextVNode()),r.createElementVNode("div",rw,[r.withDirectives(r.createElementVNode("div",iw,null,512),[[r.vShow,!m.value]]),W[1]||(W[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:N},null,512),[[r.vShow,m.value]])]),W[8]||(W[8]=r.createTextVNode()),s.isOpen?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[i.mode==="list"?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"list",ref:c,style:r.normalizeStyle(E),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(q,$)=>r.renderSlot(V.$slots,"item",{key:$,item:q,textItem:"text",isSelected:L(q),isHovered:s.activeOption==$,onClick:r.withModifiers(A=>X(q),["stop"])},()=>[r.createVNode(di,{option:q,"text-item":"text","is-selected":L(q),"is-hovered":s.activeOption==$,size:"medium",onClick:r.withModifiers(A=>X(q),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),W[3]||(W[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",ow,W[2]||(W[2]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):i.mode==="tabs"?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,style:r.normalizeStyle(E),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(q,$)=>r.renderSlot(V.$slots,"item",{key:$,item:q,isSelected:L(q),isHovered:s.activeOption==$,onClick:r.withModifiers(A=>X(q),["stop"])},()=>[r.createVNode(tw,{option:q,"is-selected":L(q),"is-hovered":s.activeOption==$,onClick:r.withModifiers(A=>X(q),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),W[5]||(W[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",sw,W[4]||(W[4]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)],34))}}),aw={class:"ui-dropdown__envelope"},lw=["tabindex"],cw={class:"ui-dropdown__container"},dw={class:"ui-dropdown__field"},uw=["disabled","placeholder"],pw={class:"ui-dropdown__controls"},hw={key:0},fw={key:0,class:"required-icon"},mw={key:0,class:"nothing-found"},gw={key:0,class:"ui-dropdown__error"},yw={key:1,class:"ui-dropdown__helper"},vw={key:2,class:"ui-dropdown__helper"},_w={name:"PlDropdown"},Cw=r.defineComponent({..._w,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>lo(X.value.findIndex($=>Pt($.value,i.modelValue)),$=>$<0?0:$),m=()=>p.activeIndex=f(),y=r.computed(()=>i.options===void 0),k=r.computed(()=>y.value?!0:i.disabled),S=r.computed(()=>(i.options??[]).findIndex($=>Pt($.value,i.modelValue))),M=r.computed(()=>{if(!y.value){if(i.error)return i.error;if(i.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),T=r.computed(()=>ar(i.options??[]).map(($,A)=>({...$,index:A,isSelected:A===S.value,isActive:A===p.activeIndex}))),R=r.computed(()=>{const $=r.unref(T).find(A=>Pt(A.value,i.modelValue));return($==null?void 0:$.label)||i.modelValue}),C=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(R.value):i.placeholder),G=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),X=r.computed(()=>{const $=T.value;return p.search?$.filter(A=>{const Z=p.search.toLowerCase();return A.label.toLowerCase().includes(Z)||A.description&&A.description.toLowerCase().includes(Z)?!0:typeof A.value=="string"?A.value.toLowerCase().includes(Z):A.value===p.search}):$}),L=r.computed(()=>k.value?void 0:"0"),P=$=>{var A;n("update:modelValue",$),p.search="",p.open=!1,(A=l==null?void 0:l.value)==null||A.focus()},O=()=>n("update:modelValue",void 0),z=()=>{var $;return($=u.value)==null?void 0:$.focus()},N=()=>p.open=!p.open,E=()=>p.open=!0,V=$=>{var A;(A=l==null?void 0:l.value)!=null&&A.contains($.relatedTarget)||(p.search="",p.open=!1)},W=()=>{const $=c.value;$&&ot($.querySelector(".hovered-item"),A=>{co($,A)})},q=$=>{var A,Z;if(["ArrowDown","ArrowUp","Enter","Escape"].includes($.code))$.preventDefault();else return;const{open:J,activeIndex:pe}=p;if(!J){$.code==="Enter"&&(p.open=!0);return}$.code==="Escape"&&(p.open=!1,(A=l.value)==null||A.focus());const we=r.unref(X),{length:Ct}=we;if(!Ct)return;$.code==="Enter"&&P((Z=we.find(Vn=>Vn.index===pe))==null?void 0:Z.value);const Tt=we.findIndex(Vn=>Vn.index===pe)??-1,ht=$.code==="ArrowDown"?1:$.code==="ArrowUp"?-1:0,vr=Math.abs(Tt+ht+Ct)%Ct;p.activeIndex=X.value[vr].index??-1};return On(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,$=>{var A;return $?(A=u.value)==null?void 0:A.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&W()}),($,A)=>(r.openBlock(),r.createElementBlock("div",aw,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:L.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:$.error,disabled:k.value}]),onKeydown:q,onFocusout:V},[r.createElementVNode("div",cw,[r.createElementVNode("div",dw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":A[0]||(A[0]=Z=>p.search=Z),type:"text",tabindex:"-1",disabled:k.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:E},null,40,uw),[[r.vModelText,p.search]]),A[4]||(A[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:z},[r.createVNode(yl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(R.value),1)]),_:1})])),A[5]||(A[5]=r.createTextVNode()),r.createElementVNode("div",pw,[y.value?(r.openBlock(),r.createBlock(r.unref(Ln),{key:0,name:"loading"})):r.createCommentVNode("",!0),A[1]||(A[1]=r.createTextVNode()),$.clearable&&G.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:1,name:"delete-clear",onClick:r.withModifiers(O,["stop"])})):r.createCommentVNode("",!0),A[2]||(A[2]=r.createTextVNode()),r.renderSlot($.$slots,"append"),A[3]||(A[3]=r.createTextVNode()),$.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${$.arrowIconLarge}`]]),onClick:r.withModifiers(N,["stop"])},null,2)):$.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${$.arrowIcon}`]]),onClick:r.withModifiers(N,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(N,["stop"])}))])]),A[9]||(A[9]=r.createTextVNode()),$.label?(r.openBlock(),r.createElementBlock("label",hw,[$.required?(r.openBlock(),r.createElementBlock("i",fw)):r.createCommentVNode("",!0),A[6]||(A[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString($.label),1),A[7]||(A[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot($.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),A[10]||(A[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,class:"ui-dropdown__options"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(X.value,(Z,J)=>(r.openBlock(),r.createBlock(di,{key:J,option:Z,"is-selected":Z.isSelected,"is-hovered":Z.isActive,size:$.optionSize,onClick:r.withModifiers(pe=>P(Z.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),A[8]||(A[8]=r.createTextVNode()),X.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",mw,"Nothing found"))],512)):r.createCommentVNode("",!0),A[11]||(A[11]=r.createTextVNode()),r.createVNode(lr,{class:"ui-dropdown__contour"})])],42,lw),A[12]||(A[12]=r.createTextVNode()),M.value?(r.openBlock(),r.createElementBlock("div",gw,r.toDisplayString(M.value),1)):y.value&&$.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",yw,r.toDisplayString($.loadingOptionsHelper),1)):$.helper?(r.openBlock(),r.createElementBlock("div",vw,r.toDisplayString($.helper),1)):r.createCommentVNode("",!0)]))}}),ww={key:0,class:"ui-progress-bar"},bw={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},xw={class:"ui-progress-bar__message flex-grow-1"},kw={class:"ui-progress-bar__percent"},Sw=r.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(t){const e=t,n=r.computed(()=>e.progress===100?e.completeMessage:"");return(i,s)=>i.loading?(r.openBlock(),r.createElementBlock("div",ww,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:i.progress+"%"})},null,4),s[1]||(s[1]=r.createTextVNode()),r.createElementVNode("div",bw,[r.createElementVNode("div",xw,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",kw,r.toDisplayString(i.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),Ew={class:"mi-number-field__main-wrapper d-flex"},Tw={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},Bw={key:0,class:"text-description"},Aw=["disabled","placeholder"],Nw={class:"mi-number-field__icons d-flex-column"},Vw={key:0,class:"mi-number-field__hint text-description"},Pw=r.defineComponent({__name:"PlNumberField",props:{modelValue:{},disabled:{type:Boolean},label:{default:void 0},placeholder:{default:void 0},step:{default:1},minValue:{default:void 0},maxValue:{default:void 0},errorMessage:{default:void 0},validate:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,s=r.ref(),l=r.useSlots(),c=r.ref();On(s);const u=r.ref(!0),p=r.computed({get(){return u.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(C){var G;C=C.replace(/,/g,""),k(C)?(i("update:modelValue",+C),C.toString()!==((G=n.modelValue)==null?void 0:G.toString())&&+C===n.modelValue&&C[C.length-1]!=="."&&(u.value=!1,r.nextTick(()=>{u.value=!0}))):(C.trim()===""&&i("update:modelValue",void 0),u.value=!1,r.nextTick(()=>{u.value=!0}))}}),f=r.computed(()=>{let C=[];return n.errorMessage&&C.push(n.errorMessage),k(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&C.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&C.push(`Model value must be less than ${n.maxValue}`)):C.push("Model value is not a number."),C=[...C],C.join(" ")}),m=r.computed(()=>!!(n.maxValue&&n.modelValue!==void 0&&(n.modelValue||0)+n.step>n.maxValue)),y=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function k(C){return C!==void 0?(C=C==null?void 0:C.toString(),!isNaN(+C)&&!isNaN(parseFloat(C))):!1}function S(){if(!m.value){let C=0;n.modelValue===void 0?C=n.minValue?n.minValue:0:C=+(n.modelValue||0)+n.step,p.value=C.toString()}}function M(){if(!y.value){let C=0;n.modelValue===void 0?C=0:C=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,C).toString():C.toString()}}function T(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?S():C.code==="ArrowDown"&&M()}const R=C=>{C.detail>1&&C.preventDefault()};return(C,G)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:s,class:r.normalizeClass([{error:!!f.value.trim(),disabled:C.disabled},"mi-number-field d-flex-column"]),onMousedown:R,onKeydown:G[1]||(G[1]=X=>T(X))},[r.createElementVNode("div",Ew,[r.createVNode(lr,{class:"mi-number-field__contour"}),G[6]||(G[6]=r.createTextVNode()),r.createElementVNode("div",Tw,[C.label?(r.openBlock(),r.createElementBlock("label",Bw,[r.createTextVNode(r.toDisplayString(C.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),G[2]||(G[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":G[0]||(G[0]=X=>p.value=X),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,Aw),[[r.vModelText,p.value]])]),G[7]||(G[7]=r.createTextVNode()),r.createElementVNode("div",Nw,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:m.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:S},G[3]||(G[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),G[5]||(G[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:y.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:M},G[4]||(G[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),G[8]||(G[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",Vw,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),Dw={class:"pl-chip__text"},vl=r.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(t){const e=r.ref(),n=r.ref(!1);return r.onMounted(()=>{var i;e.value&&(n.value=((i=e.value)==null?void 0:i.clientWidth)>=256)}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(Vt),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[s[4]||(s[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:i.small}])},[r.createElementVNode("div",Dw,[r.renderSlot(i.$slots,"default")]),s[3]||(s[3]=r.createTextVNode()),i.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:s[0]||(s[0]=r.withKeys(l=>i.$emit("close"),["enter"])),onClick:s[1]||(s[1]=r.withModifiers(l=>i.$emit("close"),["stop"]))},s[2]||(s[2]=[r.createElementVNode("div",{class:"pl-chip__close--icon"},null,-1)]),32)):r.createCommentVNode("",!0)],2)]),_:2},[n.value?{name:"tooltip",fn:r.withCtx(()=>[r.renderSlot(i.$slots,"default")]),key:"0"}:void 0]),1024))}}),Fw={class:"pl-multi-dropdown__envelope"},Rw=["tabindex"],Mw={class:"pl-multi-dropdown__container"},Iw={class:"pl-multi-dropdown__field"},Ow=["disabled","placeholder"],Lw={class:"pl-multi-dropdown__append"},Gw={key:0},zw={key:0,class:"required-icon"},Uw={class:"pl-multi-dropdown__open-chips-container"},Zw={key:0,class:"nothing-found"},$w={key:0,class:"pl-multi-dropdown__error"},Ww={key:1,class:"pl-multi-dropdown__helper"},Hw={name:"PlDropdownMulti"},jw=r.defineComponent({...Hw,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=N=>n("update:modelValue",N),s=r.useSlots(),l=t,c=r.ref(),u=r.ref(),p=r.ref(),f=r.reactive({search:"",activeOption:-1,open:!1,optionsHeight:0}),m=r.computed(()=>Array.isArray(l.modelValue)?l.modelValue:[]),y=r.computed(()=>f.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),k=r.computed(()=>ar(l.options).filter(N=>gl(m.value,N.value))),S=r.computed(()=>{const N=r.unref(m),E=ar(l.options);return(f.search?E.filter(V=>{const W=f.search.toLowerCase();return V.label.toLowerCase().includes(W)?!0:typeof V.value=="string"?V.value.toLowerCase().includes(W):V.value===f.search}):[...E]).map(V=>({...V,selected:gl(N,V.value)}))}),M=r.computed(()=>l.disabled?void 0:"0"),T=()=>{f.activeOption=lo(S.value.findIndex(N=>Pt(N.value,l.modelValue)),N=>N<0?0:N)},R=N=>{var E;const V=r.unref(m);i(gl(V,N)?V.filter(W=>!Pt(W,N)):[...V,N]),f.search="",(E=c==null?void 0:c.value)==null||E.focus()},C=N=>i(r.unref(m).filter(E=>!Pt(E,N))),G=()=>{var N;return(N=p.value)==null?void 0:N.focus()},X=()=>f.open=!f.open,L=N=>{var E,V;const W=N.relatedTarget;!((E=c.value)!=null&&E.contains(W))&&!((V=u.value)!=null&&V.contains(W))&&(f.search="",f.open=!1)},P=()=>{const N=u.value;N&&ot(N.querySelector(".hovered-item"),E=>{co(N,E)})},O=N=>{var E;const{open:V,activeOption:W}=f;if(!V){N.code==="Enter"&&(f.open=!0);return}N.code==="Escape"&&(f.open=!1,(E=c.value)==null||E.focus());const q=r.unref(S),{length:$}=q;if(!$)return;["ArrowDown","ArrowUp","Enter"].includes(N.code)&&N.preventDefault(),N.code==="Enter"&&R(q[W].value);const A=N.code==="ArrowDown"?1:N.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(W+A+$)%$,requestAnimationFrame(P)};On(c),r.watch(()=>l.modelValue,()=>T(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&P()});const z=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,N=>{if(N){const E=N.getBoundingClientRect();f.optionsHeight=E.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ui(c,N=>{const E=N.top+N.height+5;E+f.optionsHeight>N.clientHeight?z.top=N.top-f.optionsHeight-5+"px":z.top=E+"px",z.left=N.left+"px",z.width=N.width+"px"}),(N,E)=>(r.openBlock(),r.createElementBlock("div",Fw,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:M.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:N.error,disabled:N.disabled}]),onKeydown:O,onFocusout:L},[r.createElementVNode("div",Mw,[r.createElementVNode("div",Iw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":E[0]||(E[0]=V=>f.search=V),type:"text",tabindex:"-1",disabled:N.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:E[1]||(E[1]=V=>f.open=!0)},null,40,Ow),[[r.vModelText,f.search]]),E[3]||(E[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:G},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(V,W)=>(r.openBlock(),r.createBlock(r.unref(vl),{key:W,closeable:"",small:"",onClick:E[2]||(E[2]=r.withModifiers(q=>f.open=!0,["stop"])),onClose:q=>C(V.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(V.label||V.value),1)]),_:2},1032,["onClose"]))),128))])),E[4]||(E[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(X,["stop"])}),E[5]||(E[5]=r.createTextVNode()),r.createElementVNode("div",Lw,[r.renderSlot(N.$slots,"append")])]),E[10]||(E[10]=r.createTextVNode()),N.label?(r.openBlock(),r.createElementBlock("label",Gw,[N.required?(r.openBlock(),r.createElementBlock("i",zw)):r.createCommentVNode("",!0),E[6]||(E[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(N.label),1),E[7]||(E[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(N.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),E[11]||(E[11]=r.createTextVNode()),f.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-multi-dropdown__options",style:r.normalizeStyle(z),tabindex:"-1",onFocusout:L},[r.createElementVNode("div",Uw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(V,W)=>(r.openBlock(),r.createBlock(r.unref(vl),{key:W,closeable:"",small:"",onClose:q=>C(V.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(V.label||V.value),1)]),_:2},1032,["onClose"]))),128))]),E[8]||(E[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(V,W)=>(r.openBlock(),r.createBlock(di,{key:W,option:V,"text-item":"text","is-selected":V.selected,"is-hovered":f.activeOption==W,size:"medium","use-checkbox":"",onClick:r.withModifiers(q=>R(V.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),E[9]||(E[9]=r.createTextVNode()),S.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Zw,"Nothing found"))],36)])):r.createCommentVNode("",!0),E[12]||(E[12]=r.createTextVNode()),r.createVNode(lr,{class:"pl-multi-dropdown__contour"})])],42,Rw),E[13]||(E[13]=r.createTextVNode()),N.error?(r.openBlock(),r.createElementBlock("div",$w,r.toDisplayString(N.error),1)):N.helper?(r.openBlock(),r.createElementBlock("div",Ww,r.toDisplayString(N.helper),1)):r.createCommentVNode("",!0)]))}}),_l=r.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>e.modelValue);return(i,s)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:i.disabled}]),onClick:s[0]||(s[0]=l=>i.$emit("update:modelValue",!i.modelValue)),onKeydown:s[1]||(s[1]=r.withKeys(l=>i.$emit("update:modelValue",!i.modelValue),["enter"]))},null,34))}}),qw={name:"PlCheckbox"},Au=r.defineComponent({...qw,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(i,s)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:i.disabled}])},[r.createVNode(_l,r.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=l=>i.$emit("update:modelValue",l))}),null,16),s[3]||(s[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:s[1]||(s[1]=l=>i.$emit("update:modelValue",!i.$props.modelValue))},[r.renderSlot(i.$slots,"default")])],2)):(r.openBlock(),r.createBlock(_l,r.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=l=>i.$emit("update:modelValue",l))}),null,16))}}),Kw={key:0},Yw=["onClick"],Jw={name:"PlCheckboxGroup"},Xw=r.defineComponent({...Jw,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=c=>i.modelValue.includes(c),l=c=>{const u=i.modelValue??[];n("update:modelValue",s(c)?u.filter(p=>p!==c):[...u,c])};return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:c.disabled}])},[c.label?(r.openBlock(),r.createElementBlock("label",Kw,r.toDisplayString(c.label),1)):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.options.map(p=>({label:"label"in p?p.label:p.text,value:p.value})),(p,f)=>(r.openBlock(),r.createElementBlock("div",{key:f},[r.createVNode(_l,{disabled:c.disabled,label:p.label,"model-value":s(p.value),"onUpdate:modelValue":()=>l(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),u[0]||(u[0]=r.createTextVNode()),r.createElementVNode("label",{onClick:r.withModifiers(()=>l(p.value),["stop"])},r.toDisplayString(p.label),9,Yw)]))),128))],2))}}),Qw="_component_tupwt_1",eb={component:Qw},tb={};function nb(t,e){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(t.$style.component)},e[0]||(e[0]=[r.createElementVNode("div",null,null,-1)]),2)}const rb={$style:eb},ib=Tn(tb,[["render",nb],["__cssModules",rb]]),ob={key:1,class:"pl-dialog-modal__title"},sb={inheritAttrs:!1},Cl=r.defineComponent({...sb,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.useAttrs();function u(p){l.value&&s.closeOnOutsideClick&&document.contains(p.target)&&!l.value.contains(p.target)&&i("update:modelValue",!1)}return tt(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&i("update:modelValue",!1)}),(p,f)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,{name:"dialog"},{default:r.withCtx(()=>[p.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:u},[r.createElementVNode("div",r.mergeProps(r.unref(c),{ref_key:"modal",ref:l,class:["pl-dialog-modal",{"has-title":r.unref(n).title,"has-content":r.unref(n).default}],style:{width:p.width,height:p.height,minHeight:p.minHeight,maxHeight:p.maxHeight}}),[p.closable?(r.openBlock(),r.createBlock(ib,{key:0,class:"close-modal-btn",onClick:f[0]||(f[0]=r.withModifiers(m=>i("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),f[1]||(f[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",ob,[r.renderSlot(p.$slots,"title")])):r.createCommentVNode("",!0),f[2]||(f[2]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(["pl-dialog-modal__content",{"no-content-gutters":p.noContentGutters,"no-top-content-gutter":p.noTopContentGutter}])},[r.renderSlot(p.$slots,"default")],2),f[3]||(f[3]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["pl-dialog-modal__actions",{"has-top-border":p.actionsHasTopBorder}])},[r.renderSlot(p.$slots,"actions")],2)):r.createCommentVNode("",!0)],16)])):r.createCommentVNode("",!0)]),_:3})]))}}),ab=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(i,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(i.$slots,"default")]),_:3}))}}),lb={key:0,class:"pl-slide-modal__title"},cb={class:"pl-slide-modal__content"},db={key:1,class:"pl-slide-modal__actions"},ub={name:"PlSlideModal",inheritAttrs:!1},pb=r.defineComponent({...ub,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.useAttrs();return fs(l,()=>{s.modelValue&&s.closeOnOutsideClick&&i("update:modelValue",!1)}),tt(document,"keydown",u=>{u.key==="Escape"&&i("update:modelValue",!1)}),(u,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(ab,null,{default:r.withCtx(()=>[u.modelValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref_key:"modal",ref:l,style:{width:u.width}},r.unref(c),{class:["pl-slide-modal",{"has-title":r.unref(n).title,"has-actions":r.unref(n).actions}],onKeyup:p[1]||(p[1]=r.withKeys(f=>i("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=f=>i("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",lb,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",cb,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",db,[r.renderSlot(u.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),u.modelValue&&u.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(f=>i("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),hb={key:0,class:"label"},fb={name:"PlToggleSwitch"},gs=r.defineComponent({...fb,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["ui-toggle-switch",{active:e.modelValue}]),onClick:n[0]||(n[0]=i=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(i=>e.$emit("update:modelValue",!e.modelValue),["enter"]))},[n[2]||(n[2]=r.createElementVNode("div",{class:"ui-toggle-switch__body"},[r.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),n[3]||(n[3]=r.createTextVNode()),e.label?(r.openBlock(),r.createElementBlock("span",hb,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function Nu(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function mb(t){return r.unref(t)}const gb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function yb(t,e,n={}){const{immediate:i=!0}=n,s=r.ref(!1);let l=null;function c(){l&&(clearTimeout(l),l=null)}function u(){s.value=!1,c()}function p(...f){c(),s.value=!0,l=setTimeout(()=>{s.value=!1,l=null,t(...f)},mb(e))}return i&&(s.value=!0,gb&&p()),Nu(u),{isPending:r.readonly(s),start:p,stop:u}}function vb(t,e,n){return r.watch(t,(i,s,l)=>{i&&e(i,s,l)},{...n,once:!1})}function _b(t,e,n){const{start:i}=yb(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),i())}function c(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&c(),Nu(u),{isActive:s,pause:u,resume:c}}const Cb="[==PROGRESS==]";function wb(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bb(t){const e=r.ref(),n=r.reactive({errorCount:0});async function i(){var l;let c=e.value;if(c===void 0)return;const u=t.mockPlatforma??window.platforma;if(!u){console.warn("Platforma API is not available");return}for(;;){const p=await u.logDriver.readText(c.logHandle,100,c.lastOffset);if(c.error=void 0,n.errorCount=0,p.shouldUpdateHandle||c.logHandle!==((l=e.value)==null?void 0:l.logHandle))return;const f=t.progressPrefix??Cb,m=new TextDecoder().decode(p.data).replace(new RegExp(`${wb(f)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=_b(()=>i().catch(l=>{e.value&&(n.errorCount++,n.errorCount>(t.maxRetries??3)?e.value.error=l:console.warn("skip error:",l,"retry..."))}),1500,{immediate:!1});return vb(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>s.pause()),r.watch(()=>t.logHandle,l=>{var c;l===void 0?(e.value=void 0,s.pause()):l!==((c=e.value)==null?void 0:c.logHandle)&&(e.value={logHandle:l,lastOffset:0,lines:"",finished:!1,error:void 0},n.errorCount=0,s.resume())},{immediate:!0}),e}const xb={key:0},kb={key:1,class:"pl-log-view__error"},Sb={name:"PlLogView"},Eb=r.defineComponent({...Sb,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=k=>{if(k&&k.ok===!1)return k.errors.join(`
51
- `)},n=t,i=bb(n),s=r.ref(!0),l=r.ref(),c=r.ref(),u=r.computed(()=>{var k;return((k=i.value)==null?void 0:k.error)??n.error??e(n.output)}),p=r.computed(()=>{var k;return((k=i.value)==null?void 0:k.lines)??n.value??mv(n.output)});On(c);const f=()=>{p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},m=()=>{Mr(l.value,k=>{s.value&&k.scrollTo(k.scrollLeft,k.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{m()})},{immediate:!0});const y=k=>{const S=k.target;s.value=S.scrollTop+20>=S.scrollHeight-S.offsetHeight};return(k,S)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[k.label?(r.openBlock(),r.createElementBlock("label",xb,r.toDisplayString(k.label),1)):r.createCommentVNode("",!0),S[0]||(S[0]=r.createTextVNode()),r.createVNode(lr,{class:"pl-log-view__contour"}),S[1]||(S[1]=r.createTextVNode()),r.createVNode(r.unref(Ln),{title:"Copy content",class:"pl-log-view__copy",name:"clipboard",onClick:f}),S[2]||(S[2]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",kb,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:y},r.toDisplayString(p.value),545))],2))}}),Tb="_component_1ukal_1",Bb="_tab_1ukal_14",Ab="_disabled_1ukal_27",Nb="_active_1ukal_56",Vb="_topLine_1ukal_69",hi={component:Tb,tab:Bb,disabled:Ab,active:Nb,topLine:Vb},Pb=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const i=r.unref(e);if(!i)return;const s=i.$el.querySelector("span");s&&requestAnimationFrame(()=>{s.offsetWidth<s.scrollWidth&&(n.isOverflown=!0),console.log("el.offsetWidth, el.scrollWidth",s.offsetWidth,s.scrollWidth)})}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(Vt),{ref_key:"rootRef",ref:e,element:"div",position:"top",hide:!n.isOverflown,"close-delay":300,"data-is-overflown":n.isOverflown?"true":"false"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(i.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(i.$slots,"default"),s[0]||(s[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Db={name:"PlTabs"},Fb=r.defineComponent({...Db,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=s=>n("update:modelValue",s);return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(hi).component,{[r.unref(hi).disabled]:s.disabled,[r.unref(hi).topLine]:s.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createBlock(Pb,{key:u,tabindex:s.modelValue===c.value||s.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(hi).active]:s.modelValue===c.value,[r.unref(hi).disabled]:c.disabled},r.unref(hi).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>i(c.value),["enter"]),onClick:p=>i(c.value)},{default:r.withCtx(()=>[r.renderSlot(s.$slots,c.value,{option:c},()=>[r.createElementVNode("span",null,r.toDisplayString(c.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}});function Rb(t){const e=t.split("/"),n=[];for(let i=0;i<e.length;i++)n.push({index:i,name:i===0?"Root":e[i],path:e.slice(0,i+1).join("/")});return n}const Mb={class:"file-dialog"},Ib={class:"file-dialog__search"},Ob={class:"ls-container"},Lb={class:"ls-head"},Gb={class:"ls-head__breadcrumbs"},zb=["title","onClick"],Ub={key:0,class:"icon-16 icon-chevron-right"},Zb={class:"d-flex ml-auto align-center gap-12"},$b={class:"ls-head__selected"},Wb={key:0,class:"ls-loader"},Hb={key:1,class:"ls-empty"},jb={key:2,class:"ls-error"},qb={class:"ls-error__message"},Kb={key:3,class:"ls-body"},Yb=["onClick"],Jb=["title"],Xb=["onClick"],Qb=["title"],Vu=r.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const n=e,i=t,s=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),l=r.reactive(s()),c=r.computed(()=>l.showHiddenItems?l.items:l.items.filter(z=>!z.name.startsWith("."))),u=r.computed(()=>{var z;return{modelValue:i.modelValue,dirPath:l.dirPath,storageHandle:(z=l.storageEntry)==null?void 0:z.handle}}),p=(z,N)=>{window.platforma&&l.currentLoadingPath!==N&&(l.error="",l.items=[],l.lastSelected=void 0,l.currentLoadingPath=N,window.platforma.lsDriver.listFiles(z,N).then(E=>{N===l.dirPath&&(l.items=Yd(E).entries.map(V=>({path:V.fullPath,name:V.name,isDir:V.type==="dir",canBeSelected:V.type==="file"&&(!i.extensions||i.extensions.some(W=>V.fullPath.endsWith(W))),handle:V.type==="file"?V.handle:void 0,selected:!1})).sort((V,W)=>V.isDir&&!W.isDir?-1:!V.isDir&&W.isDir?1:V.name.localeCompare(W.name)).map((V,W)=>({id:W,...V})),l.lastSelected=void 0)}).catch(E=>l.error=String(E)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:z,dirPath:N,modelValue:E}=u.value;z&&E&&p(z,N)},m=Qd(z=>{l.dirPath=z??""},1e3),y=r.computed(()=>Rb(l.dirPath)),k=r.computed(()=>l.items.filter(z=>z.canBeSelected&&z.selected&&!z.isDir)),S=r.computed(()=>k.value.length>0),M=()=>{n("update:modelValue",!1)},T=()=>{var z;S.value&&(z=l.storageEntry)!=null&&z.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:k.value.map(N=>N.handle)}),M())},R=z=>{l.dirPath=z,l.storageEntry&&f()},C=(z,N)=>{const{shiftKey:E,metaKey:V}=z,{lastSelected:W}=l;if(z.preventDefault(),N.canBeSelected){if(i.multi||l.items.forEach(q=>q.selected=!1),N.selected=!0,!i.multi)return;!V&&!E&&l.items.forEach(q=>{q.id!==N.id&&(q.selected=!1)}),E&&W!==void 0&&l.items.forEach(q=>{pv(q.id,W,N.id)&&(q.selected=!0)}),N.selected&&(l.lastSelected=N.id)}},G=z=>{z&&!i.multi||l.items.filter(N=>N.canBeSelected).forEach(N=>{N.selected=z})},X=()=>G(!0),L=()=>G(!1),P=()=>{if(l.error="",l.lastSelected=void 0,L(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(z=>{l.storageOptions=z.map(N=>({text:N.name,value:N})),i.autoSelectStorage&&Mr(z.find(N=>N.name==="local"||N.name.startsWith("local_disk_")&&N.initialFullPath.length>4),N=>{l.storageEntry=N,l.dirPath=N.initialFullPath})}).catch(z=>l.error=String(z))};r.watch(r.toRef(l,"storageEntry"),z=>{l.dirPath=(z==null?void 0:z.initialFullPath)??""}),r.watch([()=>l.dirPath,()=>l.storageEntry],()=>{f()}),r.watch(()=>i.modelValue,z=>{z?P():Object.assign(l,s())},{immediate:!0}),tt(document,"keydown",z=>{i.modelValue&&z.target===document.body&&(z.metaKey&&z.code==="KeyA"&&(z.preventDefault(),X()),z.metaKey&&z.shiftKey&&z.code==="Period"&&(z.preventDefault(),l.showHiddenItems=!l.showHiddenItems),z.code==="Enter"&&T())}),r.onUpdated(P);const O={mounted:z=>{if(z.clientWidth<z.scrollWidth){const N=z.innerText;z.innerText=N.substring(0,57)+"..."+N.substring(N.length-10)}}};return(z,N)=>(r.openBlock(),r.createBlock(r.unref(Cl),{"no-content-gutters":!0,"close-on-outside-click":z.closeOnOutsideClick,class:"split","model-value":z.modelValue,width:"688px",height:"720px","onUpdate:modelValue":M,onClick:r.withModifiers(L,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(z.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(cl),{style:{"min-width":"160px"},disabled:!S.value,onClick:r.withModifiers(T,["stop"])},{default:r.withCtx(()=>N[14]||(N[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),N[16]||(N[16]=r.createTextVNode()),r.createVNode(r.unref(ul),{"justify-center":!1,onClick:r.withModifiers(M,["stop"])},{default:r.withCtx(()=>N[15]||(N[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[N[17]||(N[17]=r.createTextVNode()),r.createElementVNode("div",Mb,[r.createElementVNode("div",Ib,[r.createVNode(r.unref(uo),{modelValue:l.storageEntry,"onUpdate:modelValue":N[0]||(N[0]=E=>l.storageEntry=E),label:"Select storage",options:l.storageOptions},null,8,["modelValue","options"]),N[1]||(N[1]=r.createTextVNode()),r.createVNode(r.unref(Ir),{"model-value":l.dirPath,label:"Enter path","onUpdate:modelValue":r.unref(m)},null,8,["model-value","onUpdate:modelValue"])]),N[13]||(N[13]=r.createTextVNode()),r.createElementVNode("div",Ob,[r.createElementVNode("div",Lb,[r.createElementVNode("div",Gb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(E,V)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:V},[r.createElementVNode("div",{title:E.path,onClick:W=>R(E.path)},r.toDisplayString(E.name),9,zb),N[2]||(N[2]=r.createTextVNode()),E.index!==y.value.length-1?(r.openBlock(),r.createElementBlock("i",Ub)):r.createCommentVNode("",!0)],64))),128))]),N[3]||(N[3]=r.createTextVNode()),r.createElementVNode("div",Zb,[r.createElementVNode("span",$b,"Selected: "+r.toDisplayString(k.value.length),1)])]),N[12]||(N[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",Wb,N[4]||(N[4]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):l.storageEntry?l.error?(r.openBlock(),r.createElementBlock("div",jb,[N[6]||(N[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),N[7]||(N[7]=r.createTextVNode()),r.createElementVNode("div",qb,r.toDisplayString(l.error),1)])):(r.openBlock(),r.createElementBlock("div",Kb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,E=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:E.id},[E.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:V=>R(E.path)},[N[8]||(N[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),N[9]||(N[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:E.name},[r.createTextVNode(r.toDisplayString(E.name),1)],8,Jb)),[[O]])],8,Yb)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:E.canBeSelected,selected:E.selected}),onClick:r.withModifiers(V=>C(V,E),["stop"])},[N[10]||(N[10]=r.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),N[11]||(N[11]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:E.name},[r.createTextVNode(r.toDisplayString(E.name),1)],8,Qb)),[[O]])],10,Xb))],64))),128))])):(r.openBlock(),r.createElementBlock("div",Hb,N[5]||(N[5]=[r.createElementVNode("div",{class:"ls-empty__cat"},null,-1),r.createTextVNode(),r.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),N[18]||(N[18]=r.createTextVNode())]),_:1},8,["close-on-outside-click","model-value"]))}});var Ie;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Ie||(Ie={}));var wl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(wl||(wl={}));const se=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cr=t=>{switch(typeof t){case"undefined":return se.undefined;case"string":return se.string;case"number":return isNaN(t)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(t)?se.array:t===null?se.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?se.promise:typeof Map<"u"&&t instanceof Map?se.map:typeof Set<"u"&&t instanceof Set?se.set:typeof Date<"u"&&t instanceof Date?se.date:se.object;default:return se.unknown}},ee=Ie.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"]),ex=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ot extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},i={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let u=i,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof Ot))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Ot.create=t=>new Ot(t);const fi=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===se.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ie.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ie.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ie.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ie.joinValues(t.options)}, received '${t.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.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}"`:Ie.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ee.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 ee.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 ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ie.assertNever(t)}return{message:n}};let Pu=fi;function tx(t){Pu=t}function ys(){return Pu}const vs=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},nx=[];function ie(t,e){const n=ys(),i=vs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===fi?void 0:fi].filter(s=>!!s)});t.common.issues.push(i)}class yt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return yt.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const Ce=Object.freeze({status:"aborted"}),_s=t=>({status:"dirty",value:t}),kt=t=>({status:"valid",value:t}),bl=t=>t.status==="aborted",xl=t=>t.status==="dirty",po=t=>t.status==="valid",ho=t=>typeof Promise<"u"&&t instanceof Promise;function Cs(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Du(t,e,n,i,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var ue;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ue||(ue={}));var fo,mo;class Bn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Fu=(t,e)=>{if(po(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 Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(l,c)=>{var u,p;const{message:f}=t;return l.code==="invalid_enum_value"?{message:f??c.defaultError}:typeof c.data>"u"?{message:(u=f??i)!==null&&u!==void 0?u:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(p=f??n)!==null&&p!==void 0?p:c.defaultError}},description:s}}class Ae{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 cr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new yt,ctx:{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(ho(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return Fu(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(ho(s)?s:Promise.resolve(s));return Fu(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:ee.custom,...i(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new cn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Nn.create(this,this._def)}nullable(){return fr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ln.create(this,this._def)}promise(){return vi.create(this,this._def)}or(e){return _o.create([this,e],this._def)}and(e){return Co.create(this,e,this._def)}transform(e){return new cn({...Ee(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new So({...Ee(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new El({typeName:ve.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Eo({...Ee(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return To.create(this,e)}readonly(){return Bo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const rx=/^c[^\s-]{8,}$/i,ix=/^[0-9a-z]+$/,ox=/^[0-9A-HJKMNP-TV-Z]{26}$/,sx=/^[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,ax=/^[a-z0-9_-]{21}$/i,lx=/^[-+]?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)?)??$/,cx=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kl;const ux=/^(?:(?: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])$/,px=/^(([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})))$/,hx=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ru="((\\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])))",fx=new RegExp(`^${Ru}$`);function Mu(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 mx(t){return new RegExp(`^${Mu(t)}$`)}function Iu(t){let e=`${Ru}T${Mu(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 gx(t,e){return!!((e==="v4"||!e)&&ux.test(t)||(e==="v6"||!e)&&px.test(t))}class an extends Ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==se.string){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:se.string,received:s.parsedType}),Ce}const n=new yt;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,c=e.data.length<s.value;(l||c)&&(i=this._getOrReturnCtx(e,i),l?ie(i,{code:ee.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&ie(i,{code:ee.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")cx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")kl||(kl=new RegExp(dx,"u")),kl.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")sx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")ax.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")rx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")ix.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")ox.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Iu(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?fx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?mx(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?lx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?gx(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?hx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:s.message}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:ee.invalid_string,...ue.errToObj(i)})}_addCheck(e){return new an({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ue.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ue.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ue.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ue.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ue.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ue.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ue.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ue.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ue.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ue.errToObj(e)})}datetime(e){var n,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...ue.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,...ue.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ue.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ue.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ue.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ue.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ue.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ue.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ue.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ue.errToObj(n)})}nonempty(e){return this.min(1,ue.errToObj(e))}trim(){return new an({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new an({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new an({...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}}an.create=t=>{var e;return new an({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function yx(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class dr extends Ae{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)!==se.number){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:se.number,received:s.parsedType}),Ce}let n;const i=new yt;for(const s of this._def.checks)s.kind==="int"?Ie.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?yx(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.not_finite,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,i,s){return new dr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ue.toString(s)}]})}_addCheck(e){return new dr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ue.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"&&Ie.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}dr.create=t=>new dr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class ur extends Ae{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)!==se.bigint){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:se.bigint,received:s.parsedType}),Ce}let n;const i=new yt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,i,s){return new ur({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ue.toString(s)}]})}_addCheck(e){return new ur({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.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}}ur.create=t=>{var e;return new ur({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};class go extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==se.boolean){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.boolean,received:n.parsedType}),Ce}return kt(e.data)}}go.create=t=>new go({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class Or extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==se.date){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:se.date,received:s.parsedType}),Ce}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_date}),Ce}const n=new yt;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Or({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ue.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}}Or.create=t=>new Or({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Ee(t)});class ws extends Ae{_parse(e){if(this._getType(e)!==se.symbol){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.symbol,received:n.parsedType}),Ce}return kt(e.data)}}ws.create=t=>new ws({typeName:ve.ZodSymbol,...Ee(t)});class yo extends Ae{_parse(e){if(this._getType(e)!==se.undefined){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.undefined,received:n.parsedType}),Ce}return kt(e.data)}}yo.create=t=>new yo({typeName:ve.ZodUndefined,...Ee(t)});class vo extends Ae{_parse(e){if(this._getType(e)!==se.null){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.null,received:n.parsedType}),Ce}return kt(e.data)}}vo.create=t=>new vo({typeName:ve.ZodNull,...Ee(t)});class mi extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return kt(e.data)}}mi.create=t=>new mi({typeName:ve.ZodAny,...Ee(t)});class Lr extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return kt(e.data)}}Lr.create=t=>new Lr({typeName:ve.ZodUnknown,...Ee(t)});class Gn extends Ae{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.never,received:n.parsedType}),Ce}}Gn.create=t=>new Gn({typeName:ve.ZodNever,...Ee(t)});class bs extends Ae{_parse(e){if(this._getType(e)!==se.undefined){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.void,received:n.parsedType}),Ce}return kt(e.data)}}bs.create=t=>new bs({typeName:ve.ZodVoid,...Ee(t)});class ln extends Ae{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==se.array)return ie(n,{code:ee.invalid_type,expected:se.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?ee.too_big:ee.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ie(n,{code:ee.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ie(n,{code:ee.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new Bn(n,c,n.path,u)))).then(c=>yt.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new Bn(n,c,n.path,u)));return yt.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new ln({...this._def,minLength:{value:e,message:ue.toString(n)}})}max(e,n){return new ln({...this._def,maxLength:{value:e,message:ue.toString(n)}})}length(e,n){return new ln({...this._def,exactLength:{value:e,message:ue.toString(n)}})}nonempty(e){return this.min(1,e)}}ln.create=(t,e)=>new ln({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ee(e)});function gi(t){if(t instanceof Xe){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Nn.create(gi(i))}return new Xe({...t._def,shape:()=>e})}else return t instanceof ln?new ln({...t._def,type:gi(t.element)}):t instanceof Nn?Nn.create(gi(t.unwrap())):t instanceof fr?fr.create(gi(t.unwrap())):t instanceof An?An.create(t.items.map(e=>gi(e))):t}class Xe extends Ae{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=Ie.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==se.object){const p=this._getOrReturnCtx(e);return ie(p,{code:ee.invalid_type,expected:se.object,received:p.parsedType}),Ce}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof Gn&&this._def.unknownKeys==="strip"))for(const p in i.data)l.includes(p)||c.push(p);const u=[];for(const p of l){const f=s[p],m=i.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new Bn(i,m,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof Gn){const p=this._def.unknownKeys;if(p==="passthrough")for(const f of c)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(p==="strict")c.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:c}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const f of c){const m=i.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new Bn(i,m,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const p=[];for(const f of u){const m=await f.key,y=await f.value;p.push({key:m,value:y,alwaysSet:f.alwaysSet})}return p}).then(p=>yt.mergeObjectSync(n,p)):yt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return ue.errToObj,new Xe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=ue.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Xe({...this._def,unknownKeys:"strip"})}passthrough(){return new Xe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Xe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Xe({...this._def,catchall:e})}pick(e){const n={};return Ie.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Xe({...this._def,shape:()=>n})}omit(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Xe({...this._def,shape:()=>n})}deepPartial(){return gi(this)}partial(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Xe({...this._def,shape:()=>n})}required(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Nn;)s=s._def.innerType;n[i]=s}}),new Xe({...this._def,shape:()=>n})}keyof(){return Ou(Ie.objectKeys(this.shape))}}Xe.create=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strip",catchall:Gn.create(),typeName:ve.ZodObject,...Ee(e)}),Xe.strictCreate=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strict",catchall:Gn.create(),typeName:ve.ZodObject,...Ee(e)}),Xe.lazycreate=(t,e)=>new Xe({shape:t,unknownKeys:"strip",catchall:Gn.create(),typeName:ve.ZodObject,...Ee(e)});class _o extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new Ot(u.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:c}),Ce}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of i){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new Ot(p));return ie(n,{code:ee.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}_o.create=(t,e)=>new _o({options:t,typeName:ve.ZodUnion,...Ee(e)});const pr=t=>t instanceof bo?pr(t.schema):t instanceof cn?pr(t.innerType()):t instanceof xo?[t.value]:t instanceof hr?t.options:t instanceof ko?Ie.objectValues(t.enum):t instanceof So?pr(t._def.innerType):t instanceof yo?[void 0]:t instanceof vo?[null]:t instanceof Nn?[void 0,...pr(t.unwrap())]:t instanceof fr?[null,...pr(t.unwrap())]:t instanceof El||t instanceof Bo?pr(t.unwrap()):t instanceof Eo?pr(t._def.innerType):[];class xs extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.object)return ie(n,{code:ee.invalid_type,expected:se.object,received:n.parsedType}),Ce;const i=this.discriminator,s=n.data[i],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=pr(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 xs({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ee(i)})}}function Sl(t,e){const n=cr(t),i=cr(e);if(t===e)return{valid:!0,data:t};if(n===se.object&&i===se.object){const s=Ie.objectKeys(e),l=Ie.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Sl(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===se.array&&i===se.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=Sl(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===se.date&&i===se.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Co extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(bl(l)||bl(c))return Ce;const u=Sl(l.value,c.value);return u.valid?((xl(l)||xl(c))&&n.dirty(),{status:n.value,value:u.data}):(ie(i,{code:ee.invalid_intersection_types}),Ce)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Co.create=(t,e,n)=>new Co({left:t,right:e,typeName:ve.ZodIntersection,...Ee(n)});class An extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==se.array)return ie(i,{code:ee.invalid_type,expected:se.array,received:i.parsedType}),Ce;if(i.data.length<this._def.items.length)return ie(i,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&i.data.length>this._def.items.length&&(ie(i,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((l,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new Bn(i,l,i.path,c)):null}).filter(l=>!!l);return i.common.async?Promise.all(s).then(l=>yt.mergeArray(n,l)):yt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new An({...this._def,rest:e})}}An.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new An({items:t,typeName:ve.ZodTuple,rest:null,...Ee(e)})};class wo extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==se.object)return ie(i,{code:ee.invalid_type,expected:se.object,received:i.parsedType}),Ce;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new Bn(i,u,i.path,u)),value:c._parse(new Bn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?yt.mergeObjectAsync(n,s):yt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Ae?new wo({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ee(i)}):new wo({keyType:an.create(),valueType:e,typeName:ve.ZodRecord,...Ee(n)})}}class ks extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==se.map)return ie(i,{code:ee.invalid_type,expected:se.map,received:i.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new Bn(i,u,i.path,[f,"key"])),value:l._parse(new Bn(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return 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}}}}ks.create=(t,e,n)=>new ks({valueType:e,keyType:t,typeName:ve.ZodMap,...Ee(n)});class Gr extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==se.set)return ie(i,{code:ee.invalid_type,expected:se.set,received:i.parsedType}),Ce;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(ie(i,{code:ee.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(ie(i,{code:ee.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=[...i.data.values()].map((p,f)=>l._parse(new Bn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Gr({...this._def,minSize:{value:e,message:ue.toString(n)}})}max(e,n){return new Gr({...this._def,maxSize:{value:e,message:ue.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Gr.create=(t,e)=>new Gr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ee(e)});class yi extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.function)return ie(n,{code:ee.invalid_type,expected:se.function,received:n.parsedType}),Ce;function i(u,p){return vs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ys(),fi].filter(f=>!!f),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function s(u,p){return vs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ys(),fi].filter(f=>!!f),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof vi){const u=this;return kt(async function(...p){const f=new Ot([]),m=await u._def.args.parseAsync(p,l).catch(k=>{throw f.addIssue(i(p,k)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(k=>{throw f.addIssue(s(y,k)),f})})}else{const u=this;return kt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Ot([i(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 yi({...this._def,args:An.create(e).rest(Lr.create())})}returns(e){return new yi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new yi({args:e||An.create([]).rest(Lr.create()),returns:n||Lr.create(),typeName:ve.ZodFunction,...Ee(i)})}}class bo extends Ae{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})}}bo.create=(t,e)=>new bo({getter:t,typeName:ve.ZodLazy,...Ee(e)});class xo extends Ae{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}xo.create=(t,e)=>new xo({value:t,typeName:ve.ZodLiteral,...Ee(e)});function Ou(t,e){return new hr({values:t,typeName:ve.ZodEnum,...Ee(e)})}class hr extends Ae{constructor(){super(...arguments),fo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ie(n,{expected:Ie.joinValues(i),received:n.parsedType,code:ee.invalid_type}),Ce}if(Cs(this,fo)||Du(this,fo,new Set(this._def.values)),!Cs(this,fo).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:i}),Ce}return kt(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 hr.create(e,{...this._def,...n})}exclude(e,n=this._def){return hr.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}fo=new WeakMap,hr.create=Ou;class ko extends Ae{constructor(){super(...arguments),mo.set(this,void 0)}_parse(e){const n=Ie.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==se.string&&i.parsedType!==se.number){const s=Ie.objectValues(n);return ie(i,{expected:Ie.joinValues(s),received:i.parsedType,code:ee.invalid_type}),Ce}if(Cs(this,mo)||Du(this,mo,new Set(Ie.getValidEnumValues(this._def.values))),!Cs(this,mo).has(e.data)){const s=Ie.objectValues(n);return ie(i,{received:i.data,code:ee.invalid_enum_value,options:s}),Ce}return kt(e.data)}get enum(){return this._def.values}}mo=new WeakMap,ko.create=(t,e)=>new ko({values:t,typeName:ve.ZodNativeEnum,...Ee(e)});class vi extends Ae{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:se.promise,received:n.parsedType}),Ce;const i=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return kt(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}vi.create=(t,e)=>new vi({type:t,typeName:ve.ZodPromise,...Ee(e)});class cn extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ie(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?_s(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?_s(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!po(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>po(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Ie.assertNever(s)}}cn.create=(t,e,n)=>new cn({schema:t,typeName:ve.ZodEffects,effect:e,...Ee(n)}),cn.createWithPreprocess=(t,e,n)=>new cn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ee(n)});class Nn extends Ae{_parse(e){return this._getType(e)===se.undefined?kt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nn.create=(t,e)=>new Nn({innerType:t,typeName:ve.ZodOptional,...Ee(e)});class fr extends Ae{_parse(e){return this._getType(e)===se.null?kt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fr.create=(t,e)=>new fr({innerType:t,typeName:ve.ZodNullable,...Ee(e)});class So extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===se.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}So.create=(t,e)=>new So({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class Eo extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ho(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ot(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ot(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Eo.create=(t,e)=>new Eo({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class Ss extends Ae{_parse(e){if(this._getType(e)!==se.nan){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.nan,received:n.parsedType}),Ce}return{status:"valid",value:e.data}}}Ss.create=t=>new Ss({typeName:ve.ZodNaN,...Ee(t)});const vx=Symbol("zod_brand");class El extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class To extends Ae{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),_s(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new To({in:e,out:n,typeName:ve.ZodPipeline})}}class Bo extends Ae{_parse(e){const n=this._def.innerType._parse(e),i=s=>(po(s)&&(s.value=Object.freeze(s.value)),s);return ho(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}Bo.create=(t,e)=>new Bo({innerType:t,typeName:ve.ZodReadonly,...Ee(e)});function Lu(t,e={},n){return t?mi.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):mi.create()}const _x={object:Xe.lazycreate};var ve;(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"})(ve||(ve={}));const Cx=(t,e={message:`Input not instance of ${t.name}`})=>Lu(n=>n instanceof t,e),Gu=an.create,zu=dr.create,wx=Ss.create,bx=ur.create,Uu=go.create,xx=Or.create,kx=ws.create,Sx=yo.create,Ex=vo.create,Tx=mi.create,Bx=Lr.create,Ax=Gn.create,Nx=bs.create,Vx=ln.create,Px=Xe.create,Dx=Xe.strictCreate,Fx=_o.create,Rx=xs.create,Mx=Co.create,Ix=An.create,Ox=wo.create,Lx=ks.create,Gx=Gr.create,zx=yi.create,Ux=bo.create,Zx=xo.create,$x=hr.create,Wx=ko.create,Hx=vi.create,Zu=cn.create,jx=Nn.create,qx=fr.create,Kx=cn.createWithPreprocess,Yx=To.create;var Es=Object.freeze({__proto__:null,defaultErrorMap:fi,setErrorMap:tx,getErrorMap:ys,makeIssue:vs,EMPTY_PATH:nx,addIssueToContext:ie,ParseStatus:yt,INVALID:Ce,DIRTY:_s,OK:kt,isAborted:bl,isDirty:xl,isValid:po,isAsync:ho,get util(){return Ie},get objectUtil(){return wl},ZodParsedType:se,getParsedType:cr,ZodType:Ae,datetimeRegex:Iu,ZodString:an,ZodNumber:dr,ZodBigInt:ur,ZodBoolean:go,ZodDate:Or,ZodSymbol:ws,ZodUndefined:yo,ZodNull:vo,ZodAny:mi,ZodUnknown:Lr,ZodNever:Gn,ZodVoid:bs,ZodArray:ln,ZodObject:Xe,ZodUnion:_o,ZodDiscriminatedUnion:xs,ZodIntersection:Co,ZodTuple:An,ZodRecord:wo,ZodMap:ks,ZodSet:Gr,ZodFunction:yi,ZodLazy:bo,ZodLiteral:xo,ZodEnum:hr,ZodNativeEnum:ko,ZodPromise:vi,ZodEffects:cn,ZodTransformer:cn,ZodOptional:Nn,ZodNullable:fr,ZodDefault:So,ZodCatch:Eo,ZodNaN:Ss,BRAND:vx,ZodBranded:El,ZodPipeline:To,ZodReadonly:Bo,custom:Lu,Schema:Ae,ZodSchema:Ae,late:_x,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>an.create({...t,coerce:!0}),number:t=>dr.create({...t,coerce:!0}),boolean:t=>go.create({...t,coerce:!0}),bigint:t=>ur.create({...t,coerce:!0}),date:t=>Or.create({...t,coerce:!0})},any:Tx,array:Vx,bigint:bx,boolean:Uu,date:xx,discriminatedUnion:Rx,effect:Zu,enum:$x,function:zx,instanceof:Cx,intersection:Mx,lazy:Ux,literal:Zx,map:Lx,nan:wx,nativeEnum:Wx,never:Ax,null:Ex,nullable:qx,number:zu,object:Px,oboolean:()=>Uu().optional(),onumber:()=>zu().optional(),optional:jx,ostring:()=>Gu().optional(),pipeline:Yx,preprocess:Kx,promise:Hx,record:Ox,set:Gx,strictObject:Dx,string:Gu,symbol:kx,transformer:Zu,tuple:Ix,undefined:Sx,union:Fx,unknown:Bx,void:Nx,NEVER:Ce,ZodIssueCode:ee,quotelessJson:ex,ZodError:Ot});function Jx(t){throw new Error("Unexpected object: "+t)}const $u="upload://upload/",Wu="index://index/";function Xx(t){return t.startsWith($u)}function Qx(t){return t.startsWith(Wu)}function ek(t){if(Qx(t)){const e=t.slice(Wu.length);return JSON.parse(decodeURIComponent(e)).path}else if(Xx(t)){const e=t.slice($u.length);return JSON.parse(decodeURIComponent(e)).localPath}Jx(t)}Es.object({__isRef:Es.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Es.string().describe("Upstream block id"),name:Es.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 tk(t){return t.replace(/^.*[\\/]/,"")}const nk={key:0,ref:"label"},rk={key:0,class:"required-icon"},ik=["data-placeholder"],ok={key:5,class:"pl-file-input__stats"},sk={key:0,class:"pl-file-input__error"},ak={key:1,class:"upl-file-input__helper"},Hu=r.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},showFilenameOnly:{type:Boolean},cellStyle:{type:Boolean,default:!1},fileDialogTitle:{default:void 0},fileDialogCloseOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.reactive({fileDialogOpen:!1}),i=r.useSlots(),s=e,l=t,c=r.computed(()=>{if(l.modelValue)try{const C=ek(l.modelValue).trim();return l.showFilenameOnly?tk(C):C}catch(C){return console.error(C),l.modelValue}return""}),u=r.computed(()=>l.progress&&!l.progress.done),p=r.computed(()=>l.progress&&l.progress.done),f=r.computed(()=>l.error),m=r.computed(()=>l.error),y=r.computed(()=>{const{status:C,done:G}=l.progress??{};return!C||!C.bytesTotal?"":C.bytesProcessed&&!G?el(C.bytesProcessed,{})+" / "+el(C.bytesTotal,{}):el(C.bytesTotal,{})}),k=r.computed(()=>{var C;const{progress:G}=l;return G?{width:G.done?"100%":Math.round((((C=G.status)==null?void 0:C.progress)??0)*100)+"%"}:{}}),S=()=>{n.fileDialogOpen=!0},M=C=>{C.files.length&&s("update:modelValue",C.files[0])},T=()=>s("update:modelValue",void 0),R=r.ref();return l.cellStyle||On(R),(C,G)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!C.cellStyle,"has-file":!!c.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:R,class:r.normalizeClass(["pl-file-input",{dashed:C.dashed,error:f.value}]),tabindex:"0",onKeyup:r.withKeys(S,["enter"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(k.value)},null,4),G[3]||(G[3]=r.createTextVNode()),!C.cellStyle&&C.label?(r.openBlock(),r.createElementBlock("label",nk,[C.required?(r.openBlock(),r.createElementBlock("i",rk)):r.createCommentVNode("",!0),G[1]||(G[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(C.label),1),G[2]||(G[2]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),G[4]||(G[4]=r.createTextVNode()),f.value?(r.openBlock(),r.createBlock(r.unref(Ln),{key:1,name:"restart"})):u.value?(r.openBlock(),r.createBlock(r.unref(Ln),{key:2,name:"cloud-upload"})):p.value?(r.openBlock(),r.createBlock(r.unref(Ln),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(Ln),{key:4,name:"paper-clip"})),G[5]||(G[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":C.placeholder??"Choose file",class:"pl-file-input__filename",onClick:r.withModifiers(S,["stop"])},r.toDisplayString(c.value),9,ik),G[6]||(G[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",ok,r.toDisplayString(y.value),1)):r.createCommentVNode("",!0),G[7]||(G[7]=r.createTextVNode()),C.modelValue?(r.openBlock(),r.createBlock(r.unref(Ln),{key:6,name:"close",onClick:r.withModifiers(T,["stop"])})):r.createCommentVNode("",!0),G[8]||(G[8]=r.createTextVNode()),r.createVNode(lr,{class:"pl-file-input__contour"})],34),G[9]||(G[9]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",sk,r.toDisplayString(m.value),1)):C.helper?(r.openBlock(),r.createElementBlock("div",ak,r.toDisplayString(C.helper),1)):r.createCommentVNode("",!0)],2),G[10]||(G[10]=r.createTextVNode()),r.createVNode(r.unref(Vu),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":G[0]||(G[0]=X=>n.fileDialogOpen=X),extensions:C.extensions,title:C.fileDialogTitle,"close-on-outside-click":C.fileDialogCloseOnOutsideClick,"onImport:files":M},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),lk={class:"pl-notification-alert__wrapper d-flex"},ck={class:"pl-notification-alert__content flex-grow-1"},dk={key:0,class:"pl-notification-alert__close"},uk={key:0,class:"pl-notification-alert__actions d-flex"},ju=r.defineComponent({__name:"PlNotificationAlert",props:r.mergeModels({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=r.useModel(t,"modelValue");function i(){e.closable&&(n.value=!1)}return(s,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([s.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${s.width}`})},[r.createElementVNode("div",lk,[r.createElementVNode("div",ck,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",dk,[r.createVNode(r.unref(ul),{icon:"close",onClick:i})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),s.$slots.actions?(r.openBlock(),r.createElementBlock("div",uk,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),qu=r.defineComponent({__name:"PlCopyData",emits:["copy"],setup(t,{emit:e}){const n=e,i=r.ref(!1),s=r.computed(()=>i.value?"mask-clipboard-copied":"mask-clipboard");function l(){i.value=!0,setTimeout(()=>i.value=!1,700),n("copy")}return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.value,"mask-24"]),onClick:l},null,2))}}),pk=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,i)=>r.renderSlot(n.$slots,"default")}});function vt(t,e,n){return e>t?e:t>n?n:t}const Tl=t=>r.computed(()=>{const e=[100],{min:n,max:i,step:s}=t.value;let l=n;for(;l<i;){l+=s;const c=(1-(vt(l,n,i)-n)/(i-n))*100;e.push(c)}return e}),hk={class:"ui-slider__wrapper"},fk={class:"ui-slider__label-section"},mk={key:0,class:"text-s"},gk={key:1,class:"ui-slider__value-static text-s"},yk={class:"ui-slider__base"},vk={class:"ui-slider__container"},_k={class:"ui-slider__container ui-slider__container-thumb"},Ck={class:"ui-slider__input-wrapper d-flex"},wk=["value"],bk={key:0,class:"ui-slider__error"},Ku=r.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue:0}),c=r.computed(()=>s.max-s.min),u=r.computed(()=>vt((s.modelValue??0)+l.deltaValue,s.min,s.max)),p=r.ref(s.modelValue),f=r.computed(()=>{const P=s.modelValue;return Number.isFinite(P)?P<s.min?`Min value: ${s.min}`:P>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),m=r.computed(()=>s),y=Tl(m),k=r.computed(()=>(u.value-s.min)/c.value),S=r.computed(()=>({right:Math.ceil((1-k.value)*100)+"%"})),M=r.computed(()=>({right:`calc(${Math.ceil((1-k.value)*100)}%) `})),T=r.ref(),R=r.ref();r.watch(()=>s.modelValue,P=>{p.value=P});function C(P){const O=vt(P,s.min,s.max);return Math.round((O+Number.EPSILON)*(1/s.step))/(1/s.step)}sr(R,P=>{var O;ot((O=r.unref(T))==null?void 0:O.getBoundingClientRect(),z=>{const{dx:N}=P;l.deltaValue=N/z.width*c.value,p.value=C(vt((s.modelValue??0)+l.deltaValue,s.min,s.max)),P.stop&&(i("update:modelValue",C(u.value)),l.deltaValue=0)})});function G(P){i("update:modelValue",C(P))}function X(P){G(+P.target.value)}function L(P){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(P.code)&&P.preventDefault();const O=P.code==="ArrowUp"||P.code==="ArrowRight"?s.step*1:P.code==="ArrowDown"||P.code==="ArrowLeft"?s.step*-1:0;G(s.modelValue+O)}return(P,O)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",hk,[r.createElementVNode("div",fk,[P.label?(r.openBlock(),r.createElementBlock("label",mk,[r.createElementVNode("span",null,r.toDisplayString(P.label),1),O[1]||(O[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(P.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),O[2]||(O[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",gk,r.toDisplayString(p.value)+r.toDisplayString(P.measure),1)):r.createCommentVNode("",!0)]),O[6]||(O[6]=r.createTextVNode()),r.createElementVNode("div",yk,[r.createElementVNode("div",vk,[r.createElementVNode("div",{ref_key:"barRef",ref:T,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(S.value)},null,4)],512)]),O[5]||(O[5]=r.createTextVNode()),r.createElementVNode("div",_k,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(z,N)=>(r.openBlock(),r.createElementBlock("div",{key:N,style:r.normalizeStyle({right:`${z}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),O[4]||(O[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:R,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(M.value),onKeydown:L},O[3]||(O[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),O[7]||(O[7]=r.createTextVNode()),r.createElementVNode("div",Ck,[s.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:O[0]||(O[0]=z=>X(z))},null,40,wk)):r.createCommentVNode("",!0)])],2),O[8]||(O[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",bk,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function xk(t,e=null,n=null){function i(u){const{scrollTop:p,scrollHeight:f,clientHeight:m}=u;if(!(f>m)||!e)return null;const y=f-p-m,k=p>e?e:0,S=y>e?m-e-k:m;return`linear-gradient(
50
+ `,hC=["innerHTML"],fC={class:"dropdown-list-item__title-container"},mC={class:"dropdown-list-item__title text-s"},gC={key:0,class:"dropdown-list-item__description text-description"},yC={key:1,class:"dropdown-list-item__icon flex-self-start"},di=r.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{const l=[];return e.size==="small"&&l.push("dropdown-list-item__small"),e.isSelected&&l.push("dropdown-list-item__selected"),e.isHovered&&l.push("hovered-item"),l.join(" ")}),i=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),s=r.computed(()=>e.isSelected?pC:uC);return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([n.value,"dropdown-list-item"])},[e.useCheckbox?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(i.value),innerHTML:s.value},null,10,hC)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",fC,[r.createElementVNode("div",mC,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",gC,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",yC)):r.createCommentVNode("",!0)],2))}});function ui(t,e){const n=ol(()=>{if(t.value){const{scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:i,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p,offsetY:i+f.y,offsetX:s+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});r.onMounted(n),tt(window,"scroll",n,{capture:!0,passive:!0}),tt(window,"resize",n,{passive:!0}),tt(window,"adjust",n,!0)}const vC=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),i=r.computed(()=>`mask-16 mask-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([i.value,s.$style.icon])},null,6))}}),_C="_icon_1ugxm_2",CC={icon:_C},wC={$style:CC},pi=Tn(vC,[["__cssModules",wC]]),bC=["onKeyup"],xC=r.defineComponent({__name:"PlBtnSplit",props:r.mergeModels({options:{},disabled:{type:Boolean},loading:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:r.mergeModels(["click"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const i=t,s=n,l=r.useModel(t,"modelValue"),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.reactive({open:!1,optionsHeight:0,activeIndex:-1});e({data:m});const y=r.reactive({top:"0px",left:"0px",width:"0px"});r.watch(u,P=>{if(P){const L=P.getBoundingClientRect();m.optionsHeight=L.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const T=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),S=r.computed(()=>(i.options??[]).findIndex(P=>so(P.value,l.value))),D=r.computed(()=>ar(i.options??[]).map((P,L)=>({...P,index:L,isSelected:L===S.value,isActive:L===m.activeIndex}))),k=r.computed(()=>i.loading||i.options===void 0),M=r.computed(()=>{var P;return((P=D.value.find(L=>so(L.value,l.value)))==null?void 0:P.label)??(i.options===void 0?"...":"")});ui(c,P=>{const L=P.top+P.height+3;L+m.optionsHeight>P.clientHeight?y.top=P.top-m.optionsHeight-3+"px":y.top=L+"px",y.left=P.left+"px",y.width=P.width+"px",console.log(P.top,y)});const C=P=>{var L;l.value=P,m.open=!1,(L=c==null?void 0:c.value)==null||L.focus()};function G(){s("click")}const X=P=>{var L,z;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(P.code))P.preventDefault();else return;if(P.target===f.value&&P.code==="Enter"){G();return}const{open:A,activeIndex:E}=m;if(!A&&P.target===p.value){P.code==="Enter"&&(m.open=!0);return}P.code==="Escape"&&(m.open=!1,(L=c.value)==null||L.focus());const V=r.unref(D),{length:W}=V;if(!W)return;P.code==="Enter"&&C((z=V.find(U=>U.index===E))==null?void 0:z.value);const q=V.findIndex(U=>U.index===E)??-1,Z=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0,N=Math.abs(q+Z+W)%W;m.activeIndex=D.value[N].index??-1},O=P=>{var L,z;const A=P.relatedTarget;!((L=c.value)!=null&&L.contains(A))&&!((z=u.value)!=null&&z.contains(A))&&(m.open=!1)};return(P,L)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass([{disabled:P.disabled||k.value,loading:k.value},"pl-btn-split d-flex"]),onFocusout:O,onKeydown:X},[r.createElementVNode("div",{ref_key:"buttonAction",ref:f,class:"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn",tabindex:"0",onClick:G,onKeyup:r.withKeys(r.withModifiers(G,["stop"]),["enter"])},r.toDisplayString(M.value),41,bC),L[1]||(L[1]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"menuActivator",ref:p,class:"pl-btn-split__icon-container d-flex align-center justify-center",tabindex:"0",onClick:L[0]||(L[0]=z=>m.open=!m.open)},[k.value?(r.openBlock(),r.createBlock(pi,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([T.value,"pl-btn-split__icon"])},null,2))],512),L[2]||(L[2]=r.createTextVNode()),m.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-dropdown__options",style:r.normalizeStyle(y),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(D.value,(z,A)=>(r.openBlock(),r.createBlock(di,{key:A,option:z,"is-selected":z.isSelected,"is-hovered":z.isActive,size:"medium",onClick:r.withModifiers(E=>C(z.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function vu(t){function e(n){const i=n.currentTarget,s=document.createElement("span"),l=Math.max(i.clientWidth,i.clientHeight),c=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-i.offsetLeft-c}px`,s.style.top=`${n.clientY-i.offsetTop-c}px`,s.classList.add("ripple");const u=i.getElementsByClassName("ripple")[0];u&&u.remove(),i.appendChild(s)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const kC={key:0},SC={inheritAttrs:!1},hs=r.defineComponent({...SC,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t,n=r.ref(),i=r.computed(()=>e.small||e.size==="small"),s=r.computed(()=>e.large||e.size==="large");return vu(n),(l,c)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:i.value,large:s.value,round:l.round,reverse:l.reverse,justifyCenter:l.justifyCenter,[l.$attrs.class+""]:!0}},{...l.$attrs,disabled:!!l.$attrs.disabled||l.loading}),[l.round?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",kC,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(pi),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(pi),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),EC={name:"PlBtnPrimary"},cl=r.defineComponent({...EC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(hs,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),TC={name:"PlBtnAccent"},BC=r.defineComponent({...TC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(hs,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),NC={name:"PlBtnDanger"},AC=r.defineComponent({...NC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(hs,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),VC={name:"PlBtnSecondary"},dl=r.defineComponent({...VC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,i)=>(r.openBlock(),r.createBlock(hs,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),PC={key:0},DC={name:"PlBtnGhost"},ul=r.defineComponent({...DC,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.size==="small"),i=r.computed(()=>e.size==="large"),s=r.ref(),l=r.useSlots();return vu(s),(c,u)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:s,tabindex:"0",class:["pl-btn-ghost",{loading:c.loading,small:n.value,large:i.value,round:c.round,reverse:c.reverse,justifyCenter:c.justifyCenter,[c.$attrs.class+""]:!0}]},{...c.$attrs,disabled:!!c.$attrs.disabled||c.loading}),[r.unref(l).default&&!c.round?(r.openBlock(),r.createElementBlock("span",PC,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(pi),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(pi),{key:2,name:c.icon,size:c.size},null,8,["name","size"])):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),r.renderSlot(c.$slots,"append")],16))}}),FC=r.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(t){const e=t,n=r.ref(!1);return(i,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:i.disabled,loading:i.loading,hover:n.value}]),onMouseover:s[0]||(s[0]=l=>n.value=!0),onMouseleave:s[1]||(s[1]=l=>n.value=!1)},[r.createVNode(dl,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),s[2]||(s[2]=r.createTextVNode()),r.renderSlot(i.$slots,"default")],34))}});function RC(t,e){const n=r.ref();return ui(t,i=>{n.value=i}),r.computed(()=>{const i=r.unref(n),s=r.unref(e),l=s.position??"top",c=s.gap??8;if(!i)return"";const u=i.offsetY+Math.floor(i.height/2),p=i.offsetX+Math.floor(i.width/2);return l==="top-left"?`left: ${i.offsetX}px; top: ${i.offsetY-c}px;`:l==="top"?`left: ${p}px; top: ${i.offsetY-c}px;`:l==="right"?`left: ${i.offsetX+i.width+c}px; top: ${u}px;`:l==="left"?`right: ${i.scrollWidth-i.x+c}px; top: ${u}px;`:""})}function lo(t,e){return e(t)}function ot(t,e){if(t!=null)return e(t)}function MC(t){return Array.isArray(t)?t:[t]}function IC(t,e,...n){n.forEach(i=>{t[i]=e[i]})}function fs(t,e){tt(document,"click",n=>{document.contains(n.target)&&(MC(t).map(i=>i.value).filter(i=>!!i).some(i=>i==null?void 0:i.contains(n.target))||e())})}const LC={},OC={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function GC(t,e){return r.openBlock(),r.createElementBlock("svg",OC,e[0]||(e[0]=[r.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const zC=Tn(LC,[["render",GC]]),pl=new Map,$C={name:"PlTooltip"},kt=r.defineComponent({...$C,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"}},emits:["tooltip:close"],setup(t,{emit:e}){const n=e,i=Symbol(),s=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});pl.set(i,()=>f()),r.watch(()=>l.open,k=>{requestAnimationFrame(()=>{l.tooltipOpen=k})});let c=()=>{};const u=hu(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[k,M]of pl.entries())k!==i&&M()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,c(),await au(100),l.over&&p())},y=()=>{l.over=!1,c=lu(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,k=>{k&&f()});const T=r.ref(),S=r.ref(),D=RC(T,r.toRef(s));return fs([T,S],()=>f()),r.onUnmounted(()=>{pl.delete(i)}),(k,M)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(k.element),r.mergeProps(k.$attrs,{ref_key:"rootRef",ref:T,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(k.$slots,"default"),M[1]||(M[1]=r.createTextVNode()),k.$slots.tooltip&&l.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createVNode(r.Transition,{name:"tooltip-transition"},{default:r.withCtx(()=>[l.tooltipOpen?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:r.normalizeStyle(r.unref(D))},[r.createElementVNode("div",{ref_key:"tooltip",ref:S,class:r.normalizeClass(["pl-tooltip",k.position]),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(k.$slots,"tooltip")]),M[0]||(M[0]=r.createTextVNode()),r.createVNode(zC)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),UC={},ZC={class:"inner-border"};function WC(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",ZC,[r.renderSlot(t.$slots,"default")])}const HC=Tn(UC,[["render",WC]]),jC={key:0},qC=["tabindex","onKeydown","onClick"],KC={key:1,class:"ui-btn-group__helper"},YC={key:2,class:"ui-btn-group__error"},JC={name:"PlBtnGroup"},XC=r.defineComponent({...JC,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=u=>i("update:modelValue",u),l=t,c=r.computed(()=>l.options.map(u=>({label:"label"in u?u.label:u.text,value:u.value})));return(u,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-group",{disabled:u.disabled}])},[u.label?(r.openBlock(),r.createElementBlock("label",jC,[r.createElementVNode("span",null,r.toDisplayString(u.label),1),p[0]||(p[0]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(u.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),p[1]||(p[1]=r.createTextVNode()),r.createVNode(HC,{class:"ui-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(f,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["ui-btn-group__option text-s",{active:u.modelValue===f.value}]),tabindex:u.modelValue===f.value||u.disabled?void 0:0,onKeydown:r.withKeys(y=>s(f.value),["enter"]),onClick:y=>s(f.value)},r.toDisplayString(f.label),43,qC))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",KC,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",YC,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}}),QC={inheritAttrs:!1},e0={class:"double-contour"};function t0(t,e,n,i,s,l){return r.openBlock(),r.createElementBlock("div",e0,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const lr=Tn(QC,[["render",t0]]);function _u(t){r.onMounted(t),r.onUpdated(t)}const hl=new WeakMap,fl=new ResizeObserver(t=>{for(const e of t)ot(hl.get(e.target),n=>n(e))});function Cu(t,e){hl.set(t,e),fl.unobserve(t),fl.observe(t)}function wu(t){fl.unobserve(t),hl.delete(t)}const n0=8,bu=4;function Ln(t,e="label"){const n=new Set;_u(()=>{ot(t==null?void 0:t.value,i=>{const s=i.querySelector(e);s&&(n.add(s),Cu(s,()=>{const l=su(()=>s.getBoundingClientRect().width+lo(n0,c=>Number.isNaN(c)?bu:c+bu));i.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&i.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(i=>wu(i))})}function r0(t,e){const n=[];return e&&e.length>0&&e.forEach(i=>{const s=i(t);typeof s=="string"&&n.push(s)}),{isValid:n.length===0,errors:n}}function xu(t,e){return r.computed(()=>r0(t.value,e))}const i0=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),i=r.computed(()=>`icon-16 icon-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([i.value,s.$style.icon])},null,6))}}),o0="_icon_1ugxm_2",s0={icon:o0},a0={$style:s0},ms=Tn(i0,[["__cssModules",a0]]),l0=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,i.$style.icon])},null,2))}}),c0="_icon_1ugxm_2",d0={icon:c0},u0={$style:d0},ku=Tn(l0,[["__cssModules",u0]]),p0={class:"pl-text-field__envelope"},h0={key:0,ref:"label"},f0={key:0,class:"required-icon"},m0={key:1,class:"pl-text-field__prefix"},g0=["disabled","placeholder","type"],y0={class:"pl-text-field__append"},v0={key:0,class:"pl-text-field__error"},_0={key:1,class:"pl-text-field__helper"},C0={name:"PlTextField"},Ir=r.defineComponent({...C0,props:r.mergeModels({label:{},clearable:{type:[Boolean,Function]},parse:{type:Function},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{},type:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useSlots(),n=r.useModel(t,"modelValue"),i=t,s=r.ref(void 0),l=r.ref(),c=r.ref(!1),u=r.reactive({cached:void 0}),p=r.computed({get(){return u.cached?u.cached.value:n.value===void 0||n.value===null?"":String(n.value)},set(O){if(u.cached=void 0,i.parse)try{n.value=i.parse(O)}catch(P){u.cached={error:P instanceof Error?P.message:String(P),value:O}}else n.value=O}}),f=r.computed(()=>i.type&&i.type==="password"?c.value?"text":i.type:"text"),m=r.computed(()=>c.value?"view-show":"view-hide"),y=()=>{i.clearable&&(u.cached=void 0,n.value=i.clearable===!0?"":i.clearable())},T=xu(p,i.rules||[]),S=r.computed(()=>i.clearable?i.clearable===!0?n.value==="":n.value===i.clearable():n.value===""),D=r.computed(()=>!S.value),k=r.computed(()=>{const O=[];return i.error&&O.push(i.error),u.cached&&O.push(u.cached.error),T.value.isValid||O.push(...T.value.errors),O}),M=r.computed(()=>k.value.length>0),C=r.computed(()=>i.clearable&&D.value&&i.type!=="password"),G=()=>c.value=!c.value,X=()=>{u.cached=void 0};return Ln(s),(O,P)=>(r.openBlock(),r.createElementBlock("div",p0,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:M.value,disabled:O.disabled,dashed:O.dashed,nonEmpty:D.value}])},[O.label?(r.openBlock(),r.createElementBlock("label",h0,[O.required?(r.openBlock(),r.createElementBlock("i",f0)):r.createCommentVNode("",!0),P[1]||(P[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(O.label),1),P[2]||(P[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(O.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),P[5]||(P[5]=r.createTextVNode()),O.prefix?(r.openBlock(),r.createElementBlock("div",m0,r.toDisplayString(O.prefix),1)):r.createCommentVNode("",!0),P[6]||(P[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":P[0]||(P[0]=L=>p.value=L),disabled:O.disabled,placeholder:O.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:X},null,40,g0),[[r.vModelDynamic,p.value]]),P[7]||(P[7]=r.createTextVNode()),r.createElementVNode("div",y0,[C.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:0,name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),P[3]||(P[3]=r.createTextVNode()),O.type==="password"?(r.openBlock(),r.createBlock(r.unref(ku),{key:1,name:m.value,style:{cursor:"pointer"},onClick:G},null,8,["name"])):r.createCommentVNode("",!0),P[4]||(P[4]=r.createTextVNode()),r.renderSlot(O.$slots,"append")]),P[8]||(P[8]=r.createTextVNode()),r.createVNode(lr,{class:"pl-text-field__contour"})],2),P[9]||(P[9]=r.createTextVNode()),M.value?(r.openBlock(),r.createElementBlock("div",v0,r.toDisplayString(k.value.join(" ")),1)):O.helper?(r.openBlock(),r.createElementBlock("div",_0,r.toDisplayString(O.helper),1)):r.createCommentVNode("",!0)]))}}),w0={class:"ui-text-area__envelope"},b0={key:0,ref:"label"},x0={key:0,class:"required-icon"},k0=["readonly","rows","disabled","placeholder"],S0={class:"ui-text-area__append"},E0={key:0,class:"ui-text-area__error"},T0={key:1,class:"ui-text-area__helper"},B0={name:"PlTextArea"},N0=r.defineComponent({...B0,props:{modelValue:{},label:{},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},dashed:{type:Boolean},rows:{},autogrow:{type:Boolean},rules:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.ref(),u=r.computed({get(){return s.modelValue??""},set(S){i("update:modelValue",S)}}),p=r.computed(()=>!!s.modelValue),f=xu(u,s.rules||[]);Ln(l);const m=r.computed(()=>{const S=[];return s.error&&S.push(s.error),S.push(...f.value.errors),S}),y=r.computed(()=>m.value.length>0),T=()=>{if(!s.autogrow)return;const S=c.value;S&&(S.style.height="auto",S.style.height=`${S.scrollHeight}px`)};return r.onMounted(()=>{T()}),(S,D)=>(r.openBlock(),r.createElementBlock("div",w0,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:S.disabled,dashed:S.dashed,nonEmpty:p.value}])},[S.label?(r.openBlock(),r.createElementBlock("label",b0,[S.required?(r.openBlock(),r.createElementBlock("i",x0)):r.createCommentVNode("",!0),D[1]||(D[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(S.label),1),D[2]||(D[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(S.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),D[3]||(D[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":D[0]||(D[0]=k=>u.value=k),readonly:S.readonly,rows:S.rows,disabled:S.disabled,placeholder:S.placeholder??"...",spellcheck:"false",onInput:T},null,40,k0),[[r.vModelText,u.value]]),D[4]||(D[4]=r.createTextVNode()),r.createElementVNode("div",S0,[r.renderSlot(S.$slots,"append")]),D[5]||(D[5]=r.createTextVNode()),r.createVNode(lr,{class:"ui-text-area__contour"})],2),D[6]||(D[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",E0,r.toDisplayString(m.value.join(" ")),1)):S.helper?(r.openBlock(),r.createElementBlock("div",T0,r.toDisplayString(S.helper),1)):r.createCommentVNode("",!0)]))}});function Su(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n&&s>n}function Eu(t,e){const n=t.scrollTop,i=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<i+n?"ceil":s>n?"floor":"visible"}function co(t,e,n={}){const i=t.scrollTop,s=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,u=Eu(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?c-(s-l):c;t.scrollTop=i+f*(m-i)};Su(t,e)||uu({duration:n.duration||100,timing:du(f=>f),draw:p})}function ml(t,e,n,i){return t.addEventListener(e,n,i),function(){t.removeEventListener(e,n)}}function A0(t,e){const n=e.getBoundingClientRect();return t.x<n.x||t.x>n.x+n.width||t.y<n.y||t.y>n.y+n.height}function Tu(t){return t!==null&&typeof t=="object"}function Pt(t,e){return Tu(t)&&Tu(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Pt(t[n],e[n])):t===e}function gl(t,e){return t.some(n=>Pt(n,e))}const yl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),i=r.ref(!1),s=r.computed(()=>i.value&&e.value?"ui-lt-animate":""),l=pu(m=>i.value=m,500),c=r.computed(()=>{var m;return n.value?`${((m=n.value)==null?void 0:m.innerHTML.length)*.4}s`:"5s"});function u(){const m=il(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){u(),l(!0)}function f(){l(!1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(m.$attrs,{class:"ui-lt-container"}),[r.createElementVNode("span",{onMouseover:p,onMouseleave:f},[r.createElementVNode("span",{ref_key:"span",ref:n,class:r.normalizeClass(s.value)},[r.renderSlot(m.$slots,"default")],2)],32)],16))}}),V0=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(i,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,i.$style.icon])},null,2))}}),P0="_icon_1ugxm_2",D0={icon:P0},F0={$style:D0},On=Tn(V0,[["__cssModules",F0]]),R0={class:"pl-dropdown__envelope"},M0=["tabindex"],I0={class:"pl-dropdown__container"},L0={class:"pl-dropdown__field"},O0=["disabled","placeholder"],G0={class:"pl-dropdown__controls"},z0={key:0},$0={key:0,class:"required-icon"},U0={key:0,class:"nothing-found"},Z0={key:0,class:"pl-dropdown__error"},W0={key:1,class:"pl-dropdown__helper"},H0={key:2,class:"pl-dropdown__helper"},j0={name:"PlDropdown"},uo=r.defineComponent({...j0,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>lo(X.value.findIndex(N=>Pt(N.value,i.modelValue)),N=>N<0?0:N),m=()=>p.activeIndex=f(),y=r.computed(()=>i.options===void 0),T=r.computed(()=>y.value?!0:i.disabled),S=r.computed(()=>(i.options??[]).findIndex(N=>Pt(N.value,i.modelValue))),D=r.computed(()=>{if(!y.value){if(i.error)return i.error;if(i.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),k=r.computed(()=>ar(i.options??[]).map((N,U)=>({...N,index:U,isSelected:U===S.value,isActive:U===p.activeIndex}))),M=r.computed(()=>{const N=r.unref(k).find(U=>Pt(U.value,i.modelValue));return(N==null?void 0:N.label)||i.modelValue}),C=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(M.value):i.placeholder),G=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),X=r.computed(()=>{const N=k.value;return p.search?N.filter(U=>{const J=p.search.toLowerCase();return U.label.toLowerCase().includes(J)||U.description&&U.description.toLowerCase().includes(J)?!0:typeof U.value=="string"?U.value.toLowerCase().includes(J):U.value===p.search}):N}),O=r.computed(()=>T.value?void 0:"0"),P=N=>{var U;n("update:modelValue",N),p.search="",p.open=!1,(U=l==null?void 0:l.value)==null||U.focus()},L=()=>n("update:modelValue",void 0),z=()=>{var N;return(N=u.value)==null?void 0:N.focus()},A=()=>p.open=!p.open,E=()=>p.open=!0,V=N=>{var U,J;const pe=N.relatedTarget;!((U=l.value)!=null&&U.contains(pe))&&!((J=c.value)!=null&&J.contains(pe))&&(p.search="",p.open=!1)},W=()=>{const N=c.value;N&&ot(N.querySelector(".hovered-item"),U=>{co(N,U)})},q=N=>{var U,J;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(N.code))N.preventDefault();else return;const{open:pe,activeIndex:we}=p;if(!pe){N.code==="Enter"&&(p.open=!0);return}N.code==="Escape"&&(p.open=!1,(U=l.value)==null||U.focus());const Ct=r.unref(X),{length:Bt}=Ct;if(!Bt)return;N.code==="Enter"&&P((J=Ct.find(_r=>_r.index===we))==null?void 0:J.value);const ht=Ct.findIndex(_r=>_r.index===we)??-1,vr=N.code==="ArrowDown"?1:N.code==="ArrowUp"?-1:0,Vn=Math.abs(ht+vr+Bt)%Bt;p.activeIndex=X.value[Vn].index??-1};Ln(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,N=>{var U;return N?(U=u.value)==null?void 0:U.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&W()});const Z=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(c,N=>{if(N){const U=N.getBoundingClientRect();p.optionsHeight=U.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ui(l,N=>{const U=N.top+N.height+3;U+p.optionsHeight>N.clientHeight?Z.top=N.top-p.optionsHeight-3+"px":Z.top=U+"px",Z.left=N.left+"px",Z.width=N.width+"px"}),(N,U)=>(r.openBlock(),r.createElementBlock("div",R0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:O.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:N.error,disabled:T.value}]),onKeydown:q,onFocusout:V},[r.createElementVNode("div",I0,[r.createElementVNode("div",L0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":U[0]||(U[0]=J=>p.search=J),type:"text",tabindex:"-1",disabled:T.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:E},null,40,O0),[[r.vModelText,p.search]]),U[4]||(U[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:z},[r.createVNode(yl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(M.value),1)]),_:1})])),U[5]||(U[5]=r.createTextVNode()),r.createElementVNode("div",G0,[y.value?(r.openBlock(),r.createBlock(r.unref(On),{key:0,name:"loading"})):r.createCommentVNode("",!0),U[1]||(U[1]=r.createTextVNode()),N.clearable&&G.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:1,name:"delete-clear",onClick:r.withModifiers(L,["stop"])})):r.createCommentVNode("",!0),U[2]||(U[2]=r.createTextVNode()),r.renderSlot(N.$slots,"append"),U[3]||(U[3]=r.createTextVNode()),N.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${N.arrowIconLarge}`]]),onClick:r.withModifiers(A,["stop"])},null,2)):N.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${N.arrowIcon}`]]),onClick:r.withModifiers(A,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(A,["stop"])}))])]),U[9]||(U[9]=r.createTextVNode()),N.label?(r.openBlock(),r.createElementBlock("label",z0,[N.required?(r.openBlock(),r.createElementBlock("i",$0)):r.createCommentVNode("",!0),U[6]||(U[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(N.label),1),U[7]||(U[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(N.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),U[10]||(U[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:c,class:"pl-dropdown__options",style:r.normalizeStyle(Z),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(X.value,(J,pe)=>(r.openBlock(),r.createBlock(di,{key:pe,option:J,"is-selected":J.isSelected,"is-hovered":J.isActive,size:N.optionSize,onClick:r.withModifiers(we=>P(J.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),U[8]||(U[8]=r.createTextVNode()),X.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",U0,"Nothing found"))],4)])):r.createCommentVNode("",!0),U[11]||(U[11]=r.createTextVNode()),r.createVNode(lr,{class:"pl-dropdown__contour"})])],42,M0),U[12]||(U[12]=r.createTextVNode()),D.value?(r.openBlock(),r.createElementBlock("div",Z0,r.toDisplayString(D.value),1)):y.value&&N.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",W0,r.toDisplayString(N.loadingOptionsHelper),1)):N.helper?(r.openBlock(),r.createElementBlock("div",H0,r.toDisplayString(N.helper),1)):r.createCommentVNode("",!0)]))}}),q0={name:"PlDropdownRef"},K0=r.defineComponent({...q0,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>{var s;return(s=e.options)==null?void 0:s.map(l=>({label:l.label,value:l.ref}))}),i=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,l)=>(r.openBlock(),r.createBlock(r.unref(uo),r.mergeProps(e,{options:n.value,"loading-options-helper":s.loadingOptionsHelper,"arrow-icon-large":i.value,"onUpdate:modelValue":l[0]||(l[0]=c=>s.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function Y0(t,e){return r.computed(()=>{const n=ar(t.value);return e.value?n.filter(i=>i.label.toLowerCase().includes(e.value.toLowerCase())):n})}const J0={class:"resizable-input"},X0=["placeholder","value","disabled"],Q0=r.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,i=e,s=r.computed(()=>{var u;return n.placeholder?n.placeholder:(u=n.modelValue||n.value)==null?void 0:u.replace('"',"")}),l=r.computed(()=>{const u={};return n.width&&(u.width=n.width),n.maxWidth&&(u.maxWidth=n.maxWidth),u});function c(u){const p=u.target.value;i("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",J0,[r.createElementVNode("span",{style:r.normalizeStyle(l.value),class:"resizable-input__size-span"},r.toDisplayString(s.value),5),p[0]||(p[0]=r.createTextVNode()),r.createElementVNode("input",r.mergeProps(u.$attrs,{placeholder:u.placeholder,value:n.modelValue,disabled:n.disabled,style:l.value,onInput:c}),null,16,X0)]))}}),ew={class:"dropdown-tab-item__title text-caps13"},tw=r.defineComponent({__name:"TabItem",props:{option:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>e.option.label),i=r.computed(()=>{const s=[];return e.isSelected&&s.push("dropdown-tab-item__selected"),e.isHovered&&s.push("hovered-item"),s.join(" ")});return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.value,"dropdown-tab-item"])},[r.createElementVNode("div",ew,r.toDisplayString(n.value),1)],2))}}),nw={class:"pl-line-dropdown__prefix"},rw={class:"pl-line-dropdown__icon-wrapper"},iw={class:"pl-line-dropdown__icon"},ow={key:0,class:"pl-line-dropdown__no-item"},sw={key:0,class:"pl-line-dropdown__no-item"},Bu=r.defineComponent({__name:"PlDropdownLine",props:{modelValue:{},disabled:{type:Boolean},prefix:{default:""},options:{},placeholder:{default:"Select.."},mode:{default:"list"},tabsContainerStyles:{type:[Boolean,null,String,Object,Array],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),c=r.ref(),u=r.computed(()=>{const V=[];return s.isOpen&&V.push("open"),i.disabled&&V.push("disabled"),V.join(" ")}),p=r.ref(""),f=Y0(r.toRef(i,"options"),p),m=r.computed(()=>!!(i.clearable&&s.isOpen&&i.modelValue&&y.value)),y=r.computed(()=>{if(i.modelValue){const V=D();if(V!==-1){const W=ar(i.options)[V];return typeof W.label=="object"?W.label.title:W.label}}return""}),T=r.ref(y.value),S=r.computed(()=>s.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");fs(l,()=>{i.mode==="list"&&(s.isOpen=!1)}),r.watch(()=>T.value,V=>{y.value!==V?p.value=V:p.value=""}),r.watch(()=>s.isOpen,V=>{var W;V&&l.value&&((W=l.value.querySelector("input"))==null||W.focus(),r.nextTick(()=>z()))}),r.watch(()=>i.modelValue,()=>k(),{immediate:!0});function D(){return i.options.findIndex(V=>Pt(V.value,i.modelValue))}function k(){s.activeOption=lo(f.value.findIndex(V=>Pt(V.value,i.modelValue)),V=>V<0?0:V),T.value=y.value}function M(){p.value=""}function C(){i.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function G(){i.mode==="list"&&(s.isOpen=!1)}function X(V){V&&(n("update:modelValue",V.value),G(),M())}function O(V){return Pt(V.value,i.modelValue)}const P=V=>{var W,q;const Z=V.relatedTarget;!((W=l.value)!=null&&W.contains(Z))&&!((q=c.value)!=null&&q.contains(Z))&&(p.value="",s.isOpen=!1)};function L(V){const{activeOption:W}=s;if(!s.isOpen&&V.code==="Enter"){s.isOpen=!0;return}const{length:q}=f.value;if(!q)return;["ArrowDown","ArrowUp","Enter"].includes(V.code)&&V.preventDefault(),V.code==="Enter"&&X(f.value[W]);const Z=V.code==="ArrowDown"?1:V.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(W+Z+q)%q,requestAnimationFrame(z)}function z(){const V=c.value;V&&ot(V.querySelector(".hovered-item"),W=>{i.mode==="list"?co(V,W):W.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function A(){n("update:modelValue",void 0)}const E=r.reactive({top:"0px",left:"0px"});return r.watch(c,V=>{if(V){const W=V.getBoundingClientRect();s.optionsHeight=W.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ui(l,V=>{const W=V.top+V.height+2;W+s.optionsHeight>V.clientHeight?E.top=V.top-s.optionsHeight-2+"px":E.top=W+"px",E.left=V.left+"px"}),(V,W)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:L,onFocusout:P,onClick:C},[r.createElementVNode("div",nw,r.toDisplayString(i==null?void 0:i.prefix),1),W[6]||(W[6]=r.createTextVNode()),r.createVNode(Q0,{modelValue:T.value,"onUpdate:modelValue":W[0]||(W[0]=q=>T.value=q),placeholder:S.value,disabled:i.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),W[7]||(W[7]=r.createTextVNode()),r.createElementVNode("div",rw,[r.withDirectives(r.createElementVNode("div",iw,null,512),[[r.vShow,!m.value]]),W[1]||(W[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:A},null,512),[[r.vShow,m.value]])]),W[8]||(W[8]=r.createTextVNode()),s.isOpen?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[i.mode==="list"?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"list",ref:c,style:r.normalizeStyle(E),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(q,Z)=>r.renderSlot(V.$slots,"item",{key:Z,item:q,textItem:"text",isSelected:O(q),isHovered:s.activeOption==Z,onClick:r.withModifiers(N=>X(q),["stop"])},()=>[r.createVNode(di,{option:q,"text-item":"text","is-selected":O(q),"is-hovered":s.activeOption==Z,size:"medium",onClick:r.withModifiers(N=>X(q),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),W[3]||(W[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",ow,W[2]||(W[2]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):i.mode==="tabs"?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,style:r.normalizeStyle(E),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(q,Z)=>r.renderSlot(V.$slots,"item",{key:Z,item:q,isSelected:O(q),isHovered:s.activeOption==Z,onClick:r.withModifiers(N=>X(q),["stop"])},()=>[r.createVNode(tw,{option:q,"is-selected":O(q),"is-hovered":s.activeOption==Z,onClick:r.withModifiers(N=>X(q),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),W[5]||(W[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",sw,W[4]||(W[4]=[r.createElementVNode("div",{class:"pl-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):r.createCommentVNode("",!0)],36)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)],34))}}),aw={class:"ui-dropdown__envelope"},lw=["tabindex"],cw={class:"ui-dropdown__container"},dw={class:"ui-dropdown__field"},uw=["disabled","placeholder"],pw={class:"ui-dropdown__controls"},hw={key:0},fw={key:0,class:"required-icon"},mw={key:0,class:"nothing-found"},gw={key:0,class:"ui-dropdown__error"},yw={key:1,class:"ui-dropdown__helper"},vw={key:2,class:"ui-dropdown__helper"},_w={name:"PlDropdown"},Cw=r.defineComponent({..._w,props:{modelValue:{},label:{default:""},options:{default:void 0},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=r.useSlots(),l=r.ref(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>lo(X.value.findIndex(Z=>Pt(Z.value,i.modelValue)),Z=>Z<0?0:Z),m=()=>p.activeIndex=f(),y=r.computed(()=>i.options===void 0),T=r.computed(()=>y.value?!0:i.disabled),S=r.computed(()=>(i.options??[]).findIndex(Z=>Pt(Z.value,i.modelValue))),D=r.computed(()=>{if(!y.value){if(i.error)return i.error;if(i.modelValue!==void 0&&S.value===-1)return"The selected value is not one of the options"}}),k=r.computed(()=>ar(i.options??[]).map((Z,N)=>({...Z,index:N,isSelected:N===S.value,isActive:N===p.activeIndex}))),M=r.computed(()=>{const Z=r.unref(k).find(N=>Pt(N.value,i.modelValue));return(Z==null?void 0:Z.label)||i.modelValue}),C=r.computed(()=>!p.open&&i.modelValue?"":i.modelValue?String(M.value):i.placeholder),G=r.computed(()=>i.modelValue!==void 0&&i.modelValue!==null),X=r.computed(()=>{const Z=k.value;return p.search?Z.filter(N=>{const U=p.search.toLowerCase();return N.label.toLowerCase().includes(U)||N.description&&N.description.toLowerCase().includes(U)?!0:typeof N.value=="string"?N.value.toLowerCase().includes(U):N.value===p.search}):Z}),O=r.computed(()=>T.value?void 0:"0"),P=Z=>{var N;n("update:modelValue",Z),p.search="",p.open=!1,(N=l==null?void 0:l.value)==null||N.focus()},L=()=>n("update:modelValue",void 0),z=()=>{var Z;return(Z=u.value)==null?void 0:Z.focus()},A=()=>p.open=!p.open,E=()=>p.open=!0,V=Z=>{var N;(N=l==null?void 0:l.value)!=null&&N.contains(Z.relatedTarget)||(p.search="",p.open=!1)},W=()=>{const Z=c.value;Z&&ot(Z.querySelector(".hovered-item"),N=>{co(Z,N)})},q=Z=>{var N,U;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(Z.code))Z.preventDefault();else return;const{open:J,activeIndex:pe}=p;if(!J){Z.code==="Enter"&&(p.open=!0);return}Z.code==="Escape"&&(p.open=!1,(N=l.value)==null||N.focus());const we=r.unref(X),{length:Ct}=we;if(!Ct)return;Z.code==="Enter"&&P((U=we.find(Vn=>Vn.index===pe))==null?void 0:U.value);const Bt=we.findIndex(Vn=>Vn.index===pe)??-1,ht=Z.code==="ArrowDown"?1:Z.code==="ArrowUp"?-1:0,vr=Math.abs(Bt+ht+Ct)%Ct;p.activeIndex=X.value[vr].index??-1};return Ln(l),r.watch(()=>i.modelValue,m,{immediate:!0}),r.watch(()=>p.open,Z=>{var N;return Z?(N=u.value)==null?void 0:N.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&W()}),(Z,N)=>(r.openBlock(),r.createElementBlock("div",aw,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:O.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:Z.error,disabled:T.value}]),onKeydown:q,onFocusout:V},[r.createElementVNode("div",cw,[r.createElementVNode("div",dw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":N[0]||(N[0]=U=>p.search=U),type:"text",tabindex:"-1",disabled:T.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:E},null,40,uw),[[r.vModelText,p.search]]),N[4]||(N[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:z},[r.createVNode(yl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(M.value),1)]),_:1})])),N[5]||(N[5]=r.createTextVNode()),r.createElementVNode("div",pw,[y.value?(r.openBlock(),r.createBlock(r.unref(On),{key:0,name:"loading"})):r.createCommentVNode("",!0),N[1]||(N[1]=r.createTextVNode()),Z.clearable&&G.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:1,name:"delete-clear",onClick:r.withModifiers(L,["stop"])})):r.createCommentVNode("",!0),N[2]||(N[2]=r.createTextVNode()),r.renderSlot(Z.$slots,"append"),N[3]||(N[3]=r.createTextVNode()),Z.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${Z.arrowIconLarge}`]]),onClick:r.withModifiers(A,["stop"])},null,2)):Z.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${Z.arrowIcon}`]]),onClick:r.withModifiers(A,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(A,["stop"])}))])]),N[9]||(N[9]=r.createTextVNode()),Z.label?(r.openBlock(),r.createElementBlock("label",hw,[Z.required?(r.openBlock(),r.createElementBlock("i",fw)):r.createCommentVNode("",!0),N[6]||(N[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(Z.label),1),N[7]||(N[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(Z.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),N[10]||(N[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,class:"ui-dropdown__options"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(X.value,(U,J)=>(r.openBlock(),r.createBlock(di,{key:J,option:U,"is-selected":U.isSelected,"is-hovered":U.isActive,size:Z.optionSize,onClick:r.withModifiers(pe=>P(U.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),N[8]||(N[8]=r.createTextVNode()),X.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",mw,"Nothing found"))],512)):r.createCommentVNode("",!0),N[11]||(N[11]=r.createTextVNode()),r.createVNode(lr,{class:"ui-dropdown__contour"})])],42,lw),N[12]||(N[12]=r.createTextVNode()),D.value?(r.openBlock(),r.createElementBlock("div",gw,r.toDisplayString(D.value),1)):y.value&&Z.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",yw,r.toDisplayString(Z.loadingOptionsHelper),1)):Z.helper?(r.openBlock(),r.createElementBlock("div",vw,r.toDisplayString(Z.helper),1)):r.createCommentVNode("",!0)]))}}),ww={key:0,class:"ui-progress-bar"},bw={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},xw={class:"ui-progress-bar__message flex-grow-1"},kw={class:"ui-progress-bar__percent"},Sw=r.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(t){const e=t,n=r.computed(()=>e.progress===100?e.completeMessage:"");return(i,s)=>i.loading?(r.openBlock(),r.createElementBlock("div",ww,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:i.progress+"%"})},null,4),s[1]||(s[1]=r.createTextVNode()),r.createElementVNode("div",bw,[r.createElementVNode("div",xw,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",kw,r.toDisplayString(i.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),Ew={class:"mi-number-field__main-wrapper d-flex"},Tw={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},Bw={key:0,class:"text-description"},Nw=["disabled","placeholder"],Aw={class:"mi-number-field__icons d-flex-column"},Vw={key:0,class:"mi-number-field__hint text-description"},Pw=r.defineComponent({__name:"PlNumberField",props:{modelValue:{},disabled:{type:Boolean},label:{default:void 0},placeholder:{default:void 0},step:{default:1},minValue:{default:void 0},maxValue:{default:void 0},errorMessage:{default:void 0},validate:{type:Function,default:void 0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,s=r.ref(),l=r.useSlots(),c=r.ref();Ln(s);const u=r.ref(!0),p=r.computed({get(){return u.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(C){var G;C=C.replace(/,/g,""),T(C)?(i("update:modelValue",+C),C.toString()!==((G=n.modelValue)==null?void 0:G.toString())&&+C===n.modelValue&&C[C.length-1]!=="."&&(u.value=!1,r.nextTick(()=>{u.value=!0}))):(C.trim()===""&&i("update:modelValue",void 0),u.value=!1,r.nextTick(()=>{u.value=!0}))}}),f=r.computed(()=>{let C=[];return n.errorMessage&&C.push(n.errorMessage),T(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&C.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&C.push(`Model value must be less than ${n.maxValue}`)):C.push("Model value is not a number."),C=[...C],C.join(" ")}),m=r.computed(()=>!!(n.maxValue&&n.modelValue!==void 0&&(n.modelValue||0)+n.step>n.maxValue)),y=r.computed(()=>!!(n.minValue&&n.modelValue!==void 0&&(n.modelValue||0)-n.step<n.minValue));function T(C){return C!==void 0?(C=C==null?void 0:C.toString(),!isNaN(+C)&&!isNaN(parseFloat(C))):!1}function S(){if(!m.value){let C=0;n.modelValue===void 0?C=n.minValue?n.minValue:0:C=+(n.modelValue||0)+n.step,p.value=C.toString()}}function D(){if(!y.value){let C=0;n.modelValue===void 0?C=0:C=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,C).toString():C.toString()}}function k(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?S():C.code==="ArrowDown"&&D()}const M=C=>{C.detail>1&&C.preventDefault()};return(C,G)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:s,class:r.normalizeClass([{error:!!f.value.trim(),disabled:C.disabled},"mi-number-field d-flex-column"]),onMousedown:M,onKeydown:G[1]||(G[1]=X=>k(X))},[r.createElementVNode("div",Ew,[r.createVNode(lr,{class:"mi-number-field__contour"}),G[6]||(G[6]=r.createTextVNode()),r.createElementVNode("div",Tw,[C.label?(r.openBlock(),r.createElementBlock("label",Bw,[r.createTextVNode(r.toDisplayString(C.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),G[2]||(G[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":G[0]||(G[0]=X=>p.value=X),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,Nw),[[r.vModelText,p.value]])]),G[7]||(G[7]=r.createTextVNode()),r.createElementVNode("div",Aw,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:m.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:S},G[3]||(G[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),G[5]||(G[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:y.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:D},G[4]||(G[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),G[8]||(G[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",Vw,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),Dw={class:"pl-chip__text"},vl=r.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(t){const e=r.ref(),n=r.ref(!1);return r.onMounted(()=>{var i;e.value&&(n.value=((i=e.value)==null?void 0:i.clientWidth)>=256)}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(kt),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[s[4]||(s[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:i.small}])},[r.createElementVNode("div",Dw,[r.renderSlot(i.$slots,"default")]),s[3]||(s[3]=r.createTextVNode()),i.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:s[0]||(s[0]=r.withKeys(l=>i.$emit("close"),["enter"])),onClick:s[1]||(s[1]=r.withModifiers(l=>i.$emit("close"),["stop"]))},s[2]||(s[2]=[r.createElementVNode("div",{class:"pl-chip__close--icon"},null,-1)]),32)):r.createCommentVNode("",!0)],2)]),_:2},[n.value?{name:"tooltip",fn:r.withCtx(()=>[r.renderSlot(i.$slots,"default")]),key:"0"}:void 0]),1024))}}),Fw={class:"pl-multi-dropdown__envelope"},Rw=["tabindex"],Mw={class:"pl-multi-dropdown__container"},Iw={class:"pl-multi-dropdown__field"},Lw=["disabled","placeholder"],Ow={class:"pl-multi-dropdown__append"},Gw={key:0},zw={key:0,class:"required-icon"},$w={class:"pl-multi-dropdown__open-chips-container"},Uw={key:0,class:"nothing-found"},Zw={key:0,class:"pl-multi-dropdown__error"},Ww={key:1,class:"pl-multi-dropdown__helper"},Hw={name:"PlDropdownMulti"},jw=r.defineComponent({...Hw,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=A=>n("update:modelValue",A),s=r.useSlots(),l=t,c=r.ref(),u=r.ref(),p=r.ref(),f=r.reactive({search:"",activeOption:-1,open:!1,optionsHeight:0}),m=r.computed(()=>Array.isArray(l.modelValue)?l.modelValue:[]),y=r.computed(()=>f.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),T=r.computed(()=>ar(l.options).filter(A=>gl(m.value,A.value))),S=r.computed(()=>{const A=r.unref(m),E=ar(l.options);return(f.search?E.filter(V=>{const W=f.search.toLowerCase();return V.label.toLowerCase().includes(W)?!0:typeof V.value=="string"?V.value.toLowerCase().includes(W):V.value===f.search}):[...E]).map(V=>({...V,selected:gl(A,V.value)}))}),D=r.computed(()=>l.disabled?void 0:"0"),k=()=>{f.activeOption=lo(S.value.findIndex(A=>Pt(A.value,l.modelValue)),A=>A<0?0:A)},M=A=>{var E;const V=r.unref(m);i(gl(V,A)?V.filter(W=>!Pt(W,A)):[...V,A]),f.search="",(E=c==null?void 0:c.value)==null||E.focus()},C=A=>i(r.unref(m).filter(E=>!Pt(E,A))),G=()=>{var A;return(A=p.value)==null?void 0:A.focus()},X=()=>f.open=!f.open,O=A=>{var E,V;const W=A.relatedTarget;!((E=c.value)!=null&&E.contains(W))&&!((V=u.value)!=null&&V.contains(W))&&(f.search="",f.open=!1)},P=()=>{const A=u.value;A&&ot(A.querySelector(".hovered-item"),E=>{co(A,E)})},L=A=>{var E;const{open:V,activeOption:W}=f;if(!V){A.code==="Enter"&&(f.open=!0);return}A.code==="Escape"&&(f.open=!1,(E=c.value)==null||E.focus());const q=r.unref(S),{length:Z}=q;if(!Z)return;["ArrowDown","ArrowUp","Enter"].includes(A.code)&&A.preventDefault(),A.code==="Enter"&&M(q[W].value);const N=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(W+N+Z)%Z,requestAnimationFrame(P)};Ln(c),r.watch(()=>l.modelValue,()=>k(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&P()});const z=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,A=>{if(A){const E=A.getBoundingClientRect();f.optionsHeight=E.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ui(c,A=>{const E=A.top+A.height+5;E+f.optionsHeight>A.clientHeight?z.top=A.top-f.optionsHeight-5+"px":z.top=E+"px",z.left=A.left+"px",z.width=A.width+"px"}),(A,E)=>(r.openBlock(),r.createElementBlock("div",Fw,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:D.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:A.error,disabled:A.disabled}]),onKeydown:L,onFocusout:O},[r.createElementVNode("div",Mw,[r.createElementVNode("div",Iw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":E[0]||(E[0]=V=>f.search=V),type:"text",tabindex:"-1",disabled:A.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:E[1]||(E[1]=V=>f.open=!0)},null,40,Lw),[[r.vModelText,f.search]]),E[3]||(E[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:G},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(T.value,(V,W)=>(r.openBlock(),r.createBlock(r.unref(vl),{key:W,closeable:"",small:"",onClick:E[2]||(E[2]=r.withModifiers(q=>f.open=!0,["stop"])),onClose:q=>C(V.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(V.label||V.value),1)]),_:2},1032,["onClose"]))),128))])),E[4]||(E[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(X,["stop"])}),E[5]||(E[5]=r.createTextVNode()),r.createElementVNode("div",Ow,[r.renderSlot(A.$slots,"append")])]),E[10]||(E[10]=r.createTextVNode()),A.label?(r.openBlock(),r.createElementBlock("label",Gw,[A.required?(r.openBlock(),r.createElementBlock("i",zw)):r.createCommentVNode("",!0),E[6]||(E[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(A.label),1),E[7]||(E[7]=r.createTextVNode()),r.unref(s).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(A.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),E[11]||(E[11]=r.createTextVNode()),f.open?(r.openBlock(),r.createBlock(r.Teleport,{key:1,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:u,class:"pl-multi-dropdown__options",style:r.normalizeStyle(z),tabindex:"-1",onFocusout:O},[r.createElementVNode("div",$w,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(T.value,(V,W)=>(r.openBlock(),r.createBlock(r.unref(vl),{key:W,closeable:"",small:"",onClose:q=>C(V.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(V.label||V.value),1)]),_:2},1032,["onClose"]))),128))]),E[8]||(E[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.value,(V,W)=>(r.openBlock(),r.createBlock(di,{key:W,option:V,"text-item":"text","is-selected":V.selected,"is-hovered":f.activeOption==W,size:"medium","use-checkbox":"",onClick:r.withModifiers(q=>M(V.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),E[9]||(E[9]=r.createTextVNode()),S.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Uw,"Nothing found"))],36)])):r.createCommentVNode("",!0),E[12]||(E[12]=r.createTextVNode()),r.createVNode(lr,{class:"pl-multi-dropdown__contour"})])],42,Rw),E[13]||(E[13]=r.createTextVNode()),A.error?(r.openBlock(),r.createElementBlock("div",Zw,r.toDisplayString(A.error),1)):A.helper?(r.openBlock(),r.createElementBlock("div",Ww,r.toDisplayString(A.helper),1)):r.createCommentVNode("",!0)]))}}),_l=r.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.computed(()=>e.modelValue);return(i,s)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:i.disabled}]),onClick:s[0]||(s[0]=l=>i.$emit("update:modelValue",!i.modelValue)),onKeydown:s[1]||(s[1]=r.withKeys(l=>i.$emit("update:modelValue",!i.modelValue),["enter"]))},null,34))}}),qw={name:"PlCheckbox"},Nu=r.defineComponent({...qw,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(i,s)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:i.disabled}])},[r.createVNode(_l,r.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=l=>i.$emit("update:modelValue",l))}),null,16),s[3]||(s[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:s[1]||(s[1]=l=>i.$emit("update:modelValue",!i.$props.modelValue))},[r.renderSlot(i.$slots,"default")])],2)):(r.openBlock(),r.createBlock(_l,r.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=l=>i.$emit("update:modelValue",l))}),null,16))}}),Kw={key:0},Yw=["onClick"],Jw={name:"PlCheckboxGroup"},Xw=r.defineComponent({...Jw,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=t,s=c=>i.modelValue.includes(c),l=c=>{const u=i.modelValue??[];n("update:modelValue",s(c)?u.filter(p=>p!==c):[...u,c])};return(c,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:c.disabled}])},[c.label?(r.openBlock(),r.createElementBlock("label",Kw,r.toDisplayString(c.label),1)):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.options.map(p=>({label:"label"in p?p.label:p.text,value:p.value})),(p,f)=>(r.openBlock(),r.createElementBlock("div",{key:f},[r.createVNode(_l,{disabled:c.disabled,label:p.label,"model-value":s(p.value),"onUpdate:modelValue":()=>l(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),u[0]||(u[0]=r.createTextVNode()),r.createElementVNode("label",{onClick:r.withModifiers(()=>l(p.value),["stop"])},r.toDisplayString(p.label),9,Yw)]))),128))],2))}}),Qw="_component_tupwt_1",eb={component:Qw},tb={};function nb(t,e){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(t.$style.component)},e[0]||(e[0]=[r.createElementVNode("div",null,null,-1)]),2)}const rb={$style:eb},ib=Tn(tb,[["render",nb],["__cssModules",rb]]),ob={key:1,class:"pl-dialog-modal__title"},sb={inheritAttrs:!1},Cl=r.defineComponent({...sb,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},maxHeight:{default:"auto"},closable:{type:Boolean,default:!0},noContentGutters:{type:Boolean,default:!1},noTopContentGutter:{type:Boolean},actionsHasTopBorder:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.useAttrs();function u(p){l.value&&s.closeOnOutsideClick&&document.contains(p.target)&&!l.value.contains(p.target)&&i("update:modelValue",!1)}return tt(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&i("update:modelValue",!1)}),(p,f)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,{name:"dialog"},{default:r.withCtx(()=>[p.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:u},[r.createElementVNode("div",r.mergeProps(r.unref(c),{ref_key:"modal",ref:l,class:["pl-dialog-modal",{"has-title":r.unref(n).title,"has-content":r.unref(n).default}],style:{width:p.width,height:p.height,minHeight:p.minHeight,maxHeight:p.maxHeight}}),[p.closable?(r.openBlock(),r.createBlock(ib,{key:0,class:"close-modal-btn",onClick:f[0]||(f[0]=r.withModifiers(m=>i("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),f[1]||(f[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",ob,[r.renderSlot(p.$slots,"title")])):r.createCommentVNode("",!0),f[2]||(f[2]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(["pl-dialog-modal__content",{"no-content-gutters":p.noContentGutters,"no-top-content-gutter":p.noTopContentGutter}])},[r.renderSlot(p.$slots,"default")],2),f[3]||(f[3]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["pl-dialog-modal__actions",{"has-top-border":p.actionsHasTopBorder}])},[r.renderSlot(p.$slots,"actions")],2)):r.createCommentVNode("",!0)],16)])):r.createCommentVNode("",!0)]),_:3})]))}}),ab=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(i,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(i.$slots,"default")]),_:3}))}}),lb={key:0,class:"pl-slide-modal__title"},cb={class:"pl-slide-modal__content"},db={key:1,class:"pl-slide-modal__actions"},ub={name:"PlSlideModal",inheritAttrs:!1},pb=r.defineComponent({...ub,props:{modelValue:{type:Boolean,default:!1},width:{default:"368px"},shadow:{type:Boolean,default:!1},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.ref(),c=r.useAttrs();return fs(l,()=>{s.modelValue&&s.closeOnOutsideClick&&i("update:modelValue",!1)}),tt(document,"keydown",u=>{u.key==="Escape"&&i("update:modelValue",!1)}),(u,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(ab,null,{default:r.withCtx(()=>[u.modelValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref_key:"modal",ref:l,style:{width:u.width}},r.unref(c),{class:["pl-slide-modal",{"has-title":r.unref(n).title,"has-actions":r.unref(n).actions}],onKeyup:p[1]||(p[1]=r.withKeys(f=>i("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=f=>i("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",lb,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",cb,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",db,[r.renderSlot(u.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),u.modelValue&&u.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(f=>i("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),hb={key:0,class:"label"},fb={name:"PlToggleSwitch"},gs=r.defineComponent({...fb,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["ui-toggle-switch",{active:e.modelValue}]),onClick:n[0]||(n[0]=i=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(i=>e.$emit("update:modelValue",!e.modelValue),["enter"]))},[n[2]||(n[2]=r.createElementVNode("div",{class:"ui-toggle-switch__body"},[r.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),n[3]||(n[3]=r.createTextVNode()),e.label?(r.openBlock(),r.createElementBlock("span",hb,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function Au(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function mb(t){return r.unref(t)}const gb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function yb(t,e,n={}){const{immediate:i=!0}=n,s=r.ref(!1);let l=null;function c(){l&&(clearTimeout(l),l=null)}function u(){s.value=!1,c()}function p(...f){c(),s.value=!0,l=setTimeout(()=>{s.value=!1,l=null,t(...f)},mb(e))}return i&&(s.value=!0,gb&&p()),Au(u),{isPending:r.readonly(s),start:p,stop:u}}function vb(t,e,n){return r.watch(t,(i,s,l)=>{i&&e(i,s,l)},{...n,once:!1})}function _b(t,e,n){const{start:i}=yb(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),i())}function c(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&c(),Au(u),{isActive:s,pause:u,resume:c}}const Cb="[==PROGRESS==]";function wb(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bb(t){const e=r.ref(),n=r.reactive({errorCount:0});async function i(){var l;let c=e.value;if(c===void 0)return;const u=t.mockPlatforma??window.platforma;if(!u){console.warn("Platforma API is not available");return}for(;;){const p=await u.logDriver.readText(c.logHandle,100,c.lastOffset);if(c.error=void 0,n.errorCount=0,p.shouldUpdateHandle||c.logHandle!==((l=e.value)==null?void 0:l.logHandle))return;const f=t.progressPrefix??Cb,m=new TextDecoder().decode(p.data).replace(new RegExp(`${wb(f)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=_b(()=>i().catch(l=>{e.value&&(n.errorCount++,n.errorCount>(t.maxRetries??3)?e.value.error=l:console.warn("skip error:",l,"retry..."))}),1500,{immediate:!1});return vb(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>s.pause()),r.watch(()=>t.logHandle,l=>{var c;l===void 0?(e.value=void 0,s.pause()):l!==((c=e.value)==null?void 0:c.logHandle)&&(e.value={logHandle:l,lastOffset:0,lines:"",finished:!1,error:void 0},n.errorCount=0,s.resume())},{immediate:!0}),e}const xb={key:0},kb={class:"pl-log-view__copy"},Sb={key:1,class:"pl-log-view__error"},Eb={name:"PlLogView"},Vu=r.defineComponent({...Eb,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=D=>{if(D&&D.ok===!1)return D.errors.join(`
51
+ `)},n=t,i=bb(n),s=r.ref(!0),l=r.ref(),c=r.ref(),u=r.computed(()=>{var D;return((D=i.value)==null?void 0:D.error)??n.error??e(n.output)}),p=r.computed(()=>{var D;return((D=i.value)==null?void 0:D.lines)??n.value??mv(n.output)}),f=r.ref(!1);Ln(c);const m=r.computed(()=>f.value?"clipboard-copied":"clipboard"),y=()=>{f.value=!0,setTimeout(()=>{f.value=!1},1200),p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},T=()=>{Mr(l.value,D=>{s.value&&D.scrollTo(D.scrollLeft,D.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{T()})},{immediate:!0});const S=D=>{const k=D.target;s.value=k.scrollTop+20>=k.scrollHeight-k.offsetHeight};return(D,k)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[D.label?(r.openBlock(),r.createElementBlock("label",xb,r.toDisplayString(D.label),1)):r.createCommentVNode("",!0),k[1]||(k[1]=r.createTextVNode()),r.createVNode(lr,{class:"pl-log-view__contour"}),k[2]||(k[2]=r.createTextVNode()),r.createElementVNode("div",kb,[r.createVNode(r.unref(kt),{"close-delay":800,position:"top"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(f.value?"copied":"copy"),1)]),default:r.withCtx(()=>[r.createVNode(r.unref(On),{title:"Copy content",name:m.value,onClick:y},null,8,["name"]),k[0]||(k[0]=r.createTextVNode())]),_:1})]),k[3]||(k[3]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",Sb,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:S},r.toDisplayString(p.value),545))],2))}}),Tb="_component_1ukal_1",Bb="_tab_1ukal_14",Nb="_disabled_1ukal_27",Ab="_active_1ukal_56",Vb="_topLine_1ukal_69",hi={component:Tb,tab:Bb,disabled:Nb,active:Ab,topLine:Vb},Pb=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const i=r.unref(e);if(!i)return;const s=i.$el.querySelector("span");s&&requestAnimationFrame(()=>{s.offsetWidth<s.scrollWidth&&(n.isOverflown=!0),console.log("el.offsetWidth, el.scrollWidth",s.offsetWidth,s.scrollWidth)})}),(i,s)=>(r.openBlock(),r.createBlock(r.unref(kt),{ref_key:"rootRef",ref:e,element:"div",position:"top",hide:!n.isOverflown,"close-delay":300,"data-is-overflown":n.isOverflown?"true":"false"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(i.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(i.$slots,"default"),s[0]||(s[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Db={name:"PlTabs"},Fb=r.defineComponent({...Db,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,i=s=>n("update:modelValue",s);return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(hi).component,{[r.unref(hi).disabled]:s.disabled,[r.unref(hi).topLine]:s.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(c,u)=>(r.openBlock(),r.createBlock(Pb,{key:u,tabindex:s.modelValue===c.value||s.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(hi).active]:s.modelValue===c.value,[r.unref(hi).disabled]:c.disabled},r.unref(hi).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>i(c.value),["enter"]),onClick:p=>i(c.value)},{default:r.withCtx(()=>[r.renderSlot(s.$slots,c.value,{option:c},()=>[r.createElementVNode("span",null,r.toDisplayString(c.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}});function Rb(t){const e=t.split("/"),n=[];for(let i=0;i<e.length;i++)n.push({index:i,name:i===0?"Root":e[i],path:e.slice(0,i+1).join("/")});return n}const Mb={class:"file-dialog"},Ib={class:"file-dialog__search"},Lb={class:"ls-container"},Ob={class:"ls-head"},Gb={class:"ls-head__breadcrumbs"},zb=["title","onClick"],$b={key:0,class:"icon-16 icon-chevron-right"},Ub={class:"d-flex ml-auto align-center gap-12"},Zb={class:"ls-head__selected"},Wb={key:0,class:"ls-loader"},Hb={key:1,class:"ls-empty"},jb={key:2,class:"ls-error"},qb={class:"ls-error__message"},Kb={key:3,class:"ls-body"},Yb=["onClick"],Jb=["title"],Xb=["onClick"],Qb=["title"],Pu=r.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},closeOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(t,{emit:e}){const n=e,i=t,s=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),l=r.reactive(s()),c=r.computed(()=>l.showHiddenItems?l.items:l.items.filter(z=>!z.name.startsWith("."))),u=r.computed(()=>{var z;return{modelValue:i.modelValue,dirPath:l.dirPath,storageHandle:(z=l.storageEntry)==null?void 0:z.handle}}),p=(z,A)=>{window.platforma&&l.currentLoadingPath!==A&&(l.error="",l.items=[],l.lastSelected=void 0,l.currentLoadingPath=A,window.platforma.lsDriver.listFiles(z,A).then(E=>{A===l.dirPath&&(l.items=Yd(E).entries.map(V=>({path:V.fullPath,name:V.name,isDir:V.type==="dir",canBeSelected:V.type==="file"&&(!i.extensions||i.extensions.some(W=>V.fullPath.endsWith(W))),handle:V.type==="file"?V.handle:void 0,selected:!1})).sort((V,W)=>V.isDir&&!W.isDir?-1:!V.isDir&&W.isDir?1:V.name.localeCompare(W.name)).map((V,W)=>({id:W,...V})),l.lastSelected=void 0)}).catch(E=>l.error=String(E)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:z,dirPath:A,modelValue:E}=u.value;z&&E&&p(z,A)},m=Qd(z=>{l.dirPath=z??""},1e3),y=r.computed(()=>Rb(l.dirPath)),T=r.computed(()=>l.items.filter(z=>z.canBeSelected&&z.selected&&!z.isDir)),S=r.computed(()=>T.value.length>0),D=()=>{n("update:modelValue",!1)},k=()=>{var z;S.value&&(z=l.storageEntry)!=null&&z.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:T.value.map(A=>A.handle)}),D())},M=z=>{l.dirPath=z,l.storageEntry&&f()},C=(z,A)=>{const{shiftKey:E,metaKey:V}=z,{lastSelected:W}=l;if(z.preventDefault(),A.canBeSelected){if(i.multi||l.items.forEach(q=>q.selected=!1),A.selected=!0,!i.multi)return;!V&&!E&&l.items.forEach(q=>{q.id!==A.id&&(q.selected=!1)}),E&&W!==void 0&&l.items.forEach(q=>{pv(q.id,W,A.id)&&(q.selected=!0)}),A.selected&&(l.lastSelected=A.id)}},G=z=>{z&&!i.multi||l.items.filter(A=>A.canBeSelected).forEach(A=>{A.selected=z})},X=()=>G(!0),O=()=>G(!1),P=()=>{if(l.error="",l.lastSelected=void 0,O(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(z=>{l.storageOptions=z.map(A=>({text:A.name,value:A})),i.autoSelectStorage&&Mr(z.find(A=>A.name==="local"||A.name.startsWith("local_disk_")&&A.initialFullPath.length>4),A=>{l.storageEntry=A,l.dirPath=A.initialFullPath})}).catch(z=>l.error=String(z))};r.watch(r.toRef(l,"storageEntry"),z=>{l.dirPath=(z==null?void 0:z.initialFullPath)??""}),r.watch([()=>l.dirPath,()=>l.storageEntry],()=>{f()}),r.watch(()=>i.modelValue,z=>{z?P():Object.assign(l,s())},{immediate:!0}),tt(document,"keydown",z=>{i.modelValue&&z.target===document.body&&(z.metaKey&&z.code==="KeyA"&&(z.preventDefault(),X()),z.metaKey&&z.shiftKey&&z.code==="Period"&&(z.preventDefault(),l.showHiddenItems=!l.showHiddenItems),z.code==="Enter"&&k())}),r.onUpdated(P);const L={mounted:z=>{if(z.clientWidth<z.scrollWidth){const A=z.innerText;z.innerText=A.substring(0,57)+"..."+A.substring(A.length-10)}}};return(z,A)=>(r.openBlock(),r.createBlock(r.unref(Cl),{"no-content-gutters":!0,"close-on-outside-click":z.closeOnOutsideClick,class:"split","model-value":z.modelValue,width:"688px",height:"720px","onUpdate:modelValue":D,onClick:r.withModifiers(O,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(z.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(cl),{style:{"min-width":"160px"},disabled:!S.value,onClick:r.withModifiers(k,["stop"])},{default:r.withCtx(()=>A[14]||(A[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),A[16]||(A[16]=r.createTextVNode()),r.createVNode(r.unref(ul),{"justify-center":!1,onClick:r.withModifiers(D,["stop"])},{default:r.withCtx(()=>A[15]||(A[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[A[17]||(A[17]=r.createTextVNode()),r.createElementVNode("div",Mb,[r.createElementVNode("div",Ib,[r.createVNode(r.unref(uo),{modelValue:l.storageEntry,"onUpdate:modelValue":A[0]||(A[0]=E=>l.storageEntry=E),label:"Select storage",options:l.storageOptions},null,8,["modelValue","options"]),A[1]||(A[1]=r.createTextVNode()),r.createVNode(r.unref(Ir),{"model-value":l.dirPath,label:"Enter path","onUpdate:modelValue":r.unref(m)},null,8,["model-value","onUpdate:modelValue"])]),A[13]||(A[13]=r.createTextVNode()),r.createElementVNode("div",Lb,[r.createElementVNode("div",Ob,[r.createElementVNode("div",Gb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(E,V)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:V},[r.createElementVNode("div",{title:E.path,onClick:W=>M(E.path)},r.toDisplayString(E.name),9,zb),A[2]||(A[2]=r.createTextVNode()),E.index!==y.value.length-1?(r.openBlock(),r.createElementBlock("i",$b)):r.createCommentVNode("",!0)],64))),128))]),A[3]||(A[3]=r.createTextVNode()),r.createElementVNode("div",Ub,[r.createElementVNode("span",Zb,"Selected: "+r.toDisplayString(T.value.length),1)])]),A[12]||(A[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",Wb,A[4]||(A[4]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):l.storageEntry?l.error?(r.openBlock(),r.createElementBlock("div",jb,[A[6]||(A[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),A[7]||(A[7]=r.createTextVNode()),r.createElementVNode("div",qb,r.toDisplayString(l.error),1)])):(r.openBlock(),r.createElementBlock("div",Kb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,E=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:E.id},[E.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:V=>M(E.path)},[A[8]||(A[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),A[9]||(A[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:E.name},[r.createTextVNode(r.toDisplayString(E.name),1)],8,Jb)),[[L]])],8,Yb)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:E.canBeSelected,selected:E.selected}),onClick:r.withModifiers(V=>C(V,E),["stop"])},[A[10]||(A[10]=r.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),A[11]||(A[11]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:E.name},[r.createTextVNode(r.toDisplayString(E.name),1)],8,Qb)),[[L]])],10,Xb))],64))),128))])):(r.openBlock(),r.createElementBlock("div",Hb,A[5]||(A[5]=[r.createElementVNode("div",{class:"ls-empty__cat"},null,-1),r.createTextVNode(),r.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),A[18]||(A[18]=r.createTextVNode())]),_:1},8,["close-on-outside-click","model-value"]))}});var Ie;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of l)c[u]=s[u];return t.objectValues(c)},t.objectValues=s=>t.objectKeys(s).map(function(l){return s[l]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},t.find=(s,l)=>{for(const c of s)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function i(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=i,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Ie||(Ie={}));var wl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(wl||(wl={}));const se=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cr=t=>{switch(typeof t){case"undefined":return se.undefined;case"string":return se.string;case"number":return isNaN(t)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(t)?se.array:t===null?se.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?se.promise:typeof Map<"u"&&t instanceof Map?se.map:typeof Set<"u"&&t instanceof Set?se.set:typeof Date<"u"&&t instanceof Date?se.date:se.object;default:return se.unknown}},ee=Ie.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"]),ex=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Lt extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},i={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)i._errors.push(n(c));else{let u=i,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),i}static assert(e){if(!(e instanceof Lt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):i.push(e(s));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Lt.create=t=>new Lt(t);const fi=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===se.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ie.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ie.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ie.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ie.joinValues(t.options)}, received '${t.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.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}"`:Ie.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ee.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 ee.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 ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ie.assertNever(t)}return{message:n}};let Du=fi;function tx(t){Du=t}function ys(){return Du}const vs=t=>{const{data:e,path:n,errorMaps:i,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=i.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},nx=[];function ie(t,e){const n=ys(),i=vs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===fi?void 0:fi].filter(s=>!!s)});t.common.issues.push(i)}class yt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const s of n){const l=await s.key,c=await s.value;i.push({key:l,value:c})}return yt.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(i[l.value]=c.value)}return{status:e.value,value:i}}}const Ce=Object.freeze({status:"aborted"}),_s=t=>({status:"dirty",value:t}),St=t=>({status:"valid",value:t}),bl=t=>t.status==="aborted",xl=t=>t.status==="dirty",po=t=>t.status==="valid",ho=t=>typeof Promise<"u"&&t instanceof Promise;function Cs(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Fu(t,e,n,i,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var ue;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ue||(ue={}));var fo,mo;class Bn{constructor(e,n,i,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ru=(t,e)=>{if(po(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 Lt(t.common.issues);return this._error=n,this._error}}};function Ee(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:s}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(l,c)=>{var u,p;const{message:f}=t;return l.code==="invalid_enum_value"?{message:f??c.defaultError}:typeof c.data>"u"?{message:(u=f??i)!==null&&u!==void 0?u:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(p=f??n)!==null&&p!==void 0?p:c.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 cr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new yt,ctx:{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(ho(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){var i;const s={common:{issues:[],async:(i=n==null?void 0:n.async)!==null&&i!==void 0?i:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return Ru(s,l)}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},s=this._parse({data:e,path:i.path,parent:i}),l=await(ho(s)?s:Promise.resolve(s));return Ru(i,l)}refine(e,n){const i=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:ee.custom,...i(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof n=="function"?n(i,s):n),!1))}_refinement(e){return new cn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return An.create(this,this._def)}nullable(){return fr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ln.create(this,this._def)}promise(){return vi.create(this,this._def)}or(e){return _o.create([this,e],this._def)}and(e){return Co.create(this,e,this._def)}transform(e){return new cn({...Ee(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new So({...Ee(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new El({typeName:ve.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Eo({...Ee(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return To.create(this,e)}readonly(){return Bo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const rx=/^c[^\s-]{8,}$/i,ix=/^[0-9a-z]+$/,ox=/^[0-9A-HJKMNP-TV-Z]{26}$/,sx=/^[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,ax=/^[a-z0-9_-]{21}$/i,lx=/^[-+]?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)?)??$/,cx=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kl;const ux=/^(?:(?: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])$/,px=/^(([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})))$/,hx=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Mu="((\\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])))",fx=new RegExp(`^${Mu}$`);function Iu(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 mx(t){return new RegExp(`^${Iu(t)}$`)}function Lu(t){let e=`${Mu}T${Iu(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 gx(t,e){return!!((e==="v4"||!e)&&ux.test(t)||(e==="v6"||!e)&&px.test(t))}class an extends Ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==se.string){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:se.string,received:s.parsedType}),Ce}const n=new yt;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,c=e.data.length<s.value;(l||c)&&(i=this._getOrReturnCtx(e,i),l?ie(i,{code:ee.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&ie(i,{code:ee.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")cx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")kl||(kl=new RegExp(dx,"u")),kl.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")sx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")ax.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")rx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")ix.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")ox.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Lu(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?fx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?mx(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?lx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?gx(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?hx.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:s.message}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,i){return this.refinement(s=>e.test(s),{validation:n,code:ee.invalid_string,...ue.errToObj(i)})}_addCheck(e){return new an({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ue.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ue.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ue.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ue.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ue.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ue.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ue.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ue.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ue.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ue.errToObj(e)})}datetime(e){var n,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...ue.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,...ue.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ue.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ue.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ue.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ue.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ue.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ue.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ue.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ue.errToObj(n)})}nonempty(e){return this.min(1,ue.errToObj(e))}trim(){return new an({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new an({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new an({...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}}an.create=t=>{var e;return new an({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function yx(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=n>i?n:i,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class dr 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)!==se.number){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:se.number,received:s.parsedType}),Ce}let n;const i=new yt;for(const s of this._def.checks)s.kind==="int"?Ie.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?yx(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.not_finite,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,i,s){return new dr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ue.toString(s)}]})}_addCheck(e){return new dr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ue.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"&&Ie.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}dr.create=t=>new dr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class ur 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)!==se.bigint){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:se.bigint,received:s.parsedType}),Ce}let n;const i=new yt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),ie(n,{code:ee.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ie.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,i,s){return new ur({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ue.toString(s)}]})}_addCheck(e){return new ur({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.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}}ur.create=t=>{var e;return new ur({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};class go extends Ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==se.boolean){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.boolean,received:n.parsedType}),Ce}return St(e.data)}}go.create=t=>new go({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class Lr extends Ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==se.date){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_type,expected:se.date,received:s.parsedType}),Ce}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ie(s,{code:ee.invalid_date}),Ce}const n=new yt;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Ie.assertNever(s);return{status:n.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:ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ue.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:ve.ZodDate,...Ee(t)});class ws extends Ne{_parse(e){if(this._getType(e)!==se.symbol){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.symbol,received:n.parsedType}),Ce}return St(e.data)}}ws.create=t=>new ws({typeName:ve.ZodSymbol,...Ee(t)});class yo extends Ne{_parse(e){if(this._getType(e)!==se.undefined){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.undefined,received:n.parsedType}),Ce}return St(e.data)}}yo.create=t=>new yo({typeName:ve.ZodUndefined,...Ee(t)});class vo extends Ne{_parse(e){if(this._getType(e)!==se.null){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.null,received:n.parsedType}),Ce}return St(e.data)}}vo.create=t=>new vo({typeName:ve.ZodNull,...Ee(t)});class mi extends Ne{constructor(){super(...arguments),this._any=!0}_parse(e){return St(e.data)}}mi.create=t=>new mi({typeName:ve.ZodAny,...Ee(t)});class Or extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return St(e.data)}}Or.create=t=>new Or({typeName:ve.ZodUnknown,...Ee(t)});class Gn extends Ne{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.never,received:n.parsedType}),Ce}}Gn.create=t=>new Gn({typeName:ve.ZodNever,...Ee(t)});class bs extends Ne{_parse(e){if(this._getType(e)!==se.undefined){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.void,received:n.parsedType}),Ce}return St(e.data)}}bs.create=t=>new bs({typeName:ve.ZodVoid,...Ee(t)});class ln extends Ne{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),s=this._def;if(n.parsedType!==se.array)return ie(n,{code:ee.invalid_type,expected:se.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?ee.too_big:ee.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ie(n,{code:ee.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ie(n,{code:ee.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new Bn(n,c,n.path,u)))).then(c=>yt.mergeArray(i,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new Bn(n,c,n.path,u)));return yt.mergeArray(i,l)}get element(){return this._def.type}min(e,n){return new ln({...this._def,minLength:{value:e,message:ue.toString(n)}})}max(e,n){return new ln({...this._def,maxLength:{value:e,message:ue.toString(n)}})}length(e,n){return new ln({...this._def,exactLength:{value:e,message:ue.toString(n)}})}nonempty(e){return this.min(1,e)}}ln.create=(t,e)=>new ln({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ee(e)});function gi(t){if(t instanceof Xe){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=An.create(gi(i))}return new Xe({...t._def,shape:()=>e})}else return t instanceof ln?new ln({...t._def,type:gi(t.element)}):t instanceof An?An.create(gi(t.unwrap())):t instanceof fr?fr.create(gi(t.unwrap())):t instanceof Nn?Nn.create(t.items.map(e=>gi(e))):t}class Xe 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=Ie.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==se.object){const p=this._getOrReturnCtx(e);return ie(p,{code:ee.invalid_type,expected:se.object,received:p.parsedType}),Ce}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof Gn&&this._def.unknownKeys==="strip"))for(const p in i.data)l.includes(p)||c.push(p);const u=[];for(const p of l){const f=s[p],m=i.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new Bn(i,m,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof Gn){const p=this._def.unknownKeys;if(p==="passthrough")for(const f of c)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(p==="strict")c.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:c}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const f of c){const m=i.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new Bn(i,m,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const p=[];for(const f of u){const m=await f.key,y=await f.value;p.push({key:m,value:y,alwaysSet:f.alwaysSet})}return p}).then(p=>yt.mergeObjectSync(n,p)):yt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return ue.errToObj,new Xe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,l,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,i).message)!==null&&c!==void 0?c:i.defaultError;return n.code==="unrecognized_keys"?{message:(u=ue.errToObj(e).message)!==null&&u!==void 0?u:p}:{message:p}}}:{}})}strip(){return new Xe({...this._def,unknownKeys:"strip"})}passthrough(){return new Xe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Xe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Xe({...this._def,catchall:e})}pick(e){const n={};return Ie.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(n[i]=this.shape[i])}),new Xe({...this._def,shape:()=>n})}omit(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{e[i]||(n[i]=this.shape[i])}),new Xe({...this._def,shape:()=>n})}deepPartial(){return gi(this)}partial(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{const s=this.shape[i];e&&!e[i]?n[i]=s:n[i]=s.optional()}),new Xe({...this._def,shape:()=>n})}required(e){const n={};return Ie.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof An;)s=s._def.innerType;n[i]=s}}),new Xe({...this._def,shape:()=>n})}keyof(){return Ou(Ie.objectKeys(this.shape))}}Xe.create=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strip",catchall:Gn.create(),typeName:ve.ZodObject,...Ee(e)}),Xe.strictCreate=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strict",catchall:Gn.create(),typeName:ve.ZodObject,...Ee(e)}),Xe.lazycreate=(t,e)=>new Xe({shape:t,unknownKeys:"strip",catchall:Gn.create(),typeName:ve.ZodObject,...Ee(e)});class _o extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=l.map(u=>new Lt(u.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:c}),Ce}if(n.common.async)return Promise.all(i.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of i){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new Lt(p));return ie(n,{code:ee.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}_o.create=(t,e)=>new _o({options:t,typeName:ve.ZodUnion,...Ee(e)});const pr=t=>t instanceof bo?pr(t.schema):t instanceof cn?pr(t.innerType()):t instanceof xo?[t.value]:t instanceof hr?t.options:t instanceof ko?Ie.objectValues(t.enum):t instanceof So?pr(t._def.innerType):t instanceof yo?[void 0]:t instanceof vo?[null]:t instanceof An?[void 0,...pr(t.unwrap())]:t instanceof fr?[null,...pr(t.unwrap())]:t instanceof El||t instanceof Bo?pr(t.unwrap()):t instanceof Eo?pr(t._def.innerType):[];class xs extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.object)return ie(n,{code:ee.invalid_type,expected:se.object,received:n.parsedType}),Ce;const i=this.discriminator,s=n.data[i],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const s=new Map;for(const l of n){const c=pr(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 xs({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ee(i)})}}function Sl(t,e){const n=cr(t),i=cr(e);if(t===e)return{valid:!0,data:t};if(n===se.object&&i===se.object){const s=Ie.objectKeys(e),l=Ie.objectKeys(t).filter(u=>s.indexOf(u)!==-1),c={...t,...e};for(const u of l){const p=Sl(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}else if(n===se.array&&i===se.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=Sl(c,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===se.date&&i===se.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Co extends Ne{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=(l,c)=>{if(bl(l)||bl(c))return Ce;const u=Sl(l.value,c.value);return u.valid?((xl(l)||xl(c))&&n.dirty(),{status:n.value,value:u.data}):(ie(i,{code:ee.invalid_intersection_types}),Ce)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Co.create=(t,e,n)=>new Co({left:t,right:e,typeName:ve.ZodIntersection,...Ee(n)});class Nn extends Ne{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==se.array)return ie(i,{code:ee.invalid_type,expected:se.array,received:i.parsedType}),Ce;if(i.data.length<this._def.items.length)return ie(i,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&i.data.length>this._def.items.length&&(ie(i,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((l,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new Bn(i,l,i.path,c)):null}).filter(l=>!!l);return i.common.async?Promise.all(s).then(l=>yt.mergeArray(n,l)):yt.mergeArray(n,s)}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:ve.ZodTuple,rest:null,...Ee(e)})};class wo extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==se.object)return ie(i,{code:ee.invalid_type,expected:se.object,received:i.parsedType}),Ce;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in i.data)s.push({key:l._parse(new Bn(i,u,i.path,u)),value:c._parse(new Bn(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?yt.mergeObjectAsync(n,s):yt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Ne?new wo({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ee(i)}):new wo({keyType:an.create(),valueType:e,typeName:ve.ZodRecord,...Ee(n)})}}class ks extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==se.map)return ie(i,{code:ee.invalid_type,expected:se.map,received:i.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,c=[...i.data.entries()].map(([u,p],f)=>({key:s._parse(new Bn(i,u,i.path,[f,"key"])),value:l._parse(new Bn(i,p,i.path,[f,"value"]))}));if(i.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return 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}}}}ks.create=(t,e,n)=>new ks({valueType:e,keyType:t,typeName:ve.ZodMap,...Ee(n)});class Gr extends Ne{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==se.set)return ie(i,{code:ee.invalid_type,expected:se.set,received:i.parsedType}),Ce;const s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(ie(i,{code:ee.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(ie(i,{code:ee.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=[...i.data.values()].map((p,f)=>l._parse(new Bn(i,p,i.path,f)));return i.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new Gr({...this._def,minSize:{value:e,message:ue.toString(n)}})}max(e,n){return new Gr({...this._def,maxSize:{value:e,message:ue.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Gr.create=(t,e)=>new Gr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ee(e)});class yi extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.function)return ie(n,{code:ee.invalid_type,expected:se.function,received:n.parsedType}),Ce;function i(u,p){return vs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ys(),fi].filter(f=>!!f),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function s(u,p){return vs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ys(),fi].filter(f=>!!f),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof vi){const u=this;return St(async function(...p){const f=new Lt([]),m=await u._def.args.parseAsync(p,l).catch(T=>{throw f.addIssue(i(p,T)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(T=>{throw f.addIssue(s(y,T)),f})})}else{const u=this;return St(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Lt([i(p,f.error)]);const m=Reflect.apply(c,this,f.data),y=u._def.returns.safeParse(m,l);if(!y.success)throw new Lt([s(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new yi({...this._def,args:Nn.create(e).rest(Or.create())})}returns(e){return new yi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new yi({args:e||Nn.create([]).rest(Or.create()),returns:n||Or.create(),typeName:ve.ZodFunction,...Ee(i)})}}class bo 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})}}bo.create=(t,e)=>new bo({getter:t,typeName:ve.ZodLazy,...Ee(e)});class xo extends Ne{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}xo.create=(t,e)=>new xo({value:t,typeName:ve.ZodLiteral,...Ee(e)});function Ou(t,e){return new hr({values:t,typeName:ve.ZodEnum,...Ee(e)})}class hr extends Ne{constructor(){super(...arguments),fo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ie(n,{expected:Ie.joinValues(i),received:n.parsedType,code:ee.invalid_type}),Ce}if(Cs(this,fo)||Fu(this,fo,new Set(this._def.values)),!Cs(this,fo).has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:i}),Ce}return St(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 hr.create(e,{...this._def,...n})}exclude(e,n=this._def){return hr.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}fo=new WeakMap,hr.create=Ou;class ko extends Ne{constructor(){super(...arguments),mo.set(this,void 0)}_parse(e){const n=Ie.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==se.string&&i.parsedType!==se.number){const s=Ie.objectValues(n);return ie(i,{expected:Ie.joinValues(s),received:i.parsedType,code:ee.invalid_type}),Ce}if(Cs(this,mo)||Fu(this,mo,new Set(Ie.getValidEnumValues(this._def.values))),!Cs(this,mo).has(e.data)){const s=Ie.objectValues(n);return ie(i,{received:i.data,code:ee.invalid_enum_value,options:s}),Ce}return St(e.data)}get enum(){return this._def.values}}mo=new WeakMap,ko.create=(t,e)=>new ko({values:t,typeName:ve.ZodNativeEnum,...Ee(e)});class vi extends Ne{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:se.promise,received:n.parsedType}),Ce;const i=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return St(i.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}vi.create=(t,e)=>new vi({type:t,typeName:ve.ZodPromise,...Ee(e)});class cn extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{ie(i,c),c.fatal?n.abort():n.dirty()},get path(){return i.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(i.data,l);if(i.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?_s(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:c,path:i.path,parent:i});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?_s(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(i.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){const u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!po(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>po(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Ie.assertNever(s)}}cn.create=(t,e,n)=>new cn({schema:t,typeName:ve.ZodEffects,effect:e,...Ee(n)}),cn.createWithPreprocess=(t,e,n)=>new cn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ee(n)});class An extends Ne{_parse(e){return this._getType(e)===se.undefined?St(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}An.create=(t,e)=>new An({innerType:t,typeName:ve.ZodOptional,...Ee(e)});class fr extends Ne{_parse(e){return this._getType(e)===se.null?St(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fr.create=(t,e)=>new fr({innerType:t,typeName:ve.ZodNullable,...Ee(e)});class So extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===se.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}So.create=(t,e)=>new So({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class Eo extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ho(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Lt(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Eo.create=(t,e)=>new Eo({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});class Ss extends Ne{_parse(e){if(this._getType(e)!==se.nan){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:se.nan,received:n.parsedType}),Ce}return{status:"valid",value:e.data}}}Ss.create=t=>new Ss({typeName:ve.ZodNaN,...Ee(t)});const vx=Symbol("zod_brand");class El extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class To extends Ne{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),_s(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,n){return new To({in:e,out:n,typeName:ve.ZodPipeline})}}class Bo extends Ne{_parse(e){const n=this._def.innerType._parse(e),i=s=>(po(s)&&(s.value=Object.freeze(s.value)),s);return ho(n)?n.then(s=>i(s)):i(n)}unwrap(){return this._def.innerType}}Bo.create=(t,e)=>new Bo({innerType:t,typeName:ve.ZodReadonly,...Ee(e)});function Gu(t,e={},n){return t?mi.create().superRefine((i,s)=>{var l,c;if(!t(i)){const u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):mi.create()}const _x={object:Xe.lazycreate};var ve;(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"})(ve||(ve={}));const Cx=(t,e={message:`Input not instance of ${t.name}`})=>Gu(n=>n instanceof t,e),zu=an.create,$u=dr.create,wx=Ss.create,bx=ur.create,Uu=go.create,xx=Lr.create,kx=ws.create,Sx=yo.create,Ex=vo.create,Tx=mi.create,Bx=Or.create,Nx=Gn.create,Ax=bs.create,Vx=ln.create,Px=Xe.create,Dx=Xe.strictCreate,Fx=_o.create,Rx=xs.create,Mx=Co.create,Ix=Nn.create,Lx=wo.create,Ox=ks.create,Gx=Gr.create,zx=yi.create,$x=bo.create,Ux=xo.create,Zx=hr.create,Wx=ko.create,Hx=vi.create,Zu=cn.create,jx=An.create,qx=fr.create,Kx=cn.createWithPreprocess,Yx=To.create;var Es=Object.freeze({__proto__:null,defaultErrorMap:fi,setErrorMap:tx,getErrorMap:ys,makeIssue:vs,EMPTY_PATH:nx,addIssueToContext:ie,ParseStatus:yt,INVALID:Ce,DIRTY:_s,OK:St,isAborted:bl,isDirty:xl,isValid:po,isAsync:ho,get util(){return Ie},get objectUtil(){return wl},ZodParsedType:se,getParsedType:cr,ZodType:Ne,datetimeRegex:Lu,ZodString:an,ZodNumber:dr,ZodBigInt:ur,ZodBoolean:go,ZodDate:Lr,ZodSymbol:ws,ZodUndefined:yo,ZodNull:vo,ZodAny:mi,ZodUnknown:Or,ZodNever:Gn,ZodVoid:bs,ZodArray:ln,ZodObject:Xe,ZodUnion:_o,ZodDiscriminatedUnion:xs,ZodIntersection:Co,ZodTuple:Nn,ZodRecord:wo,ZodMap:ks,ZodSet:Gr,ZodFunction:yi,ZodLazy:bo,ZodLiteral:xo,ZodEnum:hr,ZodNativeEnum:ko,ZodPromise:vi,ZodEffects:cn,ZodTransformer:cn,ZodOptional:An,ZodNullable:fr,ZodDefault:So,ZodCatch:Eo,ZodNaN:Ss,BRAND:vx,ZodBranded:El,ZodPipeline:To,ZodReadonly:Bo,custom:Gu,Schema:Ne,ZodSchema:Ne,late:_x,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>an.create({...t,coerce:!0}),number:t=>dr.create({...t,coerce:!0}),boolean:t=>go.create({...t,coerce:!0}),bigint:t=>ur.create({...t,coerce:!0}),date:t=>Lr.create({...t,coerce:!0})},any:Tx,array:Vx,bigint:bx,boolean:Uu,date:xx,discriminatedUnion:Rx,effect:Zu,enum:Zx,function:zx,instanceof:Cx,intersection:Mx,lazy:$x,literal:Ux,map:Ox,nan:wx,nativeEnum:Wx,never:Nx,null:Ex,nullable:qx,number:$u,object:Px,oboolean:()=>Uu().optional(),onumber:()=>$u().optional(),optional:jx,ostring:()=>zu().optional(),pipeline:Yx,preprocess:Kx,promise:Hx,record:Lx,set:Gx,strictObject:Dx,string:zu,symbol:kx,transformer:Zu,tuple:Ix,undefined:Sx,union:Fx,unknown:Bx,void:Ax,NEVER:Ce,ZodIssueCode:ee,quotelessJson:ex,ZodError:Lt});function Jx(t){throw new Error("Unexpected object: "+t)}const Wu="upload://upload/",Hu="index://index/";function Xx(t){return t.startsWith(Wu)}function Qx(t){return t.startsWith(Hu)}function ek(t){if(Qx(t)){const e=t.slice(Hu.length);return JSON.parse(decodeURIComponent(e)).path}else if(Xx(t)){const e=t.slice(Wu.length);return JSON.parse(decodeURIComponent(e)).localPath}Jx(t)}Es.object({__isRef:Es.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:Es.string().describe("Upstream block id"),name:Es.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 tk(t){return t.replace(/^.*[\\/]/,"")}const nk={key:0,ref:"label"},rk={key:0,class:"required-icon"},ik=["data-placeholder"],ok={key:5,class:"pl-file-input__stats"},sk={key:0,class:"pl-file-input__error"},ak={key:1,class:"upl-file-input__helper"},ju=r.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},showFilenameOnly:{type:Boolean},cellStyle:{type:Boolean,default:!1},fileDialogTitle:{default:void 0},fileDialogCloseOnOutsideClick:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.reactive({fileDialogOpen:!1}),i=r.useSlots(),s=e,l=t,c=r.computed(()=>{if(l.modelValue)try{const C=ek(l.modelValue).trim();return l.showFilenameOnly?tk(C):C}catch(C){return console.error(C),l.modelValue}return""}),u=r.computed(()=>l.progress&&!l.progress.done),p=r.computed(()=>l.progress&&l.progress.done),f=r.computed(()=>l.error),m=r.computed(()=>l.error),y=r.computed(()=>{const{status:C,done:G}=l.progress??{};return!C||!C.bytesTotal?"":C.bytesProcessed&&!G?el(C.bytesProcessed,{})+" / "+el(C.bytesTotal,{}):el(C.bytesTotal,{})}),T=r.computed(()=>{var C;const{progress:G}=l;return G?{width:G.done?"100%":Math.round((((C=G.status)==null?void 0:C.progress)??0)*100)+"%"}:{}}),S=()=>{n.fileDialogOpen=!0},D=C=>{C.files.length&&s("update:modelValue",C.files[0])},k=()=>s("update:modelValue",void 0),M=r.ref();return l.cellStyle||Ln(M),(C,G)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!C.cellStyle,"has-file":!!c.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:M,class:r.normalizeClass(["pl-file-input",{dashed:C.dashed,error:f.value}]),tabindex:"0",onKeyup:r.withKeys(S,["enter"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(T.value)},null,4),G[3]||(G[3]=r.createTextVNode()),!C.cellStyle&&C.label?(r.openBlock(),r.createElementBlock("label",nk,[C.required?(r.openBlock(),r.createElementBlock("i",rk)):r.createCommentVNode("",!0),G[1]||(G[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(C.label),1),G[2]||(G[2]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(C.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),G[4]||(G[4]=r.createTextVNode()),f.value?(r.openBlock(),r.createBlock(r.unref(On),{key:1,name:"restart"})):u.value?(r.openBlock(),r.createBlock(r.unref(On),{key:2,name:"cloud-upload"})):p.value?(r.openBlock(),r.createBlock(r.unref(On),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(On),{key:4,name:"paper-clip"})),G[5]||(G[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":C.placeholder??"Choose file",class:"pl-file-input__filename",onClick:r.withModifiers(S,["stop"])},r.toDisplayString(c.value),9,ik),G[6]||(G[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",ok,r.toDisplayString(y.value),1)):r.createCommentVNode("",!0),G[7]||(G[7]=r.createTextVNode()),C.modelValue?(r.openBlock(),r.createBlock(r.unref(On),{key:6,name:"close",onClick:r.withModifiers(k,["stop"])})):r.createCommentVNode("",!0),G[8]||(G[8]=r.createTextVNode()),r.createVNode(lr,{class:"pl-file-input__contour"})],34),G[9]||(G[9]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",sk,r.toDisplayString(m.value),1)):C.helper?(r.openBlock(),r.createElementBlock("div",ak,r.toDisplayString(C.helper),1)):r.createCommentVNode("",!0)],2),G[10]||(G[10]=r.createTextVNode()),r.createVNode(r.unref(Pu),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":G[0]||(G[0]=X=>n.fileDialogOpen=X),extensions:C.extensions,title:C.fileDialogTitle,"close-on-outside-click":C.fileDialogCloseOnOutsideClick,"onImport:files":D},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),lk={class:"pl-notification-alert__wrapper d-flex"},ck={class:"pl-notification-alert__content flex-grow-1"},dk={key:0,class:"pl-notification-alert__close"},uk={key:0,class:"pl-notification-alert__actions d-flex"},qu=r.defineComponent({__name:"PlNotificationAlert",props:r.mergeModels({type:{default:"neutral"},width:{default:"256px"},closable:{type:Boolean}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=r.useModel(t,"modelValue");function i(){e.closable&&(n.value=!1)}return(s,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([s.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${s.width}`})},[r.createElementVNode("div",lk,[r.createElementVNode("div",ck,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",dk,[r.createVNode(r.unref(ul),{icon:"close",onClick:i})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),s.$slots.actions?(r.openBlock(),r.createElementBlock("div",uk,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),pk=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,i)=>r.renderSlot(n.$slots,"default")}});function vt(t,e,n){return e>t?e:t>n?n:t}const Tl=t=>r.computed(()=>{const e=[100],{min:n,max:i,step:s}=t.value;let l=n;for(;l<i;){l+=s;const c=(1-(vt(l,n,i)-n)/(i-n))*100;e.push(c)}return e}),hk={class:"ui-slider__wrapper"},fk={class:"ui-slider__label-section"},mk={key:0,class:"text-s"},gk={key:1,class:"ui-slider__value-static text-s"},yk={class:"ui-slider__base"},vk={class:"ui-slider__container"},_k={class:"ui-slider__container ui-slider__container-thumb"},Ck={class:"ui-slider__input-wrapper d-flex"},wk=["value"],bk={key:0,class:"ui-slider__error"},Ku=r.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue:0}),c=r.computed(()=>s.max-s.min),u=r.computed(()=>vt((s.modelValue??0)+l.deltaValue,s.min,s.max)),p=r.ref(s.modelValue),f=r.computed(()=>{const P=s.modelValue;return Number.isFinite(P)?P<s.min?`Min value: ${s.min}`:P>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),m=r.computed(()=>s),y=Tl(m),T=r.computed(()=>(u.value-s.min)/c.value),S=r.computed(()=>({right:Math.ceil((1-T.value)*100)+"%"})),D=r.computed(()=>({right:`calc(${Math.ceil((1-T.value)*100)}%) `})),k=r.ref(),M=r.ref();r.watch(()=>s.modelValue,P=>{p.value=P});function C(P){const L=vt(P,s.min,s.max);return Math.round((L+Number.EPSILON)*(1/s.step))/(1/s.step)}sr(M,P=>{var L;ot((L=r.unref(k))==null?void 0:L.getBoundingClientRect(),z=>{const{dx:A}=P;l.deltaValue=A/z.width*c.value,p.value=C(vt((s.modelValue??0)+l.deltaValue,s.min,s.max)),P.stop&&(i("update:modelValue",C(u.value)),l.deltaValue=0)})});function G(P){i("update:modelValue",C(P))}function X(P){G(+P.target.value)}function O(P){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(P.code)&&P.preventDefault();const L=P.code==="ArrowUp"||P.code==="ArrowRight"?s.step*1:P.code==="ArrowDown"||P.code==="ArrowLeft"?s.step*-1:0;G(s.modelValue+L)}return(P,L)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",hk,[r.createElementVNode("div",fk,[P.label?(r.openBlock(),r.createElementBlock("label",mk,[r.createElementVNode("span",null,r.toDisplayString(P.label),1),L[1]||(L[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(P.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),L[2]||(L[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",gk,r.toDisplayString(p.value)+r.toDisplayString(P.measure),1)):r.createCommentVNode("",!0)]),L[6]||(L[6]=r.createTextVNode()),r.createElementVNode("div",yk,[r.createElementVNode("div",vk,[r.createElementVNode("div",{ref_key:"barRef",ref:k,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(S.value)},null,4)],512)]),L[5]||(L[5]=r.createTextVNode()),r.createElementVNode("div",_k,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(z,A)=>(r.openBlock(),r.createElementBlock("div",{key:A,style:r.normalizeStyle({right:`${z}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),L[4]||(L[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:M,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(D.value),onKeydown:O},L[3]||(L[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),L[7]||(L[7]=r.createTextVNode()),r.createElementVNode("div",Ck,[s.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:L[0]||(L[0]=z=>X(z))},null,40,wk)):r.createCommentVNode("",!0)])],2),L[8]||(L[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",bk,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function xk(t,e=null,n=null){function i(u){const{scrollTop:p,scrollHeight:f,clientHeight:m}=u;if(!(f>m)||!e)return null;const y=f-p-m,T=p>e?e:0,S=y>e?m-e-T:m;return`linear-gradient(
52
52
  to bottom,
53
53
  transparent,
54
- black ${k}px,
54
+ black ${T}px,
55
55
  black ${S}px,
56
56
  transparent 100%
57
- )`}function s(u){const{scrollLeft:p,scrollWidth:f,clientWidth:m}=u;if(!(f>m)||!n)return null;const y=f-p-m,k=p>n?n:0,S=y>n?m-n-k:m;return`linear-gradient(
57
+ )`}function s(u){const{scrollLeft:p,scrollWidth:f,clientWidth:m}=u;if(!(f>m)||!n)return null;const y=f-p-m,T=p>n?n:0,S=y>n?m-n-T:m;return`linear-gradient(
58
58
  to right,
59
59
  transparent,
60
- black ${k}px,
60
+ black ${T}px,
61
61
  black ${S}px,
62
62
  transparent 100%
63
- )`}function l(){const u=t.value;if(!u)return;const p=[i(u),s(u)].filter(f=>f!==null);u.style.setProperty("-webkit-mask-image",p.join(",")),u.style.setProperty("mask-image",p.join(",")),p.length>1&&(u.style.setProperty("-webkit-mask-composite","source-in"),u.style.setProperty("mask-composite","source-in"))}const c=ol(l);r.onMounted(l),tt(window,"scroll",c,!0),tt(window,"resize",c,!0)}function Yu(t,e){_u(()=>{ot(r.unref(t),n=>{Cu(n,()=>e(n))})}),r.onUnmounted(()=>{ot(r.unref(t),n=>{wu(n)})})}const mr={item:"sortable__item",animate:"sortable__animate"},Ao=t=>t.getBoundingClientRect().y,Ju=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},kk=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function Sk(t,e){const n={item:void 0,options(){var S;return[...((S=t.value)==null?void 0:S.children)??[]]}},i=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function c(S){const M=e.handle?this.querySelector(e.handle):null;M&&!M.contains(S.target)||(this.classList.remove(mr.animate),this.classList.add(mr.item),n.item={el:this,y:S.y,dy:0,orderChanged:!1})}function u(S){const M=n.options();return M.slice(0,M.indexOf(S))}function p(S){const M=n.options();return M.slice(M.indexOf(S)+1)}function f(S,M){const T=n.options().filter(C=>C!==M),R=T.indexOf(S);return T.splice(R,0,M),T}function m(S,M){const T=n.options().filter(C=>C!==M),R=T.indexOf(S);return T.splice(R+1,0,M),T}function y(S,M){S.dy=M-S.y,S.el.style.setProperty("transform",`translateY(${S.dy}px)`)}function k(S){var M;if(!n.item)return;const{el:T}=n.item;if(!T.isConnected){n.item=void 0;return}const R=S.map(O=>Ao(O)),C=Ao(T);(M=t.value)==null||M.replaceChildren(...S);const G=Ao(T),X=S.map(O=>Ao(O)),L=[];for(let O=0;O<X.length;O++){const z=S[O];if(z===n.item.el)continue;const N=X[O],E=R[O]-N;z.style.transform=`translateY(${E}px)`,L.push(z)}const P=G-C;n.item.y=n.item.y+P,n.item.dy=n.item.dy-P,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),L.forEach(O=>O.classList.remove(mr.animate)),requestAnimationFrame(function(){L.forEach(O=>{O.classList.add(mr.animate),O.style.transform="",O.addEventListener("transitionend",()=>{O.classList.remove(mr.animate)})})})}tt(window,"mousemove",S=>{if(!n.item)return;const{el:M}=n.item;y(n.item,S.y);const T=Ao(n.item.el),R=kk(n.item.el),C=u(M),G=p(M);C.forEach(X=>{const L=Ju(X);T+s<L&&k(f(X,M))}),G.forEach(X=>{const L=Ju(X);R-s>L&&k(m(X,M))})}),tt(window,"mouseup",()=>{if(!n.item)return;const{el:S,orderChanged:M}=n.item;S.classList.add(mr.animate),S.style.removeProperty("transform"),S.addEventListener("transitionend",()=>{S.classList.remove(mr.animate,mr.item)}),setTimeout(()=>{if(!M)return;const T=n.options().map(C=>Number(C.getAttribute("data-index"))),R=t.value;if(R){for(const C of n.options())R.removeChild(C);i.value.forEach(C=>{R.appendChild(C)})}e.onChange(T)},l),n.item=void 0}),r.watchEffect(()=>{i.value.forEach((S,M)=>{S.removeEventListener("mousedown",c),S.addEventListener("mousedown",c),S.setAttribute("data-index",String(M))})})}function Ek(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function Tk(t,e,n){const i=r.reactive({data:Qa.deepClone(e(t.value)),changed:!1});return r.watch(()=>i.data,s=>{i.changed?n(Qa.deepClone(s)):i.changed=!0},{deep:!0}),r.watch(t,s=>{Object.assign(i,{data:Qa.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),i}function Bk(t){const e=r.reactive({isLoading:!1,result:void 0,error:void 0,async run(...n){this.isLoading=!0,this.error=void 0;try{this.result=await t(...n)}catch(i){this.error=i}finally{this.isLoading=!1}},debounce(n,i=1e3){return Qd(()=>{const s=n();this.run(...s).catch(console.error)},i)}});return e.run=e.run.bind(e),e}function Ak(t,e){function n(c,u){const p=r.unref(t);if(!p)return;const f=`translate(${u.x-c.x}px, ${u.y-c.y}px)`;p.style.setProperty("transform",f),e(u)}function i(c){const u=p=>n(c,p);document.addEventListener("mousemove",u),document.addEventListener("mouseup",()=>{const p=r.unref(t);document.removeEventListener("mousemove",u),p&&(p.style.setProperty("transition","all .3s ease-in-out"),p.style.removeProperty("transform"),p.addEventListener("transitionend",()=>{p.style.removeProperty("transition")}))},{once:!0})}function s(){var c;(c=r.unref(t))==null||c.addEventListener("mousedown",i)}function l(){var c;(c=r.unref(t))==null||c.removeEventListener("mousedown",i)}r.onMounted(s),r.onUnmounted(l)}const Nk={class:"ui-slider__wrapper"},Vk={class:"ui-slider__label-section"},Pk={key:0,class:"text-s"},Dk={class:"ui-slider__base"},Fk={class:"ui-slider__container"},Rk={class:"ui-slider__container ui-slider__container-thumb"},Mk=["data-percent"],Ik=["data-percent"],Ok=["data-percent"],Lk={key:0,class:"ui-slider__error"},Gk=r.defineComponent({__name:"SliderRangeTriple",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:"%"},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.computed(()=>s.max-s.min),y=r.computed(()=>s),k=Tl(y),S=r.computed(()=>vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),M=r.computed(()=>vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),T=r.computed(()=>vt((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),R=r.computed(()=>{const Z=s.modelValue;if(!(Array.isArray(Z)&&Z.length===3&&Z.every(pe=>Number.isFinite(pe))))return"Expected model [number, number, number]";const J=[];return[...s.modelValue].forEach(pe=>{pe>s.max&&J.push(`Max model value must be lower than max props ${s.max}.`),pe<s.min&&J.push("Min model value must be greater than max props.")}),J.length>0?J.join(" "):s.error}),C=r.computed(()=>(S.value-s.min)/m.value),G=r.computed(()=>(M.value-s.min)/m.value),X=r.computed(()=>(T.value-s.min)/m.value),L=r.computed(()=>V()),P=r.computed(()=>({right:L.value[0]+"%",left:100-L.value[2]+"%"})),O=r.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),z=r.computed(()=>({right:Math.ceil((1-G.value)*100)+"%"})),N=r.computed(()=>({right:Math.ceil((1-X.value)*100)+"%"}));sr(u,Z=>{var J;ot((J=r.unref(c))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=Z;l.deltaValue1=we/pe.width*m.value,u.value&&E(u.value,s.modelValue[0],l.deltaValue1),Z.stop&&(q([W(S.value),W(M.value),W(T.value)]),l.deltaValue1=0)})}),sr(p,Z=>{var J;ot((J=r.unref(c))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=Z;l.deltaValue2=we/pe.width*m.value,p.value&&E(p.value,s.modelValue[1],l.deltaValue2),Z.stop&&(q([W(S.value),W(M.value),W(T.value)]),l.deltaValue2=0)})}),sr(f,Z=>{var J;ot((J=r.unref(c))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=Z;l.deltaValue3=we/pe.width*m.value,f.value&&E(f.value,s.modelValue[2],l.deltaValue3),Z.stop&&(q([W(S.value),W(M.value),W(T.value)]),l.deltaValue3=0)})});function E(Z,J,pe){const we=W(vt((J??0)+pe,s.min,s.max));Z.dataset.percent=`${we}${s.measure}`,$()}function V(){const Z=Math.ceil((1-C.value)*100),J=Math.ceil((1-G.value)*100),pe=Math.ceil((1-X.value)*100);return[Z,J,pe].sort((we,Ct)=>we-Ct)}function W(Z){const J=vt(Z,s.min,s.max);return Math.round((J+Number.EPSILON)*(1/s.step))/(1/s.step)}function q(Z){i("update:modelValue",Z)}function $(){const Z=Number(O.value.right.substring(0,O.value.right.length-1)),J=Number(z.value.right.substring(0,z.value.right.length-1)),pe=Number(N.value.right.substring(0,N.value.right.length-1)),we=[{r:Z,th:u},{r:J,th:p},{r:pe,th:f}].sort((Ct,Tt)=>Ct.r-Tt.r);we[0].th.value&&(we[0].th.value.dataset.hint="high"),we[1].th.value&&(we[1].th.value.dataset.hint="mid"),we[2].th.value&&(we[2].th.value.dataset.hint="low")}function A(Z,J){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(Z.code)&&Z.preventDefault();const pe=Z.code==="ArrowUp"||Z.code==="ArrowRight"?s.step*1:Z.code==="ArrowDown"||Z.code==="ArrowLeft"?s.step*-1:0,we=[...s.modelValue];we[J]=vt(we[J]+pe,s.min,s.max),q(we),$()}return r.onMounted(()=>{$()}),(Z,J)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",Nk,[r.createElementVNode("div",Vk,[Z.label?(r.openBlock(),r.createElementBlock("label",Pk,[r.createElementVNode("span",null,r.toDisplayString(Z.label),1),J[3]||(J[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(Z.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),J[11]||(J[11]=r.createTextVNode()),r.createElementVNode("div",Dk,[r.createElementVNode("div",Fk,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(P.value)},null,4)],512)]),J[10]||(J[10]=r.createTextVNode()),r.createElementVNode("div",Rk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(k),(pe,we)=>(r.openBlock(),r.createElementBlock("div",{key:we,style:r.normalizeStyle({right:`${pe}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),J[7]||(J[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(O.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:J[0]||(J[0]=pe=>A(pe,0))},J[4]||(J[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Mk),J[8]||(J[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(z.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:J[1]||(J[1]=pe=>A(pe,1))},J[5]||(J[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Ik),J[9]||(J[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(N.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:J[2]||(J[2]=pe=>A(pe,2))},J[6]||(J[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Ok)])])]),J[12]||(J[12]=r.createTextVNode()),J[13]||(J[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),J[14]||(J[14]=r.createTextVNode()),R.value?(r.openBlock(),r.createElementBlock("div",Lk,r.toDisplayString(R.value),1)):r.createCommentVNode("",!0)],2))}}),zk={class:"ui-input-range__separator"},Uk=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,i=e,s=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),c=r.computed(()=>(l.value,"ui-input-range-focused")),u=r.computed({get(){return{left:Math.min(...n.modelValue),right:Math.max(...n.modelValue)}},set(){}});r.watch(()=>u.value,m=>(s.left=m.left)&&(s.right=m.right));function p(){i("update:modelValue",[+s.left,+s.right]),i("change",[+s.left,+s.right])}function f(m,y){const k=y.target.value;/^[0-9]{0,2}$/.test(k)?m?s.left=+k:s.right=+k:m?s.left=+k.slice(0,k.length-1):s.right=+k.slice(0,k.length-1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[c.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=k=>u.value.left=k),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=k=>l.value=!0),onFocusout:y[2]||(y[2]=k=>l.value=!1),onInput:y[3]||(y[3]=k=>f(!0,k))},null,544),[[r.vModelText,u.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",zk,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=k=>u.value.right=k),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=k=>l.value=!0),onFocusout:y[6]||(y[6]=k=>l.value=!1),onInput:y[7]||(y[7]=k=>f(!1,k))},null,544),[[r.vModelText,u.value.right]])],16))}}),Zk={class:"ui-slider__wrapper"},$k={class:"ui-slider__label-section"},Wk={key:0,class:"text-s"},Hk={key:1,class:"ui-slider__value-static text-s"},jk={class:"ui-slider__base"},qk={class:"ui-slider__container"},Kk={class:"ui-slider__container ui-slider__container-thumb"},Yk={class:"ui-slider__input-wrapper d-flex"},Jk={key:0,class:"ui-slider__error"},Xk=r.defineComponent({__name:"SliderRange",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(s.modelValue),m=r.ref(s.modelValue[0]),y=r.ref(s.modelValue[1]),k=r.computed(()=>s),S=Tl(k),M=r.computed(()=>[m.value,y.value].sort(($,A)=>$-A).join("-")),T=r.computed(()=>s.max-s.min),R=r.computed(()=>vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),C=r.computed(()=>vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),G=r.computed(()=>{const $=s.modelValue;return Array.isArray($)&&$.length===2&&$.every(A=>Number.isFinite(A))?s.error:"Expected model [number, number]"}),X=r.computed(()=>(R.value-s.min)/T.value),L=r.computed(()=>(C.value-s.min)/T.value),P=r.computed(()=>E()),O=r.computed(()=>({right:P.value[0]+"%",left:100-P.value[1]+"%"})),z=r.computed(()=>({right:Math.ceil((1-X.value)*100)+"%"})),N=r.computed(()=>({right:Math.ceil((1-L.value)*100)+"%"}));r.watch(()=>s.modelValue,$=>{f.value=$,m.value=+$[0],y.value=+$[1]},{immediate:!0}),sr(u,$=>{var A;ot((A=r.unref(c))==null?void 0:A.getBoundingClientRect(),Z=>{const{dx:J}=$;l.deltaValue1=J/Z.width*T.value,m.value=V(vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,y.value].sort((pe,we)=>pe-we),$.stop&&(W([V(R.value),V(C.value)]),l.deltaValue1=0)})}),sr(p,$=>{var A;ot((A=r.unref(c))==null?void 0:A.getBoundingClientRect(),Z=>{const{dx:J}=$;l.deltaValue2=J/Z.width*T.value,y.value=V(vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,y.value].sort((pe,we)=>pe-we),$.stop&&(W([V(R.value),V(C.value)]),l.deltaValue2=0)})});function E(){const $=Math.ceil((1-X.value)*100),A=Math.ceil((1-L.value)*100);return[$,A].sort((Z,J)=>Z-J)}function V($){const A=vt($,s.min,s.max);return Math.round((A+Number.EPSILON)*(1/s.step))/(1/s.step)}function W($){i("update:modelValue",$)}function q($,A){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes($.code)&&$.preventDefault();const Z=$.code==="ArrowUp"||$.code==="ArrowRight"?s.step*1:$.code==="ArrowDown"||$.code==="ArrowLeft"?s.step*-1:0,J=[...s.modelValue];J[A]=vt(J[A]+Z,s.min,s.max),W(J)}return($,A)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",Zk,[r.createElementVNode("div",$k,[$.label?(r.openBlock(),r.createElementBlock("label",Wk,[r.createElementVNode("span",null,r.toDisplayString($.label),1),A[3]||(A[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Vt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot($.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),A[4]||(A[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",Hk,r.toDisplayString(M.value),1)):r.createCommentVNode("",!0)]),A[10]||(A[10]=r.createTextVNode()),r.createElementVNode("div",jk,[r.createElementVNode("div",qk,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(O.value)},null,4)],512)]),A[9]||(A[9]=r.createTextVNode()),r.createElementVNode("div",Kk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(S),(Z,J)=>(r.openBlock(),r.createElementBlock("div",{key:J,style:r.normalizeStyle({right:`${Z}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),A[7]||(A[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(z.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:A[0]||(A[0]=Z=>q(Z,0))},A[5]||(A[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),A[8]||(A[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(N.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:A[1]||(A[1]=Z=>q(Z,1))},A[6]||(A[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),A[11]||(A[11]=r.createTextVNode()),r.createElementVNode("div",Yk,[s.mode==="input"?(r.openBlock(),r.createBlock(Uk,{key:0,modelValue:f.value,"onUpdate:modelValue":A[2]||(A[2]=Z=>f.value=Z),class:"ui-focused-border",onChange:W},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),A[12]||(A[12]=r.createTextVNode()),G.value?(r.openBlock(),r.createElementBlock("div",Jk,r.toDisplayString(G.value),1)):r.createCommentVNode("",!0)],2))}}),Qk=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientHeight/(i.scrollHeight||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{top:i.scrollTop*p+"px",height:Math.floor(i.clientHeight*p)+"px"}});return tt(s,"pointerdown",p=>{const f={clientY:p.clientY},m=ml(document,"mousemove",y=>{const k=(y.clientY-f.clientY)/l.value;n("update:scrollTop",i.scrollTop+k),f.clientY=y.clientY});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,f)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"v-scroll"},[r.createElementVNode("div",{class:"v-scroll__scrollbar",style:r.normalizeStyle(u.value)},null,4)],512)):r.createCommentVNode("",!0)}}),eS=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientWidth/(i.scrollWidth||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{left:i.scrollLeft*p+"px",width:Math.floor(i.clientWidth*p)+"px"}});return tt(s,"pointerdown",p=>{const f={clientX:p.clientX},m=ml(document,"mousemove",y=>{const k=(y.clientX-f.clientX)/l.value;n("update:scrollLeft",i.scrollLeft+k),f.clientX=y.clientX});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,f)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"h-scroll"},[r.createElementVNode("div",{class:"h-scroll__scrollbar",style:r.normalizeStyle(u.value)},null,4)],512)):r.createCommentVNode("",!0)}}),tS={class:"ui-scrollable"},nS=r.defineComponent({__name:"Scrollable",setup(t){const e=r.ref(),n=r.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function i(u){IC(n,u,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const s=u=>{u.preventDefault();const p=u.currentTarget;p.scrollTop+=u.deltaY,p.scrollLeft+=u.deltaX,i(p)};function l(u){ot(r.unref(e),p=>{p.scrollTop=u,i(p)})}function c(u){ot(r.unref(e),p=>{p.scrollLeft=u,i(p)})}return Yu(e,u=>{ot(u,p=>i(p))}),r.onMounted(()=>{ot(r.unref(e),u=>{i(u),u.addEventListener("wheel",s)})}),r.onUnmounted(()=>{ot(r.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(r.openBlock(),r.createElementBlock("div",tS,[r.createElementVNode("div",{ref_key:"containerRef",ref:e,class:"ui-scrollable__container",onWheel:s},[r.renderSlot(u.$slots,"default")],544),p[2]||(p[2]=r.createTextVNode()),r.createVNode(Qk,{"scroll-top":n.scrollTop,"client-height":n.clientHeight,"scroll-height":n.scrollHeight,onWheel:p[0]||(p[0]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollTop":l},null,8,["scroll-top","client-height","scroll-height"]),p[3]||(p[3]=r.createTextVNode()),r.createVNode(eS,{"scroll-left":n.scrollLeft,"client-width":n.clientWidth,"scroll-width":n.scrollWidth,onWheel:p[1]||(p[1]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":c},null,8,["scroll-left","client-width","scroll-width"])]))}}),rS="add.svg",iS="box.svg",oS="calendar.svg",sS="checkmark.svg",aS="clipboard.svg",lS="close.svg",cS="copy.svg",dS="download.svg",uS="duplicate.svg",pS="edit.svg",hS="error.svg",fS="filter.svg",mS="help.svg",gS="info.svg",yS="link.svg",vS="loading.svg",_S="lock.svg",CS="maximize.svg",wS="minimize.svg",bS="minus.svg",xS="more.svg",kS="open.svg",SS="pause.svg",ES="play.svg",TS="renew.svg",BS="restart.svg",AS="reverse.svg",NS="settings.svg",VS="sort.svg",PS="stop.svg",DS="success.svg",FS="time.svg",RS="tune.svg",MS="warning.svg",IS="zip.svg",OS={add:rS,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",box:iS,calendar:oS,"caret-down":"caret-down.svg","caret-left":"caret-left.svg","caret-right":"caret-right.svg","caret-up":"caret-up.svg","cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg",checkmark:sS,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:aS,close:lS,copy:cS,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:dS,"drag-dots":"drag-dots.svg",duplicate:uS,edit:pS,error:hS,export:"export.svg","filter-on":"filter-on.svg",filter:fS,"help-outline":"help-outline.svg",help:mS,"info-outline":"info-outline.svg",info:gS,"jump-link":"jump-link.svg",link:yS,loading:vS,lock:_S,maximize:CS,minimize:wS,minus:bS,more:xS,open:kS,"paper-clip":"paper-clip.svg",pause:SS,play:ES,renew:TS,restart:BS,reverse:AS,settings:NS,sort:VS,stop:PS,success:DS,time:FS,tune:RS,warning:MS,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:IS},LS="add.svg",GS="annotate.svg",zS="annotation.svg",US="area.svg",ZS="axes.svg",$S="bar.svg",WS="bindot.svg",HS="box.svg",jS="boxplot.svg",qS="bubble.svg",KS="calendar.svg",YS="canvas.svg",JS="checkbox.svg",XS="checkmark.svg",QS="clipboard.svg",e1="close.svg",t1="cluster.svg",n1="code.svg",r1="color.svg",i1="columns.svg",o1="container.svg",s1="cookie.svg",a1="copy.svg",l1="cpu.svg",c1="debug.svg",d1="dna.svg",u1="download.svg",p1="duplicate.svg",h1="edit.svg",f1="error.svg",m1="filter.svg",g1="generate.svg",y1="graph.svg",v1="heatmap.svg",_1="help.svg",C1="info.svg",w1="jitter.svg",b1="lasso.svg",x1="layers.svg",k1="learn.svg",S1="legend.svg",E1="line.svg",T1="link.svg",B1="loading.svg",A1="lock.svg",N1="maximize.svg",V1="menu.svg",P1="minimize.svg",D1="minus.svg",F1="more.svg",R1="pause.svg",M1="pin.svg",I1="play.svg",O1="product.svg",L1="publications.svg",G1="renew.svg",z1="restart.svg",U1="reverse.svg",Z1="search.svg",$1="server.svg",W1="settings.svg",H1="sina.svg",j1="skatterplot.svg",q1="slice.svg",K1="sort.svg",Y1="statistics.svg",J1="stop.svg",X1="success.svg",Q1="table.svg",eE="template.svg",tE="terminal.svg",nE="time.svg",rE="tune.svg",iE="venn.svg",oE="violin.svg",sE="warning.svg",aE="wetlab.svg",lE="zip.svg",cE={"add-layer":"add-layer.svg",add:LS,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:GS,annotation:zS,area:US,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",axes:ZS,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:$S,bindot:WS,box:HS,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:jS,bubble:qS,calendar:KS,canvas:YS,"cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg","checkbox-checked":"checkbox-checked.svg","checkbox-intermediate":"checkbox-intermediate.svg",checkbox:JS,checkmark:XS,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-sort":"chevron-sort.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:QS,close:e1,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:t1,code:n1,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:r1,columns:i1,"connected-points":"connected-points.svg",container:o1,cookie:s1,copy:a1,cpu:l1,"data-dimentions":"data-dimentions.svg",debug:c1,"delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg","dendrogram-X-line":"dendrogram-X-line.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-line":"dendrogram-Y-line.svg","dendrogram-Y":"dendrogram-Y.svg","dna-add":"dna-add.svg","dna-import":"dna-import.svg",dna:d1,download:u1,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:p1,edit:h1,"error-bar":"error-bar.svg",error:f1,"expand-left":"expand-left.svg","expand-right":"expand-right.svg",export:"export.svg","file-doc-add":"file-doc-add.svg","file-doc-download":"file-doc-download.svg","file-doc-import":"file-doc-import.svg","file-doc":"file-doc.svg","filter-on":"filter-on.svg",filter:m1,"fire-tips":"fire-tips.svg","folder-parent":"folder-parent.svg","frame-type-all":"frame-type-all.svg","frame-type-bottom":"frame-type-bottom.svg","frame-type-left-bottom":"frame-type-left-bottom.svg","frame-type-left":"frame-type-left.svg","frame-type-none":"frame-type-none.svg",generate:g1,graph:y1,heatmap:v1,"help-outline":"help-outline.svg",help:_1,"info-outline":"info-outline.svg",info:C1,jitter:w1,"jump-link":"jump-link.svg",lasso:b1,layers:x1,learn:k1,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:S1,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:E1,"linetype-dashed":"linetype-dashed.svg","linetype-dotdash":"linetype-dotdash.svg","linetype-dotted":"linetype-dotted.svg","linetype-longdash":"linetype-longdash.svg","linetype-solid":"linetype-solid.svg","linetype-twodash":"linetype-twodash.svg","link-disabled":"link-disabled.svg",link:T1,loading:B1,lock:A1,maximize:N1,menu:V1,minimize:P1,minus:D1,more:F1,"paper-clip":"paper-clip.svg",pause:R1,pin:M1,play:I1,"position-bottom-annotation":"position-bottom-annotation.svg","position-bottom":"position-bottom.svg","position-left-annotation":"position-left-annotation.svg","position-left":"position-left.svg","position-right-annotation":"position-right-annotation.svg","position-right":"position-right.svg","position-top-annotation":"position-top-annotation.svg","position-top":"position-top.svg",product:O1,publications:L1,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:G1,restart:z1,reverse:U1,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:Z1,"server-on":"server-on.svg",server:$1,settings:W1,sina:H1,skatterplot:j1,slice:q1,"social-github":"social-github.svg","social-linkedin":"social-linkedin.svg","social-twitter-X":"social-twitter-X.svg","social-twitter-bird":"social-twitter-bird.svg","social-youtube":"social-youtube.svg","sort-list-down":"sort-list-down.svg","sort-list-up":"sort-list-up.svg",sort:K1,statistics:Y1,stop:J1,"strip-plot":"strip-plot.svg",success:X1,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:Q1,template:eE,terminal:tE,"text-align-center":"text-align-center.svg","text-align-left":"text-align-left.svg","text-align-right":"text-align-right.svg","theme-dark":"theme-dark.svg","theme-light":"theme-light.svg",time:nE,tune:rE,venn:iE,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:oE,warning:sE,wetlab:aE,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:lE,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function dE(){return{txtSec:{title:"Text",data:{"--txt-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Text on the colored elements"},"--txt-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary text layer"},"--txt-02":{light:[!0,!1],value:["#231842","#ADAEB8"],description:"Secondary text layer - large arrays of text"},"--txt-03":{light:[!0,!0],value:["#9D9EAE","#60616B"],description:"Tetritary text layer - hints and descriptions"},"--txt-mask":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Text mask in inputs, icons, etc."},"--txt-focus":{light:[!0,!0],value:["#07AD3E","#87E087"],description:"Colored text in active/focus elements"},"--txt-error":{light:[!0,!0],value:["#F1222F","#FF5C5C"],description:"Colored text in error elements"},"--txt-link":{light:[!0,!0],value:["#5F31CC","#9470FF"],description:"Colored text in links"}}},iconSec:{title:"Icon",data:{"--ic-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Icons on colored elements"},"--ic-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary elements"},"--ic-02":{light:[!1,!0],value:["#CFD1DB","#60616B"],description:"Secondary & tetritary elements"},"--ic-accent":{light:[!0,!1],value:["#07AD3E","#87E087"],description:"Focus/active elements"}}},borderSec:{title:"Border",data:{"--border-color-default":{light:[!0,!0],value:["#110529","#60616B"],description:"Main border for components"},"--border-color-hover":{light:[!0,!0],value:["#231842","#ADAEB8"],description:"Hover on main border"},"--border-color-focus":{light:[!1,!1],value:["#49CC49","#49CC49"],description:"Active border for components"},"--border-color-error":{light:[!1,!1],value:["#FF5C5C","#FF5C5C"],description:"Error border for components"},"--border-color-div-grey":{light:[!1,!0],value:["#E1E3EB","#232329"],description:"Divider lines low contrast"},"--border-color-div-bw":{light:[!1,!0],value:["#FFFFFF","#000000"],description:"Divider lines hight contrast"}}},btnSec:{title:"Button",data:{"--btn-accent-default":{light:[!0,!0],value:["#845CFF"," #5F31CC"],description:"Accent coloured button"},"--btn-accent-hover":{light:[!0,!0],value:["#9470FF"," #5F31CC"],description:"Hover on accent coloured button"},"--btn-accent-press":{light:[!0,!0],value:["#6F4DD6","#5F31CC"],description:"Pressed on accent coloured button"},"--btn-primary-default":{light:[!0,!0],value:["#110529","#5F31CC"],description:"Primary button"},"--btn-primary-hover":{light:[!0,!0],value:["#231842","#6D3DDB"],description:"Hover on primary button"},"--btn-primary-press":{light:[!0,!0],value:["#080214","#5328B8"],description:"Hover on primary button"},"--btn-sec-hover-white":{light:[!1,!0],value:["rgba(255, 255, 255, 0.50)","rgba(131, 131, 163, 0.16)"],description:"Hover background on transparent button"},"--btn-sec-hover-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.16)","rgba(131, 131, 163, 0.16)"],description:"Hover background on ghost button & icons"},"--btn-sec-press-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.24)","rgba(131, 131, 163, 0.24)"],description:"Hover background on ghost button & icons"},"--btn-active-select":{light:[!1,!0],value:["rgba(99, 224, 36, 0.24)","rgba(99, 224, 36, 0.24)"],description:"Fill on selected elements"},"--btn-switcher":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","#5E5E70"],description:"Gradient on active controll/switcher element"}}},disSec:{title:"Disable",data:{"--dis-00":{light:[!1,!0],value:["#FFFFFF","#65656B"],description:"Elements on dis-01, labels, texts, icons"},"--dis-01":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Buttons, borders, labels, texts, icons"}}},bgSec:{title:"Background",data:{"--bg-base-dark":{light:[!0,!0],value:["#110529","#0D0D0F"],description:"Default dark block background"},"--bg-base-light":{light:[!1,!0],value:["#F7F8FA","#0D0D0F"],description:"Default light block background"},"--bg-elevated-01":{light:[!1,!0],value:["#FFFFFF","#1B1B1F"],description:"Default block background"},"--bg-elevated-02":{light:[!1,!0],value:["#E1E3EB","#2D2D33"],description:"Secondary block background"}}},filledSec:{title:"Filled",data:{"--filled-V-BG":{light:[!1,!0],value:["#D0F0C0","rgba(66, 184, 66, 0.40)"],description:"Text background selection on V-read"},"--filled-D-BG":{light:[!1,!0],value:["#FFCECC","rgba(229, 83, 229, 0.40)"],description:"Text background selection on D-read"},"--filled-N-BG":{light:[!1,!0],value:["#FAF5AA","rgba(83, 82, 102, 0.40)"],description:"Text background selection on C/N-read"},"--filled-J-BG":{light:[!1,!0],value:["#DEDBFF","rgba(132, 92, 255, 0.40)"],description:"Text background selection on J-read"}}},notificationSec:{title:"Notification",data:{"--notification-neutral":{light:[!1,!0],value:["linear-gradient(90deg, #D6D9FF 0%, #FFF 100%)","linear-gradient(90deg, #4D4D8F 0%, #292933 100%)"],description:"Background on neutral blocks"},"--notification-success":{light:[!1,!0],value:["linear-gradient(90deg, #C9F0B6 0%, #FFF 100%)","linear-gradient(90deg, #305C3E 0%, #292933 100%)"],description:"Background on success blocks"},"--notification-warning":{light:[!1,!0],value:["linear-gradient(90deg, #FEE0A3 0%, #FFF 100%)","linear-gradient(90deg, #754F2D 0%, #292933 100%)"],description:"Background on warning blocks"},"--notification-error":{light:[!1,!0],value:["linear-gradient(90deg, #FFB8B8 0%, #FFF 100%)","linear-gradient(90deg, #8F3343 0%, #292933 100%)"],description:"Background on error blocks"}}},gradientSec:{title:"Gradient",data:{"--gradient-blue-green":{light:[!0,!0],value:["linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand dark gradient"},"--gradient-green-lime":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-violet":{light:[!1,!0],value:["linear-gradient(180deg, #ADB8FF 0%, #D6E9FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-clear":{light:[!1,!0],value:["linear-gradient(180deg, #85BEFF 0%, #CEF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-orange":{light:[!1,!0],value:["linear-gradient(180deg, #FFB766 0%, #FFEAA3 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-mint":{light:[!1,!0],value:["linear-gradient(180deg, #7DD1D1 0%, #C8FAE9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-lime":{light:[!1,!0],value:["linear-gradient(180deg, #BFE062 0%, #E4FFAD 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-rose":{light:[!1,!0],value:["linear-gradient(0deg, #FFDDD6 0%, #FF99C9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-red":{light:[!1,!0],value:["linear-gradient(0deg, #FFD5CC 0%, #FF9494 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-violet":{light:[!1,!0],value:["linear-gradient(180deg, #BCA3FF 0%, #E5E5FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"}}}}}const uE=["add","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","box","calendar","caret-down","caret-left","caret-right","caret-up","cell-type-num","cell-type-txt","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-up","clipboard-copied","clipboard","close","copy","data-dimentions","delete-bin","delete-circle","delete-clear","download","drag-dots","duplicate","edit","error","export","filter-on","filter","help-outline","help","info-outline","info","jump-link","link","loading","lock","maximize","minimize","minus","more","open","paper-clip","pause","play","renew","restart","reverse","settings","sort","stop","success","time","tune","warning","x-axis","y-axis","zip"],pE=["add-layer","add","align-center","align-left","align-right","annotate","annotation","area","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","axes","bar-cross","bar-error","bar-stacked","bar-trend","bar","bindot","box","boxplot-binned","boxplot-jitter","boxplot-notched","boxplot","bubble","calendar","canvas","cell-type-num","cell-type-txt","checkbox-checked","checkbox-intermediate","checkbox","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-sort","chevron-up","clipboard-copied","clipboard","close","cloud-download","cloud-offline","cloud-online","cloud-upload","cluster","code","color-fill","color-none","color-stroke","color","columns","connected-points","container","cookie","copy","cpu","data-dimentions","debug","delete-bin","delete-circle","delete-clear","dendrogram-X-line","dendrogram-X","dendrogram-Y-line","dendrogram-Y","dna-add","dna-import","dna","download","drag-dots","drag-horizontal","drag-vertical","duplicate","edit","error-bar","error","expand-left","expand-right","export","file-doc-add","file-doc-download","file-doc-import","file-doc","filter-on","filter","fire-tips","folder-parent","frame-type-all","frame-type-bottom","frame-type-left-bottom","frame-type-left","frame-type-none","generate","graph","heatmap","help-outline","help","info-outline","info","jitter","jump-link","lasso","layers","learn","legend-box-dot","legend-box","legend","line-binned","line-error","line-jitter","line","linetype-dashed","linetype-dotdash","linetype-dotted","linetype-longdash","linetype-solid","linetype-twodash","link-disabled","link","loading","lock","maximize","menu","minimize","minus","more","paper-clip","pause","pin","play","position-bottom-annotation","position-bottom","position-left-annotation","position-left","position-right-annotation","position-right","position-top-annotation","position-top","product","publications","radio-button-checked","radio-button","renew","restart","reverse","rotation-0","rotation-45","rotation-90","search","server-on","server","settings","sina","skatterplot","slice","social-github","social-linkedin","social-twitter-X","social-twitter-bird","social-youtube","sort-list-down","sort-list-up","sort","statistics","stop","strip-plot","success","table-add","table-alias","table-import","table","template","terminal","text-align-center","text-align-left","text-align-right","theme-dark","theme-light","time","tune","venn","view-hide","view-show","violin-binned","violin-jitter","violin","warning","wetlab","windows-collapse","windows-expand","x-axis","y-axis","zip","zoom-in","zoom-out"],hE={allCssVariables:dE(),icons16:OS,icons24:cE},fE={class:"block__not-found"},mE=r.defineComponent({__name:"NotFound",setup(t){const n=Xa().useApp(),i=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",fE,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(dl),{onClick:r.withModifiers(i,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),Ts=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},gE={},yE={class:"block__loader-page"};function vE(t,e){return r.openBlock(),r.createElementBlock("div",yE,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const _E=Ts(gE,[["render",vE]]),CE={class:"pl-app-notification-alert"},wE={class:"pl-app-notification-alert__content"},bE={class:"pl-app-notification-alert__title"},xE={class:"pl-app-notification-alert__error-description"},kE=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),i=r.ref(!0),s=r.computed(()=>Object.entries(e.errors).filter(u=>!!u[1]));function l(){n.value=!0}function c(u){navigator.clipboard&&navigator.clipboard.writeText(JSON.stringify(u))}return r.watch(()=>e.errors,u=>{i.value=Object.values(u).some(p=>!!p)},{immediate:!0,deep:!0}),(u,p)=>(r.openBlock(),r.createElementBlock("div",CE,[r.createVNode(r.unref(Cl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=f=>n.value=f),width:"50%",style:{"max-height":"100vh"}},{title:r.withCtx(()=>p[2]||(p[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",wE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>{var m;return r.openBlock(),r.createElementBlock("div",{key:f[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",bE,r.toDisplayString(f[0]),1),r.createElementVNode("div",xE,[r.createElementVNode("code",null,r.toDisplayString((m=f[1])==null?void 0:m.message),1),r.createVNode(r.unref(qu),{class:"pl-app-notification-alert__copy-icon",onCopyData:y=>c(f[1])},null,8,["onCopyData"])])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(ju),{modelValue:i.value,"onUpdate:modelValue":p[1]||(p[1]=f=>i.value=f),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(cl),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>p[3]||(p[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(yu))]),default:r.withCtx(()=>[p[4]||(p[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),SE={class:"block block__layout"},EE={key:0},TE=r.defineComponent({__name:"BlockLayout",setup(t){const e=Xa(),n=p=>{try{return new URL(p,"http://dummy").pathname}catch{console.error("Invalid href",p);return}},i=r.computed(()=>e.loaded?e.useApp().href:void 0),s=r.computed(()=>{if(e.loaded){const p=e.useApp(),f=n(p.snapshot.navigationState.href);return f?p.getRoute(f):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),c=r.computed(()=>l.value?l.value.model.outputErrors:{}),u=r.computed(()=>{var p;return((p=l.value)==null?void 0:p.showErrorsNotification)??!0});return(p,f)=>(r.openBlock(),r.createElementBlock("div",SE,[r.unref(e).error?(r.openBlock(),r.createElementBlock("div",EE,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value),{key:i.value})):(r.openBlock(),r.createBlock(mE,{key:3})):(r.openBlock(),r.createBlock(_E,{key:1},{default:r.withCtx(()=>f[0]||(f[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&u.value?(r.openBlock(),r.createBlock(r.unref(kE),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var Bs={exports:{}};/**
63
+ )`}function l(){const u=t.value;if(!u)return;const p=[i(u),s(u)].filter(f=>f!==null);u.style.setProperty("-webkit-mask-image",p.join(",")),u.style.setProperty("mask-image",p.join(",")),p.length>1&&(u.style.setProperty("-webkit-mask-composite","source-in"),u.style.setProperty("mask-composite","source-in"))}const c=ol(l);r.onMounted(l),tt(window,"scroll",c,!0),tt(window,"resize",c,!0)}function Yu(t,e){_u(()=>{ot(r.unref(t),n=>{Cu(n,()=>e(n))})}),r.onUnmounted(()=>{ot(r.unref(t),n=>{wu(n)})})}const mr={item:"sortable__item",animate:"sortable__animate"},No=t=>t.getBoundingClientRect().y,Ju=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},kk=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function Sk(t,e){const n={item:void 0,options(){var S;return[...((S=t.value)==null?void 0:S.children)??[]]}},i=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function c(S){const D=e.handle?this.querySelector(e.handle):null;D&&!D.contains(S.target)||(this.classList.remove(mr.animate),this.classList.add(mr.item),n.item={el:this,y:S.y,dy:0,orderChanged:!1})}function u(S){const D=n.options();return D.slice(0,D.indexOf(S))}function p(S){const D=n.options();return D.slice(D.indexOf(S)+1)}function f(S,D){const k=n.options().filter(C=>C!==D),M=k.indexOf(S);return k.splice(M,0,D),k}function m(S,D){const k=n.options().filter(C=>C!==D),M=k.indexOf(S);return k.splice(M+1,0,D),k}function y(S,D){S.dy=D-S.y,S.el.style.setProperty("transform",`translateY(${S.dy}px)`)}function T(S){var D;if(!n.item)return;const{el:k}=n.item;if(!k.isConnected){n.item=void 0;return}const M=S.map(L=>No(L)),C=No(k);(D=t.value)==null||D.replaceChildren(...S);const G=No(k),X=S.map(L=>No(L)),O=[];for(let L=0;L<X.length;L++){const z=S[L];if(z===n.item.el)continue;const A=X[L],E=M[L]-A;z.style.transform=`translateY(${E}px)`,O.push(z)}const P=G-C;n.item.y=n.item.y+P,n.item.dy=n.item.dy-P,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),O.forEach(L=>L.classList.remove(mr.animate)),requestAnimationFrame(function(){O.forEach(L=>{L.classList.add(mr.animate),L.style.transform="",L.addEventListener("transitionend",()=>{L.classList.remove(mr.animate)})})})}tt(window,"mousemove",S=>{if(!n.item)return;const{el:D}=n.item;y(n.item,S.y);const k=No(n.item.el),M=kk(n.item.el),C=u(D),G=p(D);C.forEach(X=>{const O=Ju(X);k+s<O&&T(f(X,D))}),G.forEach(X=>{const O=Ju(X);M-s>O&&T(m(X,D))})}),tt(window,"mouseup",()=>{if(!n.item)return;const{el:S,orderChanged:D}=n.item;S.classList.add(mr.animate),S.style.removeProperty("transform"),S.addEventListener("transitionend",()=>{S.classList.remove(mr.animate,mr.item)}),setTimeout(()=>{if(!D)return;const k=n.options().map(C=>Number(C.getAttribute("data-index"))),M=t.value;if(M){for(const C of n.options())M.removeChild(C);i.value.forEach(C=>{M.appendChild(C)})}e.onChange(k)},l),n.item=void 0}),r.watchEffect(()=>{i.value.forEach((S,D)=>{S.removeEventListener("mousedown",c),S.addEventListener("mousedown",c),S.setAttribute("data-index",String(D))})})}function Ek(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function Tk(t,e,n){const i=r.reactive({data:Qa.deepClone(e(t.value)),changed:!1});return r.watch(()=>i.data,s=>{i.changed?n(Qa.deepClone(s)):i.changed=!0},{deep:!0}),r.watch(t,s=>{Object.assign(i,{data:Qa.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),i}function Bk(t){const e=r.reactive({isLoading:!1,result:void 0,error:void 0,async run(...n){this.isLoading=!0,this.error=void 0;try{this.result=await t(...n)}catch(i){this.error=i}finally{this.isLoading=!1}},debounce(n,i=1e3){return Qd(()=>{const s=n();this.run(...s).catch(console.error)},i)}});return e.run=e.run.bind(e),e}function Nk(t,e){function n(c,u){const p=r.unref(t);if(!p)return;const f=`translate(${u.x-c.x}px, ${u.y-c.y}px)`;p.style.setProperty("transform",f),e(u)}function i(c){const u=p=>n(c,p);document.addEventListener("mousemove",u),document.addEventListener("mouseup",()=>{const p=r.unref(t);document.removeEventListener("mousemove",u),p&&(p.style.setProperty("transition","all .3s ease-in-out"),p.style.removeProperty("transform"),p.addEventListener("transitionend",()=>{p.style.removeProperty("transition")}))},{once:!0})}function s(){var c;(c=r.unref(t))==null||c.addEventListener("mousedown",i)}function l(){var c;(c=r.unref(t))==null||c.removeEventListener("mousedown",i)}r.onMounted(s),r.onUnmounted(l)}const Ak={class:"ui-slider__wrapper"},Vk={class:"ui-slider__label-section"},Pk={key:0,class:"text-s"},Dk={class:"ui-slider__base"},Fk={class:"ui-slider__container"},Rk={class:"ui-slider__container ui-slider__container-thumb"},Mk=["data-percent"],Ik=["data-percent"],Lk=["data-percent"],Ok={key:0,class:"ui-slider__error"},Gk=r.defineComponent({__name:"SliderRangeTriple",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:"%"},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.computed(()=>s.max-s.min),y=r.computed(()=>s),T=Tl(y),S=r.computed(()=>vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),D=r.computed(()=>vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),k=r.computed(()=>vt((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),M=r.computed(()=>{const U=s.modelValue;if(!(Array.isArray(U)&&U.length===3&&U.every(pe=>Number.isFinite(pe))))return"Expected model [number, number, number]";const J=[];return[...s.modelValue].forEach(pe=>{pe>s.max&&J.push(`Max model value must be lower than max props ${s.max}.`),pe<s.min&&J.push("Min model value must be greater than max props.")}),J.length>0?J.join(" "):s.error}),C=r.computed(()=>(S.value-s.min)/m.value),G=r.computed(()=>(D.value-s.min)/m.value),X=r.computed(()=>(k.value-s.min)/m.value),O=r.computed(()=>V()),P=r.computed(()=>({right:O.value[0]+"%",left:100-O.value[2]+"%"})),L=r.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),z=r.computed(()=>({right:Math.ceil((1-G.value)*100)+"%"})),A=r.computed(()=>({right:Math.ceil((1-X.value)*100)+"%"}));sr(u,U=>{var J;ot((J=r.unref(c))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=U;l.deltaValue1=we/pe.width*m.value,u.value&&E(u.value,s.modelValue[0],l.deltaValue1),U.stop&&(q([W(S.value),W(D.value),W(k.value)]),l.deltaValue1=0)})}),sr(p,U=>{var J;ot((J=r.unref(c))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=U;l.deltaValue2=we/pe.width*m.value,p.value&&E(p.value,s.modelValue[1],l.deltaValue2),U.stop&&(q([W(S.value),W(D.value),W(k.value)]),l.deltaValue2=0)})}),sr(f,U=>{var J;ot((J=r.unref(c))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=U;l.deltaValue3=we/pe.width*m.value,f.value&&E(f.value,s.modelValue[2],l.deltaValue3),U.stop&&(q([W(S.value),W(D.value),W(k.value)]),l.deltaValue3=0)})});function E(U,J,pe){const we=W(vt((J??0)+pe,s.min,s.max));U.dataset.percent=`${we}${s.measure}`,Z()}function V(){const U=Math.ceil((1-C.value)*100),J=Math.ceil((1-G.value)*100),pe=Math.ceil((1-X.value)*100);return[U,J,pe].sort((we,Ct)=>we-Ct)}function W(U){const J=vt(U,s.min,s.max);return Math.round((J+Number.EPSILON)*(1/s.step))/(1/s.step)}function q(U){i("update:modelValue",U)}function Z(){const U=Number(L.value.right.substring(0,L.value.right.length-1)),J=Number(z.value.right.substring(0,z.value.right.length-1)),pe=Number(A.value.right.substring(0,A.value.right.length-1)),we=[{r:U,th:u},{r:J,th:p},{r:pe,th:f}].sort((Ct,Bt)=>Ct.r-Bt.r);we[0].th.value&&(we[0].th.value.dataset.hint="high"),we[1].th.value&&(we[1].th.value.dataset.hint="mid"),we[2].th.value&&(we[2].th.value.dataset.hint="low")}function N(U,J){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(U.code)&&U.preventDefault();const pe=U.code==="ArrowUp"||U.code==="ArrowRight"?s.step*1:U.code==="ArrowDown"||U.code==="ArrowLeft"?s.step*-1:0,we=[...s.modelValue];we[J]=vt(we[J]+pe,s.min,s.max),q(we),Z()}return r.onMounted(()=>{Z()}),(U,J)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",Ak,[r.createElementVNode("div",Vk,[U.label?(r.openBlock(),r.createElementBlock("label",Pk,[r.createElementVNode("span",null,r.toDisplayString(U.label),1),J[3]||(J[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(U.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),J[11]||(J[11]=r.createTextVNode()),r.createElementVNode("div",Dk,[r.createElementVNode("div",Fk,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(P.value)},null,4)],512)]),J[10]||(J[10]=r.createTextVNode()),r.createElementVNode("div",Rk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(T),(pe,we)=>(r.openBlock(),r.createElementBlock("div",{key:we,style:r.normalizeStyle({right:`${pe}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),J[7]||(J[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(L.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:J[0]||(J[0]=pe=>N(pe,0))},J[4]||(J[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Mk),J[8]||(J[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(z.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:J[1]||(J[1]=pe=>N(pe,1))},J[5]||(J[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Ik),J[9]||(J[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(A.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:J[2]||(J[2]=pe=>N(pe,2))},J[6]||(J[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Lk)])])]),J[12]||(J[12]=r.createTextVNode()),J[13]||(J[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),J[14]||(J[14]=r.createTextVNode()),M.value?(r.openBlock(),r.createElementBlock("div",Ok,r.toDisplayString(M.value),1)):r.createCommentVNode("",!0)],2))}}),zk={class:"ui-input-range__separator"},$k=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,i=e,s=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),c=r.computed(()=>(l.value,"ui-input-range-focused")),u=r.computed({get(){return{left:Math.min(...n.modelValue),right:Math.max(...n.modelValue)}},set(){}});r.watch(()=>u.value,m=>(s.left=m.left)&&(s.right=m.right));function p(){i("update:modelValue",[+s.left,+s.right]),i("change",[+s.left,+s.right])}function f(m,y){const T=y.target.value;/^[0-9]{0,2}$/.test(T)?m?s.left=+T:s.right=+T:m?s.left=+T.slice(0,T.length-1):s.right=+T.slice(0,T.length-1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[c.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=T=>u.value.left=T),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=T=>l.value=!0),onFocusout:y[2]||(y[2]=T=>l.value=!1),onInput:y[3]||(y[3]=T=>f(!0,T))},null,544),[[r.vModelText,u.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",zk,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=T=>u.value.right=T),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=T=>l.value=!0),onFocusout:y[6]||(y[6]=T=>l.value=!1),onInput:y[7]||(y[7]=T=>f(!1,T))},null,544),[[r.vModelText,u.value.right]])],16))}}),Uk={class:"ui-slider__wrapper"},Zk={class:"ui-slider__label-section"},Wk={key:0,class:"text-s"},Hk={key:1,class:"ui-slider__value-static text-s"},jk={class:"ui-slider__base"},qk={class:"ui-slider__container"},Kk={class:"ui-slider__container ui-slider__container-thumb"},Yk={class:"ui-slider__input-wrapper d-flex"},Jk={key:0,class:"ui-slider__error"},Xk=r.defineComponent({__name:"SliderRange",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),i=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(s.modelValue),m=r.ref(s.modelValue[0]),y=r.ref(s.modelValue[1]),T=r.computed(()=>s),S=Tl(T),D=r.computed(()=>[m.value,y.value].sort((Z,N)=>Z-N).join("-")),k=r.computed(()=>s.max-s.min),M=r.computed(()=>vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),C=r.computed(()=>vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),G=r.computed(()=>{const Z=s.modelValue;return Array.isArray(Z)&&Z.length===2&&Z.every(N=>Number.isFinite(N))?s.error:"Expected model [number, number]"}),X=r.computed(()=>(M.value-s.min)/k.value),O=r.computed(()=>(C.value-s.min)/k.value),P=r.computed(()=>E()),L=r.computed(()=>({right:P.value[0]+"%",left:100-P.value[1]+"%"})),z=r.computed(()=>({right:Math.ceil((1-X.value)*100)+"%"})),A=r.computed(()=>({right:Math.ceil((1-O.value)*100)+"%"}));r.watch(()=>s.modelValue,Z=>{f.value=Z,m.value=+Z[0],y.value=+Z[1]},{immediate:!0}),sr(u,Z=>{var N;ot((N=r.unref(c))==null?void 0:N.getBoundingClientRect(),U=>{const{dx:J}=Z;l.deltaValue1=J/U.width*k.value,m.value=V(vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,y.value].sort((pe,we)=>pe-we),Z.stop&&(W([V(M.value),V(C.value)]),l.deltaValue1=0)})}),sr(p,Z=>{var N;ot((N=r.unref(c))==null?void 0:N.getBoundingClientRect(),U=>{const{dx:J}=Z;l.deltaValue2=J/U.width*k.value,y.value=V(vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,y.value].sort((pe,we)=>pe-we),Z.stop&&(W([V(M.value),V(C.value)]),l.deltaValue2=0)})});function E(){const Z=Math.ceil((1-X.value)*100),N=Math.ceil((1-O.value)*100);return[Z,N].sort((U,J)=>U-J)}function V(Z){const N=vt(Z,s.min,s.max);return Math.round((N+Number.EPSILON)*(1/s.step))/(1/s.step)}function W(Z){i("update:modelValue",Z)}function q(Z,N){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(Z.code)&&Z.preventDefault();const U=Z.code==="ArrowUp"||Z.code==="ArrowRight"?s.step*1:Z.code==="ArrowDown"||Z.code==="ArrowLeft"?s.step*-1:0,J=[...s.modelValue];J[N]=vt(J[N]+U,s.min,s.max),W(J)}return(Z,N)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([s.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${s.mode}`,"ui-slider"])},[r.createElementVNode("div",Uk,[r.createElementVNode("div",Zk,[Z.label?(r.openBlock(),r.createElementBlock("label",Wk,[r.createElementVNode("span",null,r.toDisplayString(Z.label),1),N[3]||(N[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(kt),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(Z.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),N[4]||(N[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",Hk,r.toDisplayString(D.value),1)):r.createCommentVNode("",!0)]),N[10]||(N[10]=r.createTextVNode()),r.createElementVNode("div",jk,[r.createElementVNode("div",qk,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(L.value)},null,4)],512)]),N[9]||(N[9]=r.createTextVNode()),r.createElementVNode("div",Kk,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(S),(U,J)=>(r.openBlock(),r.createElementBlock("div",{key:J,style:r.normalizeStyle({right:`${U}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),N[7]||(N[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:u,style:r.normalizeStyle(z.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:N[0]||(N[0]=U=>q(U,0))},N[5]||(N[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),N[8]||(N[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(A.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:N[1]||(N[1]=U=>q(U,1))},N[6]||(N[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),N[11]||(N[11]=r.createTextVNode()),r.createElementVNode("div",Yk,[s.mode==="input"?(r.openBlock(),r.createBlock($k,{key:0,modelValue:f.value,"onUpdate:modelValue":N[2]||(N[2]=U=>f.value=U),class:"ui-focused-border",onChange:W},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),N[12]||(N[12]=r.createTextVNode()),G.value?(r.openBlock(),r.createElementBlock("div",Jk,r.toDisplayString(G.value),1)):r.createCommentVNode("",!0)],2))}}),Qk=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientHeight/(i.scrollHeight||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{top:i.scrollTop*p+"px",height:Math.floor(i.clientHeight*p)+"px"}});return tt(s,"pointerdown",p=>{const f={clientY:p.clientY},m=ml(document,"mousemove",y=>{const T=(y.clientY-f.clientY)/l.value;n("update:scrollTop",i.scrollTop+T),f.clientY=y.clientY});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,f)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"v-scroll"},[r.createElementVNode("div",{class:"v-scroll__scrollbar",style:r.normalizeStyle(u.value)},null,4)],512)):r.createCommentVNode("",!0)}}),eS=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,i=t,s=r.ref(),l=r.computed(()=>i.clientWidth/(i.scrollWidth||1)),c=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{left:i.scrollLeft*p+"px",width:Math.floor(i.clientWidth*p)+"px"}});return tt(s,"pointerdown",p=>{const f={clientX:p.clientX},m=ml(document,"mousemove",y=>{const T=(y.clientX-f.clientX)/l.value;n("update:scrollLeft",i.scrollLeft+T),f.clientX=y.clientX});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,f)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:s,class:"h-scroll"},[r.createElementVNode("div",{class:"h-scroll__scrollbar",style:r.normalizeStyle(u.value)},null,4)],512)):r.createCommentVNode("",!0)}}),tS={class:"ui-scrollable"},nS=r.defineComponent({__name:"Scrollable",setup(t){const e=r.ref(),n=r.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function i(u){IC(n,u,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const s=u=>{u.preventDefault();const p=u.currentTarget;p.scrollTop+=u.deltaY,p.scrollLeft+=u.deltaX,i(p)};function l(u){ot(r.unref(e),p=>{p.scrollTop=u,i(p)})}function c(u){ot(r.unref(e),p=>{p.scrollLeft=u,i(p)})}return Yu(e,u=>{ot(u,p=>i(p))}),r.onMounted(()=>{ot(r.unref(e),u=>{i(u),u.addEventListener("wheel",s)})}),r.onUnmounted(()=>{ot(r.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(r.openBlock(),r.createElementBlock("div",tS,[r.createElementVNode("div",{ref_key:"containerRef",ref:e,class:"ui-scrollable__container",onWheel:s},[r.renderSlot(u.$slots,"default")],544),p[2]||(p[2]=r.createTextVNode()),r.createVNode(Qk,{"scroll-top":n.scrollTop,"client-height":n.clientHeight,"scroll-height":n.scrollHeight,onWheel:p[0]||(p[0]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollTop":l},null,8,["scroll-top","client-height","scroll-height"]),p[3]||(p[3]=r.createTextVNode()),r.createVNode(eS,{"scroll-left":n.scrollLeft,"client-width":n.clientWidth,"scroll-width":n.scrollWidth,onWheel:p[1]||(p[1]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":c},null,8,["scroll-left","client-width","scroll-width"])]))}}),rS="add.svg",iS="box.svg",oS="calendar.svg",sS="checkmark.svg",aS="clipboard.svg",lS="close.svg",cS="copy.svg",dS="download.svg",uS="duplicate.svg",pS="edit.svg",hS="error.svg",fS="filter.svg",mS="help.svg",gS="info.svg",yS="link.svg",vS="loading.svg",_S="lock.svg",CS="maximize.svg",wS="minimize.svg",bS="minus.svg",xS="more.svg",kS="open.svg",SS="pause.svg",ES="play.svg",TS="renew.svg",BS="restart.svg",NS="reverse.svg",AS="settings.svg",VS="sort.svg",PS="stop.svg",DS="success.svg",FS="time.svg",RS="tune.svg",MS="warning.svg",IS="zip.svg",LS={add:rS,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",box:iS,calendar:oS,"caret-down":"caret-down.svg","caret-left":"caret-left.svg","caret-right":"caret-right.svg","caret-up":"caret-up.svg","cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg",checkmark:sS,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:aS,close:lS,copy:cS,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:dS,"drag-dots":"drag-dots.svg",duplicate:uS,edit:pS,error:hS,export:"export.svg","filter-on":"filter-on.svg",filter:fS,"help-outline":"help-outline.svg",help:mS,"info-outline":"info-outline.svg",info:gS,"jump-link":"jump-link.svg",link:yS,loading:vS,lock:_S,maximize:CS,minimize:wS,minus:bS,more:xS,open:kS,"paper-clip":"paper-clip.svg",pause:SS,play:ES,renew:TS,restart:BS,reverse:NS,settings:AS,sort:VS,stop:PS,success:DS,time:FS,tune:RS,warning:MS,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:IS},OS="add.svg",GS="annotate.svg",zS="annotation.svg",$S="area.svg",US="axes.svg",ZS="bar.svg",WS="bindot.svg",HS="box.svg",jS="boxplot.svg",qS="bubble.svg",KS="calendar.svg",YS="canvas.svg",JS="checkbox.svg",XS="checkmark.svg",QS="clipboard.svg",e1="close.svg",t1="cluster.svg",n1="code.svg",r1="color.svg",i1="columns.svg",o1="container.svg",s1="cookie.svg",a1="copy.svg",l1="cpu.svg",c1="debug.svg",d1="dna.svg",u1="download.svg",p1="duplicate.svg",h1="edit.svg",f1="error.svg",m1="filter.svg",g1="generate.svg",y1="graph.svg",v1="heatmap.svg",_1="help.svg",C1="info.svg",w1="jitter.svg",b1="lasso.svg",x1="layers.svg",k1="learn.svg",S1="legend.svg",E1="line.svg",T1="link.svg",B1="loading.svg",N1="lock.svg",A1="maximize.svg",V1="menu.svg",P1="minimize.svg",D1="minus.svg",F1="more.svg",R1="pause.svg",M1="pin.svg",I1="play.svg",L1="product.svg",O1="publications.svg",G1="renew.svg",z1="restart.svg",$1="reverse.svg",U1="search.svg",Z1="server.svg",W1="settings.svg",H1="sina.svg",j1="skatterplot.svg",q1="slice.svg",K1="sort.svg",Y1="statistics.svg",J1="stop.svg",X1="success.svg",Q1="table.svg",eE="template.svg",tE="terminal.svg",nE="time.svg",rE="tune.svg",iE="venn.svg",oE="violin.svg",sE="warning.svg",aE="wetlab.svg",lE="zip.svg",cE={"add-layer":"add-layer.svg",add:OS,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:GS,annotation:zS,area:$S,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-link":"arrow-link.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",axes:US,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:ZS,bindot:WS,box:HS,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:jS,bubble:qS,calendar:KS,canvas:YS,"cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg","checkbox-checked":"checkbox-checked.svg","checkbox-intermediate":"checkbox-intermediate.svg",checkbox:JS,checkmark:XS,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-sort":"chevron-sort.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:QS,close:e1,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:t1,code:n1,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:r1,columns:i1,"connected-points":"connected-points.svg",container:o1,cookie:s1,copy:a1,cpu:l1,"data-dimentions":"data-dimentions.svg",debug:c1,"delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg","dendrogram-X-line":"dendrogram-X-line.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-line":"dendrogram-Y-line.svg","dendrogram-Y":"dendrogram-Y.svg","dna-add":"dna-add.svg","dna-import":"dna-import.svg",dna:d1,download:u1,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:p1,edit:h1,"error-bar":"error-bar.svg",error:f1,"expand-left":"expand-left.svg","expand-right":"expand-right.svg",export:"export.svg","file-doc-add":"file-doc-add.svg","file-doc-download":"file-doc-download.svg","file-doc-import":"file-doc-import.svg","file-doc":"file-doc.svg","filter-on":"filter-on.svg",filter:m1,"fire-tips":"fire-tips.svg","folder-parent":"folder-parent.svg","frame-type-all":"frame-type-all.svg","frame-type-bottom":"frame-type-bottom.svg","frame-type-left-bottom":"frame-type-left-bottom.svg","frame-type-left":"frame-type-left.svg","frame-type-none":"frame-type-none.svg",generate:g1,graph:y1,heatmap:v1,"help-outline":"help-outline.svg",help:_1,"info-outline":"info-outline.svg",info:C1,jitter:w1,"jump-link":"jump-link.svg",lasso:b1,layers:x1,learn:k1,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:S1,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:E1,"linetype-dashed":"linetype-dashed.svg","linetype-dotdash":"linetype-dotdash.svg","linetype-dotted":"linetype-dotted.svg","linetype-longdash":"linetype-longdash.svg","linetype-solid":"linetype-solid.svg","linetype-twodash":"linetype-twodash.svg","link-disabled":"link-disabled.svg",link:T1,loading:B1,lock:N1,maximize:A1,menu:V1,minimize:P1,minus:D1,more:F1,"paper-clip":"paper-clip.svg",pause:R1,pin:M1,play:I1,"position-bottom-annotation":"position-bottom-annotation.svg","position-bottom":"position-bottom.svg","position-left-annotation":"position-left-annotation.svg","position-left":"position-left.svg","position-right-annotation":"position-right-annotation.svg","position-right":"position-right.svg","position-top-annotation":"position-top-annotation.svg","position-top":"position-top.svg",product:L1,publications:O1,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:G1,restart:z1,reverse:$1,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:U1,"server-on":"server-on.svg",server:Z1,settings:W1,sina:H1,skatterplot:j1,slice:q1,"social-github":"social-github.svg","social-linkedin":"social-linkedin.svg","social-twitter-X":"social-twitter-X.svg","social-twitter-bird":"social-twitter-bird.svg","social-youtube":"social-youtube.svg","sort-list-down":"sort-list-down.svg","sort-list-up":"sort-list-up.svg",sort:K1,statistics:Y1,stop:J1,"strip-plot":"strip-plot.svg",success:X1,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:Q1,template:eE,terminal:tE,"text-align-center":"text-align-center.svg","text-align-left":"text-align-left.svg","text-align-right":"text-align-right.svg","theme-dark":"theme-dark.svg","theme-light":"theme-light.svg",time:nE,tune:rE,venn:iE,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:oE,warning:sE,wetlab:aE,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:lE,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function dE(){return{txtSec:{title:"Text",data:{"--txt-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Text on the colored elements"},"--txt-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary text layer"},"--txt-02":{light:[!0,!1],value:["#231842","#ADAEB8"],description:"Secondary text layer - large arrays of text"},"--txt-03":{light:[!0,!0],value:["#9D9EAE","#60616B"],description:"Tetritary text layer - hints and descriptions"},"--txt-mask":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Text mask in inputs, icons, etc."},"--txt-focus":{light:[!0,!0],value:["#07AD3E","#87E087"],description:"Colored text in active/focus elements"},"--txt-error":{light:[!0,!0],value:["#F1222F","#FF5C5C"],description:"Colored text in error elements"},"--txt-link":{light:[!0,!0],value:["#5F31CC","#9470FF"],description:"Colored text in links"}}},iconSec:{title:"Icon",data:{"--ic-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Icons on colored elements"},"--ic-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary elements"},"--ic-02":{light:[!1,!0],value:["#CFD1DB","#60616B"],description:"Secondary & tetritary elements"},"--ic-accent":{light:[!0,!1],value:["#07AD3E","#87E087"],description:"Focus/active elements"}}},borderSec:{title:"Border",data:{"--border-color-default":{light:[!0,!0],value:["#110529","#60616B"],description:"Main border for components"},"--border-color-hover":{light:[!0,!0],value:["#231842","#ADAEB8"],description:"Hover on main border"},"--border-color-focus":{light:[!1,!1],value:["#49CC49","#49CC49"],description:"Active border for components"},"--border-color-error":{light:[!1,!1],value:["#FF5C5C","#FF5C5C"],description:"Error border for components"},"--border-color-div-grey":{light:[!1,!0],value:["#E1E3EB","#232329"],description:"Divider lines low contrast"},"--border-color-div-bw":{light:[!1,!0],value:["#FFFFFF","#000000"],description:"Divider lines hight contrast"}}},btnSec:{title:"Button",data:{"--btn-accent-default":{light:[!0,!0],value:["#845CFF"," #5F31CC"],description:"Accent coloured button"},"--btn-accent-hover":{light:[!0,!0],value:["#9470FF"," #5F31CC"],description:"Hover on accent coloured button"},"--btn-accent-press":{light:[!0,!0],value:["#6F4DD6","#5F31CC"],description:"Pressed on accent coloured button"},"--btn-primary-default":{light:[!0,!0],value:["#110529","#5F31CC"],description:"Primary button"},"--btn-primary-hover":{light:[!0,!0],value:["#231842","#6D3DDB"],description:"Hover on primary button"},"--btn-primary-press":{light:[!0,!0],value:["#080214","#5328B8"],description:"Hover on primary button"},"--btn-sec-hover-white":{light:[!1,!0],value:["rgba(255, 255, 255, 0.50)","rgba(131, 131, 163, 0.16)"],description:"Hover background on transparent button"},"--btn-sec-hover-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.16)","rgba(131, 131, 163, 0.16)"],description:"Hover background on ghost button & icons"},"--btn-sec-press-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.24)","rgba(131, 131, 163, 0.24)"],description:"Hover background on ghost button & icons"},"--btn-active-select":{light:[!1,!0],value:["rgba(99, 224, 36, 0.24)","rgba(99, 224, 36, 0.24)"],description:"Fill on selected elements"},"--btn-switcher":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","#5E5E70"],description:"Gradient on active controll/switcher element"}}},disSec:{title:"Disable",data:{"--dis-00":{light:[!1,!0],value:["#FFFFFF","#65656B"],description:"Elements on dis-01, labels, texts, icons"},"--dis-01":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Buttons, borders, labels, texts, icons"}}},bgSec:{title:"Background",data:{"--bg-base-dark":{light:[!0,!0],value:["#110529","#0D0D0F"],description:"Default dark block background"},"--bg-base-light":{light:[!1,!0],value:["#F7F8FA","#0D0D0F"],description:"Default light block background"},"--bg-elevated-01":{light:[!1,!0],value:["#FFFFFF","#1B1B1F"],description:"Default block background"},"--bg-elevated-02":{light:[!1,!0],value:["#E1E3EB","#2D2D33"],description:"Secondary block background"}}},filledSec:{title:"Filled",data:{"--filled-V-BG":{light:[!1,!0],value:["#D0F0C0","rgba(66, 184, 66, 0.40)"],description:"Text background selection on V-read"},"--filled-D-BG":{light:[!1,!0],value:["#FFCECC","rgba(229, 83, 229, 0.40)"],description:"Text background selection on D-read"},"--filled-N-BG":{light:[!1,!0],value:["#FAF5AA","rgba(83, 82, 102, 0.40)"],description:"Text background selection on C/N-read"},"--filled-J-BG":{light:[!1,!0],value:["#DEDBFF","rgba(132, 92, 255, 0.40)"],description:"Text background selection on J-read"}}},notificationSec:{title:"Notification",data:{"--notification-neutral":{light:[!1,!0],value:["linear-gradient(90deg, #D6D9FF 0%, #FFF 100%)","linear-gradient(90deg, #4D4D8F 0%, #292933 100%)"],description:"Background on neutral blocks"},"--notification-success":{light:[!1,!0],value:["linear-gradient(90deg, #C9F0B6 0%, #FFF 100%)","linear-gradient(90deg, #305C3E 0%, #292933 100%)"],description:"Background on success blocks"},"--notification-warning":{light:[!1,!0],value:["linear-gradient(90deg, #FEE0A3 0%, #FFF 100%)","linear-gradient(90deg, #754F2D 0%, #292933 100%)"],description:"Background on warning blocks"},"--notification-error":{light:[!1,!0],value:["linear-gradient(90deg, #FFB8B8 0%, #FFF 100%)","linear-gradient(90deg, #8F3343 0%, #292933 100%)"],description:"Background on error blocks"}}},gradientSec:{title:"Gradient",data:{"--gradient-blue-green":{light:[!0,!0],value:["linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand dark gradient"},"--gradient-green-lime":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-violet":{light:[!1,!0],value:["linear-gradient(180deg, #ADB8FF 0%, #D6E9FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-clear":{light:[!1,!0],value:["linear-gradient(180deg, #85BEFF 0%, #CEF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-orange":{light:[!1,!0],value:["linear-gradient(180deg, #FFB766 0%, #FFEAA3 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-mint":{light:[!1,!0],value:["linear-gradient(180deg, #7DD1D1 0%, #C8FAE9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-lime":{light:[!1,!0],value:["linear-gradient(180deg, #BFE062 0%, #E4FFAD 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-rose":{light:[!1,!0],value:["linear-gradient(0deg, #FFDDD6 0%, #FF99C9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-red":{light:[!1,!0],value:["linear-gradient(0deg, #FFD5CC 0%, #FF9494 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-violet":{light:[!1,!0],value:["linear-gradient(180deg, #BCA3FF 0%, #E5E5FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"}}}}}const uE=["add","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","box","calendar","caret-down","caret-left","caret-right","caret-up","cell-type-num","cell-type-txt","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-up","clipboard-copied","clipboard","close","copy","data-dimentions","delete-bin","delete-circle","delete-clear","download","drag-dots","duplicate","edit","error","export","filter-on","filter","help-outline","help","info-outline","info","jump-link","link","loading","lock","maximize","minimize","minus","more","open","paper-clip","pause","play","renew","restart","reverse","settings","sort","stop","success","time","tune","warning","x-axis","y-axis","zip"],pE=["add-layer","add","align-center","align-left","align-right","annotate","annotation","area","arrow-down","arrow-left","arrow-link","arrow-right","arrow-up","axes","bar-cross","bar-error","bar-stacked","bar-trend","bar","bindot","box","boxplot-binned","boxplot-jitter","boxplot-notched","boxplot","bubble","calendar","canvas","cell-type-num","cell-type-txt","checkbox-checked","checkbox-intermediate","checkbox","checkmark","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-sort","chevron-up","clipboard-copied","clipboard","close","cloud-download","cloud-offline","cloud-online","cloud-upload","cluster","code","color-fill","color-none","color-stroke","color","columns","connected-points","container","cookie","copy","cpu","data-dimentions","debug","delete-bin","delete-circle","delete-clear","dendrogram-X-line","dendrogram-X","dendrogram-Y-line","dendrogram-Y","dna-add","dna-import","dna","download","drag-dots","drag-horizontal","drag-vertical","duplicate","edit","error-bar","error","expand-left","expand-right","export","file-doc-add","file-doc-download","file-doc-import","file-doc","filter-on","filter","fire-tips","folder-parent","frame-type-all","frame-type-bottom","frame-type-left-bottom","frame-type-left","frame-type-none","generate","graph","heatmap","help-outline","help","info-outline","info","jitter","jump-link","lasso","layers","learn","legend-box-dot","legend-box","legend","line-binned","line-error","line-jitter","line","linetype-dashed","linetype-dotdash","linetype-dotted","linetype-longdash","linetype-solid","linetype-twodash","link-disabled","link","loading","lock","maximize","menu","minimize","minus","more","paper-clip","pause","pin","play","position-bottom-annotation","position-bottom","position-left-annotation","position-left","position-right-annotation","position-right","position-top-annotation","position-top","product","publications","radio-button-checked","radio-button","renew","restart","reverse","rotation-0","rotation-45","rotation-90","search","server-on","server","settings","sina","skatterplot","slice","social-github","social-linkedin","social-twitter-X","social-twitter-bird","social-youtube","sort-list-down","sort-list-up","sort","statistics","stop","strip-plot","success","table-add","table-alias","table-import","table","template","terminal","text-align-center","text-align-left","text-align-right","theme-dark","theme-light","time","tune","venn","view-hide","view-show","violin-binned","violin-jitter","violin","warning","wetlab","windows-collapse","windows-expand","x-axis","y-axis","zip","zoom-in","zoom-out"],hE={allCssVariables:dE(),icons16:LS,icons24:cE},fE={class:"block__not-found"},mE=r.defineComponent({__name:"NotFound",setup(t){const n=Xa().useApp(),i=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",fE,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(dl),{onClick:r.withModifiers(i,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),Ts=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n},gE={},yE={class:"block__loader-page"};function vE(t,e){return r.openBlock(),r.createElementBlock("div",yE,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const _E=Ts(gE,[["render",vE]]),CE={class:"pl-app-notification-alert"},wE={class:"pl-app-notification-alert__content"},bE={class:"pl-app-notification-alert__title"},xE=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),i=r.ref(!0),s=r.computed(()=>Object.entries(e.errors).filter(c=>!!c[1]));function l(){n.value=!0}return r.watch(()=>e.errors,c=>{i.value=Object.values(c).some(u=>!!u)},{immediate:!0,deep:!0}),(c,u)=>(r.openBlock(),r.createElementBlock("div",CE,[r.createVNode(r.unref(Cl),{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=p=>n.value=p),width:"50%",style:{"max-height":"100vh"}},{title:r.withCtx(()=>u[2]||(u[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",wE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,p=>{var f;return r.openBlock(),r.createElementBlock("div",{key:p[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",bE,r.toDisplayString(p[0]),1),r.createVNode(r.unref(Vu),{value:(f=p[1])==null?void 0:f.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(qu),{modelValue:i.value,"onUpdate:modelValue":u[1]||(u[1]=p=>i.value=p),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(cl),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>u[3]||(u[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(yu))]),default:r.withCtx(()=>[u[4]||(u[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),kE={class:"block block__layout"},SE={key:0},EE=r.defineComponent({__name:"BlockLayout",setup(t){const e=Xa(),n=p=>{try{return new URL(p,"http://dummy").pathname}catch{console.error("Invalid href",p);return}},i=r.computed(()=>e.loaded?e.useApp().href:void 0),s=r.computed(()=>{if(e.loaded){const p=e.useApp(),f=n(p.snapshot.navigationState.href);return f?p.getRoute(f):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),c=r.computed(()=>l.value?l.value.model.outputErrors:{}),u=r.computed(()=>{var p;return((p=l.value)==null?void 0:p.showErrorsNotification)??!0});return(p,f)=>(r.openBlock(),r.createElementBlock("div",kE,[r.unref(e).error?(r.openBlock(),r.createElementBlock("div",SE,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value),{key:i.value})):(r.openBlock(),r.createBlock(mE,{key:3})):(r.openBlock(),r.createBlock(_E,{key:1},{default:r.withCtx(()=>f[0]||(f[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&u.value?(r.openBlock(),r.createBlock(r.unref(xE),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var Bs={exports:{}};/**
64
64
  * @license
65
65
  * Lodash <https://lodash.com/>
66
66
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
67
67
  * Released under MIT license <https://lodash.com/license>
68
68
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
69
69
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
70
- */Bs.exports,function(t,e){(function(){var n,i="4.17.21",s=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",y=1,k=2,S=4,M=1,T=2,R=1,C=2,G=4,X=8,L=16,P=32,O=64,z=128,N=256,E=512,V=30,W="...",q=800,$=16,A=1,Z=2,J=3,pe=1/0,we=9007199254740991,Ct=17976931348623157e292,Tt=NaN,ht=4294967295,vr=ht-1,Vn=ht>>>1,_r=[["ary",z],["bind",R],["bindKey",C],["curry",X],["curryRight",L],["flip",E],["partial",P],["partialRight",O],["rearg",N]],Un="[object Arguments]",Wr="[object Array]",Ps="[object AsyncFunction]",Ge="[object Boolean]",Cr="[object Date]",lT="[object DOMException]",Ds="[object Error]",Fs="[object Function]",hp="[object GeneratorFunction]",vn="[object Map]",Po="[object Number]",cT="[object Null]",Zn="[object Object]",fp="[object Promise]",dT="[object Proxy]",Do="[object RegExp]",_n="[object Set]",Fo="[object String]",Rs="[object Symbol]",uT="[object Undefined]",Ro="[object WeakMap]",pT="[object WeakSet]",Mo="[object ArrayBuffer]",ki="[object DataView]",Dl="[object Float32Array]",Fl="[object Float64Array]",Rl="[object Int8Array]",Ml="[object Int16Array]",Il="[object Int32Array]",Ol="[object Uint8Array]",Ll="[object Uint8ClampedArray]",Gl="[object Uint16Array]",zl="[object Uint32Array]",hT=/\b__p \+= '';/g,fT=/\b(__p \+=) '' \+/g,mT=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mp=/&(?:amp|lt|gt|quot|#39);/g,gp=/[&<>"']/g,gT=RegExp(mp.source),yT=RegExp(gp.source),vT=/<%-([\s\S]+?)%>/g,_T=/<%([\s\S]+?)%>/g,yp=/<%=([\s\S]+?)%>/g,CT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wT=/^\w*$/,bT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ul=/[\\^$.*+?()[\]{}|]/g,xT=RegExp(Ul.source),Zl=/^\s+/,kT=/\s/,ST=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ET=/\{\n\/\* \[wrapped with (.+)\] \*/,TT=/,? & /,BT=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,AT=/[()=,{}\[\]\/\s]/,NT=/\\(\\)?/g,VT=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vp=/\w*$/,PT=/^[-+]0x[0-9a-f]+$/i,DT=/^0b[01]+$/i,FT=/^\[object .+?Constructor\]$/,RT=/^0o[0-7]+$/i,MT=/^(?:0|[1-9]\d*)$/,IT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ms=/($^)/,OT=/['\n\r\u2028\u2029\\]/g,Is="\\ud800-\\udfff",LT="\\u0300-\\u036f",GT="\\ufe20-\\ufe2f",zT="\\u20d0-\\u20ff",_p=LT+GT+zT,Cp="\\u2700-\\u27bf",wp="a-z\\xdf-\\xf6\\xf8-\\xff",UT="\\xac\\xb1\\xd7\\xf7",ZT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$T="\\u2000-\\u206f",WT=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bp="A-Z\\xc0-\\xd6\\xd8-\\xde",xp="\\ufe0e\\ufe0f",kp=UT+ZT+$T+WT,$l="['’]",HT="["+Is+"]",Sp="["+kp+"]",Os="["+_p+"]",Ep="\\d+",jT="["+Cp+"]",Tp="["+wp+"]",Bp="[^"+Is+kp+Ep+Cp+wp+bp+"]",Wl="\\ud83c[\\udffb-\\udfff]",qT="(?:"+Os+"|"+Wl+")",Ap="[^"+Is+"]",Hl="(?:\\ud83c[\\udde6-\\uddff]){2}",jl="[\\ud800-\\udbff][\\udc00-\\udfff]",Si="["+bp+"]",Np="\\u200d",Vp="(?:"+Tp+"|"+Bp+")",KT="(?:"+Si+"|"+Bp+")",Pp="(?:"+$l+"(?:d|ll|m|re|s|t|ve))?",Dp="(?:"+$l+"(?:D|LL|M|RE|S|T|VE))?",Fp=qT+"?",Rp="["+xp+"]?",YT="(?:"+Np+"(?:"+[Ap,Hl,jl].join("|")+")"+Rp+Fp+")*",JT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",XT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Mp=Rp+Fp+YT,QT="(?:"+[jT,Hl,jl].join("|")+")"+Mp,eB="(?:"+[Ap+Os+"?",Os,Hl,jl,HT].join("|")+")",tB=RegExp($l,"g"),nB=RegExp(Os,"g"),ql=RegExp(Wl+"(?="+Wl+")|"+eB+Mp,"g"),rB=RegExp([Si+"?"+Tp+"+"+Pp+"(?="+[Sp,Si,"$"].join("|")+")",KT+"+"+Dp+"(?="+[Sp,Si+Vp,"$"].join("|")+")",Si+"?"+Vp+"+"+Pp,Si+"+"+Dp,XT,JT,Ep,QT].join("|"),"g"),iB=RegExp("["+Np+Is+_p+xp+"]"),oB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,sB=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],aB=-1,qe={};qe[Dl]=qe[Fl]=qe[Rl]=qe[Ml]=qe[Il]=qe[Ol]=qe[Ll]=qe[Gl]=qe[zl]=!0,qe[Un]=qe[Wr]=qe[Mo]=qe[Ge]=qe[ki]=qe[Cr]=qe[Ds]=qe[Fs]=qe[vn]=qe[Po]=qe[Zn]=qe[Do]=qe[_n]=qe[Fo]=qe[Ro]=!1;var He={};He[Un]=He[Wr]=He[Mo]=He[ki]=He[Ge]=He[Cr]=He[Dl]=He[Fl]=He[Rl]=He[Ml]=He[Il]=He[vn]=He[Po]=He[Zn]=He[Do]=He[_n]=He[Fo]=He[Rs]=He[Ol]=He[Ll]=He[Gl]=He[zl]=!0,He[Ds]=He[Fs]=He[Ro]=!1;var lB={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},cB={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dB={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},uB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pB=parseFloat,hB=parseInt,Ip=typeof Li=="object"&&Li&&Li.Object===Object&&Li,fB=typeof self=="object"&&self&&self.Object===Object&&self,ft=Ip||fB||Function("return this")(),Kl=e&&!e.nodeType&&e,Hr=Kl&&!0&&t&&!t.nodeType&&t,Op=Hr&&Hr.exports===Kl,Yl=Op&&Ip.process,Kt=function(){try{var D=Hr&&Hr.require&&Hr.require("util").types;return D||Yl&&Yl.binding&&Yl.binding("util")}catch{}}(),Lp=Kt&&Kt.isArrayBuffer,Gp=Kt&&Kt.isDate,zp=Kt&&Kt.isMap,Up=Kt&&Kt.isRegExp,Zp=Kt&&Kt.isSet,$p=Kt&&Kt.isTypedArray;function Zt(D,H,U){switch(U.length){case 0:return D.call(H);case 1:return D.call(H,U[0]);case 2:return D.call(H,U[0],U[1]);case 3:return D.call(H,U[0],U[1],U[2])}return D.apply(H,U)}function mB(D,H,U,ae){for(var xe=-1,ze=D==null?0:D.length;++xe<ze;){var at=D[xe];H(ae,at,U(at),D)}return ae}function Yt(D,H){for(var U=-1,ae=D==null?0:D.length;++U<ae&&H(D[U],U,D)!==!1;);return D}function gB(D,H){for(var U=D==null?0:D.length;U--&&H(D[U],U,D)!==!1;);return D}function Wp(D,H){for(var U=-1,ae=D==null?0:D.length;++U<ae;)if(!H(D[U],U,D))return!1;return!0}function wr(D,H){for(var U=-1,ae=D==null?0:D.length,xe=0,ze=[];++U<ae;){var at=D[U];H(at,U,D)&&(ze[xe++]=at)}return ze}function Ls(D,H){var U=D==null?0:D.length;return!!U&&Ei(D,H,0)>-1}function Jl(D,H,U){for(var ae=-1,xe=D==null?0:D.length;++ae<xe;)if(U(H,D[ae]))return!0;return!1}function Ye(D,H){for(var U=-1,ae=D==null?0:D.length,xe=Array(ae);++U<ae;)xe[U]=H(D[U],U,D);return xe}function br(D,H){for(var U=-1,ae=H.length,xe=D.length;++U<ae;)D[xe+U]=H[U];return D}function Xl(D,H,U,ae){var xe=-1,ze=D==null?0:D.length;for(ae&&ze&&(U=D[++xe]);++xe<ze;)U=H(U,D[xe],xe,D);return U}function yB(D,H,U,ae){var xe=D==null?0:D.length;for(ae&&xe&&(U=D[--xe]);xe--;)U=H(U,D[xe],xe,D);return U}function Ql(D,H){for(var U=-1,ae=D==null?0:D.length;++U<ae;)if(H(D[U],U,D))return!0;return!1}var vB=ec("length");function _B(D){return D.split("")}function CB(D){return D.match(BT)||[]}function Hp(D,H,U){var ae;return U(D,function(xe,ze,at){if(H(xe,ze,at))return ae=ze,!1}),ae}function Gs(D,H,U,ae){for(var xe=D.length,ze=U+(ae?1:-1);ae?ze--:++ze<xe;)if(H(D[ze],ze,D))return ze;return-1}function Ei(D,H,U){return H===H?PB(D,H,U):Gs(D,jp,U)}function wB(D,H,U,ae){for(var xe=U-1,ze=D.length;++xe<ze;)if(ae(D[xe],H))return xe;return-1}function jp(D){return D!==D}function qp(D,H){var U=D==null?0:D.length;return U?nc(D,H)/U:Tt}function ec(D){return function(H){return H==null?n:H[D]}}function tc(D){return function(H){return D==null?n:D[H]}}function Kp(D,H,U,ae,xe){return xe(D,function(ze,at,We){U=ae?(ae=!1,ze):H(U,ze,at,We)}),U}function bB(D,H){var U=D.length;for(D.sort(H);U--;)D[U]=D[U].value;return D}function nc(D,H){for(var U,ae=-1,xe=D.length;++ae<xe;){var ze=H(D[ae]);ze!==n&&(U=U===n?ze:U+ze)}return U}function rc(D,H){for(var U=-1,ae=Array(D);++U<D;)ae[U]=H(U);return ae}function xB(D,H){return Ye(H,function(U){return[U,D[U]]})}function Yp(D){return D&&D.slice(0,eh(D)+1).replace(Zl,"")}function $t(D){return function(H){return D(H)}}function ic(D,H){return Ye(H,function(U){return D[U]})}function Io(D,H){return D.has(H)}function Jp(D,H){for(var U=-1,ae=D.length;++U<ae&&Ei(H,D[U],0)>-1;);return U}function Xp(D,H){for(var U=D.length;U--&&Ei(H,D[U],0)>-1;);return U}function kB(D,H){for(var U=D.length,ae=0;U--;)D[U]===H&&++ae;return ae}var SB=tc(lB),EB=tc(cB);function TB(D){return"\\"+uB[D]}function BB(D,H){return D==null?n:D[H]}function Ti(D){return iB.test(D)}function AB(D){return oB.test(D)}function NB(D){for(var H,U=[];!(H=D.next()).done;)U.push(H.value);return U}function oc(D){var H=-1,U=Array(D.size);return D.forEach(function(ae,xe){U[++H]=[xe,ae]}),U}function Qp(D,H){return function(U){return D(H(U))}}function xr(D,H){for(var U=-1,ae=D.length,xe=0,ze=[];++U<ae;){var at=D[U];(at===H||at===m)&&(D[U]=m,ze[xe++]=U)}return ze}function zs(D){var H=-1,U=Array(D.size);return D.forEach(function(ae){U[++H]=ae}),U}function VB(D){var H=-1,U=Array(D.size);return D.forEach(function(ae){U[++H]=[ae,ae]}),U}function PB(D,H,U){for(var ae=U-1,xe=D.length;++ae<xe;)if(D[ae]===H)return ae;return-1}function DB(D,H,U){for(var ae=U+1;ae--;)if(D[ae]===H)return ae;return ae}function Bi(D){return Ti(D)?RB(D):vB(D)}function Cn(D){return Ti(D)?MB(D):_B(D)}function eh(D){for(var H=D.length;H--&&kT.test(D.charAt(H)););return H}var FB=tc(dB);function RB(D){for(var H=ql.lastIndex=0;ql.test(D);)++H;return H}function MB(D){return D.match(ql)||[]}function IB(D){return D.match(rB)||[]}var OB=function D(H){H=H==null?ft:Ai.defaults(ft.Object(),H,Ai.pick(ft,sB));var U=H.Array,ae=H.Date,xe=H.Error,ze=H.Function,at=H.Math,We=H.Object,sc=H.RegExp,LB=H.String,Jt=H.TypeError,Us=U.prototype,GB=ze.prototype,Ni=We.prototype,Zs=H["__core-js_shared__"],$s=GB.toString,$e=Ni.hasOwnProperty,zB=0,th=function(){var o=/[^.]+$/.exec(Zs&&Zs.keys&&Zs.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Ws=Ni.toString,UB=$s.call(We),ZB=ft._,$B=sc("^"+$s.call($e).replace(Ul,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hs=Op?H.Buffer:n,kr=H.Symbol,js=H.Uint8Array,nh=Hs?Hs.allocUnsafe:n,qs=Qp(We.getPrototypeOf,We),rh=We.create,ih=Ni.propertyIsEnumerable,Ks=Us.splice,oh=kr?kr.isConcatSpreadable:n,Oo=kr?kr.iterator:n,jr=kr?kr.toStringTag:n,Ys=function(){try{var o=Xr(We,"defineProperty");return o({},"",{}),o}catch{}}(),WB=H.clearTimeout!==ft.clearTimeout&&H.clearTimeout,HB=ae&&ae.now!==ft.Date.now&&ae.now,jB=H.setTimeout!==ft.setTimeout&&H.setTimeout,Js=at.ceil,Xs=at.floor,ac=We.getOwnPropertySymbols,qB=Hs?Hs.isBuffer:n,sh=H.isFinite,KB=Us.join,YB=Qp(We.keys,We),lt=at.max,wt=at.min,JB=ae.now,XB=H.parseInt,ah=at.random,QB=Us.reverse,lc=Xr(H,"DataView"),Lo=Xr(H,"Map"),cc=Xr(H,"Promise"),Vi=Xr(H,"Set"),Go=Xr(H,"WeakMap"),zo=Xr(We,"create"),Qs=Go&&new Go,Pi={},eA=Qr(lc),tA=Qr(Lo),nA=Qr(cc),rA=Qr(Vi),iA=Qr(Go),ea=kr?kr.prototype:n,Uo=ea?ea.valueOf:n,lh=ea?ea.toString:n;function v(o){if(et(o)&&!ke(o)&&!(o instanceof De)){if(o instanceof Xt)return o;if($e.call(o,"__wrapped__"))return df(o)}return new Xt(o)}var Di=function(){function o(){}return function(a){if(!Qe(a))return{};if(rh)return rh(a);o.prototype=a;var d=new o;return o.prototype=n,d}}();function ta(){}function Xt(o,a){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}v.templateSettings={escape:vT,evaluate:_T,interpolate:yp,variable:"",imports:{_:v}},v.prototype=ta.prototype,v.prototype.constructor=v,Xt.prototype=Di(ta.prototype),Xt.prototype.constructor=Xt;function De(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ht,this.__views__=[]}function oA(){var o=new De(this.__wrapped__);return o.__actions__=Dt(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Dt(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Dt(this.__views__),o}function sA(){if(this.__filtered__){var o=new De(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function aA(){var o=this.__wrapped__.value(),a=this.__dir__,d=ke(o),h=a<0,g=d?o.length:0,_=_N(0,g,this.__views__),x=_.start,B=_.end,F=B-x,j=h?B:x-1,K=this.__iteratees__,Y=K.length,ne=0,ce=wt(F,this.__takeCount__);if(!d||!h&&g==F&&ce==F)return Ph(o,this.__actions__);var me=[];e:for(;F--&&ne<ce;){j+=a;for(var Ne=-1,ge=o[j];++Ne<Y;){var Pe=K[Ne],Fe=Pe.iteratee,jt=Pe.type,Nt=Fe(ge);if(jt==Z)ge=Nt;else if(!Nt){if(jt==A)continue e;break e}}me[ne++]=ge}return me}De.prototype=Di(ta.prototype),De.prototype.constructor=De;function qr(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function lA(){this.__data__=zo?zo(null):{},this.size=0}function cA(o){var a=this.has(o)&&delete this.__data__[o];return this.size-=a?1:0,a}function dA(o){var a=this.__data__;if(zo){var d=a[o];return d===p?n:d}return $e.call(a,o)?a[o]:n}function uA(o){var a=this.__data__;return zo?a[o]!==n:$e.call(a,o)}function pA(o,a){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=zo&&a===n?p:a,this}qr.prototype.clear=lA,qr.prototype.delete=cA,qr.prototype.get=dA,qr.prototype.has=uA,qr.prototype.set=pA;function $n(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function hA(){this.__data__=[],this.size=0}function fA(o){var a=this.__data__,d=na(a,o);if(d<0)return!1;var h=a.length-1;return d==h?a.pop():Ks.call(a,d,1),--this.size,!0}function mA(o){var a=this.__data__,d=na(a,o);return d<0?n:a[d][1]}function gA(o){return na(this.__data__,o)>-1}function yA(o,a){var d=this.__data__,h=na(d,o);return h<0?(++this.size,d.push([o,a])):d[h][1]=a,this}$n.prototype.clear=hA,$n.prototype.delete=fA,$n.prototype.get=mA,$n.prototype.has=gA,$n.prototype.set=yA;function Wn(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function vA(){this.size=0,this.__data__={hash:new qr,map:new(Lo||$n),string:new qr}}function _A(o){var a=fa(this,o).delete(o);return this.size-=a?1:0,a}function CA(o){return fa(this,o).get(o)}function wA(o){return fa(this,o).has(o)}function bA(o,a){var d=fa(this,o),h=d.size;return d.set(o,a),this.size+=d.size==h?0:1,this}Wn.prototype.clear=vA,Wn.prototype.delete=_A,Wn.prototype.get=CA,Wn.prototype.has=wA,Wn.prototype.set=bA;function Kr(o){var a=-1,d=o==null?0:o.length;for(this.__data__=new Wn;++a<d;)this.add(o[a])}function xA(o){return this.__data__.set(o,p),this}function kA(o){return this.__data__.has(o)}Kr.prototype.add=Kr.prototype.push=xA,Kr.prototype.has=kA;function wn(o){var a=this.__data__=new $n(o);this.size=a.size}function SA(){this.__data__=new $n,this.size=0}function EA(o){var a=this.__data__,d=a.delete(o);return this.size=a.size,d}function TA(o){return this.__data__.get(o)}function BA(o){return this.__data__.has(o)}function AA(o,a){var d=this.__data__;if(d instanceof $n){var h=d.__data__;if(!Lo||h.length<s-1)return h.push([o,a]),this.size=++d.size,this;d=this.__data__=new Wn(h)}return d.set(o,a),this.size=d.size,this}wn.prototype.clear=SA,wn.prototype.delete=EA,wn.prototype.get=TA,wn.prototype.has=BA,wn.prototype.set=AA;function ch(o,a){var d=ke(o),h=!d&&ei(o),g=!d&&!h&&Ar(o),_=!d&&!h&&!g&&Ii(o),x=d||h||g||_,B=x?rc(o.length,LB):[],F=B.length;for(var j in o)(a||$e.call(o,j))&&!(x&&(j=="length"||g&&(j=="offset"||j=="parent")||_&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||Kn(j,F)))&&B.push(j);return B}function dh(o){var a=o.length;return a?o[Cc(0,a-1)]:n}function NA(o,a){return ma(Dt(o),Yr(a,0,o.length))}function VA(o){return ma(Dt(o))}function dc(o,a,d){(d!==n&&!bn(o[a],d)||d===n&&!(a in o))&&Hn(o,a,d)}function Zo(o,a,d){var h=o[a];(!($e.call(o,a)&&bn(h,d))||d===n&&!(a in o))&&Hn(o,a,d)}function na(o,a){for(var d=o.length;d--;)if(bn(o[d][0],a))return d;return-1}function PA(o,a,d,h){return Sr(o,function(g,_,x){a(h,g,d(g),x)}),h}function uh(o,a){return o&&Dn(a,pt(a),o)}function DA(o,a){return o&&Dn(a,Rt(a),o)}function Hn(o,a,d){a=="__proto__"&&Ys?Ys(o,a,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[a]=d}function uc(o,a){for(var d=-1,h=a.length,g=U(h),_=o==null;++d<h;)g[d]=_?n:Wc(o,a[d]);return g}function Yr(o,a,d){return o===o&&(d!==n&&(o=o<=d?o:d),a!==n&&(o=o>=a?o:a)),o}function Qt(o,a,d,h,g,_){var x,B=a&y,F=a&k,j=a&S;if(d&&(x=g?d(o,h,g,_):d(o)),x!==n)return x;if(!Qe(o))return o;var K=ke(o);if(K){if(x=wN(o),!B)return Dt(o,x)}else{var Y=bt(o),ne=Y==Fs||Y==hp;if(Ar(o))return Rh(o,B);if(Y==Zn||Y==Un||ne&&!g){if(x=F||ne?{}:ef(o),!B)return F?dN(o,DA(x,o)):cN(o,uh(x,o))}else{if(!He[Y])return g?o:{};x=bN(o,Y,B)}}_||(_=new wn);var ce=_.get(o);if(ce)return ce;_.set(o,x),Nf(o)?o.forEach(function(ge){x.add(Qt(ge,a,d,ge,o,_))}):Bf(o)&&o.forEach(function(ge,Pe){x.set(Pe,Qt(ge,a,d,Pe,o,_))});var me=j?F?Vc:Nc:F?Rt:pt,Ne=K?n:me(o);return Yt(Ne||o,function(ge,Pe){Ne&&(Pe=ge,ge=o[Pe]),Zo(x,Pe,Qt(ge,a,d,Pe,o,_))}),x}function FA(o){var a=pt(o);return function(d){return ph(d,o,a)}}function ph(o,a,d){var h=d.length;if(o==null)return!h;for(o=We(o);h--;){var g=d[h],_=a[g],x=o[g];if(x===n&&!(g in o)||!_(x))return!1}return!0}function hh(o,a,d){if(typeof o!="function")throw new Jt(c);return Yo(function(){o.apply(n,d)},a)}function $o(o,a,d,h){var g=-1,_=Ls,x=!0,B=o.length,F=[],j=a.length;if(!B)return F;d&&(a=Ye(a,$t(d))),h?(_=Jl,x=!1):a.length>=s&&(_=Io,x=!1,a=new Kr(a));e:for(;++g<B;){var K=o[g],Y=d==null?K:d(K);if(K=h||K!==0?K:0,x&&Y===Y){for(var ne=j;ne--;)if(a[ne]===Y)continue e;F.push(K)}else _(a,Y,h)||F.push(K)}return F}var Sr=Gh(Pn),fh=Gh(hc,!0);function RA(o,a){var d=!0;return Sr(o,function(h,g,_){return d=!!a(h,g,_),d}),d}function ra(o,a,d){for(var h=-1,g=o.length;++h<g;){var _=o[h],x=a(_);if(x!=null&&(B===n?x===x&&!Ht(x):d(x,B)))var B=x,F=_}return F}function MA(o,a,d,h){var g=o.length;for(d=Te(d),d<0&&(d=-d>g?0:g+d),h=h===n||h>g?g:Te(h),h<0&&(h+=g),h=d>h?0:Pf(h);d<h;)o[d++]=a;return o}function mh(o,a){var d=[];return Sr(o,function(h,g,_){a(h,g,_)&&d.push(h)}),d}function mt(o,a,d,h,g){var _=-1,x=o.length;for(d||(d=kN),g||(g=[]);++_<x;){var B=o[_];a>0&&d(B)?a>1?mt(B,a-1,d,h,g):br(g,B):h||(g[g.length]=B)}return g}var pc=zh(),gh=zh(!0);function Pn(o,a){return o&&pc(o,a,pt)}function hc(o,a){return o&&gh(o,a,pt)}function ia(o,a){return wr(a,function(d){return Yn(o[d])})}function Jr(o,a){a=Tr(a,o);for(var d=0,h=a.length;o!=null&&d<h;)o=o[Fn(a[d++])];return d&&d==h?o:n}function yh(o,a,d){var h=a(o);return ke(o)?h:br(h,d(o))}function Bt(o){return o==null?o===n?uT:cT:jr&&jr in We(o)?vN(o):VN(o)}function fc(o,a){return o>a}function IA(o,a){return o!=null&&$e.call(o,a)}function OA(o,a){return o!=null&&a in We(o)}function LA(o,a,d){return o>=wt(a,d)&&o<lt(a,d)}function mc(o,a,d){for(var h=d?Jl:Ls,g=o[0].length,_=o.length,x=_,B=U(_),F=1/0,j=[];x--;){var K=o[x];x&&a&&(K=Ye(K,$t(a))),F=wt(K.length,F),B[x]=!d&&(a||g>=120&&K.length>=120)?new Kr(x&&K):n}K=o[0];var Y=-1,ne=B[0];e:for(;++Y<g&&j.length<F;){var ce=K[Y],me=a?a(ce):ce;if(ce=d||ce!==0?ce:0,!(ne?Io(ne,me):h(j,me,d))){for(x=_;--x;){var Ne=B[x];if(!(Ne?Io(Ne,me):h(o[x],me,d)))continue e}ne&&ne.push(me),j.push(ce)}}return j}function GA(o,a,d,h){return Pn(o,function(g,_,x){a(h,d(g),_,x)}),h}function Wo(o,a,d){a=Tr(a,o),o=of(o,a);var h=o==null?o:o[Fn(tn(a))];return h==null?n:Zt(h,o,d)}function vh(o){return et(o)&&Bt(o)==Un}function zA(o){return et(o)&&Bt(o)==Mo}function UA(o){return et(o)&&Bt(o)==Cr}function Ho(o,a,d,h,g){return o===a?!0:o==null||a==null||!et(o)&&!et(a)?o!==o&&a!==a:ZA(o,a,d,h,Ho,g)}function ZA(o,a,d,h,g,_){var x=ke(o),B=ke(a),F=x?Wr:bt(o),j=B?Wr:bt(a);F=F==Un?Zn:F,j=j==Un?Zn:j;var K=F==Zn,Y=j==Zn,ne=F==j;if(ne&&Ar(o)){if(!Ar(a))return!1;x=!0,K=!1}if(ne&&!K)return _||(_=new wn),x||Ii(o)?Jh(o,a,d,h,g,_):gN(o,a,F,d,h,g,_);if(!(d&M)){var ce=K&&$e.call(o,"__wrapped__"),me=Y&&$e.call(a,"__wrapped__");if(ce||me){var Ne=ce?o.value():o,ge=me?a.value():a;return _||(_=new wn),g(Ne,ge,d,h,_)}}return ne?(_||(_=new wn),yN(o,a,d,h,g,_)):!1}function $A(o){return et(o)&&bt(o)==vn}function gc(o,a,d,h){var g=d.length,_=g,x=!h;if(o==null)return!_;for(o=We(o);g--;){var B=d[g];if(x&&B[2]?B[1]!==o[B[0]]:!(B[0]in o))return!1}for(;++g<_;){B=d[g];var F=B[0],j=o[F],K=B[1];if(x&&B[2]){if(j===n&&!(F in o))return!1}else{var Y=new wn;if(h)var ne=h(j,K,F,o,a,Y);if(!(ne===n?Ho(K,j,M|T,h,Y):ne))return!1}}return!0}function _h(o){if(!Qe(o)||EN(o))return!1;var a=Yn(o)?$B:FT;return a.test(Qr(o))}function WA(o){return et(o)&&Bt(o)==Do}function HA(o){return et(o)&&bt(o)==_n}function jA(o){return et(o)&&wa(o.length)&&!!qe[Bt(o)]}function Ch(o){return typeof o=="function"?o:o==null?Mt:typeof o=="object"?ke(o)?xh(o[0],o[1]):bh(o):Zf(o)}function yc(o){if(!Ko(o))return YB(o);var a=[];for(var d in We(o))$e.call(o,d)&&d!="constructor"&&a.push(d);return a}function qA(o){if(!Qe(o))return NN(o);var a=Ko(o),d=[];for(var h in o)h=="constructor"&&(a||!$e.call(o,h))||d.push(h);return d}function vc(o,a){return o<a}function wh(o,a){var d=-1,h=Ft(o)?U(o.length):[];return Sr(o,function(g,_,x){h[++d]=a(g,_,x)}),h}function bh(o){var a=Dc(o);return a.length==1&&a[0][2]?nf(a[0][0],a[0][1]):function(d){return d===o||gc(d,o,a)}}function xh(o,a){return Rc(o)&&tf(a)?nf(Fn(o),a):function(d){var h=Wc(d,o);return h===n&&h===a?Hc(d,o):Ho(a,h,M|T)}}function oa(o,a,d,h,g){o!==a&&pc(a,function(_,x){if(g||(g=new wn),Qe(_))KA(o,a,x,d,oa,h,g);else{var B=h?h(Ic(o,x),_,x+"",o,a,g):n;B===n&&(B=_),dc(o,x,B)}},Rt)}function KA(o,a,d,h,g,_,x){var B=Ic(o,d),F=Ic(a,d),j=x.get(F);if(j){dc(o,d,j);return}var K=_?_(B,F,d+"",o,a,x):n,Y=K===n;if(Y){var ne=ke(F),ce=!ne&&Ar(F),me=!ne&&!ce&&Ii(F);K=F,ne||ce||me?ke(B)?K=B:nt(B)?K=Dt(B):ce?(Y=!1,K=Rh(F,!0)):me?(Y=!1,K=Mh(F,!0)):K=[]:Jo(F)||ei(F)?(K=B,ei(B)?K=Df(B):(!Qe(B)||Yn(B))&&(K=ef(F))):Y=!1}Y&&(x.set(F,K),g(K,F,h,_,x),x.delete(F)),dc(o,d,K)}function kh(o,a){var d=o.length;if(d)return a+=a<0?d:0,Kn(a,d)?o[a]:n}function Sh(o,a,d){a.length?a=Ye(a,function(_){return ke(_)?function(x){return Jr(x,_.length===1?_[0]:_)}:_}):a=[Mt];var h=-1;a=Ye(a,$t(he()));var g=wh(o,function(_,x,B){var F=Ye(a,function(j){return j(_)});return{criteria:F,index:++h,value:_}});return bB(g,function(_,x){return lN(_,x,d)})}function YA(o,a){return Eh(o,a,function(d,h){return Hc(o,h)})}function Eh(o,a,d){for(var h=-1,g=a.length,_={};++h<g;){var x=a[h],B=Jr(o,x);d(B,x)&&jo(_,Tr(x,o),B)}return _}function JA(o){return function(a){return Jr(a,o)}}function _c(o,a,d,h){var g=h?wB:Ei,_=-1,x=a.length,B=o;for(o===a&&(a=Dt(a)),d&&(B=Ye(o,$t(d)));++_<x;)for(var F=0,j=a[_],K=d?d(j):j;(F=g(B,K,F,h))>-1;)B!==o&&Ks.call(B,F,1),Ks.call(o,F,1);return o}function Th(o,a){for(var d=o?a.length:0,h=d-1;d--;){var g=a[d];if(d==h||g!==_){var _=g;Kn(g)?Ks.call(o,g,1):xc(o,g)}}return o}function Cc(o,a){return o+Xs(ah()*(a-o+1))}function XA(o,a,d,h){for(var g=-1,_=lt(Js((a-o)/(d||1)),0),x=U(_);_--;)x[h?_:++g]=o,o+=d;return x}function wc(o,a){var d="";if(!o||a<1||a>we)return d;do a%2&&(d+=o),a=Xs(a/2),a&&(o+=o);while(a);return d}function Ve(o,a){return Oc(rf(o,a,Mt),o+"")}function QA(o){return dh(Oi(o))}function eN(o,a){var d=Oi(o);return ma(d,Yr(a,0,d.length))}function jo(o,a,d,h){if(!Qe(o))return o;a=Tr(a,o);for(var g=-1,_=a.length,x=_-1,B=o;B!=null&&++g<_;){var F=Fn(a[g]),j=d;if(F==="__proto__"||F==="constructor"||F==="prototype")return o;if(g!=x){var K=B[F];j=h?h(K,F,B):n,j===n&&(j=Qe(K)?K:Kn(a[g+1])?[]:{})}Zo(B,F,j),B=B[F]}return o}var Bh=Qs?function(o,a){return Qs.set(o,a),o}:Mt,tN=Ys?function(o,a){return Ys(o,"toString",{configurable:!0,enumerable:!1,value:qc(a),writable:!0})}:Mt;function nN(o){return ma(Oi(o))}function en(o,a,d){var h=-1,g=o.length;a<0&&(a=-a>g?0:g+a),d=d>g?g:d,d<0&&(d+=g),g=a>d?0:d-a>>>0,a>>>=0;for(var _=U(g);++h<g;)_[h]=o[h+a];return _}function rN(o,a){var d;return Sr(o,function(h,g,_){return d=a(h,g,_),!d}),!!d}function sa(o,a,d){var h=0,g=o==null?h:o.length;if(typeof a=="number"&&a===a&&g<=Vn){for(;h<g;){var _=h+g>>>1,x=o[_];x!==null&&!Ht(x)&&(d?x<=a:x<a)?h=_+1:g=_}return g}return bc(o,a,Mt,d)}function bc(o,a,d,h){var g=0,_=o==null?0:o.length;if(_===0)return 0;a=d(a);for(var x=a!==a,B=a===null,F=Ht(a),j=a===n;g<_;){var K=Xs((g+_)/2),Y=d(o[K]),ne=Y!==n,ce=Y===null,me=Y===Y,Ne=Ht(Y);if(x)var ge=h||me;else j?ge=me&&(h||ne):B?ge=me&&ne&&(h||!ce):F?ge=me&&ne&&!ce&&(h||!Ne):ce||Ne?ge=!1:ge=h?Y<=a:Y<a;ge?g=K+1:_=K}return wt(_,vr)}function Ah(o,a){for(var d=-1,h=o.length,g=0,_=[];++d<h;){var x=o[d],B=a?a(x):x;if(!d||!bn(B,F)){var F=B;_[g++]=x===0?0:x}}return _}function Nh(o){return typeof o=="number"?o:Ht(o)?Tt:+o}function Wt(o){if(typeof o=="string")return o;if(ke(o))return Ye(o,Wt)+"";if(Ht(o))return lh?lh.call(o):"";var a=o+"";return a=="0"&&1/o==-pe?"-0":a}function Er(o,a,d){var h=-1,g=Ls,_=o.length,x=!0,B=[],F=B;if(d)x=!1,g=Jl;else if(_>=s){var j=a?null:fN(o);if(j)return zs(j);x=!1,g=Io,F=new Kr}else F=a?[]:B;e:for(;++h<_;){var K=o[h],Y=a?a(K):K;if(K=d||K!==0?K:0,x&&Y===Y){for(var ne=F.length;ne--;)if(F[ne]===Y)continue e;a&&F.push(Y),B.push(K)}else g(F,Y,d)||(F!==B&&F.push(Y),B.push(K))}return B}function xc(o,a){return a=Tr(a,o),o=of(o,a),o==null||delete o[Fn(tn(a))]}function Vh(o,a,d,h){return jo(o,a,d(Jr(o,a)),h)}function aa(o,a,d,h){for(var g=o.length,_=h?g:-1;(h?_--:++_<g)&&a(o[_],_,o););return d?en(o,h?0:_,h?_+1:g):en(o,h?_+1:0,h?g:_)}function Ph(o,a){var d=o;return d instanceof De&&(d=d.value()),Xl(a,function(h,g){return g.func.apply(g.thisArg,br([h],g.args))},d)}function kc(o,a,d){var h=o.length;if(h<2)return h?Er(o[0]):[];for(var g=-1,_=U(h);++g<h;)for(var x=o[g],B=-1;++B<h;)B!=g&&(_[g]=$o(_[g]||x,o[B],a,d));return Er(mt(_,1),a,d)}function Dh(o,a,d){for(var h=-1,g=o.length,_=a.length,x={};++h<g;){var B=h<_?a[h]:n;d(x,o[h],B)}return x}function Sc(o){return nt(o)?o:[]}function Ec(o){return typeof o=="function"?o:Mt}function Tr(o,a){return ke(o)?o:Rc(o,a)?[o]:cf(Ze(o))}var iN=Ve;function Br(o,a,d){var h=o.length;return d=d===n?h:d,!a&&d>=h?o:en(o,a,d)}var Fh=WB||function(o){return ft.clearTimeout(o)};function Rh(o,a){if(a)return o.slice();var d=o.length,h=nh?nh(d):new o.constructor(d);return o.copy(h),h}function Tc(o){var a=new o.constructor(o.byteLength);return new js(a).set(new js(o)),a}function oN(o,a){var d=a?Tc(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function sN(o){var a=new o.constructor(o.source,vp.exec(o));return a.lastIndex=o.lastIndex,a}function aN(o){return Uo?We(Uo.call(o)):{}}function Mh(o,a){var d=a?Tc(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Ih(o,a){if(o!==a){var d=o!==n,h=o===null,g=o===o,_=Ht(o),x=a!==n,B=a===null,F=a===a,j=Ht(a);if(!B&&!j&&!_&&o>a||_&&x&&F&&!B&&!j||h&&x&&F||!d&&F||!g)return 1;if(!h&&!_&&!j&&o<a||j&&d&&g&&!h&&!_||B&&d&&g||!x&&g||!F)return-1}return 0}function lN(o,a,d){for(var h=-1,g=o.criteria,_=a.criteria,x=g.length,B=d.length;++h<x;){var F=Ih(g[h],_[h]);if(F){if(h>=B)return F;var j=d[h];return F*(j=="desc"?-1:1)}}return o.index-a.index}function Oh(o,a,d,h){for(var g=-1,_=o.length,x=d.length,B=-1,F=a.length,j=lt(_-x,0),K=U(F+j),Y=!h;++B<F;)K[B]=a[B];for(;++g<x;)(Y||g<_)&&(K[d[g]]=o[g]);for(;j--;)K[B++]=o[g++];return K}function Lh(o,a,d,h){for(var g=-1,_=o.length,x=-1,B=d.length,F=-1,j=a.length,K=lt(_-B,0),Y=U(K+j),ne=!h;++g<K;)Y[g]=o[g];for(var ce=g;++F<j;)Y[ce+F]=a[F];for(;++x<B;)(ne||g<_)&&(Y[ce+d[x]]=o[g++]);return Y}function Dt(o,a){var d=-1,h=o.length;for(a||(a=U(h));++d<h;)a[d]=o[d];return a}function Dn(o,a,d,h){var g=!d;d||(d={});for(var _=-1,x=a.length;++_<x;){var B=a[_],F=h?h(d[B],o[B],B,d,o):n;F===n&&(F=o[B]),g?Hn(d,B,F):Zo(d,B,F)}return d}function cN(o,a){return Dn(o,Fc(o),a)}function dN(o,a){return Dn(o,Xh(o),a)}function la(o,a){return function(d,h){var g=ke(d)?mB:PA,_=a?a():{};return g(d,o,he(h,2),_)}}function Fi(o){return Ve(function(a,d){var h=-1,g=d.length,_=g>1?d[g-1]:n,x=g>2?d[2]:n;for(_=o.length>3&&typeof _=="function"?(g--,_):n,x&&At(d[0],d[1],x)&&(_=g<3?n:_,g=1),a=We(a);++h<g;){var B=d[h];B&&o(a,B,h,_)}return a})}function Gh(o,a){return function(d,h){if(d==null)return d;if(!Ft(d))return o(d,h);for(var g=d.length,_=a?g:-1,x=We(d);(a?_--:++_<g)&&h(x[_],_,x)!==!1;);return d}}function zh(o){return function(a,d,h){for(var g=-1,_=We(a),x=h(a),B=x.length;B--;){var F=x[o?B:++g];if(d(_[F],F,_)===!1)break}return a}}function uN(o,a,d){var h=a&R,g=qo(o);function _(){var x=this&&this!==ft&&this instanceof _?g:o;return x.apply(h?d:this,arguments)}return _}function Uh(o){return function(a){a=Ze(a);var d=Ti(a)?Cn(a):n,h=d?d[0]:a.charAt(0),g=d?Br(d,1).join(""):a.slice(1);return h[o]()+g}}function Ri(o){return function(a){return Xl(zf(Gf(a).replace(tB,"")),o,"")}}function qo(o){return function(){var a=arguments;switch(a.length){case 0:return new o;case 1:return new o(a[0]);case 2:return new o(a[0],a[1]);case 3:return new o(a[0],a[1],a[2]);case 4:return new o(a[0],a[1],a[2],a[3]);case 5:return new o(a[0],a[1],a[2],a[3],a[4]);case 6:return new o(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new o(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var d=Di(o.prototype),h=o.apply(d,a);return Qe(h)?h:d}}function pN(o,a,d){var h=qo(o);function g(){for(var _=arguments.length,x=U(_),B=_,F=Mi(g);B--;)x[B]=arguments[B];var j=_<3&&x[0]!==F&&x[_-1]!==F?[]:xr(x,F);if(_-=j.length,_<d)return jh(o,a,ca,g.placeholder,n,x,j,n,n,d-_);var K=this&&this!==ft&&this instanceof g?h:o;return Zt(K,this,x)}return g}function Zh(o){return function(a,d,h){var g=We(a);if(!Ft(a)){var _=he(d,3);a=pt(a),d=function(B){return _(g[B],B,g)}}var x=o(a,d,h);return x>-1?g[_?a[x]:x]:n}}function $h(o){return qn(function(a){var d=a.length,h=d,g=Xt.prototype.thru;for(o&&a.reverse();h--;){var _=a[h];if(typeof _!="function")throw new Jt(c);if(g&&!x&&ha(_)=="wrapper")var x=new Xt([],!0)}for(h=x?h:d;++h<d;){_=a[h];var B=ha(_),F=B=="wrapper"?Pc(_):n;F&&Mc(F[0])&&F[1]==(z|X|P|N)&&!F[4].length&&F[9]==1?x=x[ha(F[0])].apply(x,F[3]):x=_.length==1&&Mc(_)?x[B]():x.thru(_)}return function(){var j=arguments,K=j[0];if(x&&j.length==1&&ke(K))return x.plant(K).value();for(var Y=0,ne=d?a[Y].apply(this,j):K;++Y<d;)ne=a[Y].call(this,ne);return ne}})}function ca(o,a,d,h,g,_,x,B,F,j){var K=a&z,Y=a&R,ne=a&C,ce=a&(X|L),me=a&E,Ne=ne?n:qo(o);function ge(){for(var Pe=arguments.length,Fe=U(Pe),jt=Pe;jt--;)Fe[jt]=arguments[jt];if(ce)var Nt=Mi(ge),qt=kB(Fe,Nt);if(h&&(Fe=Oh(Fe,h,g,ce)),_&&(Fe=Lh(Fe,_,x,ce)),Pe-=qt,ce&&Pe<j){var rt=xr(Fe,Nt);return jh(o,a,ca,ge.placeholder,d,Fe,rt,B,F,j-Pe)}var xn=Y?d:this,Xn=ne?xn[o]:o;return Pe=Fe.length,B?Fe=PN(Fe,B):me&&Pe>1&&Fe.reverse(),K&&F<Pe&&(Fe.length=F),this&&this!==ft&&this instanceof ge&&(Xn=Ne||qo(Xn)),Xn.apply(xn,Fe)}return ge}function Wh(o,a){return function(d,h){return GA(d,o,a(h),{})}}function da(o,a){return function(d,h){var g;if(d===n&&h===n)return a;if(d!==n&&(g=d),h!==n){if(g===n)return h;typeof d=="string"||typeof h=="string"?(d=Wt(d),h=Wt(h)):(d=Nh(d),h=Nh(h)),g=o(d,h)}return g}}function Bc(o){return qn(function(a){return a=Ye(a,$t(he())),Ve(function(d){var h=this;return o(a,function(g){return Zt(g,h,d)})})})}function ua(o,a){a=a===n?" ":Wt(a);var d=a.length;if(d<2)return d?wc(a,o):a;var h=wc(a,Js(o/Bi(a)));return Ti(a)?Br(Cn(h),0,o).join(""):h.slice(0,o)}function hN(o,a,d,h){var g=a&R,_=qo(o);function x(){for(var B=-1,F=arguments.length,j=-1,K=h.length,Y=U(K+F),ne=this&&this!==ft&&this instanceof x?_:o;++j<K;)Y[j]=h[j];for(;F--;)Y[j++]=arguments[++B];return Zt(ne,g?d:this,Y)}return x}function Hh(o){return function(a,d,h){return h&&typeof h!="number"&&At(a,d,h)&&(d=h=n),a=Jn(a),d===n?(d=a,a=0):d=Jn(d),h=h===n?a<d?1:-1:Jn(h),XA(a,d,h,o)}}function pa(o){return function(a,d){return typeof a=="string"&&typeof d=="string"||(a=nn(a),d=nn(d)),o(a,d)}}function jh(o,a,d,h,g,_,x,B,F,j){var K=a&X,Y=K?x:n,ne=K?n:x,ce=K?_:n,me=K?n:_;a|=K?P:O,a&=~(K?O:P),a&G||(a&=~(R|C));var Ne=[o,a,g,ce,Y,me,ne,B,F,j],ge=d.apply(n,Ne);return Mc(o)&&sf(ge,Ne),ge.placeholder=h,af(ge,o,a)}function Ac(o){var a=at[o];return function(d,h){if(d=nn(d),h=h==null?0:wt(Te(h),292),h&&sh(d)){var g=(Ze(d)+"e").split("e"),_=a(g[0]+"e"+(+g[1]+h));return g=(Ze(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(d)}}var fN=Vi&&1/zs(new Vi([,-0]))[1]==pe?function(o){return new Vi(o)}:Jc;function qh(o){return function(a){var d=bt(a);return d==vn?oc(a):d==_n?VB(a):xB(a,o(a))}}function jn(o,a,d,h,g,_,x,B){var F=a&C;if(!F&&typeof o!="function")throw new Jt(c);var j=h?h.length:0;if(j||(a&=~(P|O),h=g=n),x=x===n?x:lt(Te(x),0),B=B===n?B:Te(B),j-=g?g.length:0,a&O){var K=h,Y=g;h=g=n}var ne=F?n:Pc(o),ce=[o,a,d,h,g,K,Y,_,x,B];if(ne&&AN(ce,ne),o=ce[0],a=ce[1],d=ce[2],h=ce[3],g=ce[4],B=ce[9]=ce[9]===n?F?0:o.length:lt(ce[9]-j,0),!B&&a&(X|L)&&(a&=~(X|L)),!a||a==R)var me=uN(o,a,d);else a==X||a==L?me=pN(o,a,B):(a==P||a==(R|P))&&!g.length?me=hN(o,a,d,h):me=ca.apply(n,ce);var Ne=ne?Bh:sf;return af(Ne(me,ce),o,a)}function Kh(o,a,d,h){return o===n||bn(o,Ni[d])&&!$e.call(h,d)?a:o}function Yh(o,a,d,h,g,_){return Qe(o)&&Qe(a)&&(_.set(a,o),oa(o,a,n,Yh,_),_.delete(a)),o}function mN(o){return Jo(o)?n:o}function Jh(o,a,d,h,g,_){var x=d&M,B=o.length,F=a.length;if(B!=F&&!(x&&F>B))return!1;var j=_.get(o),K=_.get(a);if(j&&K)return j==a&&K==o;var Y=-1,ne=!0,ce=d&T?new Kr:n;for(_.set(o,a),_.set(a,o);++Y<B;){var me=o[Y],Ne=a[Y];if(h)var ge=x?h(Ne,me,Y,a,o,_):h(me,Ne,Y,o,a,_);if(ge!==n){if(ge)continue;ne=!1;break}if(ce){if(!Ql(a,function(Pe,Fe){if(!Io(ce,Fe)&&(me===Pe||g(me,Pe,d,h,_)))return ce.push(Fe)})){ne=!1;break}}else if(!(me===Ne||g(me,Ne,d,h,_))){ne=!1;break}}return _.delete(o),_.delete(a),ne}function gN(o,a,d,h,g,_,x){switch(d){case ki:if(o.byteLength!=a.byteLength||o.byteOffset!=a.byteOffset)return!1;o=o.buffer,a=a.buffer;case Mo:return!(o.byteLength!=a.byteLength||!_(new js(o),new js(a)));case Ge:case Cr:case Po:return bn(+o,+a);case Ds:return o.name==a.name&&o.message==a.message;case Do:case Fo:return o==a+"";case vn:var B=oc;case _n:var F=h&M;if(B||(B=zs),o.size!=a.size&&!F)return!1;var j=x.get(o);if(j)return j==a;h|=T,x.set(o,a);var K=Jh(B(o),B(a),h,g,_,x);return x.delete(o),K;case Rs:if(Uo)return Uo.call(o)==Uo.call(a)}return!1}function yN(o,a,d,h,g,_){var x=d&M,B=Nc(o),F=B.length,j=Nc(a),K=j.length;if(F!=K&&!x)return!1;for(var Y=F;Y--;){var ne=B[Y];if(!(x?ne in a:$e.call(a,ne)))return!1}var ce=_.get(o),me=_.get(a);if(ce&&me)return ce==a&&me==o;var Ne=!0;_.set(o,a),_.set(a,o);for(var ge=x;++Y<F;){ne=B[Y];var Pe=o[ne],Fe=a[ne];if(h)var jt=x?h(Fe,Pe,ne,a,o,_):h(Pe,Fe,ne,o,a,_);if(!(jt===n?Pe===Fe||g(Pe,Fe,d,h,_):jt)){Ne=!1;break}ge||(ge=ne=="constructor")}if(Ne&&!ge){var Nt=o.constructor,qt=a.constructor;Nt!=qt&&"constructor"in o&&"constructor"in a&&!(typeof Nt=="function"&&Nt instanceof Nt&&typeof qt=="function"&&qt instanceof qt)&&(Ne=!1)}return _.delete(o),_.delete(a),Ne}function qn(o){return Oc(rf(o,n,hf),o+"")}function Nc(o){return yh(o,pt,Fc)}function Vc(o){return yh(o,Rt,Xh)}var Pc=Qs?function(o){return Qs.get(o)}:Jc;function ha(o){for(var a=o.name+"",d=Pi[a],h=$e.call(Pi,a)?d.length:0;h--;){var g=d[h],_=g.func;if(_==null||_==o)return g.name}return a}function Mi(o){var a=$e.call(v,"placeholder")?v:o;return a.placeholder}function he(){var o=v.iteratee||Kc;return o=o===Kc?Ch:o,arguments.length?o(arguments[0],arguments[1]):o}function fa(o,a){var d=o.__data__;return SN(a)?d[typeof a=="string"?"string":"hash"]:d.map}function Dc(o){for(var a=pt(o),d=a.length;d--;){var h=a[d],g=o[h];a[d]=[h,g,tf(g)]}return a}function Xr(o,a){var d=BB(o,a);return _h(d)?d:n}function vN(o){var a=$e.call(o,jr),d=o[jr];try{o[jr]=n;var h=!0}catch{}var g=Ws.call(o);return h&&(a?o[jr]=d:delete o[jr]),g}var Fc=ac?function(o){return o==null?[]:(o=We(o),wr(ac(o),function(a){return ih.call(o,a)}))}:Xc,Xh=ac?function(o){for(var a=[];o;)br(a,Fc(o)),o=qs(o);return a}:Xc,bt=Bt;(lc&&bt(new lc(new ArrayBuffer(1)))!=ki||Lo&&bt(new Lo)!=vn||cc&&bt(cc.resolve())!=fp||Vi&&bt(new Vi)!=_n||Go&&bt(new Go)!=Ro)&&(bt=function(o){var a=Bt(o),d=a==Zn?o.constructor:n,h=d?Qr(d):"";if(h)switch(h){case eA:return ki;case tA:return vn;case nA:return fp;case rA:return _n;case iA:return Ro}return a});function _N(o,a,d){for(var h=-1,g=d.length;++h<g;){var _=d[h],x=_.size;switch(_.type){case"drop":o+=x;break;case"dropRight":a-=x;break;case"take":a=wt(a,o+x);break;case"takeRight":o=lt(o,a-x);break}}return{start:o,end:a}}function CN(o){var a=o.match(ET);return a?a[1].split(TT):[]}function Qh(o,a,d){a=Tr(a,o);for(var h=-1,g=a.length,_=!1;++h<g;){var x=Fn(a[h]);if(!(_=o!=null&&d(o,x)))break;o=o[x]}return _||++h!=g?_:(g=o==null?0:o.length,!!g&&wa(g)&&Kn(x,g)&&(ke(o)||ei(o)))}function wN(o){var a=o.length,d=new o.constructor(a);return a&&typeof o[0]=="string"&&$e.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function ef(o){return typeof o.constructor=="function"&&!Ko(o)?Di(qs(o)):{}}function bN(o,a,d){var h=o.constructor;switch(a){case Mo:return Tc(o);case Ge:case Cr:return new h(+o);case ki:return oN(o,d);case Dl:case Fl:case Rl:case Ml:case Il:case Ol:case Ll:case Gl:case zl:return Mh(o,d);case vn:return new h;case Po:case Fo:return new h(o);case Do:return sN(o);case _n:return new h;case Rs:return aN(o)}}function xN(o,a){var d=a.length;if(!d)return o;var h=d-1;return a[h]=(d>1?"& ":"")+a[h],a=a.join(d>2?", ":" "),o.replace(ST,`{
70
+ */Bs.exports,function(t,e){(function(){var n,i="4.17.21",s=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",y=1,T=2,S=4,D=1,k=2,M=1,C=2,G=4,X=8,O=16,P=32,L=64,z=128,A=256,E=512,V=30,W="...",q=800,Z=16,N=1,U=2,J=3,pe=1/0,we=9007199254740991,Ct=17976931348623157e292,Bt=NaN,ht=4294967295,vr=ht-1,Vn=ht>>>1,_r=[["ary",z],["bind",M],["bindKey",C],["curry",X],["curryRight",O],["flip",E],["partial",P],["partialRight",L],["rearg",A]],$n="[object Arguments]",Wr="[object Array]",Ps="[object AsyncFunction]",Ge="[object Boolean]",Cr="[object Date]",aT="[object DOMException]",Ds="[object Error]",Fs="[object Function]",hp="[object GeneratorFunction]",vn="[object Map]",Po="[object Number]",lT="[object Null]",Un="[object Object]",fp="[object Promise]",cT="[object Proxy]",Do="[object RegExp]",_n="[object Set]",Fo="[object String]",Rs="[object Symbol]",dT="[object Undefined]",Ro="[object WeakMap]",uT="[object WeakSet]",Mo="[object ArrayBuffer]",ki="[object DataView]",Dl="[object Float32Array]",Fl="[object Float64Array]",Rl="[object Int8Array]",Ml="[object Int16Array]",Il="[object Int32Array]",Ll="[object Uint8Array]",Ol="[object Uint8ClampedArray]",Gl="[object Uint16Array]",zl="[object Uint32Array]",pT=/\b__p \+= '';/g,hT=/\b(__p \+=) '' \+/g,fT=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mp=/&(?:amp|lt|gt|quot|#39);/g,gp=/[&<>"']/g,mT=RegExp(mp.source),gT=RegExp(gp.source),yT=/<%-([\s\S]+?)%>/g,vT=/<%([\s\S]+?)%>/g,yp=/<%=([\s\S]+?)%>/g,_T=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,CT=/^\w*$/,wT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$l=/[\\^$.*+?()[\]{}|]/g,bT=RegExp($l.source),Ul=/^\s+/,xT=/\s/,kT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ST=/\{\n\/\* \[wrapped with (.+)\] \*/,ET=/,? & /,TT=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,BT=/[()=,{}\[\]\/\s]/,NT=/\\(\\)?/g,AT=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vp=/\w*$/,VT=/^[-+]0x[0-9a-f]+$/i,PT=/^0b[01]+$/i,DT=/^\[object .+?Constructor\]$/,FT=/^0o[0-7]+$/i,RT=/^(?:0|[1-9]\d*)$/,MT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ms=/($^)/,IT=/['\n\r\u2028\u2029\\]/g,Is="\\ud800-\\udfff",LT="\\u0300-\\u036f",OT="\\ufe20-\\ufe2f",GT="\\u20d0-\\u20ff",_p=LT+OT+GT,Cp="\\u2700-\\u27bf",wp="a-z\\xdf-\\xf6\\xf8-\\xff",zT="\\xac\\xb1\\xd7\\xf7",$T="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",UT="\\u2000-\\u206f",ZT=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bp="A-Z\\xc0-\\xd6\\xd8-\\xde",xp="\\ufe0e\\ufe0f",kp=zT+$T+UT+ZT,Zl="['’]",WT="["+Is+"]",Sp="["+kp+"]",Ls="["+_p+"]",Ep="\\d+",HT="["+Cp+"]",Tp="["+wp+"]",Bp="[^"+Is+kp+Ep+Cp+wp+bp+"]",Wl="\\ud83c[\\udffb-\\udfff]",jT="(?:"+Ls+"|"+Wl+")",Np="[^"+Is+"]",Hl="(?:\\ud83c[\\udde6-\\uddff]){2}",jl="[\\ud800-\\udbff][\\udc00-\\udfff]",Si="["+bp+"]",Ap="\\u200d",Vp="(?:"+Tp+"|"+Bp+")",qT="(?:"+Si+"|"+Bp+")",Pp="(?:"+Zl+"(?:d|ll|m|re|s|t|ve))?",Dp="(?:"+Zl+"(?:D|LL|M|RE|S|T|VE))?",Fp=jT+"?",Rp="["+xp+"]?",KT="(?:"+Ap+"(?:"+[Np,Hl,jl].join("|")+")"+Rp+Fp+")*",YT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",JT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Mp=Rp+Fp+KT,XT="(?:"+[HT,Hl,jl].join("|")+")"+Mp,QT="(?:"+[Np+Ls+"?",Ls,Hl,jl,WT].join("|")+")",eB=RegExp(Zl,"g"),tB=RegExp(Ls,"g"),ql=RegExp(Wl+"(?="+Wl+")|"+QT+Mp,"g"),nB=RegExp([Si+"?"+Tp+"+"+Pp+"(?="+[Sp,Si,"$"].join("|")+")",qT+"+"+Dp+"(?="+[Sp,Si+Vp,"$"].join("|")+")",Si+"?"+Vp+"+"+Pp,Si+"+"+Dp,JT,YT,Ep,XT].join("|"),"g"),rB=RegExp("["+Ap+Is+_p+xp+"]"),iB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,oB=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],sB=-1,qe={};qe[Dl]=qe[Fl]=qe[Rl]=qe[Ml]=qe[Il]=qe[Ll]=qe[Ol]=qe[Gl]=qe[zl]=!0,qe[$n]=qe[Wr]=qe[Mo]=qe[Ge]=qe[ki]=qe[Cr]=qe[Ds]=qe[Fs]=qe[vn]=qe[Po]=qe[Un]=qe[Do]=qe[_n]=qe[Fo]=qe[Ro]=!1;var He={};He[$n]=He[Wr]=He[Mo]=He[ki]=He[Ge]=He[Cr]=He[Dl]=He[Fl]=He[Rl]=He[Ml]=He[Il]=He[vn]=He[Po]=He[Un]=He[Do]=He[_n]=He[Fo]=He[Rs]=He[Ll]=He[Ol]=He[Gl]=He[zl]=!0,He[Ds]=He[Fs]=He[Ro]=!1;var aB={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},lB={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},cB={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},dB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},uB=parseFloat,pB=parseInt,Ip=typeof Oi=="object"&&Oi&&Oi.Object===Object&&Oi,hB=typeof self=="object"&&self&&self.Object===Object&&self,ft=Ip||hB||Function("return this")(),Kl=e&&!e.nodeType&&e,Hr=Kl&&!0&&t&&!t.nodeType&&t,Lp=Hr&&Hr.exports===Kl,Yl=Lp&&Ip.process,Kt=function(){try{var F=Hr&&Hr.require&&Hr.require("util").types;return F||Yl&&Yl.binding&&Yl.binding("util")}catch{}}(),Op=Kt&&Kt.isArrayBuffer,Gp=Kt&&Kt.isDate,zp=Kt&&Kt.isMap,$p=Kt&&Kt.isRegExp,Up=Kt&&Kt.isSet,Zp=Kt&&Kt.isTypedArray;function Ut(F,H,$){switch($.length){case 0:return F.call(H);case 1:return F.call(H,$[0]);case 2:return F.call(H,$[0],$[1]);case 3:return F.call(H,$[0],$[1],$[2])}return F.apply(H,$)}function fB(F,H,$,ae){for(var xe=-1,ze=F==null?0:F.length;++xe<ze;){var at=F[xe];H(ae,at,$(at),F)}return ae}function Yt(F,H){for(var $=-1,ae=F==null?0:F.length;++$<ae&&H(F[$],$,F)!==!1;);return F}function mB(F,H){for(var $=F==null?0:F.length;$--&&H(F[$],$,F)!==!1;);return F}function Wp(F,H){for(var $=-1,ae=F==null?0:F.length;++$<ae;)if(!H(F[$],$,F))return!1;return!0}function wr(F,H){for(var $=-1,ae=F==null?0:F.length,xe=0,ze=[];++$<ae;){var at=F[$];H(at,$,F)&&(ze[xe++]=at)}return ze}function Os(F,H){var $=F==null?0:F.length;return!!$&&Ei(F,H,0)>-1}function Jl(F,H,$){for(var ae=-1,xe=F==null?0:F.length;++ae<xe;)if($(H,F[ae]))return!0;return!1}function Ye(F,H){for(var $=-1,ae=F==null?0:F.length,xe=Array(ae);++$<ae;)xe[$]=H(F[$],$,F);return xe}function br(F,H){for(var $=-1,ae=H.length,xe=F.length;++$<ae;)F[xe+$]=H[$];return F}function Xl(F,H,$,ae){var xe=-1,ze=F==null?0:F.length;for(ae&&ze&&($=F[++xe]);++xe<ze;)$=H($,F[xe],xe,F);return $}function gB(F,H,$,ae){var xe=F==null?0:F.length;for(ae&&xe&&($=F[--xe]);xe--;)$=H($,F[xe],xe,F);return $}function Ql(F,H){for(var $=-1,ae=F==null?0:F.length;++$<ae;)if(H(F[$],$,F))return!0;return!1}var yB=ec("length");function vB(F){return F.split("")}function _B(F){return F.match(TT)||[]}function Hp(F,H,$){var ae;return $(F,function(xe,ze,at){if(H(xe,ze,at))return ae=ze,!1}),ae}function Gs(F,H,$,ae){for(var xe=F.length,ze=$+(ae?1:-1);ae?ze--:++ze<xe;)if(H(F[ze],ze,F))return ze;return-1}function Ei(F,H,$){return H===H?VB(F,H,$):Gs(F,jp,$)}function CB(F,H,$,ae){for(var xe=$-1,ze=F.length;++xe<ze;)if(ae(F[xe],H))return xe;return-1}function jp(F){return F!==F}function qp(F,H){var $=F==null?0:F.length;return $?nc(F,H)/$:Bt}function ec(F){return function(H){return H==null?n:H[F]}}function tc(F){return function(H){return F==null?n:F[H]}}function Kp(F,H,$,ae,xe){return xe(F,function(ze,at,We){$=ae?(ae=!1,ze):H($,ze,at,We)}),$}function wB(F,H){var $=F.length;for(F.sort(H);$--;)F[$]=F[$].value;return F}function nc(F,H){for(var $,ae=-1,xe=F.length;++ae<xe;){var ze=H(F[ae]);ze!==n&&($=$===n?ze:$+ze)}return $}function rc(F,H){for(var $=-1,ae=Array(F);++$<F;)ae[$]=H($);return ae}function bB(F,H){return Ye(H,function($){return[$,F[$]]})}function Yp(F){return F&&F.slice(0,eh(F)+1).replace(Ul,"")}function Zt(F){return function(H){return F(H)}}function ic(F,H){return Ye(H,function($){return F[$]})}function Io(F,H){return F.has(H)}function Jp(F,H){for(var $=-1,ae=F.length;++$<ae&&Ei(H,F[$],0)>-1;);return $}function Xp(F,H){for(var $=F.length;$--&&Ei(H,F[$],0)>-1;);return $}function xB(F,H){for(var $=F.length,ae=0;$--;)F[$]===H&&++ae;return ae}var kB=tc(aB),SB=tc(lB);function EB(F){return"\\"+dB[F]}function TB(F,H){return F==null?n:F[H]}function Ti(F){return rB.test(F)}function BB(F){return iB.test(F)}function NB(F){for(var H,$=[];!(H=F.next()).done;)$.push(H.value);return $}function oc(F){var H=-1,$=Array(F.size);return F.forEach(function(ae,xe){$[++H]=[xe,ae]}),$}function Qp(F,H){return function($){return F(H($))}}function xr(F,H){for(var $=-1,ae=F.length,xe=0,ze=[];++$<ae;){var at=F[$];(at===H||at===m)&&(F[$]=m,ze[xe++]=$)}return ze}function zs(F){var H=-1,$=Array(F.size);return F.forEach(function(ae){$[++H]=ae}),$}function AB(F){var H=-1,$=Array(F.size);return F.forEach(function(ae){$[++H]=[ae,ae]}),$}function VB(F,H,$){for(var ae=$-1,xe=F.length;++ae<xe;)if(F[ae]===H)return ae;return-1}function PB(F,H,$){for(var ae=$+1;ae--;)if(F[ae]===H)return ae;return ae}function Bi(F){return Ti(F)?FB(F):yB(F)}function Cn(F){return Ti(F)?RB(F):vB(F)}function eh(F){for(var H=F.length;H--&&xT.test(F.charAt(H)););return H}var DB=tc(cB);function FB(F){for(var H=ql.lastIndex=0;ql.test(F);)++H;return H}function RB(F){return F.match(ql)||[]}function MB(F){return F.match(nB)||[]}var IB=function F(H){H=H==null?ft:Ni.defaults(ft.Object(),H,Ni.pick(ft,oB));var $=H.Array,ae=H.Date,xe=H.Error,ze=H.Function,at=H.Math,We=H.Object,sc=H.RegExp,LB=H.String,Jt=H.TypeError,$s=$.prototype,OB=ze.prototype,Ai=We.prototype,Us=H["__core-js_shared__"],Zs=OB.toString,Ze=Ai.hasOwnProperty,GB=0,th=function(){var o=/[^.]+$/.exec(Us&&Us.keys&&Us.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Ws=Ai.toString,zB=Zs.call(We),$B=ft._,UB=sc("^"+Zs.call(Ze).replace($l,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hs=Lp?H.Buffer:n,kr=H.Symbol,js=H.Uint8Array,nh=Hs?Hs.allocUnsafe:n,qs=Qp(We.getPrototypeOf,We),rh=We.create,ih=Ai.propertyIsEnumerable,Ks=$s.splice,oh=kr?kr.isConcatSpreadable:n,Lo=kr?kr.iterator:n,jr=kr?kr.toStringTag:n,Ys=function(){try{var o=Xr(We,"defineProperty");return o({},"",{}),o}catch{}}(),ZB=H.clearTimeout!==ft.clearTimeout&&H.clearTimeout,WB=ae&&ae.now!==ft.Date.now&&ae.now,HB=H.setTimeout!==ft.setTimeout&&H.setTimeout,Js=at.ceil,Xs=at.floor,ac=We.getOwnPropertySymbols,jB=Hs?Hs.isBuffer:n,sh=H.isFinite,qB=$s.join,KB=Qp(We.keys,We),lt=at.max,wt=at.min,YB=ae.now,JB=H.parseInt,ah=at.random,XB=$s.reverse,lc=Xr(H,"DataView"),Oo=Xr(H,"Map"),cc=Xr(H,"Promise"),Vi=Xr(H,"Set"),Go=Xr(H,"WeakMap"),zo=Xr(We,"create"),Qs=Go&&new Go,Pi={},QB=Qr(lc),eN=Qr(Oo),tN=Qr(cc),nN=Qr(Vi),rN=Qr(Go),ea=kr?kr.prototype:n,$o=ea?ea.valueOf:n,lh=ea?ea.toString:n;function v(o){if(et(o)&&!ke(o)&&!(o instanceof De)){if(o instanceof Xt)return o;if(Ze.call(o,"__wrapped__"))return df(o)}return new Xt(o)}var Di=function(){function o(){}return function(a){if(!Qe(a))return{};if(rh)return rh(a);o.prototype=a;var d=new o;return o.prototype=n,d}}();function ta(){}function Xt(o,a){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}v.templateSettings={escape:yT,evaluate:vT,interpolate:yp,variable:"",imports:{_:v}},v.prototype=ta.prototype,v.prototype.constructor=v,Xt.prototype=Di(ta.prototype),Xt.prototype.constructor=Xt;function De(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ht,this.__views__=[]}function iN(){var o=new De(this.__wrapped__);return o.__actions__=Dt(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Dt(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Dt(this.__views__),o}function oN(){if(this.__filtered__){var o=new De(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function sN(){var o=this.__wrapped__.value(),a=this.__dir__,d=ke(o),h=a<0,g=d?o.length:0,_=vA(0,g,this.__views__),x=_.start,B=_.end,R=B-x,j=h?B:x-1,K=this.__iteratees__,Y=K.length,ne=0,ce=wt(R,this.__takeCount__);if(!d||!h&&g==R&&ce==R)return Ph(o,this.__actions__);var me=[];e:for(;R--&&ne<ce;){j+=a;for(var Ae=-1,ge=o[j];++Ae<Y;){var Pe=K[Ae],Fe=Pe.iteratee,jt=Pe.type,Vt=Fe(ge);if(jt==U)ge=Vt;else if(!Vt){if(jt==N)continue e;break e}}me[ne++]=ge}return me}De.prototype=Di(ta.prototype),De.prototype.constructor=De;function qr(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function aN(){this.__data__=zo?zo(null):{},this.size=0}function lN(o){var a=this.has(o)&&delete this.__data__[o];return this.size-=a?1:0,a}function cN(o){var a=this.__data__;if(zo){var d=a[o];return d===p?n:d}return Ze.call(a,o)?a[o]:n}function dN(o){var a=this.__data__;return zo?a[o]!==n:Ze.call(a,o)}function uN(o,a){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=zo&&a===n?p:a,this}qr.prototype.clear=aN,qr.prototype.delete=lN,qr.prototype.get=cN,qr.prototype.has=dN,qr.prototype.set=uN;function Zn(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function pN(){this.__data__=[],this.size=0}function hN(o){var a=this.__data__,d=na(a,o);if(d<0)return!1;var h=a.length-1;return d==h?a.pop():Ks.call(a,d,1),--this.size,!0}function fN(o){var a=this.__data__,d=na(a,o);return d<0?n:a[d][1]}function mN(o){return na(this.__data__,o)>-1}function gN(o,a){var d=this.__data__,h=na(d,o);return h<0?(++this.size,d.push([o,a])):d[h][1]=a,this}Zn.prototype.clear=pN,Zn.prototype.delete=hN,Zn.prototype.get=fN,Zn.prototype.has=mN,Zn.prototype.set=gN;function Wn(o){var a=-1,d=o==null?0:o.length;for(this.clear();++a<d;){var h=o[a];this.set(h[0],h[1])}}function yN(){this.size=0,this.__data__={hash:new qr,map:new(Oo||Zn),string:new qr}}function vN(o){var a=fa(this,o).delete(o);return this.size-=a?1:0,a}function _N(o){return fa(this,o).get(o)}function CN(o){return fa(this,o).has(o)}function wN(o,a){var d=fa(this,o),h=d.size;return d.set(o,a),this.size+=d.size==h?0:1,this}Wn.prototype.clear=yN,Wn.prototype.delete=vN,Wn.prototype.get=_N,Wn.prototype.has=CN,Wn.prototype.set=wN;function Kr(o){var a=-1,d=o==null?0:o.length;for(this.__data__=new Wn;++a<d;)this.add(o[a])}function bN(o){return this.__data__.set(o,p),this}function xN(o){return this.__data__.has(o)}Kr.prototype.add=Kr.prototype.push=bN,Kr.prototype.has=xN;function wn(o){var a=this.__data__=new Zn(o);this.size=a.size}function kN(){this.__data__=new Zn,this.size=0}function SN(o){var a=this.__data__,d=a.delete(o);return this.size=a.size,d}function EN(o){return this.__data__.get(o)}function TN(o){return this.__data__.has(o)}function BN(o,a){var d=this.__data__;if(d instanceof Zn){var h=d.__data__;if(!Oo||h.length<s-1)return h.push([o,a]),this.size=++d.size,this;d=this.__data__=new Wn(h)}return d.set(o,a),this.size=d.size,this}wn.prototype.clear=kN,wn.prototype.delete=SN,wn.prototype.get=EN,wn.prototype.has=TN,wn.prototype.set=BN;function ch(o,a){var d=ke(o),h=!d&&ei(o),g=!d&&!h&&Nr(o),_=!d&&!h&&!g&&Ii(o),x=d||h||g||_,B=x?rc(o.length,LB):[],R=B.length;for(var j in o)(a||Ze.call(o,j))&&!(x&&(j=="length"||g&&(j=="offset"||j=="parent")||_&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||Kn(j,R)))&&B.push(j);return B}function dh(o){var a=o.length;return a?o[Cc(0,a-1)]:n}function NN(o,a){return ma(Dt(o),Yr(a,0,o.length))}function AN(o){return ma(Dt(o))}function dc(o,a,d){(d!==n&&!bn(o[a],d)||d===n&&!(a in o))&&Hn(o,a,d)}function Uo(o,a,d){var h=o[a];(!(Ze.call(o,a)&&bn(h,d))||d===n&&!(a in o))&&Hn(o,a,d)}function na(o,a){for(var d=o.length;d--;)if(bn(o[d][0],a))return d;return-1}function VN(o,a,d,h){return Sr(o,function(g,_,x){a(h,g,d(g),x)}),h}function uh(o,a){return o&&Dn(a,pt(a),o)}function PN(o,a){return o&&Dn(a,Rt(a),o)}function Hn(o,a,d){a=="__proto__"&&Ys?Ys(o,a,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[a]=d}function uc(o,a){for(var d=-1,h=a.length,g=$(h),_=o==null;++d<h;)g[d]=_?n:Wc(o,a[d]);return g}function Yr(o,a,d){return o===o&&(d!==n&&(o=o<=d?o:d),a!==n&&(o=o>=a?o:a)),o}function Qt(o,a,d,h,g,_){var x,B=a&y,R=a&T,j=a&S;if(d&&(x=g?d(o,h,g,_):d(o)),x!==n)return x;if(!Qe(o))return o;var K=ke(o);if(K){if(x=CA(o),!B)return Dt(o,x)}else{var Y=bt(o),ne=Y==Fs||Y==hp;if(Nr(o))return Rh(o,B);if(Y==Un||Y==$n||ne&&!g){if(x=R||ne?{}:ef(o),!B)return R?cA(o,PN(x,o)):lA(o,uh(x,o))}else{if(!He[Y])return g?o:{};x=wA(o,Y,B)}}_||(_=new wn);var ce=_.get(o);if(ce)return ce;_.set(o,x),Af(o)?o.forEach(function(ge){x.add(Qt(ge,a,d,ge,o,_))}):Bf(o)&&o.forEach(function(ge,Pe){x.set(Pe,Qt(ge,a,d,Pe,o,_))});var me=j?R?Vc:Ac:R?Rt:pt,Ae=K?n:me(o);return Yt(Ae||o,function(ge,Pe){Ae&&(Pe=ge,ge=o[Pe]),Uo(x,Pe,Qt(ge,a,d,Pe,o,_))}),x}function DN(o){var a=pt(o);return function(d){return ph(d,o,a)}}function ph(o,a,d){var h=d.length;if(o==null)return!h;for(o=We(o);h--;){var g=d[h],_=a[g],x=o[g];if(x===n&&!(g in o)||!_(x))return!1}return!0}function hh(o,a,d){if(typeof o!="function")throw new Jt(c);return Yo(function(){o.apply(n,d)},a)}function Zo(o,a,d,h){var g=-1,_=Os,x=!0,B=o.length,R=[],j=a.length;if(!B)return R;d&&(a=Ye(a,Zt(d))),h?(_=Jl,x=!1):a.length>=s&&(_=Io,x=!1,a=new Kr(a));e:for(;++g<B;){var K=o[g],Y=d==null?K:d(K);if(K=h||K!==0?K:0,x&&Y===Y){for(var ne=j;ne--;)if(a[ne]===Y)continue e;R.push(K)}else _(a,Y,h)||R.push(K)}return R}var Sr=Gh(Pn),fh=Gh(hc,!0);function FN(o,a){var d=!0;return Sr(o,function(h,g,_){return d=!!a(h,g,_),d}),d}function ra(o,a,d){for(var h=-1,g=o.length;++h<g;){var _=o[h],x=a(_);if(x!=null&&(B===n?x===x&&!Ht(x):d(x,B)))var B=x,R=_}return R}function RN(o,a,d,h){var g=o.length;for(d=Te(d),d<0&&(d=-d>g?0:g+d),h=h===n||h>g?g:Te(h),h<0&&(h+=g),h=d>h?0:Pf(h);d<h;)o[d++]=a;return o}function mh(o,a){var d=[];return Sr(o,function(h,g,_){a(h,g,_)&&d.push(h)}),d}function mt(o,a,d,h,g){var _=-1,x=o.length;for(d||(d=xA),g||(g=[]);++_<x;){var B=o[_];a>0&&d(B)?a>1?mt(B,a-1,d,h,g):br(g,B):h||(g[g.length]=B)}return g}var pc=zh(),gh=zh(!0);function Pn(o,a){return o&&pc(o,a,pt)}function hc(o,a){return o&&gh(o,a,pt)}function ia(o,a){return wr(a,function(d){return Yn(o[d])})}function Jr(o,a){a=Tr(a,o);for(var d=0,h=a.length;o!=null&&d<h;)o=o[Fn(a[d++])];return d&&d==h?o:n}function yh(o,a,d){var h=a(o);return ke(o)?h:br(h,d(o))}function Nt(o){return o==null?o===n?dT:lT:jr&&jr in We(o)?yA(o):AA(o)}function fc(o,a){return o>a}function MN(o,a){return o!=null&&Ze.call(o,a)}function IN(o,a){return o!=null&&a in We(o)}function LN(o,a,d){return o>=wt(a,d)&&o<lt(a,d)}function mc(o,a,d){for(var h=d?Jl:Os,g=o[0].length,_=o.length,x=_,B=$(_),R=1/0,j=[];x--;){var K=o[x];x&&a&&(K=Ye(K,Zt(a))),R=wt(K.length,R),B[x]=!d&&(a||g>=120&&K.length>=120)?new Kr(x&&K):n}K=o[0];var Y=-1,ne=B[0];e:for(;++Y<g&&j.length<R;){var ce=K[Y],me=a?a(ce):ce;if(ce=d||ce!==0?ce:0,!(ne?Io(ne,me):h(j,me,d))){for(x=_;--x;){var Ae=B[x];if(!(Ae?Io(Ae,me):h(o[x],me,d)))continue e}ne&&ne.push(me),j.push(ce)}}return j}function ON(o,a,d,h){return Pn(o,function(g,_,x){a(h,d(g),_,x)}),h}function Wo(o,a,d){a=Tr(a,o),o=of(o,a);var h=o==null?o:o[Fn(tn(a))];return h==null?n:Ut(h,o,d)}function vh(o){return et(o)&&Nt(o)==$n}function GN(o){return et(o)&&Nt(o)==Mo}function zN(o){return et(o)&&Nt(o)==Cr}function Ho(o,a,d,h,g){return o===a?!0:o==null||a==null||!et(o)&&!et(a)?o!==o&&a!==a:$N(o,a,d,h,Ho,g)}function $N(o,a,d,h,g,_){var x=ke(o),B=ke(a),R=x?Wr:bt(o),j=B?Wr:bt(a);R=R==$n?Un:R,j=j==$n?Un:j;var K=R==Un,Y=j==Un,ne=R==j;if(ne&&Nr(o)){if(!Nr(a))return!1;x=!0,K=!1}if(ne&&!K)return _||(_=new wn),x||Ii(o)?Jh(o,a,d,h,g,_):mA(o,a,R,d,h,g,_);if(!(d&D)){var ce=K&&Ze.call(o,"__wrapped__"),me=Y&&Ze.call(a,"__wrapped__");if(ce||me){var Ae=ce?o.value():o,ge=me?a.value():a;return _||(_=new wn),g(Ae,ge,d,h,_)}}return ne?(_||(_=new wn),gA(o,a,d,h,g,_)):!1}function UN(o){return et(o)&&bt(o)==vn}function gc(o,a,d,h){var g=d.length,_=g,x=!h;if(o==null)return!_;for(o=We(o);g--;){var B=d[g];if(x&&B[2]?B[1]!==o[B[0]]:!(B[0]in o))return!1}for(;++g<_;){B=d[g];var R=B[0],j=o[R],K=B[1];if(x&&B[2]){if(j===n&&!(R in o))return!1}else{var Y=new wn;if(h)var ne=h(j,K,R,o,a,Y);if(!(ne===n?Ho(K,j,D|k,h,Y):ne))return!1}}return!0}function _h(o){if(!Qe(o)||SA(o))return!1;var a=Yn(o)?UB:DT;return a.test(Qr(o))}function ZN(o){return et(o)&&Nt(o)==Do}function WN(o){return et(o)&&bt(o)==_n}function HN(o){return et(o)&&wa(o.length)&&!!qe[Nt(o)]}function Ch(o){return typeof o=="function"?o:o==null?Mt:typeof o=="object"?ke(o)?xh(o[0],o[1]):bh(o):Uf(o)}function yc(o){if(!Ko(o))return KB(o);var a=[];for(var d in We(o))Ze.call(o,d)&&d!="constructor"&&a.push(d);return a}function jN(o){if(!Qe(o))return NA(o);var a=Ko(o),d=[];for(var h in o)h=="constructor"&&(a||!Ze.call(o,h))||d.push(h);return d}function vc(o,a){return o<a}function wh(o,a){var d=-1,h=Ft(o)?$(o.length):[];return Sr(o,function(g,_,x){h[++d]=a(g,_,x)}),h}function bh(o){var a=Dc(o);return a.length==1&&a[0][2]?nf(a[0][0],a[0][1]):function(d){return d===o||gc(d,o,a)}}function xh(o,a){return Rc(o)&&tf(a)?nf(Fn(o),a):function(d){var h=Wc(d,o);return h===n&&h===a?Hc(d,o):Ho(a,h,D|k)}}function oa(o,a,d,h,g){o!==a&&pc(a,function(_,x){if(g||(g=new wn),Qe(_))qN(o,a,x,d,oa,h,g);else{var B=h?h(Ic(o,x),_,x+"",o,a,g):n;B===n&&(B=_),dc(o,x,B)}},Rt)}function qN(o,a,d,h,g,_,x){var B=Ic(o,d),R=Ic(a,d),j=x.get(R);if(j){dc(o,d,j);return}var K=_?_(B,R,d+"",o,a,x):n,Y=K===n;if(Y){var ne=ke(R),ce=!ne&&Nr(R),me=!ne&&!ce&&Ii(R);K=R,ne||ce||me?ke(B)?K=B:nt(B)?K=Dt(B):ce?(Y=!1,K=Rh(R,!0)):me?(Y=!1,K=Mh(R,!0)):K=[]:Jo(R)||ei(R)?(K=B,ei(B)?K=Df(B):(!Qe(B)||Yn(B))&&(K=ef(R))):Y=!1}Y&&(x.set(R,K),g(K,R,h,_,x),x.delete(R)),dc(o,d,K)}function kh(o,a){var d=o.length;if(d)return a+=a<0?d:0,Kn(a,d)?o[a]:n}function Sh(o,a,d){a.length?a=Ye(a,function(_){return ke(_)?function(x){return Jr(x,_.length===1?_[0]:_)}:_}):a=[Mt];var h=-1;a=Ye(a,Zt(he()));var g=wh(o,function(_,x,B){var R=Ye(a,function(j){return j(_)});return{criteria:R,index:++h,value:_}});return wB(g,function(_,x){return aA(_,x,d)})}function KN(o,a){return Eh(o,a,function(d,h){return Hc(o,h)})}function Eh(o,a,d){for(var h=-1,g=a.length,_={};++h<g;){var x=a[h],B=Jr(o,x);d(B,x)&&jo(_,Tr(x,o),B)}return _}function YN(o){return function(a){return Jr(a,o)}}function _c(o,a,d,h){var g=h?CB:Ei,_=-1,x=a.length,B=o;for(o===a&&(a=Dt(a)),d&&(B=Ye(o,Zt(d)));++_<x;)for(var R=0,j=a[_],K=d?d(j):j;(R=g(B,K,R,h))>-1;)B!==o&&Ks.call(B,R,1),Ks.call(o,R,1);return o}function Th(o,a){for(var d=o?a.length:0,h=d-1;d--;){var g=a[d];if(d==h||g!==_){var _=g;Kn(g)?Ks.call(o,g,1):xc(o,g)}}return o}function Cc(o,a){return o+Xs(ah()*(a-o+1))}function JN(o,a,d,h){for(var g=-1,_=lt(Js((a-o)/(d||1)),0),x=$(_);_--;)x[h?_:++g]=o,o+=d;return x}function wc(o,a){var d="";if(!o||a<1||a>we)return d;do a%2&&(d+=o),a=Xs(a/2),a&&(o+=o);while(a);return d}function Ve(o,a){return Lc(rf(o,a,Mt),o+"")}function XN(o){return dh(Li(o))}function QN(o,a){var d=Li(o);return ma(d,Yr(a,0,d.length))}function jo(o,a,d,h){if(!Qe(o))return o;a=Tr(a,o);for(var g=-1,_=a.length,x=_-1,B=o;B!=null&&++g<_;){var R=Fn(a[g]),j=d;if(R==="__proto__"||R==="constructor"||R==="prototype")return o;if(g!=x){var K=B[R];j=h?h(K,R,B):n,j===n&&(j=Qe(K)?K:Kn(a[g+1])?[]:{})}Uo(B,R,j),B=B[R]}return o}var Bh=Qs?function(o,a){return Qs.set(o,a),o}:Mt,eA=Ys?function(o,a){return Ys(o,"toString",{configurable:!0,enumerable:!1,value:qc(a),writable:!0})}:Mt;function tA(o){return ma(Li(o))}function en(o,a,d){var h=-1,g=o.length;a<0&&(a=-a>g?0:g+a),d=d>g?g:d,d<0&&(d+=g),g=a>d?0:d-a>>>0,a>>>=0;for(var _=$(g);++h<g;)_[h]=o[h+a];return _}function nA(o,a){var d;return Sr(o,function(h,g,_){return d=a(h,g,_),!d}),!!d}function sa(o,a,d){var h=0,g=o==null?h:o.length;if(typeof a=="number"&&a===a&&g<=Vn){for(;h<g;){var _=h+g>>>1,x=o[_];x!==null&&!Ht(x)&&(d?x<=a:x<a)?h=_+1:g=_}return g}return bc(o,a,Mt,d)}function bc(o,a,d,h){var g=0,_=o==null?0:o.length;if(_===0)return 0;a=d(a);for(var x=a!==a,B=a===null,R=Ht(a),j=a===n;g<_;){var K=Xs((g+_)/2),Y=d(o[K]),ne=Y!==n,ce=Y===null,me=Y===Y,Ae=Ht(Y);if(x)var ge=h||me;else j?ge=me&&(h||ne):B?ge=me&&ne&&(h||!ce):R?ge=me&&ne&&!ce&&(h||!Ae):ce||Ae?ge=!1:ge=h?Y<=a:Y<a;ge?g=K+1:_=K}return wt(_,vr)}function Nh(o,a){for(var d=-1,h=o.length,g=0,_=[];++d<h;){var x=o[d],B=a?a(x):x;if(!d||!bn(B,R)){var R=B;_[g++]=x===0?0:x}}return _}function Ah(o){return typeof o=="number"?o:Ht(o)?Bt:+o}function Wt(o){if(typeof o=="string")return o;if(ke(o))return Ye(o,Wt)+"";if(Ht(o))return lh?lh.call(o):"";var a=o+"";return a=="0"&&1/o==-pe?"-0":a}function Er(o,a,d){var h=-1,g=Os,_=o.length,x=!0,B=[],R=B;if(d)x=!1,g=Jl;else if(_>=s){var j=a?null:hA(o);if(j)return zs(j);x=!1,g=Io,R=new Kr}else R=a?[]:B;e:for(;++h<_;){var K=o[h],Y=a?a(K):K;if(K=d||K!==0?K:0,x&&Y===Y){for(var ne=R.length;ne--;)if(R[ne]===Y)continue e;a&&R.push(Y),B.push(K)}else g(R,Y,d)||(R!==B&&R.push(Y),B.push(K))}return B}function xc(o,a){return a=Tr(a,o),o=of(o,a),o==null||delete o[Fn(tn(a))]}function Vh(o,a,d,h){return jo(o,a,d(Jr(o,a)),h)}function aa(o,a,d,h){for(var g=o.length,_=h?g:-1;(h?_--:++_<g)&&a(o[_],_,o););return d?en(o,h?0:_,h?_+1:g):en(o,h?_+1:0,h?g:_)}function Ph(o,a){var d=o;return d instanceof De&&(d=d.value()),Xl(a,function(h,g){return g.func.apply(g.thisArg,br([h],g.args))},d)}function kc(o,a,d){var h=o.length;if(h<2)return h?Er(o[0]):[];for(var g=-1,_=$(h);++g<h;)for(var x=o[g],B=-1;++B<h;)B!=g&&(_[g]=Zo(_[g]||x,o[B],a,d));return Er(mt(_,1),a,d)}function Dh(o,a,d){for(var h=-1,g=o.length,_=a.length,x={};++h<g;){var B=h<_?a[h]:n;d(x,o[h],B)}return x}function Sc(o){return nt(o)?o:[]}function Ec(o){return typeof o=="function"?o:Mt}function Tr(o,a){return ke(o)?o:Rc(o,a)?[o]:cf(Ue(o))}var rA=Ve;function Br(o,a,d){var h=o.length;return d=d===n?h:d,!a&&d>=h?o:en(o,a,d)}var Fh=ZB||function(o){return ft.clearTimeout(o)};function Rh(o,a){if(a)return o.slice();var d=o.length,h=nh?nh(d):new o.constructor(d);return o.copy(h),h}function Tc(o){var a=new o.constructor(o.byteLength);return new js(a).set(new js(o)),a}function iA(o,a){var d=a?Tc(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function oA(o){var a=new o.constructor(o.source,vp.exec(o));return a.lastIndex=o.lastIndex,a}function sA(o){return $o?We($o.call(o)):{}}function Mh(o,a){var d=a?Tc(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Ih(o,a){if(o!==a){var d=o!==n,h=o===null,g=o===o,_=Ht(o),x=a!==n,B=a===null,R=a===a,j=Ht(a);if(!B&&!j&&!_&&o>a||_&&x&&R&&!B&&!j||h&&x&&R||!d&&R||!g)return 1;if(!h&&!_&&!j&&o<a||j&&d&&g&&!h&&!_||B&&d&&g||!x&&g||!R)return-1}return 0}function aA(o,a,d){for(var h=-1,g=o.criteria,_=a.criteria,x=g.length,B=d.length;++h<x;){var R=Ih(g[h],_[h]);if(R){if(h>=B)return R;var j=d[h];return R*(j=="desc"?-1:1)}}return o.index-a.index}function Lh(o,a,d,h){for(var g=-1,_=o.length,x=d.length,B=-1,R=a.length,j=lt(_-x,0),K=$(R+j),Y=!h;++B<R;)K[B]=a[B];for(;++g<x;)(Y||g<_)&&(K[d[g]]=o[g]);for(;j--;)K[B++]=o[g++];return K}function Oh(o,a,d,h){for(var g=-1,_=o.length,x=-1,B=d.length,R=-1,j=a.length,K=lt(_-B,0),Y=$(K+j),ne=!h;++g<K;)Y[g]=o[g];for(var ce=g;++R<j;)Y[ce+R]=a[R];for(;++x<B;)(ne||g<_)&&(Y[ce+d[x]]=o[g++]);return Y}function Dt(o,a){var d=-1,h=o.length;for(a||(a=$(h));++d<h;)a[d]=o[d];return a}function Dn(o,a,d,h){var g=!d;d||(d={});for(var _=-1,x=a.length;++_<x;){var B=a[_],R=h?h(d[B],o[B],B,d,o):n;R===n&&(R=o[B]),g?Hn(d,B,R):Uo(d,B,R)}return d}function lA(o,a){return Dn(o,Fc(o),a)}function cA(o,a){return Dn(o,Xh(o),a)}function la(o,a){return function(d,h){var g=ke(d)?fB:VN,_=a?a():{};return g(d,o,he(h,2),_)}}function Fi(o){return Ve(function(a,d){var h=-1,g=d.length,_=g>1?d[g-1]:n,x=g>2?d[2]:n;for(_=o.length>3&&typeof _=="function"?(g--,_):n,x&&At(d[0],d[1],x)&&(_=g<3?n:_,g=1),a=We(a);++h<g;){var B=d[h];B&&o(a,B,h,_)}return a})}function Gh(o,a){return function(d,h){if(d==null)return d;if(!Ft(d))return o(d,h);for(var g=d.length,_=a?g:-1,x=We(d);(a?_--:++_<g)&&h(x[_],_,x)!==!1;);return d}}function zh(o){return function(a,d,h){for(var g=-1,_=We(a),x=h(a),B=x.length;B--;){var R=x[o?B:++g];if(d(_[R],R,_)===!1)break}return a}}function dA(o,a,d){var h=a&M,g=qo(o);function _(){var x=this&&this!==ft&&this instanceof _?g:o;return x.apply(h?d:this,arguments)}return _}function $h(o){return function(a){a=Ue(a);var d=Ti(a)?Cn(a):n,h=d?d[0]:a.charAt(0),g=d?Br(d,1).join(""):a.slice(1);return h[o]()+g}}function Ri(o){return function(a){return Xl(zf(Gf(a).replace(eB,"")),o,"")}}function qo(o){return function(){var a=arguments;switch(a.length){case 0:return new o;case 1:return new o(a[0]);case 2:return new o(a[0],a[1]);case 3:return new o(a[0],a[1],a[2]);case 4:return new o(a[0],a[1],a[2],a[3]);case 5:return new o(a[0],a[1],a[2],a[3],a[4]);case 6:return new o(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new o(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var d=Di(o.prototype),h=o.apply(d,a);return Qe(h)?h:d}}function uA(o,a,d){var h=qo(o);function g(){for(var _=arguments.length,x=$(_),B=_,R=Mi(g);B--;)x[B]=arguments[B];var j=_<3&&x[0]!==R&&x[_-1]!==R?[]:xr(x,R);if(_-=j.length,_<d)return jh(o,a,ca,g.placeholder,n,x,j,n,n,d-_);var K=this&&this!==ft&&this instanceof g?h:o;return Ut(K,this,x)}return g}function Uh(o){return function(a,d,h){var g=We(a);if(!Ft(a)){var _=he(d,3);a=pt(a),d=function(B){return _(g[B],B,g)}}var x=o(a,d,h);return x>-1?g[_?a[x]:x]:n}}function Zh(o){return qn(function(a){var d=a.length,h=d,g=Xt.prototype.thru;for(o&&a.reverse();h--;){var _=a[h];if(typeof _!="function")throw new Jt(c);if(g&&!x&&ha(_)=="wrapper")var x=new Xt([],!0)}for(h=x?h:d;++h<d;){_=a[h];var B=ha(_),R=B=="wrapper"?Pc(_):n;R&&Mc(R[0])&&R[1]==(z|X|P|A)&&!R[4].length&&R[9]==1?x=x[ha(R[0])].apply(x,R[3]):x=_.length==1&&Mc(_)?x[B]():x.thru(_)}return function(){var j=arguments,K=j[0];if(x&&j.length==1&&ke(K))return x.plant(K).value();for(var Y=0,ne=d?a[Y].apply(this,j):K;++Y<d;)ne=a[Y].call(this,ne);return ne}})}function ca(o,a,d,h,g,_,x,B,R,j){var K=a&z,Y=a&M,ne=a&C,ce=a&(X|O),me=a&E,Ae=ne?n:qo(o);function ge(){for(var Pe=arguments.length,Fe=$(Pe),jt=Pe;jt--;)Fe[jt]=arguments[jt];if(ce)var Vt=Mi(ge),qt=xB(Fe,Vt);if(h&&(Fe=Lh(Fe,h,g,ce)),_&&(Fe=Oh(Fe,_,x,ce)),Pe-=qt,ce&&Pe<j){var rt=xr(Fe,Vt);return jh(o,a,ca,ge.placeholder,d,Fe,rt,B,R,j-Pe)}var xn=Y?d:this,Xn=ne?xn[o]:o;return Pe=Fe.length,B?Fe=VA(Fe,B):me&&Pe>1&&Fe.reverse(),K&&R<Pe&&(Fe.length=R),this&&this!==ft&&this instanceof ge&&(Xn=Ae||qo(Xn)),Xn.apply(xn,Fe)}return ge}function Wh(o,a){return function(d,h){return ON(d,o,a(h),{})}}function da(o,a){return function(d,h){var g;if(d===n&&h===n)return a;if(d!==n&&(g=d),h!==n){if(g===n)return h;typeof d=="string"||typeof h=="string"?(d=Wt(d),h=Wt(h)):(d=Ah(d),h=Ah(h)),g=o(d,h)}return g}}function Bc(o){return qn(function(a){return a=Ye(a,Zt(he())),Ve(function(d){var h=this;return o(a,function(g){return Ut(g,h,d)})})})}function ua(o,a){a=a===n?" ":Wt(a);var d=a.length;if(d<2)return d?wc(a,o):a;var h=wc(a,Js(o/Bi(a)));return Ti(a)?Br(Cn(h),0,o).join(""):h.slice(0,o)}function pA(o,a,d,h){var g=a&M,_=qo(o);function x(){for(var B=-1,R=arguments.length,j=-1,K=h.length,Y=$(K+R),ne=this&&this!==ft&&this instanceof x?_:o;++j<K;)Y[j]=h[j];for(;R--;)Y[j++]=arguments[++B];return Ut(ne,g?d:this,Y)}return x}function Hh(o){return function(a,d,h){return h&&typeof h!="number"&&At(a,d,h)&&(d=h=n),a=Jn(a),d===n?(d=a,a=0):d=Jn(d),h=h===n?a<d?1:-1:Jn(h),JN(a,d,h,o)}}function pa(o){return function(a,d){return typeof a=="string"&&typeof d=="string"||(a=nn(a),d=nn(d)),o(a,d)}}function jh(o,a,d,h,g,_,x,B,R,j){var K=a&X,Y=K?x:n,ne=K?n:x,ce=K?_:n,me=K?n:_;a|=K?P:L,a&=~(K?L:P),a&G||(a&=~(M|C));var Ae=[o,a,g,ce,Y,me,ne,B,R,j],ge=d.apply(n,Ae);return Mc(o)&&sf(ge,Ae),ge.placeholder=h,af(ge,o,a)}function Nc(o){var a=at[o];return function(d,h){if(d=nn(d),h=h==null?0:wt(Te(h),292),h&&sh(d)){var g=(Ue(d)+"e").split("e"),_=a(g[0]+"e"+(+g[1]+h));return g=(Ue(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(d)}}var hA=Vi&&1/zs(new Vi([,-0]))[1]==pe?function(o){return new Vi(o)}:Jc;function qh(o){return function(a){var d=bt(a);return d==vn?oc(a):d==_n?AB(a):bB(a,o(a))}}function jn(o,a,d,h,g,_,x,B){var R=a&C;if(!R&&typeof o!="function")throw new Jt(c);var j=h?h.length:0;if(j||(a&=~(P|L),h=g=n),x=x===n?x:lt(Te(x),0),B=B===n?B:Te(B),j-=g?g.length:0,a&L){var K=h,Y=g;h=g=n}var ne=R?n:Pc(o),ce=[o,a,d,h,g,K,Y,_,x,B];if(ne&&BA(ce,ne),o=ce[0],a=ce[1],d=ce[2],h=ce[3],g=ce[4],B=ce[9]=ce[9]===n?R?0:o.length:lt(ce[9]-j,0),!B&&a&(X|O)&&(a&=~(X|O)),!a||a==M)var me=dA(o,a,d);else a==X||a==O?me=uA(o,a,B):(a==P||a==(M|P))&&!g.length?me=pA(o,a,d,h):me=ca.apply(n,ce);var Ae=ne?Bh:sf;return af(Ae(me,ce),o,a)}function Kh(o,a,d,h){return o===n||bn(o,Ai[d])&&!Ze.call(h,d)?a:o}function Yh(o,a,d,h,g,_){return Qe(o)&&Qe(a)&&(_.set(a,o),oa(o,a,n,Yh,_),_.delete(a)),o}function fA(o){return Jo(o)?n:o}function Jh(o,a,d,h,g,_){var x=d&D,B=o.length,R=a.length;if(B!=R&&!(x&&R>B))return!1;var j=_.get(o),K=_.get(a);if(j&&K)return j==a&&K==o;var Y=-1,ne=!0,ce=d&k?new Kr:n;for(_.set(o,a),_.set(a,o);++Y<B;){var me=o[Y],Ae=a[Y];if(h)var ge=x?h(Ae,me,Y,a,o,_):h(me,Ae,Y,o,a,_);if(ge!==n){if(ge)continue;ne=!1;break}if(ce){if(!Ql(a,function(Pe,Fe){if(!Io(ce,Fe)&&(me===Pe||g(me,Pe,d,h,_)))return ce.push(Fe)})){ne=!1;break}}else if(!(me===Ae||g(me,Ae,d,h,_))){ne=!1;break}}return _.delete(o),_.delete(a),ne}function mA(o,a,d,h,g,_,x){switch(d){case ki:if(o.byteLength!=a.byteLength||o.byteOffset!=a.byteOffset)return!1;o=o.buffer,a=a.buffer;case Mo:return!(o.byteLength!=a.byteLength||!_(new js(o),new js(a)));case Ge:case Cr:case Po:return bn(+o,+a);case Ds:return o.name==a.name&&o.message==a.message;case Do:case Fo:return o==a+"";case vn:var B=oc;case _n:var R=h&D;if(B||(B=zs),o.size!=a.size&&!R)return!1;var j=x.get(o);if(j)return j==a;h|=k,x.set(o,a);var K=Jh(B(o),B(a),h,g,_,x);return x.delete(o),K;case Rs:if($o)return $o.call(o)==$o.call(a)}return!1}function gA(o,a,d,h,g,_){var x=d&D,B=Ac(o),R=B.length,j=Ac(a),K=j.length;if(R!=K&&!x)return!1;for(var Y=R;Y--;){var ne=B[Y];if(!(x?ne in a:Ze.call(a,ne)))return!1}var ce=_.get(o),me=_.get(a);if(ce&&me)return ce==a&&me==o;var Ae=!0;_.set(o,a),_.set(a,o);for(var ge=x;++Y<R;){ne=B[Y];var Pe=o[ne],Fe=a[ne];if(h)var jt=x?h(Fe,Pe,ne,a,o,_):h(Pe,Fe,ne,o,a,_);if(!(jt===n?Pe===Fe||g(Pe,Fe,d,h,_):jt)){Ae=!1;break}ge||(ge=ne=="constructor")}if(Ae&&!ge){var Vt=o.constructor,qt=a.constructor;Vt!=qt&&"constructor"in o&&"constructor"in a&&!(typeof Vt=="function"&&Vt instanceof Vt&&typeof qt=="function"&&qt instanceof qt)&&(Ae=!1)}return _.delete(o),_.delete(a),Ae}function qn(o){return Lc(rf(o,n,hf),o+"")}function Ac(o){return yh(o,pt,Fc)}function Vc(o){return yh(o,Rt,Xh)}var Pc=Qs?function(o){return Qs.get(o)}:Jc;function ha(o){for(var a=o.name+"",d=Pi[a],h=Ze.call(Pi,a)?d.length:0;h--;){var g=d[h],_=g.func;if(_==null||_==o)return g.name}return a}function Mi(o){var a=Ze.call(v,"placeholder")?v:o;return a.placeholder}function he(){var o=v.iteratee||Kc;return o=o===Kc?Ch:o,arguments.length?o(arguments[0],arguments[1]):o}function fa(o,a){var d=o.__data__;return kA(a)?d[typeof a=="string"?"string":"hash"]:d.map}function Dc(o){for(var a=pt(o),d=a.length;d--;){var h=a[d],g=o[h];a[d]=[h,g,tf(g)]}return a}function Xr(o,a){var d=TB(o,a);return _h(d)?d:n}function yA(o){var a=Ze.call(o,jr),d=o[jr];try{o[jr]=n;var h=!0}catch{}var g=Ws.call(o);return h&&(a?o[jr]=d:delete o[jr]),g}var Fc=ac?function(o){return o==null?[]:(o=We(o),wr(ac(o),function(a){return ih.call(o,a)}))}:Xc,Xh=ac?function(o){for(var a=[];o;)br(a,Fc(o)),o=qs(o);return a}:Xc,bt=Nt;(lc&&bt(new lc(new ArrayBuffer(1)))!=ki||Oo&&bt(new Oo)!=vn||cc&&bt(cc.resolve())!=fp||Vi&&bt(new Vi)!=_n||Go&&bt(new Go)!=Ro)&&(bt=function(o){var a=Nt(o),d=a==Un?o.constructor:n,h=d?Qr(d):"";if(h)switch(h){case QB:return ki;case eN:return vn;case tN:return fp;case nN:return _n;case rN:return Ro}return a});function vA(o,a,d){for(var h=-1,g=d.length;++h<g;){var _=d[h],x=_.size;switch(_.type){case"drop":o+=x;break;case"dropRight":a-=x;break;case"take":a=wt(a,o+x);break;case"takeRight":o=lt(o,a-x);break}}return{start:o,end:a}}function _A(o){var a=o.match(ST);return a?a[1].split(ET):[]}function Qh(o,a,d){a=Tr(a,o);for(var h=-1,g=a.length,_=!1;++h<g;){var x=Fn(a[h]);if(!(_=o!=null&&d(o,x)))break;o=o[x]}return _||++h!=g?_:(g=o==null?0:o.length,!!g&&wa(g)&&Kn(x,g)&&(ke(o)||ei(o)))}function CA(o){var a=o.length,d=new o.constructor(a);return a&&typeof o[0]=="string"&&Ze.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function ef(o){return typeof o.constructor=="function"&&!Ko(o)?Di(qs(o)):{}}function wA(o,a,d){var h=o.constructor;switch(a){case Mo:return Tc(o);case Ge:case Cr:return new h(+o);case ki:return iA(o,d);case Dl:case Fl:case Rl:case Ml:case Il:case Ll:case Ol:case Gl:case zl:return Mh(o,d);case vn:return new h;case Po:case Fo:return new h(o);case Do:return oA(o);case _n:return new h;case Rs:return sA(o)}}function bA(o,a){var d=a.length;if(!d)return o;var h=d-1;return a[h]=(d>1?"& ":"")+a[h],a=a.join(d>2?", ":" "),o.replace(kT,`{
71
71
  /* [wrapped with `+a+`] */
72
- `)}function kN(o){return ke(o)||ei(o)||!!(oh&&o&&o[oh])}function Kn(o,a){var d=typeof o;return a=a??we,!!a&&(d=="number"||d!="symbol"&&MT.test(o))&&o>-1&&o%1==0&&o<a}function At(o,a,d){if(!Qe(d))return!1;var h=typeof a;return(h=="number"?Ft(d)&&Kn(a,d.length):h=="string"&&a in d)?bn(d[a],o):!1}function Rc(o,a){if(ke(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Ht(o)?!0:wT.test(o)||!CT.test(o)||a!=null&&o in We(a)}function SN(o){var a=typeof o;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?o!=="__proto__":o===null}function Mc(o){var a=ha(o),d=v[a];if(typeof d!="function"||!(a in De.prototype))return!1;if(o===d)return!0;var h=Pc(d);return!!h&&o===h[0]}function EN(o){return!!th&&th in o}var TN=Zs?Yn:Qc;function Ko(o){var a=o&&o.constructor,d=typeof a=="function"&&a.prototype||Ni;return o===d}function tf(o){return o===o&&!Qe(o)}function nf(o,a){return function(d){return d==null?!1:d[o]===a&&(a!==n||o in We(d))}}function BN(o){var a=_a(o,function(h){return d.size===f&&d.clear(),h}),d=a.cache;return a}function AN(o,a){var d=o[1],h=a[1],g=d|h,_=g<(R|C|z),x=h==z&&d==X||h==z&&d==N&&o[7].length<=a[8]||h==(z|N)&&a[7].length<=a[8]&&d==X;if(!(_||x))return o;h&R&&(o[2]=a[2],g|=d&R?0:G);var B=a[3];if(B){var F=o[3];o[3]=F?Oh(F,B,a[4]):B,o[4]=F?xr(o[3],m):a[4]}return B=a[5],B&&(F=o[5],o[5]=F?Lh(F,B,a[6]):B,o[6]=F?xr(o[5],m):a[6]),B=a[7],B&&(o[7]=B),h&z&&(o[8]=o[8]==null?a[8]:wt(o[8],a[8])),o[9]==null&&(o[9]=a[9]),o[0]=a[0],o[1]=g,o}function NN(o){var a=[];if(o!=null)for(var d in We(o))a.push(d);return a}function VN(o){return Ws.call(o)}function rf(o,a,d){return a=lt(a===n?o.length-1:a,0),function(){for(var h=arguments,g=-1,_=lt(h.length-a,0),x=U(_);++g<_;)x[g]=h[a+g];g=-1;for(var B=U(a+1);++g<a;)B[g]=h[g];return B[a]=d(x),Zt(o,this,B)}}function of(o,a){return a.length<2?o:Jr(o,en(a,0,-1))}function PN(o,a){for(var d=o.length,h=wt(a.length,d),g=Dt(o);h--;){var _=a[h];o[h]=Kn(_,d)?g[_]:n}return o}function Ic(o,a){if(!(a==="constructor"&&typeof o[a]=="function")&&a!="__proto__")return o[a]}var sf=lf(Bh),Yo=jB||function(o,a){return ft.setTimeout(o,a)},Oc=lf(tN);function af(o,a,d){var h=a+"";return Oc(o,xN(h,DN(CN(h),d)))}function lf(o){var a=0,d=0;return function(){var h=JB(),g=$-(h-d);if(d=h,g>0){if(++a>=q)return arguments[0]}else a=0;return o.apply(n,arguments)}}function ma(o,a){var d=-1,h=o.length,g=h-1;for(a=a===n?h:a;++d<a;){var _=Cc(d,g),x=o[_];o[_]=o[d],o[d]=x}return o.length=a,o}var cf=BN(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(bT,function(d,h,g,_){a.push(g?_.replace(NT,"$1"):h||d)}),a});function Fn(o){if(typeof o=="string"||Ht(o))return o;var a=o+"";return a=="0"&&1/o==-pe?"-0":a}function Qr(o){if(o!=null){try{return $s.call(o)}catch{}try{return o+""}catch{}}return""}function DN(o,a){return Yt(_r,function(d){var h="_."+d[0];a&d[1]&&!Ls(o,h)&&o.push(h)}),o.sort()}function df(o){if(o instanceof De)return o.clone();var a=new Xt(o.__wrapped__,o.__chain__);return a.__actions__=Dt(o.__actions__),a.__index__=o.__index__,a.__values__=o.__values__,a}function FN(o,a,d){(d?At(o,a,d):a===n)?a=1:a=lt(Te(a),0);var h=o==null?0:o.length;if(!h||a<1)return[];for(var g=0,_=0,x=U(Js(h/a));g<h;)x[_++]=en(o,g,g+=a);return x}function RN(o){for(var a=-1,d=o==null?0:o.length,h=0,g=[];++a<d;){var _=o[a];_&&(g[h++]=_)}return g}function MN(){var o=arguments.length;if(!o)return[];for(var a=U(o-1),d=arguments[0],h=o;h--;)a[h-1]=arguments[h];return br(ke(d)?Dt(d):[d],mt(a,1))}var IN=Ve(function(o,a){return nt(o)?$o(o,mt(a,1,nt,!0)):[]}),ON=Ve(function(o,a){var d=tn(a);return nt(d)&&(d=n),nt(o)?$o(o,mt(a,1,nt,!0),he(d,2)):[]}),LN=Ve(function(o,a){var d=tn(a);return nt(d)&&(d=n),nt(o)?$o(o,mt(a,1,nt,!0),n,d):[]});function GN(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),en(o,a<0?0:a,h)):[]}function zN(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),a=h-a,en(o,0,a<0?0:a)):[]}function UN(o,a){return o&&o.length?aa(o,he(a,3),!0,!0):[]}function ZN(o,a){return o&&o.length?aa(o,he(a,3),!0):[]}function $N(o,a,d,h){var g=o==null?0:o.length;return g?(d&&typeof d!="number"&&At(o,a,d)&&(d=0,h=g),MA(o,a,d,h)):[]}function uf(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=lt(h+g,0)),Gs(o,he(a,3),g)}function pf(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=h-1;return d!==n&&(g=Te(d),g=d<0?lt(h+g,0):wt(g,h-1)),Gs(o,he(a,3),g,!0)}function hf(o){var a=o==null?0:o.length;return a?mt(o,1):[]}function WN(o){var a=o==null?0:o.length;return a?mt(o,pe):[]}function HN(o,a){var d=o==null?0:o.length;return d?(a=a===n?1:Te(a),mt(o,a)):[]}function jN(o){for(var a=-1,d=o==null?0:o.length,h={};++a<d;){var g=o[a];h[g[0]]=g[1]}return h}function ff(o){return o&&o.length?o[0]:n}function qN(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=lt(h+g,0)),Ei(o,a,g)}function KN(o){var a=o==null?0:o.length;return a?en(o,0,-1):[]}var YN=Ve(function(o){var a=Ye(o,Sc);return a.length&&a[0]===o[0]?mc(a):[]}),JN=Ve(function(o){var a=tn(o),d=Ye(o,Sc);return a===tn(d)?a=n:d.pop(),d.length&&d[0]===o[0]?mc(d,he(a,2)):[]}),XN=Ve(function(o){var a=tn(o),d=Ye(o,Sc);return a=typeof a=="function"?a:n,a&&d.pop(),d.length&&d[0]===o[0]?mc(d,n,a):[]});function QN(o,a){return o==null?"":KB.call(o,a)}function tn(o){var a=o==null?0:o.length;return a?o[a-1]:n}function eV(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=h;return d!==n&&(g=Te(d),g=g<0?lt(h+g,0):wt(g,h-1)),a===a?DB(o,a,g):Gs(o,jp,g,!0)}function tV(o,a){return o&&o.length?kh(o,Te(a)):n}var nV=Ve(mf);function mf(o,a){return o&&o.length&&a&&a.length?_c(o,a):o}function rV(o,a,d){return o&&o.length&&a&&a.length?_c(o,a,he(d,2)):o}function iV(o,a,d){return o&&o.length&&a&&a.length?_c(o,a,n,d):o}var oV=qn(function(o,a){var d=o==null?0:o.length,h=uc(o,a);return Th(o,Ye(a,function(g){return Kn(g,d)?+g:g}).sort(Ih)),h});function sV(o,a){var d=[];if(!(o&&o.length))return d;var h=-1,g=[],_=o.length;for(a=he(a,3);++h<_;){var x=o[h];a(x,h,o)&&(d.push(x),g.push(h))}return Th(o,g),d}function Lc(o){return o==null?o:QB.call(o)}function aV(o,a,d){var h=o==null?0:o.length;return h?(d&&typeof d!="number"&&At(o,a,d)?(a=0,d=h):(a=a==null?0:Te(a),d=d===n?h:Te(d)),en(o,a,d)):[]}function lV(o,a){return sa(o,a)}function cV(o,a,d){return bc(o,a,he(d,2))}function dV(o,a){var d=o==null?0:o.length;if(d){var h=sa(o,a);if(h<d&&bn(o[h],a))return h}return-1}function uV(o,a){return sa(o,a,!0)}function pV(o,a,d){return bc(o,a,he(d,2),!0)}function hV(o,a){var d=o==null?0:o.length;if(d){var h=sa(o,a,!0)-1;if(bn(o[h],a))return h}return-1}function fV(o){return o&&o.length?Ah(o):[]}function mV(o,a){return o&&o.length?Ah(o,he(a,2)):[]}function gV(o){var a=o==null?0:o.length;return a?en(o,1,a):[]}function yV(o,a,d){return o&&o.length?(a=d||a===n?1:Te(a),en(o,0,a<0?0:a)):[]}function vV(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),a=h-a,en(o,a<0?0:a,h)):[]}function _V(o,a){return o&&o.length?aa(o,he(a,3),!1,!0):[]}function CV(o,a){return o&&o.length?aa(o,he(a,3)):[]}var wV=Ve(function(o){return Er(mt(o,1,nt,!0))}),bV=Ve(function(o){var a=tn(o);return nt(a)&&(a=n),Er(mt(o,1,nt,!0),he(a,2))}),xV=Ve(function(o){var a=tn(o);return a=typeof a=="function"?a:n,Er(mt(o,1,nt,!0),n,a)});function kV(o){return o&&o.length?Er(o):[]}function SV(o,a){return o&&o.length?Er(o,he(a,2)):[]}function EV(o,a){return a=typeof a=="function"?a:n,o&&o.length?Er(o,n,a):[]}function Gc(o){if(!(o&&o.length))return[];var a=0;return o=wr(o,function(d){if(nt(d))return a=lt(d.length,a),!0}),rc(a,function(d){return Ye(o,ec(d))})}function gf(o,a){if(!(o&&o.length))return[];var d=Gc(o);return a==null?d:Ye(d,function(h){return Zt(a,n,h)})}var TV=Ve(function(o,a){return nt(o)?$o(o,a):[]}),BV=Ve(function(o){return kc(wr(o,nt))}),AV=Ve(function(o){var a=tn(o);return nt(a)&&(a=n),kc(wr(o,nt),he(a,2))}),NV=Ve(function(o){var a=tn(o);return a=typeof a=="function"?a:n,kc(wr(o,nt),n,a)}),VV=Ve(Gc);function PV(o,a){return Dh(o||[],a||[],Zo)}function DV(o,a){return Dh(o||[],a||[],jo)}var FV=Ve(function(o){var a=o.length,d=a>1?o[a-1]:n;return d=typeof d=="function"?(o.pop(),d):n,gf(o,d)});function yf(o){var a=v(o);return a.__chain__=!0,a}function RV(o,a){return a(o),o}function ga(o,a){return a(o)}var MV=qn(function(o){var a=o.length,d=a?o[0]:0,h=this.__wrapped__,g=function(_){return uc(_,o)};return a>1||this.__actions__.length||!(h instanceof De)||!Kn(d)?this.thru(g):(h=h.slice(d,+d+(a?1:0)),h.__actions__.push({func:ga,args:[g],thisArg:n}),new Xt(h,this.__chain__).thru(function(_){return a&&!_.length&&_.push(n),_}))});function IV(){return yf(this)}function OV(){return new Xt(this.value(),this.__chain__)}function LV(){this.__values__===n&&(this.__values__=Vf(this.value()));var o=this.__index__>=this.__values__.length,a=o?n:this.__values__[this.__index__++];return{done:o,value:a}}function GV(){return this}function zV(o){for(var a,d=this;d instanceof ta;){var h=df(d);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;d=d.__wrapped__}return g.__wrapped__=o,a}function UV(){var o=this.__wrapped__;if(o instanceof De){var a=o;return this.__actions__.length&&(a=new De(this)),a=a.reverse(),a.__actions__.push({func:ga,args:[Lc],thisArg:n}),new Xt(a,this.__chain__)}return this.thru(Lc)}function ZV(){return Ph(this.__wrapped__,this.__actions__)}var $V=la(function(o,a,d){$e.call(o,d)?++o[d]:Hn(o,d,1)});function WV(o,a,d){var h=ke(o)?Wp:RA;return d&&At(o,a,d)&&(a=n),h(o,he(a,3))}function HV(o,a){var d=ke(o)?wr:mh;return d(o,he(a,3))}var jV=Zh(uf),qV=Zh(pf);function KV(o,a){return mt(ya(o,a),1)}function YV(o,a){return mt(ya(o,a),pe)}function JV(o,a,d){return d=d===n?1:Te(d),mt(ya(o,a),d)}function vf(o,a){var d=ke(o)?Yt:Sr;return d(o,he(a,3))}function _f(o,a){var d=ke(o)?gB:fh;return d(o,he(a,3))}var XV=la(function(o,a,d){$e.call(o,d)?o[d].push(a):Hn(o,d,[a])});function QV(o,a,d,h){o=Ft(o)?o:Oi(o),d=d&&!h?Te(d):0;var g=o.length;return d<0&&(d=lt(g+d,0)),ba(o)?d<=g&&o.indexOf(a,d)>-1:!!g&&Ei(o,a,d)>-1}var eP=Ve(function(o,a,d){var h=-1,g=typeof a=="function",_=Ft(o)?U(o.length):[];return Sr(o,function(x){_[++h]=g?Zt(a,x,d):Wo(x,a,d)}),_}),tP=la(function(o,a,d){Hn(o,d,a)});function ya(o,a){var d=ke(o)?Ye:wh;return d(o,he(a,3))}function nP(o,a,d,h){return o==null?[]:(ke(a)||(a=a==null?[]:[a]),d=h?n:d,ke(d)||(d=d==null?[]:[d]),Sh(o,a,d))}var rP=la(function(o,a,d){o[d?0:1].push(a)},function(){return[[],[]]});function iP(o,a,d){var h=ke(o)?Xl:Kp,g=arguments.length<3;return h(o,he(a,4),d,g,Sr)}function oP(o,a,d){var h=ke(o)?yB:Kp,g=arguments.length<3;return h(o,he(a,4),d,g,fh)}function sP(o,a){var d=ke(o)?wr:mh;return d(o,Ca(he(a,3)))}function aP(o){var a=ke(o)?dh:QA;return a(o)}function lP(o,a,d){(d?At(o,a,d):a===n)?a=1:a=Te(a);var h=ke(o)?NA:eN;return h(o,a)}function cP(o){var a=ke(o)?VA:nN;return a(o)}function dP(o){if(o==null)return 0;if(Ft(o))return ba(o)?Bi(o):o.length;var a=bt(o);return a==vn||a==_n?o.size:yc(o).length}function uP(o,a,d){var h=ke(o)?Ql:rN;return d&&At(o,a,d)&&(a=n),h(o,he(a,3))}var pP=Ve(function(o,a){if(o==null)return[];var d=a.length;return d>1&&At(o,a[0],a[1])?a=[]:d>2&&At(a[0],a[1],a[2])&&(a=[a[0]]),Sh(o,mt(a,1),[])}),va=HB||function(){return ft.Date.now()};function hP(o,a){if(typeof a!="function")throw new Jt(c);return o=Te(o),function(){if(--o<1)return a.apply(this,arguments)}}function Cf(o,a,d){return a=d?n:a,a=o&&a==null?o.length:a,jn(o,z,n,n,n,n,a)}function wf(o,a){var d;if(typeof a!="function")throw new Jt(c);return o=Te(o),function(){return--o>0&&(d=a.apply(this,arguments)),o<=1&&(a=n),d}}var zc=Ve(function(o,a,d){var h=R;if(d.length){var g=xr(d,Mi(zc));h|=P}return jn(o,h,a,d,g)}),bf=Ve(function(o,a,d){var h=R|C;if(d.length){var g=xr(d,Mi(bf));h|=P}return jn(a,h,o,d,g)});function xf(o,a,d){a=d?n:a;var h=jn(o,X,n,n,n,n,n,a);return h.placeholder=xf.placeholder,h}function kf(o,a,d){a=d?n:a;var h=jn(o,L,n,n,n,n,n,a);return h.placeholder=kf.placeholder,h}function Sf(o,a,d){var h,g,_,x,B,F,j=0,K=!1,Y=!1,ne=!0;if(typeof o!="function")throw new Jt(c);a=nn(a)||0,Qe(d)&&(K=!!d.leading,Y="maxWait"in d,_=Y?lt(nn(d.maxWait)||0,a):_,ne="trailing"in d?!!d.trailing:ne);function ce(rt){var xn=h,Xn=g;return h=g=n,j=rt,x=o.apply(Xn,xn),x}function me(rt){return j=rt,B=Yo(Pe,a),K?ce(rt):x}function Ne(rt){var xn=rt-F,Xn=rt-j,$f=a-xn;return Y?wt($f,_-Xn):$f}function ge(rt){var xn=rt-F,Xn=rt-j;return F===n||xn>=a||xn<0||Y&&Xn>=_}function Pe(){var rt=va();if(ge(rt))return Fe(rt);B=Yo(Pe,Ne(rt))}function Fe(rt){return B=n,ne&&h?ce(rt):(h=g=n,x)}function jt(){B!==n&&Fh(B),j=0,h=F=g=B=n}function Nt(){return B===n?x:Fe(va())}function qt(){var rt=va(),xn=ge(rt);if(h=arguments,g=this,F=rt,xn){if(B===n)return me(F);if(Y)return Fh(B),B=Yo(Pe,a),ce(F)}return B===n&&(B=Yo(Pe,a)),x}return qt.cancel=jt,qt.flush=Nt,qt}var fP=Ve(function(o,a){return hh(o,1,a)}),mP=Ve(function(o,a,d){return hh(o,nn(a)||0,d)});function gP(o){return jn(o,E)}function _a(o,a){if(typeof o!="function"||a!=null&&typeof a!="function")throw new Jt(c);var d=function(){var h=arguments,g=a?a.apply(this,h):h[0],_=d.cache;if(_.has(g))return _.get(g);var x=o.apply(this,h);return d.cache=_.set(g,x)||_,x};return d.cache=new(_a.Cache||Wn),d}_a.Cache=Wn;function Ca(o){if(typeof o!="function")throw new Jt(c);return function(){var a=arguments;switch(a.length){case 0:return!o.call(this);case 1:return!o.call(this,a[0]);case 2:return!o.call(this,a[0],a[1]);case 3:return!o.call(this,a[0],a[1],a[2])}return!o.apply(this,a)}}function yP(o){return wf(2,o)}var vP=iN(function(o,a){a=a.length==1&&ke(a[0])?Ye(a[0],$t(he())):Ye(mt(a,1),$t(he()));var d=a.length;return Ve(function(h){for(var g=-1,_=wt(h.length,d);++g<_;)h[g]=a[g].call(this,h[g]);return Zt(o,this,h)})}),Uc=Ve(function(o,a){var d=xr(a,Mi(Uc));return jn(o,P,n,a,d)}),Ef=Ve(function(o,a){var d=xr(a,Mi(Ef));return jn(o,O,n,a,d)}),_P=qn(function(o,a){return jn(o,N,n,n,n,a)});function CP(o,a){if(typeof o!="function")throw new Jt(c);return a=a===n?a:Te(a),Ve(o,a)}function wP(o,a){if(typeof o!="function")throw new Jt(c);return a=a==null?0:lt(Te(a),0),Ve(function(d){var h=d[a],g=Br(d,0,a);return h&&br(g,h),Zt(o,this,g)})}function bP(o,a,d){var h=!0,g=!0;if(typeof o!="function")throw new Jt(c);return Qe(d)&&(h="leading"in d?!!d.leading:h,g="trailing"in d?!!d.trailing:g),Sf(o,a,{leading:h,maxWait:a,trailing:g})}function xP(o){return Cf(o,1)}function kP(o,a){return Uc(Ec(a),o)}function SP(){if(!arguments.length)return[];var o=arguments[0];return ke(o)?o:[o]}function EP(o){return Qt(o,S)}function TP(o,a){return a=typeof a=="function"?a:n,Qt(o,S,a)}function BP(o){return Qt(o,y|S)}function AP(o,a){return a=typeof a=="function"?a:n,Qt(o,y|S,a)}function NP(o,a){return a==null||ph(o,a,pt(a))}function bn(o,a){return o===a||o!==o&&a!==a}var VP=pa(fc),PP=pa(function(o,a){return o>=a}),ei=vh(function(){return arguments}())?vh:function(o){return et(o)&&$e.call(o,"callee")&&!ih.call(o,"callee")},ke=U.isArray,DP=Lp?$t(Lp):zA;function Ft(o){return o!=null&&wa(o.length)&&!Yn(o)}function nt(o){return et(o)&&Ft(o)}function FP(o){return o===!0||o===!1||et(o)&&Bt(o)==Ge}var Ar=qB||Qc,RP=Gp?$t(Gp):UA;function MP(o){return et(o)&&o.nodeType===1&&!Jo(o)}function IP(o){if(o==null)return!0;if(Ft(o)&&(ke(o)||typeof o=="string"||typeof o.splice=="function"||Ar(o)||Ii(o)||ei(o)))return!o.length;var a=bt(o);if(a==vn||a==_n)return!o.size;if(Ko(o))return!yc(o).length;for(var d in o)if($e.call(o,d))return!1;return!0}function OP(o,a){return Ho(o,a)}function LP(o,a,d){d=typeof d=="function"?d:n;var h=d?d(o,a):n;return h===n?Ho(o,a,n,d):!!h}function Zc(o){if(!et(o))return!1;var a=Bt(o);return a==Ds||a==lT||typeof o.message=="string"&&typeof o.name=="string"&&!Jo(o)}function GP(o){return typeof o=="number"&&sh(o)}function Yn(o){if(!Qe(o))return!1;var a=Bt(o);return a==Fs||a==hp||a==Ps||a==dT}function Tf(o){return typeof o=="number"&&o==Te(o)}function wa(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=we}function Qe(o){var a=typeof o;return o!=null&&(a=="object"||a=="function")}function et(o){return o!=null&&typeof o=="object"}var Bf=zp?$t(zp):$A;function zP(o,a){return o===a||gc(o,a,Dc(a))}function UP(o,a,d){return d=typeof d=="function"?d:n,gc(o,a,Dc(a),d)}function ZP(o){return Af(o)&&o!=+o}function $P(o){if(TN(o))throw new xe(l);return _h(o)}function WP(o){return o===null}function HP(o){return o==null}function Af(o){return typeof o=="number"||et(o)&&Bt(o)==Po}function Jo(o){if(!et(o)||Bt(o)!=Zn)return!1;var a=qs(o);if(a===null)return!0;var d=$e.call(a,"constructor")&&a.constructor;return typeof d=="function"&&d instanceof d&&$s.call(d)==UB}var $c=Up?$t(Up):WA;function jP(o){return Tf(o)&&o>=-we&&o<=we}var Nf=Zp?$t(Zp):HA;function ba(o){return typeof o=="string"||!ke(o)&&et(o)&&Bt(o)==Fo}function Ht(o){return typeof o=="symbol"||et(o)&&Bt(o)==Rs}var Ii=$p?$t($p):jA;function qP(o){return o===n}function KP(o){return et(o)&&bt(o)==Ro}function YP(o){return et(o)&&Bt(o)==pT}var JP=pa(vc),XP=pa(function(o,a){return o<=a});function Vf(o){if(!o)return[];if(Ft(o))return ba(o)?Cn(o):Dt(o);if(Oo&&o[Oo])return NB(o[Oo]());var a=bt(o),d=a==vn?oc:a==_n?zs:Oi;return d(o)}function Jn(o){if(!o)return o===0?o:0;if(o=nn(o),o===pe||o===-pe){var a=o<0?-1:1;return a*Ct}return o===o?o:0}function Te(o){var a=Jn(o),d=a%1;return a===a?d?a-d:a:0}function Pf(o){return o?Yr(Te(o),0,ht):0}function nn(o){if(typeof o=="number")return o;if(Ht(o))return Tt;if(Qe(o)){var a=typeof o.valueOf=="function"?o.valueOf():o;o=Qe(a)?a+"":a}if(typeof o!="string")return o===0?o:+o;o=Yp(o);var d=DT.test(o);return d||RT.test(o)?hB(o.slice(2),d?2:8):PT.test(o)?Tt:+o}function Df(o){return Dn(o,Rt(o))}function QP(o){return o?Yr(Te(o),-we,we):o===0?o:0}function Ze(o){return o==null?"":Wt(o)}var eD=Fi(function(o,a){if(Ko(a)||Ft(a)){Dn(a,pt(a),o);return}for(var d in a)$e.call(a,d)&&Zo(o,d,a[d])}),Ff=Fi(function(o,a){Dn(a,Rt(a),o)}),xa=Fi(function(o,a,d,h){Dn(a,Rt(a),o,h)}),tD=Fi(function(o,a,d,h){Dn(a,pt(a),o,h)}),nD=qn(uc);function rD(o,a){var d=Di(o);return a==null?d:uh(d,a)}var iD=Ve(function(o,a){o=We(o);var d=-1,h=a.length,g=h>2?a[2]:n;for(g&&At(a[0],a[1],g)&&(h=1);++d<h;)for(var _=a[d],x=Rt(_),B=-1,F=x.length;++B<F;){var j=x[B],K=o[j];(K===n||bn(K,Ni[j])&&!$e.call(o,j))&&(o[j]=_[j])}return o}),oD=Ve(function(o){return o.push(n,Yh),Zt(Rf,n,o)});function sD(o,a){return Hp(o,he(a,3),Pn)}function aD(o,a){return Hp(o,he(a,3),hc)}function lD(o,a){return o==null?o:pc(o,he(a,3),Rt)}function cD(o,a){return o==null?o:gh(o,he(a,3),Rt)}function dD(o,a){return o&&Pn(o,he(a,3))}function uD(o,a){return o&&hc(o,he(a,3))}function pD(o){return o==null?[]:ia(o,pt(o))}function hD(o){return o==null?[]:ia(o,Rt(o))}function Wc(o,a,d){var h=o==null?n:Jr(o,a);return h===n?d:h}function fD(o,a){return o!=null&&Qh(o,a,IA)}function Hc(o,a){return o!=null&&Qh(o,a,OA)}var mD=Wh(function(o,a,d){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),o[a]=d},qc(Mt)),gD=Wh(function(o,a,d){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),$e.call(o,a)?o[a].push(d):o[a]=[d]},he),yD=Ve(Wo);function pt(o){return Ft(o)?ch(o):yc(o)}function Rt(o){return Ft(o)?ch(o,!0):qA(o)}function vD(o,a){var d={};return a=he(a,3),Pn(o,function(h,g,_){Hn(d,a(h,g,_),h)}),d}function _D(o,a){var d={};return a=he(a,3),Pn(o,function(h,g,_){Hn(d,g,a(h,g,_))}),d}var CD=Fi(function(o,a,d){oa(o,a,d)}),Rf=Fi(function(o,a,d,h){oa(o,a,d,h)}),wD=qn(function(o,a){var d={};if(o==null)return d;var h=!1;a=Ye(a,function(_){return _=Tr(_,o),h||(h=_.length>1),_}),Dn(o,Vc(o),d),h&&(d=Qt(d,y|k|S,mN));for(var g=a.length;g--;)xc(d,a[g]);return d});function bD(o,a){return Mf(o,Ca(he(a)))}var xD=qn(function(o,a){return o==null?{}:YA(o,a)});function Mf(o,a){if(o==null)return{};var d=Ye(Vc(o),function(h){return[h]});return a=he(a),Eh(o,d,function(h,g){return a(h,g[0])})}function kD(o,a,d){a=Tr(a,o);var h=-1,g=a.length;for(g||(g=1,o=n);++h<g;){var _=o==null?n:o[Fn(a[h])];_===n&&(h=g,_=d),o=Yn(_)?_.call(o):_}return o}function SD(o,a,d){return o==null?o:jo(o,a,d)}function ED(o,a,d,h){return h=typeof h=="function"?h:n,o==null?o:jo(o,a,d,h)}var If=qh(pt),Of=qh(Rt);function TD(o,a,d){var h=ke(o),g=h||Ar(o)||Ii(o);if(a=he(a,4),d==null){var _=o&&o.constructor;g?d=h?new _:[]:Qe(o)?d=Yn(_)?Di(qs(o)):{}:d={}}return(g?Yt:Pn)(o,function(x,B,F){return a(d,x,B,F)}),d}function BD(o,a){return o==null?!0:xc(o,a)}function AD(o,a,d){return o==null?o:Vh(o,a,Ec(d))}function ND(o,a,d,h){return h=typeof h=="function"?h:n,o==null?o:Vh(o,a,Ec(d),h)}function Oi(o){return o==null?[]:ic(o,pt(o))}function VD(o){return o==null?[]:ic(o,Rt(o))}function PD(o,a,d){return d===n&&(d=a,a=n),d!==n&&(d=nn(d),d=d===d?d:0),a!==n&&(a=nn(a),a=a===a?a:0),Yr(nn(o),a,d)}function DD(o,a,d){return a=Jn(a),d===n?(d=a,a=0):d=Jn(d),o=nn(o),LA(o,a,d)}function FD(o,a,d){if(d&&typeof d!="boolean"&&At(o,a,d)&&(a=d=n),d===n&&(typeof a=="boolean"?(d=a,a=n):typeof o=="boolean"&&(d=o,o=n)),o===n&&a===n?(o=0,a=1):(o=Jn(o),a===n?(a=o,o=0):a=Jn(a)),o>a){var h=o;o=a,a=h}if(d||o%1||a%1){var g=ah();return wt(o+g*(a-o+pB("1e-"+((g+"").length-1))),a)}return Cc(o,a)}var RD=Ri(function(o,a,d){return a=a.toLowerCase(),o+(d?Lf(a):a)});function Lf(o){return jc(Ze(o).toLowerCase())}function Gf(o){return o=Ze(o),o&&o.replace(IT,SB).replace(nB,"")}function MD(o,a,d){o=Ze(o),a=Wt(a);var h=o.length;d=d===n?h:Yr(Te(d),0,h);var g=d;return d-=a.length,d>=0&&o.slice(d,g)==a}function ID(o){return o=Ze(o),o&&yT.test(o)?o.replace(gp,EB):o}function OD(o){return o=Ze(o),o&&xT.test(o)?o.replace(Ul,"\\$&"):o}var LD=Ri(function(o,a,d){return o+(d?"-":"")+a.toLowerCase()}),GD=Ri(function(o,a,d){return o+(d?" ":"")+a.toLowerCase()}),zD=Uh("toLowerCase");function UD(o,a,d){o=Ze(o),a=Te(a);var h=a?Bi(o):0;if(!a||h>=a)return o;var g=(a-h)/2;return ua(Xs(g),d)+o+ua(Js(g),d)}function ZD(o,a,d){o=Ze(o),a=Te(a);var h=a?Bi(o):0;return a&&h<a?o+ua(a-h,d):o}function $D(o,a,d){o=Ze(o),a=Te(a);var h=a?Bi(o):0;return a&&h<a?ua(a-h,d)+o:o}function WD(o,a,d){return d||a==null?a=0:a&&(a=+a),XB(Ze(o).replace(Zl,""),a||0)}function HD(o,a,d){return(d?At(o,a,d):a===n)?a=1:a=Te(a),wc(Ze(o),a)}function jD(){var o=arguments,a=Ze(o[0]);return o.length<3?a:a.replace(o[1],o[2])}var qD=Ri(function(o,a,d){return o+(d?"_":"")+a.toLowerCase()});function KD(o,a,d){return d&&typeof d!="number"&&At(o,a,d)&&(a=d=n),d=d===n?ht:d>>>0,d?(o=Ze(o),o&&(typeof a=="string"||a!=null&&!$c(a))&&(a=Wt(a),!a&&Ti(o))?Br(Cn(o),0,d):o.split(a,d)):[]}var YD=Ri(function(o,a,d){return o+(d?" ":"")+jc(a)});function JD(o,a,d){return o=Ze(o),d=d==null?0:Yr(Te(d),0,o.length),a=Wt(a),o.slice(d,d+a.length)==a}function XD(o,a,d){var h=v.templateSettings;d&&At(o,a,d)&&(a=n),o=Ze(o),a=xa({},a,h,Kh);var g=xa({},a.imports,h.imports,Kh),_=pt(g),x=ic(g,_),B,F,j=0,K=a.interpolate||Ms,Y="__p += '",ne=sc((a.escape||Ms).source+"|"+K.source+"|"+(K===yp?VT:Ms).source+"|"+(a.evaluate||Ms).source+"|$","g"),ce="//# sourceURL="+($e.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++aB+"]")+`
73
- `;o.replace(ne,function(ge,Pe,Fe,jt,Nt,qt){return Fe||(Fe=jt),Y+=o.slice(j,qt).replace(OT,TB),Pe&&(B=!0,Y+=`' +
72
+ `)}function xA(o){return ke(o)||ei(o)||!!(oh&&o&&o[oh])}function Kn(o,a){var d=typeof o;return a=a??we,!!a&&(d=="number"||d!="symbol"&&RT.test(o))&&o>-1&&o%1==0&&o<a}function At(o,a,d){if(!Qe(d))return!1;var h=typeof a;return(h=="number"?Ft(d)&&Kn(a,d.length):h=="string"&&a in d)?bn(d[a],o):!1}function Rc(o,a){if(ke(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Ht(o)?!0:CT.test(o)||!_T.test(o)||a!=null&&o in We(a)}function kA(o){var a=typeof o;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?o!=="__proto__":o===null}function Mc(o){var a=ha(o),d=v[a];if(typeof d!="function"||!(a in De.prototype))return!1;if(o===d)return!0;var h=Pc(d);return!!h&&o===h[0]}function SA(o){return!!th&&th in o}var EA=Us?Yn:Qc;function Ko(o){var a=o&&o.constructor,d=typeof a=="function"&&a.prototype||Ai;return o===d}function tf(o){return o===o&&!Qe(o)}function nf(o,a){return function(d){return d==null?!1:d[o]===a&&(a!==n||o in We(d))}}function TA(o){var a=_a(o,function(h){return d.size===f&&d.clear(),h}),d=a.cache;return a}function BA(o,a){var d=o[1],h=a[1],g=d|h,_=g<(M|C|z),x=h==z&&d==X||h==z&&d==A&&o[7].length<=a[8]||h==(z|A)&&a[7].length<=a[8]&&d==X;if(!(_||x))return o;h&M&&(o[2]=a[2],g|=d&M?0:G);var B=a[3];if(B){var R=o[3];o[3]=R?Lh(R,B,a[4]):B,o[4]=R?xr(o[3],m):a[4]}return B=a[5],B&&(R=o[5],o[5]=R?Oh(R,B,a[6]):B,o[6]=R?xr(o[5],m):a[6]),B=a[7],B&&(o[7]=B),h&z&&(o[8]=o[8]==null?a[8]:wt(o[8],a[8])),o[9]==null&&(o[9]=a[9]),o[0]=a[0],o[1]=g,o}function NA(o){var a=[];if(o!=null)for(var d in We(o))a.push(d);return a}function AA(o){return Ws.call(o)}function rf(o,a,d){return a=lt(a===n?o.length-1:a,0),function(){for(var h=arguments,g=-1,_=lt(h.length-a,0),x=$(_);++g<_;)x[g]=h[a+g];g=-1;for(var B=$(a+1);++g<a;)B[g]=h[g];return B[a]=d(x),Ut(o,this,B)}}function of(o,a){return a.length<2?o:Jr(o,en(a,0,-1))}function VA(o,a){for(var d=o.length,h=wt(a.length,d),g=Dt(o);h--;){var _=a[h];o[h]=Kn(_,d)?g[_]:n}return o}function Ic(o,a){if(!(a==="constructor"&&typeof o[a]=="function")&&a!="__proto__")return o[a]}var sf=lf(Bh),Yo=HB||function(o,a){return ft.setTimeout(o,a)},Lc=lf(eA);function af(o,a,d){var h=a+"";return Lc(o,bA(h,PA(_A(h),d)))}function lf(o){var a=0,d=0;return function(){var h=YB(),g=Z-(h-d);if(d=h,g>0){if(++a>=q)return arguments[0]}else a=0;return o.apply(n,arguments)}}function ma(o,a){var d=-1,h=o.length,g=h-1;for(a=a===n?h:a;++d<a;){var _=Cc(d,g),x=o[_];o[_]=o[d],o[d]=x}return o.length=a,o}var cf=TA(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(wT,function(d,h,g,_){a.push(g?_.replace(NT,"$1"):h||d)}),a});function Fn(o){if(typeof o=="string"||Ht(o))return o;var a=o+"";return a=="0"&&1/o==-pe?"-0":a}function Qr(o){if(o!=null){try{return Zs.call(o)}catch{}try{return o+""}catch{}}return""}function PA(o,a){return Yt(_r,function(d){var h="_."+d[0];a&d[1]&&!Os(o,h)&&o.push(h)}),o.sort()}function df(o){if(o instanceof De)return o.clone();var a=new Xt(o.__wrapped__,o.__chain__);return a.__actions__=Dt(o.__actions__),a.__index__=o.__index__,a.__values__=o.__values__,a}function DA(o,a,d){(d?At(o,a,d):a===n)?a=1:a=lt(Te(a),0);var h=o==null?0:o.length;if(!h||a<1)return[];for(var g=0,_=0,x=$(Js(h/a));g<h;)x[_++]=en(o,g,g+=a);return x}function FA(o){for(var a=-1,d=o==null?0:o.length,h=0,g=[];++a<d;){var _=o[a];_&&(g[h++]=_)}return g}function RA(){var o=arguments.length;if(!o)return[];for(var a=$(o-1),d=arguments[0],h=o;h--;)a[h-1]=arguments[h];return br(ke(d)?Dt(d):[d],mt(a,1))}var MA=Ve(function(o,a){return nt(o)?Zo(o,mt(a,1,nt,!0)):[]}),IA=Ve(function(o,a){var d=tn(a);return nt(d)&&(d=n),nt(o)?Zo(o,mt(a,1,nt,!0),he(d,2)):[]}),LA=Ve(function(o,a){var d=tn(a);return nt(d)&&(d=n),nt(o)?Zo(o,mt(a,1,nt,!0),n,d):[]});function OA(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),en(o,a<0?0:a,h)):[]}function GA(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),a=h-a,en(o,0,a<0?0:a)):[]}function zA(o,a){return o&&o.length?aa(o,he(a,3),!0,!0):[]}function $A(o,a){return o&&o.length?aa(o,he(a,3),!0):[]}function UA(o,a,d,h){var g=o==null?0:o.length;return g?(d&&typeof d!="number"&&At(o,a,d)&&(d=0,h=g),RN(o,a,d,h)):[]}function uf(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=lt(h+g,0)),Gs(o,he(a,3),g)}function pf(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=h-1;return d!==n&&(g=Te(d),g=d<0?lt(h+g,0):wt(g,h-1)),Gs(o,he(a,3),g,!0)}function hf(o){var a=o==null?0:o.length;return a?mt(o,1):[]}function ZA(o){var a=o==null?0:o.length;return a?mt(o,pe):[]}function WA(o,a){var d=o==null?0:o.length;return d?(a=a===n?1:Te(a),mt(o,a)):[]}function HA(o){for(var a=-1,d=o==null?0:o.length,h={};++a<d;){var g=o[a];h[g[0]]=g[1]}return h}function ff(o){return o&&o.length?o[0]:n}function jA(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=lt(h+g,0)),Ei(o,a,g)}function qA(o){var a=o==null?0:o.length;return a?en(o,0,-1):[]}var KA=Ve(function(o){var a=Ye(o,Sc);return a.length&&a[0]===o[0]?mc(a):[]}),YA=Ve(function(o){var a=tn(o),d=Ye(o,Sc);return a===tn(d)?a=n:d.pop(),d.length&&d[0]===o[0]?mc(d,he(a,2)):[]}),JA=Ve(function(o){var a=tn(o),d=Ye(o,Sc);return a=typeof a=="function"?a:n,a&&d.pop(),d.length&&d[0]===o[0]?mc(d,n,a):[]});function XA(o,a){return o==null?"":qB.call(o,a)}function tn(o){var a=o==null?0:o.length;return a?o[a-1]:n}function QA(o,a,d){var h=o==null?0:o.length;if(!h)return-1;var g=h;return d!==n&&(g=Te(d),g=g<0?lt(h+g,0):wt(g,h-1)),a===a?PB(o,a,g):Gs(o,jp,g,!0)}function eV(o,a){return o&&o.length?kh(o,Te(a)):n}var tV=Ve(mf);function mf(o,a){return o&&o.length&&a&&a.length?_c(o,a):o}function nV(o,a,d){return o&&o.length&&a&&a.length?_c(o,a,he(d,2)):o}function rV(o,a,d){return o&&o.length&&a&&a.length?_c(o,a,n,d):o}var iV=qn(function(o,a){var d=o==null?0:o.length,h=uc(o,a);return Th(o,Ye(a,function(g){return Kn(g,d)?+g:g}).sort(Ih)),h});function oV(o,a){var d=[];if(!(o&&o.length))return d;var h=-1,g=[],_=o.length;for(a=he(a,3);++h<_;){var x=o[h];a(x,h,o)&&(d.push(x),g.push(h))}return Th(o,g),d}function Oc(o){return o==null?o:XB.call(o)}function sV(o,a,d){var h=o==null?0:o.length;return h?(d&&typeof d!="number"&&At(o,a,d)?(a=0,d=h):(a=a==null?0:Te(a),d=d===n?h:Te(d)),en(o,a,d)):[]}function aV(o,a){return sa(o,a)}function lV(o,a,d){return bc(o,a,he(d,2))}function cV(o,a){var d=o==null?0:o.length;if(d){var h=sa(o,a);if(h<d&&bn(o[h],a))return h}return-1}function dV(o,a){return sa(o,a,!0)}function uV(o,a,d){return bc(o,a,he(d,2),!0)}function pV(o,a){var d=o==null?0:o.length;if(d){var h=sa(o,a,!0)-1;if(bn(o[h],a))return h}return-1}function hV(o){return o&&o.length?Nh(o):[]}function fV(o,a){return o&&o.length?Nh(o,he(a,2)):[]}function mV(o){var a=o==null?0:o.length;return a?en(o,1,a):[]}function gV(o,a,d){return o&&o.length?(a=d||a===n?1:Te(a),en(o,0,a<0?0:a)):[]}function yV(o,a,d){var h=o==null?0:o.length;return h?(a=d||a===n?1:Te(a),a=h-a,en(o,a<0?0:a,h)):[]}function vV(o,a){return o&&o.length?aa(o,he(a,3),!1,!0):[]}function _V(o,a){return o&&o.length?aa(o,he(a,3)):[]}var CV=Ve(function(o){return Er(mt(o,1,nt,!0))}),wV=Ve(function(o){var a=tn(o);return nt(a)&&(a=n),Er(mt(o,1,nt,!0),he(a,2))}),bV=Ve(function(o){var a=tn(o);return a=typeof a=="function"?a:n,Er(mt(o,1,nt,!0),n,a)});function xV(o){return o&&o.length?Er(o):[]}function kV(o,a){return o&&o.length?Er(o,he(a,2)):[]}function SV(o,a){return a=typeof a=="function"?a:n,o&&o.length?Er(o,n,a):[]}function Gc(o){if(!(o&&o.length))return[];var a=0;return o=wr(o,function(d){if(nt(d))return a=lt(d.length,a),!0}),rc(a,function(d){return Ye(o,ec(d))})}function gf(o,a){if(!(o&&o.length))return[];var d=Gc(o);return a==null?d:Ye(d,function(h){return Ut(a,n,h)})}var EV=Ve(function(o,a){return nt(o)?Zo(o,a):[]}),TV=Ve(function(o){return kc(wr(o,nt))}),BV=Ve(function(o){var a=tn(o);return nt(a)&&(a=n),kc(wr(o,nt),he(a,2))}),NV=Ve(function(o){var a=tn(o);return a=typeof a=="function"?a:n,kc(wr(o,nt),n,a)}),AV=Ve(Gc);function VV(o,a){return Dh(o||[],a||[],Uo)}function PV(o,a){return Dh(o||[],a||[],jo)}var DV=Ve(function(o){var a=o.length,d=a>1?o[a-1]:n;return d=typeof d=="function"?(o.pop(),d):n,gf(o,d)});function yf(o){var a=v(o);return a.__chain__=!0,a}function FV(o,a){return a(o),o}function ga(o,a){return a(o)}var RV=qn(function(o){var a=o.length,d=a?o[0]:0,h=this.__wrapped__,g=function(_){return uc(_,o)};return a>1||this.__actions__.length||!(h instanceof De)||!Kn(d)?this.thru(g):(h=h.slice(d,+d+(a?1:0)),h.__actions__.push({func:ga,args:[g],thisArg:n}),new Xt(h,this.__chain__).thru(function(_){return a&&!_.length&&_.push(n),_}))});function MV(){return yf(this)}function IV(){return new Xt(this.value(),this.__chain__)}function LV(){this.__values__===n&&(this.__values__=Vf(this.value()));var o=this.__index__>=this.__values__.length,a=o?n:this.__values__[this.__index__++];return{done:o,value:a}}function OV(){return this}function GV(o){for(var a,d=this;d instanceof ta;){var h=df(d);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;d=d.__wrapped__}return g.__wrapped__=o,a}function zV(){var o=this.__wrapped__;if(o instanceof De){var a=o;return this.__actions__.length&&(a=new De(this)),a=a.reverse(),a.__actions__.push({func:ga,args:[Oc],thisArg:n}),new Xt(a,this.__chain__)}return this.thru(Oc)}function $V(){return Ph(this.__wrapped__,this.__actions__)}var UV=la(function(o,a,d){Ze.call(o,d)?++o[d]:Hn(o,d,1)});function ZV(o,a,d){var h=ke(o)?Wp:FN;return d&&At(o,a,d)&&(a=n),h(o,he(a,3))}function WV(o,a){var d=ke(o)?wr:mh;return d(o,he(a,3))}var HV=Uh(uf),jV=Uh(pf);function qV(o,a){return mt(ya(o,a),1)}function KV(o,a){return mt(ya(o,a),pe)}function YV(o,a,d){return d=d===n?1:Te(d),mt(ya(o,a),d)}function vf(o,a){var d=ke(o)?Yt:Sr;return d(o,he(a,3))}function _f(o,a){var d=ke(o)?mB:fh;return d(o,he(a,3))}var JV=la(function(o,a,d){Ze.call(o,d)?o[d].push(a):Hn(o,d,[a])});function XV(o,a,d,h){o=Ft(o)?o:Li(o),d=d&&!h?Te(d):0;var g=o.length;return d<0&&(d=lt(g+d,0)),ba(o)?d<=g&&o.indexOf(a,d)>-1:!!g&&Ei(o,a,d)>-1}var QV=Ve(function(o,a,d){var h=-1,g=typeof a=="function",_=Ft(o)?$(o.length):[];return Sr(o,function(x){_[++h]=g?Ut(a,x,d):Wo(x,a,d)}),_}),eP=la(function(o,a,d){Hn(o,d,a)});function ya(o,a){var d=ke(o)?Ye:wh;return d(o,he(a,3))}function tP(o,a,d,h){return o==null?[]:(ke(a)||(a=a==null?[]:[a]),d=h?n:d,ke(d)||(d=d==null?[]:[d]),Sh(o,a,d))}var nP=la(function(o,a,d){o[d?0:1].push(a)},function(){return[[],[]]});function rP(o,a,d){var h=ke(o)?Xl:Kp,g=arguments.length<3;return h(o,he(a,4),d,g,Sr)}function iP(o,a,d){var h=ke(o)?gB:Kp,g=arguments.length<3;return h(o,he(a,4),d,g,fh)}function oP(o,a){var d=ke(o)?wr:mh;return d(o,Ca(he(a,3)))}function sP(o){var a=ke(o)?dh:XN;return a(o)}function aP(o,a,d){(d?At(o,a,d):a===n)?a=1:a=Te(a);var h=ke(o)?NN:QN;return h(o,a)}function lP(o){var a=ke(o)?AN:tA;return a(o)}function cP(o){if(o==null)return 0;if(Ft(o))return ba(o)?Bi(o):o.length;var a=bt(o);return a==vn||a==_n?o.size:yc(o).length}function dP(o,a,d){var h=ke(o)?Ql:nA;return d&&At(o,a,d)&&(a=n),h(o,he(a,3))}var uP=Ve(function(o,a){if(o==null)return[];var d=a.length;return d>1&&At(o,a[0],a[1])?a=[]:d>2&&At(a[0],a[1],a[2])&&(a=[a[0]]),Sh(o,mt(a,1),[])}),va=WB||function(){return ft.Date.now()};function pP(o,a){if(typeof a!="function")throw new Jt(c);return o=Te(o),function(){if(--o<1)return a.apply(this,arguments)}}function Cf(o,a,d){return a=d?n:a,a=o&&a==null?o.length:a,jn(o,z,n,n,n,n,a)}function wf(o,a){var d;if(typeof a!="function")throw new Jt(c);return o=Te(o),function(){return--o>0&&(d=a.apply(this,arguments)),o<=1&&(a=n),d}}var zc=Ve(function(o,a,d){var h=M;if(d.length){var g=xr(d,Mi(zc));h|=P}return jn(o,h,a,d,g)}),bf=Ve(function(o,a,d){var h=M|C;if(d.length){var g=xr(d,Mi(bf));h|=P}return jn(a,h,o,d,g)});function xf(o,a,d){a=d?n:a;var h=jn(o,X,n,n,n,n,n,a);return h.placeholder=xf.placeholder,h}function kf(o,a,d){a=d?n:a;var h=jn(o,O,n,n,n,n,n,a);return h.placeholder=kf.placeholder,h}function Sf(o,a,d){var h,g,_,x,B,R,j=0,K=!1,Y=!1,ne=!0;if(typeof o!="function")throw new Jt(c);a=nn(a)||0,Qe(d)&&(K=!!d.leading,Y="maxWait"in d,_=Y?lt(nn(d.maxWait)||0,a):_,ne="trailing"in d?!!d.trailing:ne);function ce(rt){var xn=h,Xn=g;return h=g=n,j=rt,x=o.apply(Xn,xn),x}function me(rt){return j=rt,B=Yo(Pe,a),K?ce(rt):x}function Ae(rt){var xn=rt-R,Xn=rt-j,Zf=a-xn;return Y?wt(Zf,_-Xn):Zf}function ge(rt){var xn=rt-R,Xn=rt-j;return R===n||xn>=a||xn<0||Y&&Xn>=_}function Pe(){var rt=va();if(ge(rt))return Fe(rt);B=Yo(Pe,Ae(rt))}function Fe(rt){return B=n,ne&&h?ce(rt):(h=g=n,x)}function jt(){B!==n&&Fh(B),j=0,h=R=g=B=n}function Vt(){return B===n?x:Fe(va())}function qt(){var rt=va(),xn=ge(rt);if(h=arguments,g=this,R=rt,xn){if(B===n)return me(R);if(Y)return Fh(B),B=Yo(Pe,a),ce(R)}return B===n&&(B=Yo(Pe,a)),x}return qt.cancel=jt,qt.flush=Vt,qt}var hP=Ve(function(o,a){return hh(o,1,a)}),fP=Ve(function(o,a,d){return hh(o,nn(a)||0,d)});function mP(o){return jn(o,E)}function _a(o,a){if(typeof o!="function"||a!=null&&typeof a!="function")throw new Jt(c);var d=function(){var h=arguments,g=a?a.apply(this,h):h[0],_=d.cache;if(_.has(g))return _.get(g);var x=o.apply(this,h);return d.cache=_.set(g,x)||_,x};return d.cache=new(_a.Cache||Wn),d}_a.Cache=Wn;function Ca(o){if(typeof o!="function")throw new Jt(c);return function(){var a=arguments;switch(a.length){case 0:return!o.call(this);case 1:return!o.call(this,a[0]);case 2:return!o.call(this,a[0],a[1]);case 3:return!o.call(this,a[0],a[1],a[2])}return!o.apply(this,a)}}function gP(o){return wf(2,o)}var yP=rA(function(o,a){a=a.length==1&&ke(a[0])?Ye(a[0],Zt(he())):Ye(mt(a,1),Zt(he()));var d=a.length;return Ve(function(h){for(var g=-1,_=wt(h.length,d);++g<_;)h[g]=a[g].call(this,h[g]);return Ut(o,this,h)})}),$c=Ve(function(o,a){var d=xr(a,Mi($c));return jn(o,P,n,a,d)}),Ef=Ve(function(o,a){var d=xr(a,Mi(Ef));return jn(o,L,n,a,d)}),vP=qn(function(o,a){return jn(o,A,n,n,n,a)});function _P(o,a){if(typeof o!="function")throw new Jt(c);return a=a===n?a:Te(a),Ve(o,a)}function CP(o,a){if(typeof o!="function")throw new Jt(c);return a=a==null?0:lt(Te(a),0),Ve(function(d){var h=d[a],g=Br(d,0,a);return h&&br(g,h),Ut(o,this,g)})}function wP(o,a,d){var h=!0,g=!0;if(typeof o!="function")throw new Jt(c);return Qe(d)&&(h="leading"in d?!!d.leading:h,g="trailing"in d?!!d.trailing:g),Sf(o,a,{leading:h,maxWait:a,trailing:g})}function bP(o){return Cf(o,1)}function xP(o,a){return $c(Ec(a),o)}function kP(){if(!arguments.length)return[];var o=arguments[0];return ke(o)?o:[o]}function SP(o){return Qt(o,S)}function EP(o,a){return a=typeof a=="function"?a:n,Qt(o,S,a)}function TP(o){return Qt(o,y|S)}function BP(o,a){return a=typeof a=="function"?a:n,Qt(o,y|S,a)}function NP(o,a){return a==null||ph(o,a,pt(a))}function bn(o,a){return o===a||o!==o&&a!==a}var AP=pa(fc),VP=pa(function(o,a){return o>=a}),ei=vh(function(){return arguments}())?vh:function(o){return et(o)&&Ze.call(o,"callee")&&!ih.call(o,"callee")},ke=$.isArray,PP=Op?Zt(Op):GN;function Ft(o){return o!=null&&wa(o.length)&&!Yn(o)}function nt(o){return et(o)&&Ft(o)}function DP(o){return o===!0||o===!1||et(o)&&Nt(o)==Ge}var Nr=jB||Qc,FP=Gp?Zt(Gp):zN;function RP(o){return et(o)&&o.nodeType===1&&!Jo(o)}function MP(o){if(o==null)return!0;if(Ft(o)&&(ke(o)||typeof o=="string"||typeof o.splice=="function"||Nr(o)||Ii(o)||ei(o)))return!o.length;var a=bt(o);if(a==vn||a==_n)return!o.size;if(Ko(o))return!yc(o).length;for(var d in o)if(Ze.call(o,d))return!1;return!0}function IP(o,a){return Ho(o,a)}function LP(o,a,d){d=typeof d=="function"?d:n;var h=d?d(o,a):n;return h===n?Ho(o,a,n,d):!!h}function Uc(o){if(!et(o))return!1;var a=Nt(o);return a==Ds||a==aT||typeof o.message=="string"&&typeof o.name=="string"&&!Jo(o)}function OP(o){return typeof o=="number"&&sh(o)}function Yn(o){if(!Qe(o))return!1;var a=Nt(o);return a==Fs||a==hp||a==Ps||a==cT}function Tf(o){return typeof o=="number"&&o==Te(o)}function wa(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=we}function Qe(o){var a=typeof o;return o!=null&&(a=="object"||a=="function")}function et(o){return o!=null&&typeof o=="object"}var Bf=zp?Zt(zp):UN;function GP(o,a){return o===a||gc(o,a,Dc(a))}function zP(o,a,d){return d=typeof d=="function"?d:n,gc(o,a,Dc(a),d)}function $P(o){return Nf(o)&&o!=+o}function UP(o){if(EA(o))throw new xe(l);return _h(o)}function ZP(o){return o===null}function WP(o){return o==null}function Nf(o){return typeof o=="number"||et(o)&&Nt(o)==Po}function Jo(o){if(!et(o)||Nt(o)!=Un)return!1;var a=qs(o);if(a===null)return!0;var d=Ze.call(a,"constructor")&&a.constructor;return typeof d=="function"&&d instanceof d&&Zs.call(d)==zB}var Zc=$p?Zt($p):ZN;function HP(o){return Tf(o)&&o>=-we&&o<=we}var Af=Up?Zt(Up):WN;function ba(o){return typeof o=="string"||!ke(o)&&et(o)&&Nt(o)==Fo}function Ht(o){return typeof o=="symbol"||et(o)&&Nt(o)==Rs}var Ii=Zp?Zt(Zp):HN;function jP(o){return o===n}function qP(o){return et(o)&&bt(o)==Ro}function KP(o){return et(o)&&Nt(o)==uT}var YP=pa(vc),JP=pa(function(o,a){return o<=a});function Vf(o){if(!o)return[];if(Ft(o))return ba(o)?Cn(o):Dt(o);if(Lo&&o[Lo])return NB(o[Lo]());var a=bt(o),d=a==vn?oc:a==_n?zs:Li;return d(o)}function Jn(o){if(!o)return o===0?o:0;if(o=nn(o),o===pe||o===-pe){var a=o<0?-1:1;return a*Ct}return o===o?o:0}function Te(o){var a=Jn(o),d=a%1;return a===a?d?a-d:a:0}function Pf(o){return o?Yr(Te(o),0,ht):0}function nn(o){if(typeof o=="number")return o;if(Ht(o))return Bt;if(Qe(o)){var a=typeof o.valueOf=="function"?o.valueOf():o;o=Qe(a)?a+"":a}if(typeof o!="string")return o===0?o:+o;o=Yp(o);var d=PT.test(o);return d||FT.test(o)?pB(o.slice(2),d?2:8):VT.test(o)?Bt:+o}function Df(o){return Dn(o,Rt(o))}function XP(o){return o?Yr(Te(o),-we,we):o===0?o:0}function Ue(o){return o==null?"":Wt(o)}var QP=Fi(function(o,a){if(Ko(a)||Ft(a)){Dn(a,pt(a),o);return}for(var d in a)Ze.call(a,d)&&Uo(o,d,a[d])}),Ff=Fi(function(o,a){Dn(a,Rt(a),o)}),xa=Fi(function(o,a,d,h){Dn(a,Rt(a),o,h)}),eD=Fi(function(o,a,d,h){Dn(a,pt(a),o,h)}),tD=qn(uc);function nD(o,a){var d=Di(o);return a==null?d:uh(d,a)}var rD=Ve(function(o,a){o=We(o);var d=-1,h=a.length,g=h>2?a[2]:n;for(g&&At(a[0],a[1],g)&&(h=1);++d<h;)for(var _=a[d],x=Rt(_),B=-1,R=x.length;++B<R;){var j=x[B],K=o[j];(K===n||bn(K,Ai[j])&&!Ze.call(o,j))&&(o[j]=_[j])}return o}),iD=Ve(function(o){return o.push(n,Yh),Ut(Rf,n,o)});function oD(o,a){return Hp(o,he(a,3),Pn)}function sD(o,a){return Hp(o,he(a,3),hc)}function aD(o,a){return o==null?o:pc(o,he(a,3),Rt)}function lD(o,a){return o==null?o:gh(o,he(a,3),Rt)}function cD(o,a){return o&&Pn(o,he(a,3))}function dD(o,a){return o&&hc(o,he(a,3))}function uD(o){return o==null?[]:ia(o,pt(o))}function pD(o){return o==null?[]:ia(o,Rt(o))}function Wc(o,a,d){var h=o==null?n:Jr(o,a);return h===n?d:h}function hD(o,a){return o!=null&&Qh(o,a,MN)}function Hc(o,a){return o!=null&&Qh(o,a,IN)}var fD=Wh(function(o,a,d){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),o[a]=d},qc(Mt)),mD=Wh(function(o,a,d){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),Ze.call(o,a)?o[a].push(d):o[a]=[d]},he),gD=Ve(Wo);function pt(o){return Ft(o)?ch(o):yc(o)}function Rt(o){return Ft(o)?ch(o,!0):jN(o)}function yD(o,a){var d={};return a=he(a,3),Pn(o,function(h,g,_){Hn(d,a(h,g,_),h)}),d}function vD(o,a){var d={};return a=he(a,3),Pn(o,function(h,g,_){Hn(d,g,a(h,g,_))}),d}var _D=Fi(function(o,a,d){oa(o,a,d)}),Rf=Fi(function(o,a,d,h){oa(o,a,d,h)}),CD=qn(function(o,a){var d={};if(o==null)return d;var h=!1;a=Ye(a,function(_){return _=Tr(_,o),h||(h=_.length>1),_}),Dn(o,Vc(o),d),h&&(d=Qt(d,y|T|S,fA));for(var g=a.length;g--;)xc(d,a[g]);return d});function wD(o,a){return Mf(o,Ca(he(a)))}var bD=qn(function(o,a){return o==null?{}:KN(o,a)});function Mf(o,a){if(o==null)return{};var d=Ye(Vc(o),function(h){return[h]});return a=he(a),Eh(o,d,function(h,g){return a(h,g[0])})}function xD(o,a,d){a=Tr(a,o);var h=-1,g=a.length;for(g||(g=1,o=n);++h<g;){var _=o==null?n:o[Fn(a[h])];_===n&&(h=g,_=d),o=Yn(_)?_.call(o):_}return o}function kD(o,a,d){return o==null?o:jo(o,a,d)}function SD(o,a,d,h){return h=typeof h=="function"?h:n,o==null?o:jo(o,a,d,h)}var If=qh(pt),Lf=qh(Rt);function ED(o,a,d){var h=ke(o),g=h||Nr(o)||Ii(o);if(a=he(a,4),d==null){var _=o&&o.constructor;g?d=h?new _:[]:Qe(o)?d=Yn(_)?Di(qs(o)):{}:d={}}return(g?Yt:Pn)(o,function(x,B,R){return a(d,x,B,R)}),d}function TD(o,a){return o==null?!0:xc(o,a)}function BD(o,a,d){return o==null?o:Vh(o,a,Ec(d))}function ND(o,a,d,h){return h=typeof h=="function"?h:n,o==null?o:Vh(o,a,Ec(d),h)}function Li(o){return o==null?[]:ic(o,pt(o))}function AD(o){return o==null?[]:ic(o,Rt(o))}function VD(o,a,d){return d===n&&(d=a,a=n),d!==n&&(d=nn(d),d=d===d?d:0),a!==n&&(a=nn(a),a=a===a?a:0),Yr(nn(o),a,d)}function PD(o,a,d){return a=Jn(a),d===n?(d=a,a=0):d=Jn(d),o=nn(o),LN(o,a,d)}function DD(o,a,d){if(d&&typeof d!="boolean"&&At(o,a,d)&&(a=d=n),d===n&&(typeof a=="boolean"?(d=a,a=n):typeof o=="boolean"&&(d=o,o=n)),o===n&&a===n?(o=0,a=1):(o=Jn(o),a===n?(a=o,o=0):a=Jn(a)),o>a){var h=o;o=a,a=h}if(d||o%1||a%1){var g=ah();return wt(o+g*(a-o+uB("1e-"+((g+"").length-1))),a)}return Cc(o,a)}var FD=Ri(function(o,a,d){return a=a.toLowerCase(),o+(d?Of(a):a)});function Of(o){return jc(Ue(o).toLowerCase())}function Gf(o){return o=Ue(o),o&&o.replace(MT,kB).replace(tB,"")}function RD(o,a,d){o=Ue(o),a=Wt(a);var h=o.length;d=d===n?h:Yr(Te(d),0,h);var g=d;return d-=a.length,d>=0&&o.slice(d,g)==a}function MD(o){return o=Ue(o),o&&gT.test(o)?o.replace(gp,SB):o}function ID(o){return o=Ue(o),o&&bT.test(o)?o.replace($l,"\\$&"):o}var LD=Ri(function(o,a,d){return o+(d?"-":"")+a.toLowerCase()}),OD=Ri(function(o,a,d){return o+(d?" ":"")+a.toLowerCase()}),GD=$h("toLowerCase");function zD(o,a,d){o=Ue(o),a=Te(a);var h=a?Bi(o):0;if(!a||h>=a)return o;var g=(a-h)/2;return ua(Xs(g),d)+o+ua(Js(g),d)}function $D(o,a,d){o=Ue(o),a=Te(a);var h=a?Bi(o):0;return a&&h<a?o+ua(a-h,d):o}function UD(o,a,d){o=Ue(o),a=Te(a);var h=a?Bi(o):0;return a&&h<a?ua(a-h,d)+o:o}function ZD(o,a,d){return d||a==null?a=0:a&&(a=+a),JB(Ue(o).replace(Ul,""),a||0)}function WD(o,a,d){return(d?At(o,a,d):a===n)?a=1:a=Te(a),wc(Ue(o),a)}function HD(){var o=arguments,a=Ue(o[0]);return o.length<3?a:a.replace(o[1],o[2])}var jD=Ri(function(o,a,d){return o+(d?"_":"")+a.toLowerCase()});function qD(o,a,d){return d&&typeof d!="number"&&At(o,a,d)&&(a=d=n),d=d===n?ht:d>>>0,d?(o=Ue(o),o&&(typeof a=="string"||a!=null&&!Zc(a))&&(a=Wt(a),!a&&Ti(o))?Br(Cn(o),0,d):o.split(a,d)):[]}var KD=Ri(function(o,a,d){return o+(d?" ":"")+jc(a)});function YD(o,a,d){return o=Ue(o),d=d==null?0:Yr(Te(d),0,o.length),a=Wt(a),o.slice(d,d+a.length)==a}function JD(o,a,d){var h=v.templateSettings;d&&At(o,a,d)&&(a=n),o=Ue(o),a=xa({},a,h,Kh);var g=xa({},a.imports,h.imports,Kh),_=pt(g),x=ic(g,_),B,R,j=0,K=a.interpolate||Ms,Y="__p += '",ne=sc((a.escape||Ms).source+"|"+K.source+"|"+(K===yp?AT:Ms).source+"|"+(a.evaluate||Ms).source+"|$","g"),ce="//# sourceURL="+(Ze.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++sB+"]")+`
73
+ `;o.replace(ne,function(ge,Pe,Fe,jt,Vt,qt){return Fe||(Fe=jt),Y+=o.slice(j,qt).replace(IT,EB),Pe&&(B=!0,Y+=`' +
74
74
  __e(`+Pe+`) +
75
- '`),Nt&&(F=!0,Y+=`';
76
- `+Nt+`;
75
+ '`),Vt&&(R=!0,Y+=`';
76
+ `+Vt+`;
77
77
  __p += '`),Fe&&(Y+=`' +
78
78
  ((__t = (`+Fe+`)) == null ? '' : __t) +
79
79
  '`),j=qt+ge.length,ge}),Y+=`';
80
- `;var me=$e.call(a,"variable")&&a.variable;if(!me)Y=`with (obj) {
80
+ `;var me=Ze.call(a,"variable")&&a.variable;if(!me)Y=`with (obj) {
81
81
  `+Y+`
82
82
  }
83
- `;else if(AT.test(me))throw new xe(u);Y=(F?Y.replace(hT,""):Y).replace(fT,"$1").replace(mT,"$1;"),Y="function("+(me||"obj")+`) {
83
+ `;else if(BT.test(me))throw new xe(u);Y=(R?Y.replace(pT,""):Y).replace(hT,"$1").replace(fT,"$1;"),Y="function("+(me||"obj")+`) {
84
84
  `+(me?"":`obj || (obj = {});
85
- `)+"var __t, __p = ''"+(B?", __e = _.escape":"")+(F?`, __j = Array.prototype.join;
85
+ `)+"var __t, __p = ''"+(B?", __e = _.escape":"")+(R?`, __j = Array.prototype.join;
86
86
  function print() { __p += __j.call(arguments, '') }
87
87
  `:`;
88
88
  `)+Y+`return __p
89
- }`;var Ne=Uf(function(){return ze(_,ce+"return "+Y).apply(n,x)});if(Ne.source=Y,Zc(Ne))throw Ne;return Ne}function QD(o){return Ze(o).toLowerCase()}function eF(o){return Ze(o).toUpperCase()}function tF(o,a,d){if(o=Ze(o),o&&(d||a===n))return Yp(o);if(!o||!(a=Wt(a)))return o;var h=Cn(o),g=Cn(a),_=Jp(h,g),x=Xp(h,g)+1;return Br(h,_,x).join("")}function nF(o,a,d){if(o=Ze(o),o&&(d||a===n))return o.slice(0,eh(o)+1);if(!o||!(a=Wt(a)))return o;var h=Cn(o),g=Xp(h,Cn(a))+1;return Br(h,0,g).join("")}function rF(o,a,d){if(o=Ze(o),o&&(d||a===n))return o.replace(Zl,"");if(!o||!(a=Wt(a)))return o;var h=Cn(o),g=Jp(h,Cn(a));return Br(h,g).join("")}function iF(o,a){var d=V,h=W;if(Qe(a)){var g="separator"in a?a.separator:g;d="length"in a?Te(a.length):d,h="omission"in a?Wt(a.omission):h}o=Ze(o);var _=o.length;if(Ti(o)){var x=Cn(o);_=x.length}if(d>=_)return o;var B=d-Bi(h);if(B<1)return h;var F=x?Br(x,0,B).join(""):o.slice(0,B);if(g===n)return F+h;if(x&&(B+=F.length-B),$c(g)){if(o.slice(B).search(g)){var j,K=F;for(g.global||(g=sc(g.source,Ze(vp.exec(g))+"g")),g.lastIndex=0;j=g.exec(K);)var Y=j.index;F=F.slice(0,Y===n?B:Y)}}else if(o.indexOf(Wt(g),B)!=B){var ne=F.lastIndexOf(g);ne>-1&&(F=F.slice(0,ne))}return F+h}function oF(o){return o=Ze(o),o&&gT.test(o)?o.replace(mp,FB):o}var sF=Ri(function(o,a,d){return o+(d?" ":"")+a.toUpperCase()}),jc=Uh("toUpperCase");function zf(o,a,d){return o=Ze(o),a=d?n:a,a===n?AB(o)?IB(o):CB(o):o.match(a)||[]}var Uf=Ve(function(o,a){try{return Zt(o,n,a)}catch(d){return Zc(d)?d:new xe(d)}}),aF=qn(function(o,a){return Yt(a,function(d){d=Fn(d),Hn(o,d,zc(o[d],o))}),o});function lF(o){var a=o==null?0:o.length,d=he();return o=a?Ye(o,function(h){if(typeof h[1]!="function")throw new Jt(c);return[d(h[0]),h[1]]}):[],Ve(function(h){for(var g=-1;++g<a;){var _=o[g];if(Zt(_[0],this,h))return Zt(_[1],this,h)}})}function cF(o){return FA(Qt(o,y))}function qc(o){return function(){return o}}function dF(o,a){return o==null||o!==o?a:o}var uF=$h(),pF=$h(!0);function Mt(o){return o}function Kc(o){return Ch(typeof o=="function"?o:Qt(o,y))}function hF(o){return bh(Qt(o,y))}function fF(o,a){return xh(o,Qt(a,y))}var mF=Ve(function(o,a){return function(d){return Wo(d,o,a)}}),gF=Ve(function(o,a){return function(d){return Wo(o,d,a)}});function Yc(o,a,d){var h=pt(a),g=ia(a,h);d==null&&!(Qe(a)&&(g.length||!h.length))&&(d=a,a=o,o=this,g=ia(a,pt(a)));var _=!(Qe(d)&&"chain"in d)||!!d.chain,x=Yn(o);return Yt(g,function(B){var F=a[B];o[B]=F,x&&(o.prototype[B]=function(){var j=this.__chain__;if(_||j){var K=o(this.__wrapped__),Y=K.__actions__=Dt(this.__actions__);return Y.push({func:F,args:arguments,thisArg:o}),K.__chain__=j,K}return F.apply(o,br([this.value()],arguments))})}),o}function yF(){return ft._===this&&(ft._=ZB),this}function Jc(){}function vF(o){return o=Te(o),Ve(function(a){return kh(a,o)})}var _F=Bc(Ye),CF=Bc(Wp),wF=Bc(Ql);function Zf(o){return Rc(o)?ec(Fn(o)):JA(o)}function bF(o){return function(a){return o==null?n:Jr(o,a)}}var xF=Hh(),kF=Hh(!0);function Xc(){return[]}function Qc(){return!1}function SF(){return{}}function EF(){return""}function TF(){return!0}function BF(o,a){if(o=Te(o),o<1||o>we)return[];var d=ht,h=wt(o,ht);a=he(a),o-=ht;for(var g=rc(h,a);++d<o;)a(d);return g}function AF(o){return ke(o)?Ye(o,Fn):Ht(o)?[o]:Dt(cf(Ze(o)))}function NF(o){var a=++zB;return Ze(o)+a}var VF=da(function(o,a){return o+a},0),PF=Ac("ceil"),DF=da(function(o,a){return o/a},1),FF=Ac("floor");function RF(o){return o&&o.length?ra(o,Mt,fc):n}function MF(o,a){return o&&o.length?ra(o,he(a,2),fc):n}function IF(o){return qp(o,Mt)}function OF(o,a){return qp(o,he(a,2))}function LF(o){return o&&o.length?ra(o,Mt,vc):n}function GF(o,a){return o&&o.length?ra(o,he(a,2),vc):n}var zF=da(function(o,a){return o*a},1),UF=Ac("round"),ZF=da(function(o,a){return o-a},0);function $F(o){return o&&o.length?nc(o,Mt):0}function WF(o,a){return o&&o.length?nc(o,he(a,2)):0}return v.after=hP,v.ary=Cf,v.assign=eD,v.assignIn=Ff,v.assignInWith=xa,v.assignWith=tD,v.at=nD,v.before=wf,v.bind=zc,v.bindAll=aF,v.bindKey=bf,v.castArray=SP,v.chain=yf,v.chunk=FN,v.compact=RN,v.concat=MN,v.cond=lF,v.conforms=cF,v.constant=qc,v.countBy=$V,v.create=rD,v.curry=xf,v.curryRight=kf,v.debounce=Sf,v.defaults=iD,v.defaultsDeep=oD,v.defer=fP,v.delay=mP,v.difference=IN,v.differenceBy=ON,v.differenceWith=LN,v.drop=GN,v.dropRight=zN,v.dropRightWhile=UN,v.dropWhile=ZN,v.fill=$N,v.filter=HV,v.flatMap=KV,v.flatMapDeep=YV,v.flatMapDepth=JV,v.flatten=hf,v.flattenDeep=WN,v.flattenDepth=HN,v.flip=gP,v.flow=uF,v.flowRight=pF,v.fromPairs=jN,v.functions=pD,v.functionsIn=hD,v.groupBy=XV,v.initial=KN,v.intersection=YN,v.intersectionBy=JN,v.intersectionWith=XN,v.invert=mD,v.invertBy=gD,v.invokeMap=eP,v.iteratee=Kc,v.keyBy=tP,v.keys=pt,v.keysIn=Rt,v.map=ya,v.mapKeys=vD,v.mapValues=_D,v.matches=hF,v.matchesProperty=fF,v.memoize=_a,v.merge=CD,v.mergeWith=Rf,v.method=mF,v.methodOf=gF,v.mixin=Yc,v.negate=Ca,v.nthArg=vF,v.omit=wD,v.omitBy=bD,v.once=yP,v.orderBy=nP,v.over=_F,v.overArgs=vP,v.overEvery=CF,v.overSome=wF,v.partial=Uc,v.partialRight=Ef,v.partition=rP,v.pick=xD,v.pickBy=Mf,v.property=Zf,v.propertyOf=bF,v.pull=nV,v.pullAll=mf,v.pullAllBy=rV,v.pullAllWith=iV,v.pullAt=oV,v.range=xF,v.rangeRight=kF,v.rearg=_P,v.reject=sP,v.remove=sV,v.rest=CP,v.reverse=Lc,v.sampleSize=lP,v.set=SD,v.setWith=ED,v.shuffle=cP,v.slice=aV,v.sortBy=pP,v.sortedUniq=fV,v.sortedUniqBy=mV,v.split=KD,v.spread=wP,v.tail=gV,v.take=yV,v.takeRight=vV,v.takeRightWhile=_V,v.takeWhile=CV,v.tap=RV,v.throttle=bP,v.thru=ga,v.toArray=Vf,v.toPairs=If,v.toPairsIn=Of,v.toPath=AF,v.toPlainObject=Df,v.transform=TD,v.unary=xP,v.union=wV,v.unionBy=bV,v.unionWith=xV,v.uniq=kV,v.uniqBy=SV,v.uniqWith=EV,v.unset=BD,v.unzip=Gc,v.unzipWith=gf,v.update=AD,v.updateWith=ND,v.values=Oi,v.valuesIn=VD,v.without=TV,v.words=zf,v.wrap=kP,v.xor=BV,v.xorBy=AV,v.xorWith=NV,v.zip=VV,v.zipObject=PV,v.zipObjectDeep=DV,v.zipWith=FV,v.entries=If,v.entriesIn=Of,v.extend=Ff,v.extendWith=xa,Yc(v,v),v.add=VF,v.attempt=Uf,v.camelCase=RD,v.capitalize=Lf,v.ceil=PF,v.clamp=PD,v.clone=EP,v.cloneDeep=BP,v.cloneDeepWith=AP,v.cloneWith=TP,v.conformsTo=NP,v.deburr=Gf,v.defaultTo=dF,v.divide=DF,v.endsWith=MD,v.eq=bn,v.escape=ID,v.escapeRegExp=OD,v.every=WV,v.find=jV,v.findIndex=uf,v.findKey=sD,v.findLast=qV,v.findLastIndex=pf,v.findLastKey=aD,v.floor=FF,v.forEach=vf,v.forEachRight=_f,v.forIn=lD,v.forInRight=cD,v.forOwn=dD,v.forOwnRight=uD,v.get=Wc,v.gt=VP,v.gte=PP,v.has=fD,v.hasIn=Hc,v.head=ff,v.identity=Mt,v.includes=QV,v.indexOf=qN,v.inRange=DD,v.invoke=yD,v.isArguments=ei,v.isArray=ke,v.isArrayBuffer=DP,v.isArrayLike=Ft,v.isArrayLikeObject=nt,v.isBoolean=FP,v.isBuffer=Ar,v.isDate=RP,v.isElement=MP,v.isEmpty=IP,v.isEqual=OP,v.isEqualWith=LP,v.isError=Zc,v.isFinite=GP,v.isFunction=Yn,v.isInteger=Tf,v.isLength=wa,v.isMap=Bf,v.isMatch=zP,v.isMatchWith=UP,v.isNaN=ZP,v.isNative=$P,v.isNil=HP,v.isNull=WP,v.isNumber=Af,v.isObject=Qe,v.isObjectLike=et,v.isPlainObject=Jo,v.isRegExp=$c,v.isSafeInteger=jP,v.isSet=Nf,v.isString=ba,v.isSymbol=Ht,v.isTypedArray=Ii,v.isUndefined=qP,v.isWeakMap=KP,v.isWeakSet=YP,v.join=QN,v.kebabCase=LD,v.last=tn,v.lastIndexOf=eV,v.lowerCase=GD,v.lowerFirst=zD,v.lt=JP,v.lte=XP,v.max=RF,v.maxBy=MF,v.mean=IF,v.meanBy=OF,v.min=LF,v.minBy=GF,v.stubArray=Xc,v.stubFalse=Qc,v.stubObject=SF,v.stubString=EF,v.stubTrue=TF,v.multiply=zF,v.nth=tV,v.noConflict=yF,v.noop=Jc,v.now=va,v.pad=UD,v.padEnd=ZD,v.padStart=$D,v.parseInt=WD,v.random=FD,v.reduce=iP,v.reduceRight=oP,v.repeat=HD,v.replace=jD,v.result=kD,v.round=UF,v.runInContext=D,v.sample=aP,v.size=dP,v.snakeCase=qD,v.some=uP,v.sortedIndex=lV,v.sortedIndexBy=cV,v.sortedIndexOf=dV,v.sortedLastIndex=uV,v.sortedLastIndexBy=pV,v.sortedLastIndexOf=hV,v.startCase=YD,v.startsWith=JD,v.subtract=ZF,v.sum=$F,v.sumBy=WF,v.template=XD,v.times=BF,v.toFinite=Jn,v.toInteger=Te,v.toLength=Pf,v.toLower=QD,v.toNumber=nn,v.toSafeInteger=QP,v.toString=Ze,v.toUpper=eF,v.trim=tF,v.trimEnd=nF,v.trimStart=rF,v.truncate=iF,v.unescape=oF,v.uniqueId=NF,v.upperCase=sF,v.upperFirst=jc,v.each=vf,v.eachRight=_f,v.first=ff,Yc(v,function(){var o={};return Pn(v,function(a,d){$e.call(v.prototype,d)||(o[d]=a)}),o}(),{chain:!1}),v.VERSION=i,Yt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){v[o].placeholder=v}),Yt(["drop","take"],function(o,a){De.prototype[o]=function(d){d=d===n?1:lt(Te(d),0);var h=this.__filtered__&&!a?new De(this):this.clone();return h.__filtered__?h.__takeCount__=wt(d,h.__takeCount__):h.__views__.push({size:wt(d,ht),type:o+(h.__dir__<0?"Right":"")}),h},De.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),Yt(["filter","map","takeWhile"],function(o,a){var d=a+1,h=d==A||d==J;De.prototype[o]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:he(g,3),type:d}),_.__filtered__=_.__filtered__||h,_}}),Yt(["head","last"],function(o,a){var d="take"+(a?"Right":"");De.prototype[o]=function(){return this[d](1).value()[0]}}),Yt(["initial","tail"],function(o,a){var d="drop"+(a?"":"Right");De.prototype[o]=function(){return this.__filtered__?new De(this):this[d](1)}}),De.prototype.compact=function(){return this.filter(Mt)},De.prototype.find=function(o){return this.filter(o).head()},De.prototype.findLast=function(o){return this.reverse().find(o)},De.prototype.invokeMap=Ve(function(o,a){return typeof o=="function"?new De(this):this.map(function(d){return Wo(d,o,a)})}),De.prototype.reject=function(o){return this.filter(Ca(he(o)))},De.prototype.slice=function(o,a){o=Te(o);var d=this;return d.__filtered__&&(o>0||a<0)?new De(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),a!==n&&(a=Te(a),d=a<0?d.dropRight(-a):d.take(a-o)),d)},De.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},De.prototype.toArray=function(){return this.take(ht)},Pn(De.prototype,function(o,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=v[h?"take"+(a=="last"?"Right":""):a],_=h||/^find/.test(a);g&&(v.prototype[a]=function(){var x=this.__wrapped__,B=h?[1]:arguments,F=x instanceof De,j=B[0],K=F||ke(x),Y=function(Pe){var Fe=g.apply(v,br([Pe],B));return h&&ne?Fe[0]:Fe};K&&d&&typeof j=="function"&&j.length!=1&&(F=K=!1);var ne=this.__chain__,ce=!!this.__actions__.length,me=_&&!ne,Ne=F&&!ce;if(!_&&K){x=Ne?x:new De(this);var ge=o.apply(x,B);return ge.__actions__.push({func:ga,args:[Y],thisArg:n}),new Xt(ge,ne)}return me&&Ne?o.apply(this,B):(ge=this.thru(Y),me?h?ge.value()[0]:ge.value():ge)})}),Yt(["pop","push","shift","sort","splice","unshift"],function(o){var a=Us[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",h=/^(?:pop|shift)$/.test(o);v.prototype[o]=function(){var g=arguments;if(h&&!this.__chain__){var _=this.value();return a.apply(ke(_)?_:[],g)}return this[d](function(x){return a.apply(ke(x)?x:[],g)})}}),Pn(De.prototype,function(o,a){var d=v[a];if(d){var h=d.name+"";$e.call(Pi,h)||(Pi[h]=[]),Pi[h].push({name:a,func:d})}}),Pi[ca(n,C).name]=[{name:"wrapper",func:n}],De.prototype.clone=oA,De.prototype.reverse=sA,De.prototype.value=aA,v.prototype.at=MV,v.prototype.chain=IV,v.prototype.commit=OV,v.prototype.next=LV,v.prototype.plant=zV,v.prototype.reverse=UV,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=ZV,v.prototype.first=v.prototype.head,Oo&&(v.prototype[Oo]=GV),v},Ai=OB();Hr?((Hr.exports=Ai)._=Ai,Kl._=Ai):ft._=Ai}).call(Li)}(Bs,Bs.exports);var Le=Bs.exports;const BE={class:"grid-overlay-container"},Xu=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",BE,[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))]))}}),AE={},NE={class:"grid-overlay-container"};function VE(t,e){return r.openBlock(),r.createElementBlock("div",NE,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Qu=Ts(AE,[["render",VE]]);async function PE(t,e){throw Error("not implemented")}function DE(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function FE(t,e){const n=[];for(const i of e)if(t[i].type==="column"){const s=DE(t[i].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=kd(l),u=t.findIndex(p=>Le.isEqual(p.id,c));if(u===-1)throw console.error("axis not found",i,c,t),Error("axis not found");n.push({columnIdx:i,axisIdx:u})}}return n}const ep=(t,e)=>(t+e).toString();function RE(t,e,n,i,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 k=i[u].data.filter(S=>S!==null);return Array.from(new Set(k))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=ME(s,i,u,p,f,e.rows);for(let y=0;y<f.length;++y){const k=f[y],S=k+"@"+y;n.push({colId:S,field:ep(i.length,y),headerName:k,valueFormatter:np})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function ME(t,e,n,i,s,l){const c=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let T=0;T<e.length;++T){if(T===n||T===i)continue;const R=t[T].toString();m[R]=e[T].data[f]}let y;const k=ti(Object.values(m))??"";c.has(k)?y=c.get(k):(c.set(k,m),y=m,y.id=u.toString(),u++);const S=s.indexOf(e[n].data[f]);if(S===-1)throw Error("index not found");const M=ep(e.length,S);y[M]=e[i].data[f]}return Array.from(c.values())}function IE(t){return ti(t)}function tp(t){return JSON.parse(t)}const np=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function OE(t,e,n){var s,l,c;const i=IE(e);return{colId:i,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(i))??((c=e.spec.annotations)==null?void 0:c["pl7.app/table/visibility"])==="optional",valueFormatter:np,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 rp(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 ip(t){const e=[];return cs(t,n=>(e.push(n),n)),e}async function LE(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Le.uniqWith(n.map(s=>Ua(s.spec.axesSpec).map(Le.cloneDeep)).flat(),Le.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function GE(t,e,n){const i=ip(n),l=(await LE(t,e,i)).filter(c=>!Le.find(i,u=>c.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function zE(t,e,n,i){const s=n.filter(m=>m.type!=="Bytes"),l=ip(i),c=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const y=Ua(l[m].spec.axesSpec);for(let k=0;k<y.length;++k){const S=Le.findIndex(s,M=>Le.isEqual(M,y[k]));S===-1||u[S]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[S]=[[m,k]],u[S]=l[m].columnId):c[S].push([m,k]))}}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,k]of c[m]){const S=await t.getUniqueValues(e,{columnId:l[y].columnId,...!u[m]&&{axis:Le.cloneDeep(s[m])},filters:[],limit:p});if(S.overflow){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}const M=S.values.type;for(const T of S.values.data)if(!(xd(T,M)||T===null)&&(f[m].add(rp(T,M)),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 k=[...f[y]].map(M=>({value:M,text:M.toString()})),S=k[0].value;return{axis:Le.cloneDeep(m),...u[y]&&{column:u[y]},options:k,defaultValue:S}})}function UE(t,e,n,i){const s=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const u=[],p=(i++).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(),k=e[m].data[c],S=e[m].type;mg(e[m].absent,c)?f[y]=void 0:xd(k,S)||k===null?f[y]=null:f[y]=rp(k,S)}l.push(f)}return l}const ZE=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function $E(t,e,n,i){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=>!Le.find(n,G=>Le.isEqual(G.axis,s[C].id)||Le.isEqual(G.column,s[C].id))).sort((C,G)=>{var P,O;if(s[C].type!==s[G].type)return s[C].type==="axis"?-1:1;const X=(P=s[C].spec.annotations)==null?void 0:P["pl7.app/table/orderPriority"],L=(O=s[G].spec.annotations)==null?void 0:O["pl7.app/table/orderPriority"];return X===void 0?L===void 0?0:1:L===void 0?-1:Number(L)-Number(X)}),u=Le.cloneDeep(c),p=FE(s,c);for(let C=c.length-1;C>=0;--C){const G=c[C];if(!ZE(s[G]))continue;const X=Ua(s[G].spec.axesSpec)[0],L=Le.findIndex(c,P=>Le.isEqual(s[P].id,X));if(L!==-1){c[L]=G;for(const P of p)P.axisIdx===G&&(P.axisIdx=L);c.splice(C,1),u.splice(C,1)}}const f=await t.getShape(e),m=f.rows,y=u.map(C=>OE(C,s[C],i));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 RE(p,f,y,await t.getData(e,c),u,c);const k=[...c],S=new Map;for(let C=0;C<l;++C)S.set(C,-1);for(let C=0;C<k.length;++C){const G=k[C];S.has(G)&&S.set(G,C)}for(const[C,G]of S)G===-1&&(S.set(C,k.length),k.push(C));const M=[];for(let C=0;C<l;++C){const G=S.get(C);if(G===void 0||G===-1)throw new Error("assertion exception");M.push(G)}let T;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(T&&!Le.isEqual(T.request.sortModel,C.request.sortModel)){T=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}T=C;let G=0,X=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(G=Math.min(m,C.request.endRow)-C.request.startRow,G>0)){const L=await t.getData(e,k,{offset:C.request.startRow,length:G});X=UE(u,L,M,C.request.startRow)}C.success({rowData:X,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(G){C.api.setGridOption("loading",!0),C.fail(),console.trace(G)}}}}}const WE={class:"ap-ag-data-table-container"},HE={key:0,class:"ap-ag-data-table-sheets"},jE=Ts(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{emit:e}){b.ModuleRegistry.registerModules([Qo.ClientSideRowModelModule,sd.ClipboardModule,od.ServerSideRowModelModule,ad.RangeSelectionModule,Ha,Hd]);const n=r.useModel(t,"modelValue"),i=t,{settings:s}=r.toRefs(i),l=e;r.watch(()=>s.value,async(L,P)=>{if(L.sourceType!=="pframe"||!L.pFrame||!L.join||P&&P.sourceType==="pframe"&&Le.isEqual(L.pFrame,P.pFrame)&&Le.isEqual(L.join,P.join))return;const O=window.platforma;if(!O)throw Error("platforma not set");const z=O.pFrameDriver;if(!z)throw Error("platforma.pFrameDriver not set");const N=await GE(z,L.pFrame,L.join),E=n.value;E.pTableParams||(E.pTableParams={sorting:[],filters:[]}),E.pTableParams.join=N,n.value=E});const c=op(()=>s.value.sourceType,async L=>{var O;const P=s.value.sourceType;switch(P){case"pframe":{const z=window.platforma;if(!z)throw Error("platforma not set");const N=z.pFrameDriver;if(!N)throw Error("platforma.pFrameDriver not set");if(!s.value.pFrame)return[];const E=s.value.pFrame,V=(O=n.value.pTableParams)==null?void 0:O.join;return V?await zE(N,E,s.value.sheetAxes,V):[]}case"ptable":return s.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${P}`)}});function u(L){if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return(L==null?void 0:L.sortModel.map(P=>{const{spec:O,...z}=tp(P.colId);return{column:z,ascending:P.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const p=r.computed({get:()=>{const L=n.value;return{columnOrder:L.gridState.columnOrder,sort:L.gridState.sort,columnVisibility:L.gridState.columnVisibility}},set:L=>{const P=n.value,O=S.value.rowModelType==="clientSide"?void 0:u(L.sort);P.gridState={...P.gridState,...L},(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(P.pTableParams||(P.pTableParams={sorting:[],filters:[]}),P.pTableParams.sorting=O),n.value=P}}),f=L=>ti(L);function m(L){var P;if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return((P=c.value)==null?void 0:P.map(O=>({type:"bySingleColumn",column:O.column?{type:"column",id:O.column}:{type:"axis",id:O.axis},predicate:{operator:"Equal",reference:L[f(O.axis)]}})))??[]}const y=r.computed({get:()=>n.value.gridState.sheets??{},set:L=>{const P=m(L),O=n.value;O.gridState.sheets=L,(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(O.pTableParams||(O.pTableParams={sorting:[],filters:[]}),O.pTableParams.filters=P),n.value=O}});r.watch(()=>[s.value,c.value],(L,P)=>{const[O,z]=L;if(!z)return;if(P){const[E,V]=P;if((O.sourceType==="ptable"||O.sourceType==="pframe")&&O.sourceType===(E==null?void 0:E.sourceType)&&Le.isEqual(z,V))return}if(O.sourceType!=="ptable"&&O.sourceType!=="pframe"){y.value={};return}const N=y.value;for(const E of z){const V=f(E.axis);N[V]||(N[V]=E.defaultValue??E.options[0].value)}y.value=N},{immediate:!0});const k=r.shallowRef(),S=r.ref({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:p.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:L=>{L.api.autoSizeAllColumns()},onRowDoubleClicked:L=>{L.data&&l("onRowDoubleClicked",L.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:L=>L.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Xu,noRowsOverlayComponent:Qu,sideBar:{toolPanels:[{id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel",toolPanelParams:{suppressRowGroups:!0,suppressValues:!0,suppressPivots:!0,suppressPivotMode:!0,suppressColumnFilter:!0,suppressColumnSelectAll:!0,suppressColumnExpandAll:!0}}],defaultToolPanel:"columns"}}),M=L=>{const P=L.api;k.value=new Proxy(P,{get(O,z,N){switch(z){case"setGridOption":return(E,V)=>{const W=S.value;W[E]=V,S.value=W,P.updateGridOptions(W)};case"updateGridOptions":return E=>{S.value={...S.value,...E},P.updateGridOptions(E)};default:return Reflect.get(O,z,N)}}})},T=L=>({columnOrder:L.columnOrder,sort:L.sort,columnVisibility:L.columnVisibility??(L.columnOrder?{hiddenColIds:[]}:void 0)}),R=L=>{S.value.initialState=p.value=T(L.state),L.api.autoSizeAllColumns()},C=()=>{S.value.initialState=p.value=T(k.value.getState()),k.value=void 0},G=r.ref(0);r.watch(()=>[k.value,p.value],(L,P)=>{if(Le.isEqual(L,P))return;const[O,z]=L;if(!O)return;const N=T(O.getState());Le.isEqual(z,N)||(S.value.initialState=z,++G.value)}),r.watch(()=>S.value,(L,P)=>{var O;if(P&&(L.rowModelType!=P.rowModelType&&++G.value,!Le.isEqual(L.columnDefs,P.columnDefs)&&L.columnDefs)){const z=V=>!("children"in V),N=(O=L.columnDefs)==null?void 0:O.filter(z),E=N==null?void 0:N.map(V=>V.colId).filter(V=>V!==void 0).map(V=>tp(V));l("columnsChanged",E??[])}});const X=(L,P)=>{var z;const O=y.value;O[L]!==P&&(O[L]=P,y.value=O,(z=k.value)==null||z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))};return r.watch(()=>[k.value,s.value,c.value],async(L,P)=>{var W,q;if(Le.isEqual(L,P))return;const[O,z,N]=L;if(!O)return;const E=window.platforma;if(!E)throw Error("platforma not set");const V=z.sourceType;switch(V){case"pframe":case"ptable":{const $=E.pFrameDriver;if(!$)throw Error("platforma.pFrameDriver not set");const A=z.pTable;if(!A||!N)return O.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const Z=(q=(W=p.value)==null?void 0:W.columnVisibility)==null?void 0:q.hiddenColIds,J=await $E($,A,N,Z);return O.updateGridOptions({loading:J.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...J})}case"xsv":{const $=E.blobDriver;if(!$)throw Error("platforma.blobDriver not set");const A=z.xsvFile;if(!(A!=null&&A.ok)||!A.value)return O.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const Z=await PE($,A.value);return O.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...Z})}default:throw Error(`unsupported source type: ${V}`)}}),(L,P)=>(r.openBlock(),r.createElementBlock("div",WE,[r.createVNode(r.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:r.withCtx(()=>[r.unref(c).value&&r.unref(c).value.length>0?(r.openBlock(),r.createElementBlock("div",HE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c).value,(O,z)=>(r.openBlock(),r.createBlock(r.unref(Bu),{key:z,"model-value":y.value[f(O.axis)],options:O.options,"onUpdate:modelValue":N=>X(f(O.axis),N)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0)]),_:1}),(r.openBlock(),r.createBlock(r.unref(em.AgGridVue),{key:G.value,theme:r.unref(qd),class:"ap-ag-data-table-grid","grid-options":S.value,onGridReady:M,onStateUpdated:R,onGridPreDestroyed:C},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-278d42fe"]]),qE={key:0,class:"d-flex gap-10 flex-column"},KE={key:0},YE=Ts(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:i,restrictions:s,defaults:l}=r.toRefs(n),c=E=>ti(E.id),u=r.computed(()=>i.value.filter(E=>{const V=E.type;switch(V){case"axis":return E.spec.type!=="Bytes";case"column":return E.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${V}`)}}).map(E=>({column:E,id:c(E)}))),p=r.computed(()=>{const E=s.value??[],V={};for(const{column:W,id:q}of u.value){const $=Le.find(E,A=>Le.isEqual(A.column.id,W.id));$!==void 0&&(V[q]=$.allowedFilterTypes)}return V}),f=r.computed(()=>{const E=l.value??[],V={};for(const{column:W,id:q}of u.value){const $=Le.find(E,A=>Le.isEqual(A.column.id,W.id));$!==void 0&&(V[q]=$.default)}return V}),m=E=>E!==void 0?E:f.value,y=r.reactive({state:m(e.value.state)});r.watch(()=>e.value,E=>{Le.isEqual(y.state,E.state)||(y.state=m(E.state))}),r.watch(()=>u.value,E=>{if(y.state!==void 0&&E.length===0)return;const V=y.state??{},W={};for(const{id:q}of E)V[q]!==void 0&&(W[q]=V[q]);y.state=W},{immediate:!0});const k=E=>{switch(E){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: ${E}`)}},S=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],M=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"],T=r.computed(()=>{const E=p.value,V={};for(const{column:W,id:q}of u.value){let A=(W.type==="column"?W.spec.valueType:W.spec.type)==="String"?M:S;const Z=E[q];Z!==void 0&&(A=A.filter(J=>Z.includes(J))),V[q]=A.map(J=>({value:J,text:k(J)}))}return V}),R=r.computed(()=>Le.some(Object.values(T.value),E=>E.length>0)),C=E=>{const V=E.type;switch(V){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return E.reference;case"number_between":return E.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return E.reference;default:throw Error(`unsupported filter type: ${V}`)}},G=(E,V)=>{switch(E){case"isNotNA":case"isNA":return{type:E};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:E,reference:typeof V=="number"?V:0};case"number_between":return{type:E,lowerBound:typeof V=="number"?V: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:E,reference:typeof V=="string"?V:""};case"string_containsFuzzyMatch":return{type:E,reference:typeof V=="string"?V:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${E}`)}},X=(E,V)=>{const W=y.state[E];y.state[E]=G(V,C(W))},L=(E,V)=>{V?y.state[E]=f.value[E]??G(T.value[E][0].value):delete y.state[E]},P=E=>{const V=Le.uniq(E);return V.sort(),V.map(W=>({value:W,text:W}))},O=E=>{const V=Number(E);if(!Number.isFinite(V))throw Error("Model value is not a number.");return V},z=E=>{const V=E.type;switch(V){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":case"string_equals":return{operator:"Equal",reference:E.reference};case"number_notEquals":case"string_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:E.reference}};case"number_greaterThan":return{operator:"Greater",reference:E.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:E.reference};case"number_lessThan":return{operator:"Less",reference:E.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:E.reference};case"number_between":return{operator:"And",operands:[{operator:E.includeLowerBound?"GreaterOrEqual":"Greater",reference:E.lowerBound},{operator:E.includeUpperBound?"LessOrEqual":"Less",reference:E.upperBound}]};case"string_contains":return{operator:"StringContains",substring:E.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:"StringContains",substring:E.reference}};case"string_matches":return{operator:"Matches",regex:E.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:E.reference}};case"string_containsFuzzyMatch":return{operator:"StringContainsFuzzy",reference:E.reference,maxEdits:E.maxEdits,substitutionsOnly:E.substitutionsOnly,wildcard:E.wildcard};default:throw Error(`unsupported filter type: ${V}`)}},N=E=>u.value.map(({column:V,id:W})=>{if(!(W in E))return;const q=z(E[W]),{spec:$,...A}=V;return{type:"bySingleColumn",column:A,predicate:q}}).filter(V=>V!==void 0);return r.watch(()=>y,E=>{Le.isEqual(E.state,e.value.state)||(e.value={state:Le.cloneDeep(E.state),filters:N(E.state)})},{immediate:!0,deep:!0}),(E,V)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,({column:W,id:q},$)=>{var A,Z,J,pe,we,Ct,Tt,ht,vr,Vn,_r,Un,Wr,Ps;return r.openBlock(),r.createElementBlock("div",{key:q},[T.value[q].length>0?(r.openBlock(),r.createElementBlock("form",qE,[r.createVNode(r.unref(Au),{"model-value":!!y.state[q],"onUpdate:modelValue":Ge=>L(q,Ge)},{default:r.withCtx(()=>{var Ge,Cr;return[r.createTextVNode(r.toDisplayString(((Cr=(Ge=W.spec.annotations)==null?void 0:Ge["pl7.app/label"])==null?void 0:Cr.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[q]}])},[y.state[q]?(r.openBlock(),r.createBlock(r.unref(uo),{key:0,"model-value":y.state[q].type,options:T.value[q],label:"Predicate","onUpdate:modelValue":Ge=>X(q,Ge)},null,8,["model-value","options","onUpdate:modelValue"])):r.createCommentVNode("",!0),((A=y.state[q])==null?void 0:A.type)==="number_equals"||((Z=y.state[q])==null?void 0:Z.type)==="number_notEquals"||((J=y.state[q])==null?void 0:J.type)==="number_lessThan"||((pe=y.state[q])==null?void 0:pe.type)==="number_lessThanOrEqualTo"||((we=y.state[q])==null?void 0:we.type)==="number_greaterThan"||((Ct=y.state[q])==null?void 0:Ct.type)==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(Ir),{key:1,modelValue:y.state[q].reference,"onUpdate:modelValue":Ge=>y.state[q].reference=Ge,parse:O,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Tt=y.state[q])==null?void 0:Tt.type)==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createVNode(r.unref(Ir),{modelValue:y.state[q].lowerBound,"onUpdate:modelValue":Ge=>y.state[q].lowerBound=Ge,parse:O,label:"Lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[q].includeLowerBound,"onUpdate:modelValue":Ge=>y.state[q].includeLowerBound=Ge,label:"Include lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(Ir),{modelValue:y.state[q].upperBound,"onUpdate:modelValue":Ge=>y.state[q].upperBound=Ge,parse:O,label:"Upper bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[q].includeUpperBound,"onUpdate:modelValue":Ge=>y.state[q].includeUpperBound=Ge,label:"Include upper bound"},null,8,["modelValue","onUpdate:modelValue"])],64)):r.createCommentVNode("",!0),((ht=y.state[q])==null?void 0:ht.type)==="string_equals"||((vr=y.state[q])==null?void 0:vr.type)==="string_notEquals"||((Vn=y.state[q])==null?void 0:Vn.type)==="string_contains"||((_r=y.state[q])==null?void 0:_r.type)==="string_doesNotContain"||((Un=y.state[q])==null?void 0:Un.type)==="string_matches"||((Wr=y.state[q])==null?void 0:Wr.type)==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(Ir),{key:3,modelValue:y.state[q].reference,"onUpdate:modelValue":Ge=>y.state[q].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Ps=y.state[q])==null?void 0:Ps.type)==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(Ir),{modelValue:y.state[q].reference,"onUpdate:modelValue":Ge=>y.state[q].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(Ku),{modelValue:y.state[q].maxEdits,"onUpdate:modelValue":Ge=>y.state[q].maxEdits=Ge,max:5,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[q].substitutionsOnly,"onUpdate:modelValue":Ge=>y.state[q].substitutionsOnly=Ge,label:"Substitutions only"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(uo),{modelValue:y.state[q].wildcard,"onUpdate:modelValue":Ge=>y.state[q].wildcard=Ge,options:P(y.state[q].reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","onUpdate:modelValue","options"])],64)):r.createCommentVNode("",!0)],2)])):r.createCommentVNode("",!0)])}),128)),R.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",KE,"No filters applicable"))],64))}}),[["__scopeId","data-v-b30bf5ef"]]),JE={key:1,class:"alert-error"},XE={key:2},QE=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),i=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&i.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),i.value?(r.openBlock(),r.createElementBlock("div",JE,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",XE,"Unresolved")):r.createCommentVNode("",!0)]))}}),eT={style:{height:"100%"}},tT=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),i=r.computed(()=>e.params.value);function s(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(i.value):void 0);return(c,u)=>(r.openBlock(),r.createElementBlock("div",eT,[r.createVNode(r.unref(Hu),{"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":i.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),As=new Map;function nT(t,e){const n=r.getCurrentScope()??r.effectScope(),i=n.run(()=>(r.onScopeDispose(()=>{As.delete(t)}),r.reactive(e())));return i[Symbol.dispose]=()=>{n.stop()},i}function rT(t){const e=Symbol();return()=>(As.has(e)||As.set(e,nT(e,t)),As.get(e))}function iT(t){return r.computed(()=>{try{return cd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function op(t,e,n){const i=r.ref(0),s=r.reactive({loading:r.computed(()=>i.value>0),loadingRef:i,value:void 0,error:void 0}),l=rm(e);return r.watch(t,async c=>{s.error=void 0,i.value++,l(c).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{i.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const _i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,sp=new Set,Bl=typeof process=="object"&&process?process:{},ap=(t,e,n,i)=>{typeof Bl.emitWarning=="function"?Bl.emitWarning(t,e,n,i):console.error(`[${n}] ${e}: ${t}`)};let Ns=globalThis.AbortController,lp=globalThis.AbortSignal;if(typeof Ns>"u"){lp=class{constructor(){Ue(this,"onabort");Ue(this,"_onabort",[]);Ue(this,"reason");Ue(this,"aborted",!1)}addEventListener(i,s){this._onabort.push(s)}},Ns=class{constructor(){Ue(this,"signal",new lp);e()}abort(i){var s,l;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const c of this.signal._onabort)c(i);(l=(s=this.signal).onabort)==null||l.call(s,i)}}};let t=((dp=Bl.env)==null?void 0:dp.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,ap("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 oT=t=>!sp.has(t),gr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),cp=t=>gr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Vs:null:null;class Vs extends Array{constructor(e){super(e),this.fill(0)}}const zr=class zr{constructor(e,n){Ue(this,"heap");Ue(this,"length");if(!w(zr,Ci))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=cp(e);if(!n)return[];fe(zr,Ci,!0);const i=new zr(e,n);return fe(zr,Ci,!1),i}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Ci=new WeakMap,Oe(zr,Ci,!1);let Al=zr;const Pl=class Pl{constructor(e){Oe(this,te);Oe(this,dn);Oe(this,Lt);Oe(this,un);Oe(this,pn);Oe(this,wi);Oe(this,bi);Ue(this,"ttl");Ue(this,"ttlResolution");Ue(this,"ttlAutopurge");Ue(this,"updateAgeOnGet");Ue(this,"updateAgeOnHas");Ue(this,"allowStale");Ue(this,"noDisposeOnSet");Ue(this,"noUpdateTTL");Ue(this,"maxEntrySize");Ue(this,"sizeCalculation");Ue(this,"noDeleteOnFetchRejection");Ue(this,"noDeleteOnStaleGet");Ue(this,"allowStaleOnFetchAbort");Ue(this,"allowStaleOnFetchRejection");Ue(this,"ignoreFetchAbort");Oe(this,st);Oe(this,hn);Oe(this,it);Oe(this,je);Oe(this,be);Oe(this,St);Oe(this,Gt);Oe(this,_t);Oe(this,dt);Oe(this,fn);Oe(this,ut);Oe(this,mn);Oe(this,gn);Oe(this,zt);Oe(this,yn);Oe(this,yr);Oe(this,Et);Oe(this,Ur,()=>{});Oe(this,zn,()=>{});Oe(this,No,()=>{});Oe(this,Ut,()=>!1);Oe(this,Zr,e=>{});Oe(this,xi,(e,n,i)=>{});Oe(this,Vo,(e,n,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ue(this,up,"LRUCache");const{max:n=0,ttl:i,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:k,maxSize:S=0,maxEntrySize:M=0,sizeCalculation:T,fetchMethod:R,memoMethod:C,noDeleteOnFetchRejection:G,noDeleteOnStaleGet:X,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:P,ignoreFetchAbort:O}=e;if(n!==0&&!gr(n))throw new TypeError("max option must be a nonnegative integer");const z=n?cp(n):Array;if(!z)throw new Error("invalid max value: "+n);if(fe(this,dn,n),fe(this,Lt,S),this.maxEntrySize=M||w(this,Lt),this.sizeCalculation=T,this.sizeCalculation){if(!w(this,Lt)&&!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(fe(this,bi,C),R!==void 0&&typeof R!="function")throw new TypeError("fetchMethod must be a function if specified");if(fe(this,wi,R),fe(this,yr,!!R),fe(this,it,new Map),fe(this,je,new Array(n).fill(void 0)),fe(this,be,new Array(n).fill(void 0)),fe(this,St,new z(n)),fe(this,Gt,new z(n)),fe(this,_t,0),fe(this,dt,0),fe(this,fn,Al.create(n)),fe(this,st,0),fe(this,hn,0),typeof f=="function"&&fe(this,un,f),typeof m=="function"?(fe(this,pn,m),fe(this,ut,[])):(fe(this,pn,void 0),fe(this,ut,void 0)),fe(this,yn,!!w(this,un)),fe(this,Et,!!w(this,pn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!k,this.noDeleteOnFetchRejection=!!G,this.allowStaleOnFetchRejection=!!L,this.allowStaleOnFetchAbort=!!P,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(w(this,Lt)!==0&&!gr(w(this,Lt)))throw new TypeError("maxSize must be a positive integer if specified");if(!gr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");le(this,te,jf).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!X,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!u,this.ttlResolution=gr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=i||0,this.ttl){if(!gr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");le(this,te,td).call(this)}if(w(this,dn)===0&&this.ttl===0&&w(this,Lt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!w(this,dn)&&!w(this,Lt)){const N="LRU_CACHE_UNBOUNDED";oT(N)&&(sp.add(N),ap("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",N,Pl))}}static unsafeExposeInternals(e){return{starts:w(e,gn),ttls:w(e,zt),sizes:w(e,mn),keyMap:w(e,it),keyList:w(e,je),valList:w(e,be),next:w(e,St),prev:w(e,Gt),get head(){return w(e,_t)},get tail(){return w(e,dt)},free:w(e,fn),isBackgroundFetch:n=>{var i;return le(i=e,te,Ke).call(i,n)},backgroundFetch:(n,i,s,l)=>{var c;return le(c=e,te,Ea).call(c,n,i,s,l)},moveToTail:n=>{var i;return le(i=e,te,Xo).call(i,n)},indexes:n=>{var i;return le(i=e,te,Nr).call(i,n)},rindexes:n=>{var i;return le(i=e,te,Vr).call(i,n)},isStale:n=>{var i;return w(i=e,Ut).call(i,n)}}}get max(){return w(this,dn)}get maxSize(){return w(this,Lt)}get calculatedSize(){return w(this,hn)}get size(){return w(this,st)}get fetchMethod(){return w(this,wi)}get memoMethod(){return w(this,bi)}get dispose(){return w(this,un)}get disposeAfter(){return w(this,pn)}getRemainingTTL(e){return w(this,it).has(e)?1/0:0}*entries(){for(const e of le(this,te,Nr).call(this))w(this,be)[e]!==void 0&&w(this,je)[e]!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield[w(this,je)[e],w(this,be)[e]])}*rentries(){for(const e of le(this,te,Vr).call(this))w(this,be)[e]!==void 0&&w(this,je)[e]!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield[w(this,je)[e],w(this,be)[e]])}*keys(){for(const e of le(this,te,Nr).call(this)){const n=w(this,je)[e];n!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield n)}}*rkeys(){for(const e of le(this,te,Vr).call(this)){const n=w(this,je)[e];n!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield n)}}*values(){for(const e of le(this,te,Nr).call(this))w(this,be)[e]!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield w(this,be)[e])}*rvalues(){for(const e of le(this,te,Vr).call(this))w(this,be)[e]!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield w(this,be)[e])}[(pp=Symbol.iterator,up=Symbol.toStringTag,pp)](){return this.entries()}find(e,n={}){for(const i of le(this,te,Nr).call(this)){const s=w(this,be)[i],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,w(this,je)[i],this))return this.get(w(this,je)[i],n)}}forEach(e,n=this){for(const i of le(this,te,Nr).call(this)){const s=w(this,be)[i],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,je)[i],this)}}rforEach(e,n=this){for(const i of le(this,te,Vr).call(this)){const s=w(this,be)[i],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,je)[i],this)}}purgeStale(){let e=!1;for(const n of le(this,te,Vr).call(this,{allowStale:!0}))w(this,Ut).call(this,n)&&(le(this,te,Pr).call(this,w(this,je)[n],"expire"),e=!0);return e}info(e){const n=w(this,it).get(e);if(n===void 0)return;const i=w(this,be)[n],s=le(this,te,Ke).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;const l={value:s};if(w(this,zt)&&w(this,gn)){const c=w(this,zt)[n],u=w(this,gn)[n];if(c&&u){const p=c-(_i.now()-u);l.ttl=p,l.start=Date.now()}}return w(this,mn)&&(l.size=w(this,mn)[n]),l}dump(){const e=[];for(const n of le(this,te,Nr).call(this,{allowStale:!0})){const i=w(this,je)[n],s=w(this,be)[n],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||i===void 0)continue;const c={value:l};if(w(this,zt)&&w(this,gn)){c.ttl=w(this,zt)[n];const u=_i.now()-w(this,gn)[n];c.start=Math.floor(Date.now()-u)}w(this,mn)&&(c.size=w(this,mn)[n]),e.unshift([i,c])}return e}load(e){this.clear();for(const[n,i]of e){if(i.start){const s=Date.now()-i.start;i.start=_i.now()-s}this.set(n,i.value,i)}}set(e,n,i={}){var k,S,M,T,R;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}=i;let{noUpdateTTL:f=this.noUpdateTTL}=i;const m=w(this,Vo).call(this,e,n,i.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),le(this,te,Pr).call(this,e,"set"),this;let y=w(this,st)===0?void 0:w(this,it).get(e);if(y===void 0)y=w(this,st)===0?w(this,dt):w(this,fn).length!==0?w(this,fn).pop():w(this,st)===w(this,dn)?le(this,te,Sa).call(this,!1):w(this,st),w(this,je)[y]=e,w(this,be)[y]=n,w(this,it).set(e,y),w(this,St)[w(this,dt)]=y,w(this,Gt)[y]=w(this,dt),fe(this,dt,y),ka(this,st)._++,w(this,xi).call(this,y,m,p),p&&(p.set="add"),f=!1;else{le(this,te,Xo).call(this,y);const C=w(this,be)[y];if(n!==C){if(w(this,yr)&&le(this,te,Ke).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:G}=C;G!==void 0&&!c&&(w(this,yn)&&((k=w(this,un))==null||k.call(this,G,e,"set")),w(this,Et)&&((S=w(this,ut))==null||S.push([G,e,"set"])))}else c||(w(this,yn)&&((M=w(this,un))==null||M.call(this,C,e,"set")),w(this,Et)&&((T=w(this,ut))==null||T.push([C,e,"set"])));if(w(this,Zr).call(this,y),w(this,xi).call(this,y,m,p),w(this,be)[y]=n,p){p.set="replace";const G=C&&le(this,te,Ke).call(this,C)?C.__staleWhileFetching:C;G!==void 0&&(p.oldValue=G)}}else p&&(p.set="update")}if(s!==0&&!w(this,zt)&&le(this,te,td).call(this),w(this,zt)&&(f||w(this,No).call(this,y,s,l),p&&w(this,zn).call(this,p,y)),!c&&w(this,Et)&&w(this,ut)){const C=w(this,ut);let G;for(;G=C==null?void 0:C.shift();)(R=w(this,pn))==null||R.call(this,...G)}return this}pop(){var e;try{for(;w(this,st);){const n=w(this,be)[w(this,_t)];if(le(this,te,Sa).call(this,!0),le(this,te,Ke).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(w(this,Et)&&w(this,ut)){const n=w(this,ut);let i;for(;i=n==null?void 0:n.shift();)(e=w(this,pn))==null||e.call(this,...i)}}}has(e,n={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=n,l=w(this,it).get(e);if(l!==void 0){const c=w(this,be)[l];if(le(this,te,Ke).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(w(this,Ut).call(this,l))s&&(s.has="stale",w(this,zn).call(this,s,l));else return i&&w(this,Ur).call(this,l),s&&(s.has="hit",w(this,zn).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:i=this.allowStale}=n,s=w(this,it).get(e);if(s===void 0||!i&&w(this,Ut).call(this,s))return;const l=w(this,be)[s];return le(this,te,Ke).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:i=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:k=this.allowStaleOnFetchRejection,ignoreFetchAbort:S=this.ignoreFetchAbort,allowStaleOnFetchAbort:M=this.allowStaleOnFetchAbort,context:T,forceRefresh:R=!1,status:C,signal:G}=n;if(!w(this,yr))return C&&(C.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const X={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:M,ignoreFetchAbort:S,status:C,signal:G};let L=w(this,it).get(e);if(L===void 0){C&&(C.fetch="miss");const P=le(this,te,Ea).call(this,e,L,X,T);return P.__returned=P}else{const P=w(this,be)[L];if(le(this,te,Ke).call(this,P)){const V=i&&P.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",V&&(C.returnedStale=!0)),V?P.__staleWhileFetching:P.__returned=P}const O=w(this,Ut).call(this,L);if(!R&&!O)return C&&(C.fetch="hit"),le(this,te,Xo).call(this,L),s&&w(this,Ur).call(this,L),C&&w(this,zn).call(this,C,L),P;const z=le(this,te,Ea).call(this,e,L,X,T),E=z.__staleWhileFetching!==void 0&&i;return C&&(C.fetch=O?"stale":"refresh",E&&O&&(C.returnedStale=!0)),E?z.__staleWhileFetching:z.__returned=z}}async forceFetch(e,n={}){const i=await this.fetch(e,n);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,n={}){const i=w(this,bi);if(!i)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=i(e,u,{options:c,context:s});return this.set(e,p,c),p}get(e,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,u=w(this,it).get(e);if(u!==void 0){const p=w(this,be)[u],f=le(this,te,Ke).call(this,p);return c&&w(this,zn).call(this,c,u),w(this,Ut).call(this,u)?(c&&(c.get="stale"),f?(c&&i&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),i?p.__staleWhileFetching:void 0):(l||le(this,te,Pr).call(this,e,"expire"),c&&i&&(c.returnedStale=!0),i?p:void 0)):(c&&(c.get="hit"),f?p.__staleWhileFetching:(le(this,te,Xo).call(this,u),s&&w(this,Ur).call(this,u),p))}else c&&(c.get="miss")}delete(e){return le(this,te,Pr).call(this,e,"delete")}clear(){return le(this,te,id).call(this,"delete")}};dn=new WeakMap,Lt=new WeakMap,un=new WeakMap,pn=new WeakMap,wi=new WeakMap,bi=new WeakMap,st=new WeakMap,hn=new WeakMap,it=new WeakMap,je=new WeakMap,be=new WeakMap,St=new WeakMap,Gt=new WeakMap,_t=new WeakMap,dt=new WeakMap,fn=new WeakMap,ut=new WeakMap,mn=new WeakMap,gn=new WeakMap,zt=new WeakMap,yn=new WeakMap,yr=new WeakMap,Et=new WeakMap,te=new WeakSet,td=function(){const e=new Vs(w(this,dn)),n=new Vs(w(this,dn));fe(this,zt,e),fe(this,gn,n),fe(this,No,(l,c,u=_i.now())=>{if(n[l]=c!==0?u:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{w(this,Ut).call(this,l)&&le(this,te,Pr).call(this,w(this,je)[l],"expire")},c+1);p.unref&&p.unref()}}),fe(this,Ur,l=>{n[l]=e[l]!==0?_i.now():0}),fe(this,zn,(l,c)=>{if(e[c]){const u=e[c],p=n[c];if(!u||!p)return;l.ttl=u,l.start=p,l.now=i||s();const f=l.now-p;l.remainingTTL=u-f}});let i=0;const s=()=>{const l=_i.now();if(this.ttlResolution>0){i=l;const c=setTimeout(()=>i=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=w(this,it).get(l);if(c===void 0)return 0;const u=e[c],p=n[c];if(!u||!p)return 1/0;const f=(i||s())-p;return u-f},fe(this,Ut,l=>{const c=n[l],u=e[l];return!!u&&!!c&&(i||s())-c>u})},Ur=new WeakMap,zn=new WeakMap,No=new WeakMap,Ut=new WeakMap,jf=function(){const e=new Vs(w(this,dn));fe(this,hn,0),fe(this,mn,e),fe(this,Zr,n=>{fe(this,hn,w(this,hn)-e[n]),e[n]=0}),fe(this,Vo,(n,i,s,l)=>{if(le(this,te,Ke).call(this,i))return 0;if(!gr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(i,n),!gr(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}),fe(this,xi,(n,i,s)=>{if(e[n]=i,w(this,Lt)){const l=w(this,Lt)-e[n];for(;w(this,hn)>l;)le(this,te,Sa).call(this,!0)}fe(this,hn,w(this,hn)+e[n]),s&&(s.entrySize=i,s.totalCalculatedSize=w(this,hn))})},Zr=new WeakMap,xi=new WeakMap,Vo=new WeakMap,Nr=function*({allowStale:e=this.allowStale}={}){if(w(this,st))for(let n=w(this,dt);!(!le(this,te,nd).call(this,n)||((e||!w(this,Ut).call(this,n))&&(yield n),n===w(this,_t)));)n=w(this,Gt)[n]},Vr=function*({allowStale:e=this.allowStale}={}){if(w(this,st))for(let n=w(this,_t);!(!le(this,te,nd).call(this,n)||((e||!w(this,Ut).call(this,n))&&(yield n),n===w(this,dt)));)n=w(this,St)[n]},nd=function(e){return e!==void 0&&w(this,it).get(w(this,je)[e])===e},Sa=function(e){var l,c;const n=w(this,_t),i=w(this,je)[n],s=w(this,be)[n];return w(this,yr)&&le(this,te,Ke).call(this,s)?s.__abortController.abort(new Error("evicted")):(w(this,yn)||w(this,Et))&&(w(this,yn)&&((l=w(this,un))==null||l.call(this,s,i,"evict")),w(this,Et)&&((c=w(this,ut))==null||c.push([s,i,"evict"]))),w(this,Zr).call(this,n),e&&(w(this,je)[n]=void 0,w(this,be)[n]=void 0,w(this,fn).push(n)),w(this,st)===1?(fe(this,_t,fe(this,dt,0)),w(this,fn).length=0):fe(this,_t,w(this,St)[n]),w(this,it).delete(i),ka(this,st)._--,n},Ea=function(e,n,i,s){const l=n===void 0?void 0:w(this,be)[n];if(le(this,te,Ke).call(this,l))return l;const c=new Ns,{signal:u}=i;u==null||u.addEventListener("abort",()=>c.abort(u.reason),{signal:c.signal});const p={signal:c.signal,options:i,context:s},f=(T,R=!1)=>{const{aborted:C}=c.signal,G=i.ignoreFetchAbort&&T!==void 0;if(i.status&&(C&&!R?(i.status.fetchAborted=!0,i.status.fetchError=c.signal.reason,G&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),C&&!G&&!R)return y(c.signal.reason);const X=S;return w(this,be)[n]===S&&(T===void 0?X.__staleWhileFetching?w(this,be)[n]=X.__staleWhileFetching:le(this,te,Pr).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,T,p.options))),T},m=T=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=T),y(T)),y=T=>{const{aborted:R}=c.signal,C=R&&i.allowStaleOnFetchAbort,G=C||i.allowStaleOnFetchRejection,X=G||i.noDeleteOnFetchRejection,L=S;if(w(this,be)[n]===S&&(!X||L.__staleWhileFetching===void 0?le(this,te,Pr).call(this,e,"fetch"):C||(w(this,be)[n]=L.__staleWhileFetching)),G)return i.status&&L.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),L.__staleWhileFetching;if(L.__returned===L)throw T},k=(T,R)=>{var G;const C=(G=w(this,wi))==null?void 0:G.call(this,e,l,p);C&&C instanceof Promise&&C.then(X=>T(X===void 0?void 0:X),R),c.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(T(void 0),i.allowStaleOnFetchAbort&&(T=X=>f(X,!0)))})};i.status&&(i.status.fetchDispatched=!0);const S=new Promise(k).then(f,m),M=Object.assign(S,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,M,{...p.options,status:void 0}),n=w(this,it).get(e)):w(this,be)[n]=M,M},Ke=function(e){if(!w(this,yr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Ns},rd=function(e,n){w(this,Gt)[n]=e,w(this,St)[e]=n},Xo=function(e){e!==w(this,dt)&&(e===w(this,_t)?fe(this,_t,w(this,St)[e]):le(this,te,rd).call(this,w(this,Gt)[e],w(this,St)[e]),le(this,te,rd).call(this,w(this,dt),e),fe(this,dt,e))},Pr=function(e,n){var s,l,c,u;let i=!1;if(w(this,st)!==0){const p=w(this,it).get(e);if(p!==void 0)if(i=!0,w(this,st)===1)le(this,te,id).call(this,n);else{w(this,Zr).call(this,p);const f=w(this,be)[p];if(le(this,te,Ke).call(this,f)?f.__abortController.abort(new Error("deleted")):(w(this,yn)||w(this,Et))&&(w(this,yn)&&((s=w(this,un))==null||s.call(this,f,e,n)),w(this,Et)&&((l=w(this,ut))==null||l.push([f,e,n]))),w(this,it).delete(e),w(this,je)[p]=void 0,w(this,be)[p]=void 0,p===w(this,dt))fe(this,dt,w(this,Gt)[p]);else if(p===w(this,_t))fe(this,_t,w(this,St)[p]);else{const m=w(this,Gt)[p];w(this,St)[m]=w(this,St)[p];const y=w(this,St)[p];w(this,Gt)[y]=w(this,Gt)[p]}ka(this,st)._--,w(this,fn).push(p)}}if(w(this,Et)&&((c=w(this,ut))!=null&&c.length)){const p=w(this,ut);let f;for(;f=p==null?void 0:p.shift();)(u=w(this,pn))==null||u.call(this,...f)}return i},id=function(e){var n,i,s;for(const l of le(this,te,Vr).call(this,{allowStale:!0})){const c=w(this,be)[l];if(le(this,te,Ke).call(this,c))c.__abortController.abort(new Error("deleted"));else{const u=w(this,je)[l];w(this,yn)&&((n=w(this,un))==null||n.call(this,c,u,e)),w(this,Et)&&((i=w(this,ut))==null||i.push([c,u,e]))}}if(w(this,it).clear(),w(this,be).fill(void 0),w(this,je).fill(void 0),w(this,zt)&&w(this,gn)&&(w(this,zt).fill(0),w(this,gn).fill(0)),w(this,mn)&&w(this,mn).fill(0),fe(this,_t,0),fe(this,dt,0),w(this,fn).length=0,fe(this,hn,0),fe(this,st,0),w(this,Et)&&w(this,ut)){const l=w(this,ut);let c;for(;c=l==null?void 0:l.shift();)(s=w(this,pn))==null||s.call(this,...c)}};let Nl=Pl;const sT={cacheSize:15e6};class aT{constructor(e){Ue(this,"_str");Ue(this,"_rawJson");Ue(this,"_zodSchema");Ue(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 $r=class $r{constructor(e){Ue(this,"fileDataCache");Ue(this,"fileDataRefs",new Map);const n={...sT,...e??{}};this.fileDataCache=new Nl({maxSize:n.cacheSize,fetchMethod:async i=>new aT(await vg().blobDriver.getContent(i)),sizeCalculation:i=>i.bytes.length,dispose:(i,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const i=r.shallowRef();return this.fileDataRefs.set(e,i),(async()=>{try{const s=await this.fileDataCache.fetch(e);i.value=s}catch(s){console.error(s)}})(),i}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n.value)==null?void 0:i.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n==null?void 0:n.value)==null?void 0:i.str})}getContentJson(e,n){if(e===void 0)return;const i=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=i==null?void 0:i.value)==null?void 0:s.rawJson:(l=i==null?void 0:i.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return $r.globalInstance.getContentBytes(e)}static getContentString(e){return $r.globalInstance.getContentString(e)}static getContentJson(e,n){return $r.globalInstance.getContentJson(e,n)}};Ue($r,"globalInstance",new $r);let Vl=$r;I.AgGridTheme=qd,I.BlockLayout=TE,I.ContextProvider=pk,I.DataTable=D_,I.DemoData=hE,I.DropdownListItem=di,I.LongText=yl,I.MultiError=Aa,I.PlAgCellFile=tT,I.PlAgDataTable=jE,I.PlAgOverlayLoading=Xu,I.PlAgOverlayNoRows=Qu,I.PlAlert=dC,I.PlBlockPage=Y_,I.PlBtnAccent=BC,I.PlBtnDanger=NC,I.PlBtnGhost=ul,I.PlBtnGroup=XC,I.PlBtnLink=FC,I.PlBtnPrimary=cl,I.PlBtnSecondary=dl,I.PlBtnSplit=xC,I.PlCheckbox=Au,I.PlCheckboxGroup=Xw,I.PlChip=vl,I.PlContainer=X_,I.PlCopyData=qu,I.PlDialogModal=Cl,I.PlDropdown=uo,I.PlDropdownLegacy=Cw,I.PlDropdownLine=Bu,I.PlDropdownMulti=jw,I.PlDropdownRef=K0,I.PlFileDialog=Vu,I.PlFileInput=Hu,I.PlGrid=iC,I.PlIcon16=ms,I.PlIcon24=ku,I.PlLogView=Eb,I.PlMaskIcon16=pi,I.PlMaskIcon24=Ln,I.PlNotificationAlert=ju,I.PlNumberField=Pw,I.PlProgressBar=Sw,I.PlRow=eC,I.PlSlideModal=pb,I.PlSpacer=yu,I.PlTableFilters=YE,I.PlTabs=Fb,I.PlTextArea=A0,I.PlTextField=Ir,I.PlToggleSwitch=gs,I.PlTooltip=Vt,I.ReactiveFileContent=Vl,I.Scrollable=nS,I.Slider=Ku,I.SliderRange=Xk,I.SliderRangeTriple=Gk,I.ThemeSwitcher=Z_,I.UnresolvedError=Ba,I.ValueOrErrorsComponent=QE,I.activateAgGrid=jd,I.animate=uu,I.animateInfinite=O_,I.call=su,I.computedResult=iT,I.createModel=Ra,I.debounce=pu,I.defineApp=lv,I.defineStore=rT,I.delay=au,I.detectOutside=N0,I.ensureError=Pa,I.eventListener=ml,I.formatZodError=Fa,I.getElementScrollPosition=Eu,I.identity=Va,I.isDefined=lm,I.isElementVisible=Su,I.isJsonEqual=Na,I.isZodError=Da,I.listToOptions=L_,I.makeEaseInOut=I_,I.makeEaseOut=du,I.maskIcons16=uE,I.maskIcons24=pE,I.normalizeListOptions=ar,I.notEmpty=il,I.randomInt=cu,I.randomString=M_,I.requestTick=ol,I.scrollIntoView=co,I.showContextMenu=tl,I.throttle=hu,I.timeout=lu,I.unwrapOptionalResult=am,I.unwrapValueOrErrors=ld,I.useClickOutside=fs,I.useDraggable=Ak,I.useEventListener=tt,I.useFormState=Tk,I.useHover=iu,I.useInterval=Ek,I.useLabelNotch=On,I.useLocalStorage=fu,I.useMouse=ru,I.useMouseCapture=sr,I.usePosition=ui,I.useQuery=Bk,I.useResizeObserver=Yu,I.useScroll=xk,I.useSdkPlugin=Xa,I.useSortable=Sk,I.useTheme=gu,I.useWatchFetch=op,I.wrapOptionalResult=cd,I.wrapValueOrErrors=sm,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
89
+ }`;var Ae=$f(function(){return ze(_,ce+"return "+Y).apply(n,x)});if(Ae.source=Y,Uc(Ae))throw Ae;return Ae}function XD(o){return Ue(o).toLowerCase()}function QD(o){return Ue(o).toUpperCase()}function eF(o,a,d){if(o=Ue(o),o&&(d||a===n))return Yp(o);if(!o||!(a=Wt(a)))return o;var h=Cn(o),g=Cn(a),_=Jp(h,g),x=Xp(h,g)+1;return Br(h,_,x).join("")}function tF(o,a,d){if(o=Ue(o),o&&(d||a===n))return o.slice(0,eh(o)+1);if(!o||!(a=Wt(a)))return o;var h=Cn(o),g=Xp(h,Cn(a))+1;return Br(h,0,g).join("")}function nF(o,a,d){if(o=Ue(o),o&&(d||a===n))return o.replace(Ul,"");if(!o||!(a=Wt(a)))return o;var h=Cn(o),g=Jp(h,Cn(a));return Br(h,g).join("")}function rF(o,a){var d=V,h=W;if(Qe(a)){var g="separator"in a?a.separator:g;d="length"in a?Te(a.length):d,h="omission"in a?Wt(a.omission):h}o=Ue(o);var _=o.length;if(Ti(o)){var x=Cn(o);_=x.length}if(d>=_)return o;var B=d-Bi(h);if(B<1)return h;var R=x?Br(x,0,B).join(""):o.slice(0,B);if(g===n)return R+h;if(x&&(B+=R.length-B),Zc(g)){if(o.slice(B).search(g)){var j,K=R;for(g.global||(g=sc(g.source,Ue(vp.exec(g))+"g")),g.lastIndex=0;j=g.exec(K);)var Y=j.index;R=R.slice(0,Y===n?B:Y)}}else if(o.indexOf(Wt(g),B)!=B){var ne=R.lastIndexOf(g);ne>-1&&(R=R.slice(0,ne))}return R+h}function iF(o){return o=Ue(o),o&&mT.test(o)?o.replace(mp,DB):o}var oF=Ri(function(o,a,d){return o+(d?" ":"")+a.toUpperCase()}),jc=$h("toUpperCase");function zf(o,a,d){return o=Ue(o),a=d?n:a,a===n?BB(o)?MB(o):_B(o):o.match(a)||[]}var $f=Ve(function(o,a){try{return Ut(o,n,a)}catch(d){return Uc(d)?d:new xe(d)}}),sF=qn(function(o,a){return Yt(a,function(d){d=Fn(d),Hn(o,d,zc(o[d],o))}),o});function aF(o){var a=o==null?0:o.length,d=he();return o=a?Ye(o,function(h){if(typeof h[1]!="function")throw new Jt(c);return[d(h[0]),h[1]]}):[],Ve(function(h){for(var g=-1;++g<a;){var _=o[g];if(Ut(_[0],this,h))return Ut(_[1],this,h)}})}function lF(o){return DN(Qt(o,y))}function qc(o){return function(){return o}}function cF(o,a){return o==null||o!==o?a:o}var dF=Zh(),uF=Zh(!0);function Mt(o){return o}function Kc(o){return Ch(typeof o=="function"?o:Qt(o,y))}function pF(o){return bh(Qt(o,y))}function hF(o,a){return xh(o,Qt(a,y))}var fF=Ve(function(o,a){return function(d){return Wo(d,o,a)}}),mF=Ve(function(o,a){return function(d){return Wo(o,d,a)}});function Yc(o,a,d){var h=pt(a),g=ia(a,h);d==null&&!(Qe(a)&&(g.length||!h.length))&&(d=a,a=o,o=this,g=ia(a,pt(a)));var _=!(Qe(d)&&"chain"in d)||!!d.chain,x=Yn(o);return Yt(g,function(B){var R=a[B];o[B]=R,x&&(o.prototype[B]=function(){var j=this.__chain__;if(_||j){var K=o(this.__wrapped__),Y=K.__actions__=Dt(this.__actions__);return Y.push({func:R,args:arguments,thisArg:o}),K.__chain__=j,K}return R.apply(o,br([this.value()],arguments))})}),o}function gF(){return ft._===this&&(ft._=$B),this}function Jc(){}function yF(o){return o=Te(o),Ve(function(a){return kh(a,o)})}var vF=Bc(Ye),_F=Bc(Wp),CF=Bc(Ql);function Uf(o){return Rc(o)?ec(Fn(o)):YN(o)}function wF(o){return function(a){return o==null?n:Jr(o,a)}}var bF=Hh(),xF=Hh(!0);function Xc(){return[]}function Qc(){return!1}function kF(){return{}}function SF(){return""}function EF(){return!0}function TF(o,a){if(o=Te(o),o<1||o>we)return[];var d=ht,h=wt(o,ht);a=he(a),o-=ht;for(var g=rc(h,a);++d<o;)a(d);return g}function BF(o){return ke(o)?Ye(o,Fn):Ht(o)?[o]:Dt(cf(Ue(o)))}function NF(o){var a=++GB;return Ue(o)+a}var AF=da(function(o,a){return o+a},0),VF=Nc("ceil"),PF=da(function(o,a){return o/a},1),DF=Nc("floor");function FF(o){return o&&o.length?ra(o,Mt,fc):n}function RF(o,a){return o&&o.length?ra(o,he(a,2),fc):n}function MF(o){return qp(o,Mt)}function IF(o,a){return qp(o,he(a,2))}function LF(o){return o&&o.length?ra(o,Mt,vc):n}function OF(o,a){return o&&o.length?ra(o,he(a,2),vc):n}var GF=da(function(o,a){return o*a},1),zF=Nc("round"),$F=da(function(o,a){return o-a},0);function UF(o){return o&&o.length?nc(o,Mt):0}function ZF(o,a){return o&&o.length?nc(o,he(a,2)):0}return v.after=pP,v.ary=Cf,v.assign=QP,v.assignIn=Ff,v.assignInWith=xa,v.assignWith=eD,v.at=tD,v.before=wf,v.bind=zc,v.bindAll=sF,v.bindKey=bf,v.castArray=kP,v.chain=yf,v.chunk=DA,v.compact=FA,v.concat=RA,v.cond=aF,v.conforms=lF,v.constant=qc,v.countBy=UV,v.create=nD,v.curry=xf,v.curryRight=kf,v.debounce=Sf,v.defaults=rD,v.defaultsDeep=iD,v.defer=hP,v.delay=fP,v.difference=MA,v.differenceBy=IA,v.differenceWith=LA,v.drop=OA,v.dropRight=GA,v.dropRightWhile=zA,v.dropWhile=$A,v.fill=UA,v.filter=WV,v.flatMap=qV,v.flatMapDeep=KV,v.flatMapDepth=YV,v.flatten=hf,v.flattenDeep=ZA,v.flattenDepth=WA,v.flip=mP,v.flow=dF,v.flowRight=uF,v.fromPairs=HA,v.functions=uD,v.functionsIn=pD,v.groupBy=JV,v.initial=qA,v.intersection=KA,v.intersectionBy=YA,v.intersectionWith=JA,v.invert=fD,v.invertBy=mD,v.invokeMap=QV,v.iteratee=Kc,v.keyBy=eP,v.keys=pt,v.keysIn=Rt,v.map=ya,v.mapKeys=yD,v.mapValues=vD,v.matches=pF,v.matchesProperty=hF,v.memoize=_a,v.merge=_D,v.mergeWith=Rf,v.method=fF,v.methodOf=mF,v.mixin=Yc,v.negate=Ca,v.nthArg=yF,v.omit=CD,v.omitBy=wD,v.once=gP,v.orderBy=tP,v.over=vF,v.overArgs=yP,v.overEvery=_F,v.overSome=CF,v.partial=$c,v.partialRight=Ef,v.partition=nP,v.pick=bD,v.pickBy=Mf,v.property=Uf,v.propertyOf=wF,v.pull=tV,v.pullAll=mf,v.pullAllBy=nV,v.pullAllWith=rV,v.pullAt=iV,v.range=bF,v.rangeRight=xF,v.rearg=vP,v.reject=oP,v.remove=oV,v.rest=_P,v.reverse=Oc,v.sampleSize=aP,v.set=kD,v.setWith=SD,v.shuffle=lP,v.slice=sV,v.sortBy=uP,v.sortedUniq=hV,v.sortedUniqBy=fV,v.split=qD,v.spread=CP,v.tail=mV,v.take=gV,v.takeRight=yV,v.takeRightWhile=vV,v.takeWhile=_V,v.tap=FV,v.throttle=wP,v.thru=ga,v.toArray=Vf,v.toPairs=If,v.toPairsIn=Lf,v.toPath=BF,v.toPlainObject=Df,v.transform=ED,v.unary=bP,v.union=CV,v.unionBy=wV,v.unionWith=bV,v.uniq=xV,v.uniqBy=kV,v.uniqWith=SV,v.unset=TD,v.unzip=Gc,v.unzipWith=gf,v.update=BD,v.updateWith=ND,v.values=Li,v.valuesIn=AD,v.without=EV,v.words=zf,v.wrap=xP,v.xor=TV,v.xorBy=BV,v.xorWith=NV,v.zip=AV,v.zipObject=VV,v.zipObjectDeep=PV,v.zipWith=DV,v.entries=If,v.entriesIn=Lf,v.extend=Ff,v.extendWith=xa,Yc(v,v),v.add=AF,v.attempt=$f,v.camelCase=FD,v.capitalize=Of,v.ceil=VF,v.clamp=VD,v.clone=SP,v.cloneDeep=TP,v.cloneDeepWith=BP,v.cloneWith=EP,v.conformsTo=NP,v.deburr=Gf,v.defaultTo=cF,v.divide=PF,v.endsWith=RD,v.eq=bn,v.escape=MD,v.escapeRegExp=ID,v.every=ZV,v.find=HV,v.findIndex=uf,v.findKey=oD,v.findLast=jV,v.findLastIndex=pf,v.findLastKey=sD,v.floor=DF,v.forEach=vf,v.forEachRight=_f,v.forIn=aD,v.forInRight=lD,v.forOwn=cD,v.forOwnRight=dD,v.get=Wc,v.gt=AP,v.gte=VP,v.has=hD,v.hasIn=Hc,v.head=ff,v.identity=Mt,v.includes=XV,v.indexOf=jA,v.inRange=PD,v.invoke=gD,v.isArguments=ei,v.isArray=ke,v.isArrayBuffer=PP,v.isArrayLike=Ft,v.isArrayLikeObject=nt,v.isBoolean=DP,v.isBuffer=Nr,v.isDate=FP,v.isElement=RP,v.isEmpty=MP,v.isEqual=IP,v.isEqualWith=LP,v.isError=Uc,v.isFinite=OP,v.isFunction=Yn,v.isInteger=Tf,v.isLength=wa,v.isMap=Bf,v.isMatch=GP,v.isMatchWith=zP,v.isNaN=$P,v.isNative=UP,v.isNil=WP,v.isNull=ZP,v.isNumber=Nf,v.isObject=Qe,v.isObjectLike=et,v.isPlainObject=Jo,v.isRegExp=Zc,v.isSafeInteger=HP,v.isSet=Af,v.isString=ba,v.isSymbol=Ht,v.isTypedArray=Ii,v.isUndefined=jP,v.isWeakMap=qP,v.isWeakSet=KP,v.join=XA,v.kebabCase=LD,v.last=tn,v.lastIndexOf=QA,v.lowerCase=OD,v.lowerFirst=GD,v.lt=YP,v.lte=JP,v.max=FF,v.maxBy=RF,v.mean=MF,v.meanBy=IF,v.min=LF,v.minBy=OF,v.stubArray=Xc,v.stubFalse=Qc,v.stubObject=kF,v.stubString=SF,v.stubTrue=EF,v.multiply=GF,v.nth=eV,v.noConflict=gF,v.noop=Jc,v.now=va,v.pad=zD,v.padEnd=$D,v.padStart=UD,v.parseInt=ZD,v.random=DD,v.reduce=rP,v.reduceRight=iP,v.repeat=WD,v.replace=HD,v.result=xD,v.round=zF,v.runInContext=F,v.sample=sP,v.size=cP,v.snakeCase=jD,v.some=dP,v.sortedIndex=aV,v.sortedIndexBy=lV,v.sortedIndexOf=cV,v.sortedLastIndex=dV,v.sortedLastIndexBy=uV,v.sortedLastIndexOf=pV,v.startCase=KD,v.startsWith=YD,v.subtract=$F,v.sum=UF,v.sumBy=ZF,v.template=JD,v.times=TF,v.toFinite=Jn,v.toInteger=Te,v.toLength=Pf,v.toLower=XD,v.toNumber=nn,v.toSafeInteger=XP,v.toString=Ue,v.toUpper=QD,v.trim=eF,v.trimEnd=tF,v.trimStart=nF,v.truncate=rF,v.unescape=iF,v.uniqueId=NF,v.upperCase=oF,v.upperFirst=jc,v.each=vf,v.eachRight=_f,v.first=ff,Yc(v,function(){var o={};return Pn(v,function(a,d){Ze.call(v.prototype,d)||(o[d]=a)}),o}(),{chain:!1}),v.VERSION=i,Yt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){v[o].placeholder=v}),Yt(["drop","take"],function(o,a){De.prototype[o]=function(d){d=d===n?1:lt(Te(d),0);var h=this.__filtered__&&!a?new De(this):this.clone();return h.__filtered__?h.__takeCount__=wt(d,h.__takeCount__):h.__views__.push({size:wt(d,ht),type:o+(h.__dir__<0?"Right":"")}),h},De.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),Yt(["filter","map","takeWhile"],function(o,a){var d=a+1,h=d==N||d==J;De.prototype[o]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:he(g,3),type:d}),_.__filtered__=_.__filtered__||h,_}}),Yt(["head","last"],function(o,a){var d="take"+(a?"Right":"");De.prototype[o]=function(){return this[d](1).value()[0]}}),Yt(["initial","tail"],function(o,a){var d="drop"+(a?"":"Right");De.prototype[o]=function(){return this.__filtered__?new De(this):this[d](1)}}),De.prototype.compact=function(){return this.filter(Mt)},De.prototype.find=function(o){return this.filter(o).head()},De.prototype.findLast=function(o){return this.reverse().find(o)},De.prototype.invokeMap=Ve(function(o,a){return typeof o=="function"?new De(this):this.map(function(d){return Wo(d,o,a)})}),De.prototype.reject=function(o){return this.filter(Ca(he(o)))},De.prototype.slice=function(o,a){o=Te(o);var d=this;return d.__filtered__&&(o>0||a<0)?new De(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),a!==n&&(a=Te(a),d=a<0?d.dropRight(-a):d.take(a-o)),d)},De.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},De.prototype.toArray=function(){return this.take(ht)},Pn(De.prototype,function(o,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=v[h?"take"+(a=="last"?"Right":""):a],_=h||/^find/.test(a);g&&(v.prototype[a]=function(){var x=this.__wrapped__,B=h?[1]:arguments,R=x instanceof De,j=B[0],K=R||ke(x),Y=function(Pe){var Fe=g.apply(v,br([Pe],B));return h&&ne?Fe[0]:Fe};K&&d&&typeof j=="function"&&j.length!=1&&(R=K=!1);var ne=this.__chain__,ce=!!this.__actions__.length,me=_&&!ne,Ae=R&&!ce;if(!_&&K){x=Ae?x:new De(this);var ge=o.apply(x,B);return ge.__actions__.push({func:ga,args:[Y],thisArg:n}),new Xt(ge,ne)}return me&&Ae?o.apply(this,B):(ge=this.thru(Y),me?h?ge.value()[0]:ge.value():ge)})}),Yt(["pop","push","shift","sort","splice","unshift"],function(o){var a=$s[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",h=/^(?:pop|shift)$/.test(o);v.prototype[o]=function(){var g=arguments;if(h&&!this.__chain__){var _=this.value();return a.apply(ke(_)?_:[],g)}return this[d](function(x){return a.apply(ke(x)?x:[],g)})}}),Pn(De.prototype,function(o,a){var d=v[a];if(d){var h=d.name+"";Ze.call(Pi,h)||(Pi[h]=[]),Pi[h].push({name:a,func:d})}}),Pi[ca(n,C).name]=[{name:"wrapper",func:n}],De.prototype.clone=iN,De.prototype.reverse=oN,De.prototype.value=sN,v.prototype.at=RV,v.prototype.chain=MV,v.prototype.commit=IV,v.prototype.next=LV,v.prototype.plant=GV,v.prototype.reverse=zV,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=$V,v.prototype.first=v.prototype.head,Lo&&(v.prototype[Lo]=OV),v},Ni=IB();Hr?((Hr.exports=Ni)._=Ni,Kl._=Ni):ft._=Ni}).call(Oi)}(Bs,Bs.exports);var Oe=Bs.exports;const TE={class:"grid-overlay-container"},Xu=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",TE,[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))]))}}),BE={},NE={class:"grid-overlay-container"};function AE(t,e){return r.openBlock(),r.createElementBlock("div",NE,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Qu=Ts(BE,[["render",AE]]);async function VE(t,e){throw Error("not implemented")}function PE(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function DE(t,e){const n=[];for(const i of e)if(t[i].type==="column"){const s=PE(t[i].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=kd(l),u=t.findIndex(p=>Oe.isEqual(p.id,c));if(u===-1)throw console.error("axis not found",i,c,t),Error("axis not found");n.push({columnIdx:i,axisIdx:u})}}return n}const ep=(t,e)=>(t+e).toString();function FE(t,e,n,i,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=i[u].data.filter(S=>S!==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=RE(s,i,u,p,f,e.rows);for(let y=0;y<f.length;++y){const T=f[y],S=T+"@"+y;n.push({colId:S,field:ep(i.length,y),headerName:T,valueFormatter:np})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function RE(t,e,n,i,s,l){const c=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let k=0;k<e.length;++k){if(k===n||k===i)continue;const M=t[k].toString();m[M]=e[k].data[f]}let y;const T=ti(Object.values(m))??"";c.has(T)?y=c.get(T):(c.set(T,m),y=m,y.id=u.toString(),u++);const S=s.indexOf(e[n].data[f]);if(S===-1)throw Error("index not found");const D=ep(e.length,S);y[D]=e[i].data[f]}return Array.from(c.values())}function ME(t){return ti(t)}function tp(t){return JSON.parse(t)}const np=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function IE(t,e,n){var s,l,c;const i=ME(e);return{colId:i,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(i))??((c=e.spec.annotations)==null?void 0:c["pl7.app/table/visibility"])==="optional",valueFormatter:np,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 rp(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 ip(t){const e=[];return cs(t,n=>(e.push(n),n)),e}async function LE(t,e,n){return n.length?(await t.findColumns(e,{columnFilter:{name:["pl7.app/label"]},compatibleWith:Oe.uniqWith(n.map(s=>$a(s.spec.axesSpec).map(Oe.cloneDeep)).flat(),Oe.isEqual),strictlyCompatible:!0})).hits.filter(s=>s.spec.axesSpec.length===1):[]}async function OE(t,e,n){const i=ip(n),l=(await LE(t,e,i)).filter(c=>!Oe.find(i,u=>c.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function GE(t,e,n,i){const s=n.filter(m=>m.type!=="Bytes"),l=ip(i),c=s.map(m=>[]),u=s.map(m=>null);for(let m=0;m<l.length;++m){const y=$a(l[m].spec.axesSpec);for(let T=0;T<y.length;++T){const S=Oe.findIndex(s,D=>Oe.isEqual(D,y[T]));S===-1||u[S]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[S]=[[m,T]],u[S]=l[m].columnId):c[S].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 S=await t.getUniqueValues(e,{columnId:l[y].columnId,...!u[m]&&{axis:Oe.cloneDeep(s[m])},filters:[],limit:p});if(S.overflow){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}const D=S.values.type;for(const k of S.values.data)if(!(xd(k,D)||k===null)&&(f[m].add(rp(k,D)),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(D=>({value:D,text:D.toString()})),S=T[0].value;return{axis:Oe.cloneDeep(m),...u[y]&&{column:u[y]},options:T,defaultValue:S}})}function zE(t,e,n,i){const s=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const u=[],p=(i++).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],S=e[m].type;mg(e[m].absent,c)?f[y]=void 0:xd(T,S)||T===null?f[y]=null:f[y]=rp(T,S)}l.push(f)}return l}const $E=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function UE(t,e,n,i){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=>!Oe.find(n,G=>Oe.isEqual(G.axis,s[C].id)||Oe.isEqual(G.column,s[C].id))).sort((C,G)=>{var P,L;if(s[C].type!==s[G].type)return s[C].type==="axis"?-1:1;const X=(P=s[C].spec.annotations)==null?void 0:P["pl7.app/table/orderPriority"],O=(L=s[G].spec.annotations)==null?void 0:L["pl7.app/table/orderPriority"];return X===void 0?O===void 0?0:1:O===void 0?-1:Number(O)-Number(X)}),u=Oe.cloneDeep(c),p=DE(s,c);for(let C=c.length-1;C>=0;--C){const G=c[C];if(!$E(s[G]))continue;const X=$a(s[G].spec.axesSpec)[0],O=Oe.findIndex(c,P=>Oe.isEqual(s[P].id,X));if(O!==-1){c[O]=G;for(const P of p)P.axisIdx===G&&(P.axisIdx=O);c.splice(C,1),u.splice(C,1)}}const f=await t.getShape(e),m=f.rows,y=u.map(C=>IE(C,s[C],i));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 FE(p,f,y,await t.getData(e,c),u,c);const T=[...c],S=new Map;for(let C=0;C<l;++C)S.set(C,-1);for(let C=0;C<T.length;++C){const G=T[C];S.has(G)&&S.set(G,C)}for(const[C,G]of S)G===-1&&(S.set(C,T.length),T.push(C));const D=[];for(let C=0;C<l;++C){const G=S.get(C);if(G===void 0||G===-1)throw new Error("assertion exception");D.push(G)}let k;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(k&&!Oe.isEqual(k.request.sortModel,C.request.sortModel)){k=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}k=C;let G=0,X=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(G=Math.min(m,C.request.endRow)-C.request.startRow,G>0)){const O=await t.getData(e,T,{offset:C.request.startRow,length:G});X=zE(u,O,D,C.request.startRow)}C.success({rowData:X,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(G){C.api.setGridOption("loading",!0),C.fail(),console.trace(G)}}}}}const ZE={class:"ap-ag-data-table-container"},WE={key:0,class:"ap-ag-data-table-sheets"},HE=Ts(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{emit:e}){b.ModuleRegistry.registerModules([Qo.ClientSideRowModelModule,sd.ClipboardModule,od.ServerSideRowModelModule,ad.RangeSelectionModule,Ha,Hd]);const n=r.useModel(t,"modelValue"),i=t,{settings:s}=r.toRefs(i),l=e;r.watch(()=>s.value,async(O,P)=>{if(O.sourceType!=="pframe"||!O.pFrame||!O.join||P&&P.sourceType==="pframe"&&Oe.isEqual(O.pFrame,P.pFrame)&&Oe.isEqual(O.join,P.join))return;const L=window.platforma;if(!L)throw Error("platforma not set");const z=L.pFrameDriver;if(!z)throw Error("platforma.pFrameDriver not set");const A=await OE(z,O.pFrame,O.join),E=n.value;E.pTableParams||(E.pTableParams={sorting:[],filters:[]}),E.pTableParams.join=A,n.value=E});const c=op(()=>s.value.sourceType,async O=>{var L;const P=s.value.sourceType;switch(P){case"pframe":{const z=window.platforma;if(!z)throw Error("platforma not set");const A=z.pFrameDriver;if(!A)throw Error("platforma.pFrameDriver not set");if(!s.value.pFrame)return[];const E=s.value.pFrame,V=(L=n.value.pTableParams)==null?void 0:L.join;return V?await GE(A,E,s.value.sheetAxes,V):[]}case"ptable":return s.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${P}`)}});function u(O){if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return(O==null?void 0:O.sortModel.map(P=>{const{spec:L,...z}=tp(P.colId);return{column:z,ascending:P.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const p=r.computed({get:()=>{const O=n.value;return{columnOrder:O.gridState.columnOrder,sort:O.gridState.sort,columnVisibility:O.gridState.columnVisibility}},set:O=>{const P=n.value,L=S.value.rowModelType==="clientSide"?void 0:u(O.sort);P.gridState={...P.gridState,...O},(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(P.pTableParams||(P.pTableParams={sorting:[],filters:[]}),P.pTableParams.sorting=L),n.value=P}}),f=O=>ti(O);function m(O){var P;if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return((P=c.value)==null?void 0:P.map(L=>({type:"bySingleColumn",column:L.column?{type:"column",id:L.column}:{type:"axis",id:L.axis},predicate:{operator:"Equal",reference:O[f(L.axis)]}})))??[]}const y=r.computed({get:()=>n.value.gridState.sheets??{},set:O=>{const P=m(O),L=n.value;L.gridState.sheets=O,(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(L.pTableParams||(L.pTableParams={sorting:[],filters:[]}),L.pTableParams.filters=P),n.value=L}});r.watch(()=>[s.value,c.value],(O,P)=>{const[L,z]=O;if(!z)return;if(P){const[E,V]=P;if((L.sourceType==="ptable"||L.sourceType==="pframe")&&L.sourceType===(E==null?void 0:E.sourceType)&&Oe.isEqual(z,V))return}if(L.sourceType!=="ptable"&&L.sourceType!=="pframe"){y.value={};return}const A=y.value;for(const E of z){const V=f(E.axis);A[V]||(A[V]=E.defaultValue??E.options[0].value)}y.value=A},{immediate:!0});const T=r.shallowRef(),S=r.ref({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:p.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:O=>{O.api.autoSizeAllColumns()},onRowDoubleClicked:O=>{O.data&&l("onRowDoubleClicked",O.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:O=>O.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Xu,noRowsOverlayComponent:Qu,sideBar:{toolPanels:[{id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel",toolPanelParams:{suppressRowGroups:!0,suppressValues:!0,suppressPivots:!0,suppressPivotMode:!0,suppressColumnFilter:!0,suppressColumnSelectAll:!0,suppressColumnExpandAll:!0}}],defaultToolPanel:"columns"}}),D=O=>{const P=O.api;T.value=new Proxy(P,{get(L,z,A){switch(z){case"setGridOption":return(E,V)=>{const W=S.value;W[E]=V,S.value=W,P.updateGridOptions(W)};case"updateGridOptions":return E=>{S.value={...S.value,...E},P.updateGridOptions(E)};default:return Reflect.get(L,z,A)}}})},k=O=>({columnOrder:O.columnOrder,sort:O.sort,columnVisibility:O.columnVisibility??(O.columnOrder?{hiddenColIds:[]}:void 0)}),M=O=>{S.value.initialState=p.value=k(O.state),O.api.autoSizeAllColumns()},C=()=>{S.value.initialState=p.value=k(T.value.getState()),T.value=void 0},G=r.ref(0);r.watch(()=>[T.value,p.value],(O,P)=>{if(Oe.isEqual(O,P))return;const[L,z]=O;if(!L)return;const A=k(L.getState());Oe.isEqual(z,A)||(S.value.initialState=z,++G.value)}),r.watch(()=>S.value,(O,P)=>{var L;if(P&&(O.rowModelType!=P.rowModelType&&++G.value,!Oe.isEqual(O.columnDefs,P.columnDefs)&&O.columnDefs)){const z=V=>!("children"in V),A=(L=O.columnDefs)==null?void 0:L.filter(z),E=A==null?void 0:A.map(V=>V.colId).filter(V=>V!==void 0).map(V=>tp(V));l("columnsChanged",E??[])}});const X=(O,P)=>{var z;const L=y.value;L[O]!==P&&(L[O]=P,y.value=L,(z=T.value)==null||z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))};return r.watch(()=>[T.value,s.value,c.value],async(O,P)=>{var W,q;if(Oe.isEqual(O,P))return;const[L,z,A]=O;if(!L)return;const E=window.platforma;if(!E)throw Error("platforma not set");const V=z.sourceType;switch(V){case"pframe":case"ptable":{const Z=E.pFrameDriver;if(!Z)throw Error("platforma.pFrameDriver not set");const N=z.pTable;if(!N||!A)return L.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const U=(q=(W=p.value)==null?void 0:W.columnVisibility)==null?void 0:q.hiddenColIds,J=await UE(Z,N,A,U);return L.updateGridOptions({loading:J.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...J})}case"xsv":{const Z=E.blobDriver;if(!Z)throw Error("platforma.blobDriver not set");const N=z.xsvFile;if(!(N!=null&&N.ok)||!N.value)return L.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const U=await VE(Z,N.value);return L.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...U})}default:throw Error(`unsupported source type: ${V}`)}}),(O,P)=>(r.openBlock(),r.createElementBlock("div",ZE,[r.createVNode(r.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:r.withCtx(()=>[r.unref(c).value&&r.unref(c).value.length>0?(r.openBlock(),r.createElementBlock("div",WE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c).value,(L,z)=>(r.openBlock(),r.createBlock(r.unref(Bu),{key:z,"model-value":y.value[f(L.axis)],options:L.options,"onUpdate:modelValue":A=>X(f(L.axis),A)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0)]),_:1}),(r.openBlock(),r.createBlock(r.unref(em.AgGridVue),{key:G.value,theme:r.unref(qd),class:"ap-ag-data-table-grid","grid-options":S.value,onGridReady:D,onStateUpdated:M,onGridPreDestroyed:C},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-278d42fe"]]),jE={key:0,class:"d-flex gap-10 flex-column"},qE={key:0},KE=Ts(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:i,restrictions:s,defaults:l}=r.toRefs(n),c=E=>ti(E.id),u=r.computed(()=>i.value.filter(E=>{const V=E.type;switch(V){case"axis":return E.spec.type!=="Bytes";case"column":return E.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${V}`)}}).map(E=>({column:E,id:c(E)}))),p=r.computed(()=>{const E=s.value??[],V={};for(const{column:W,id:q}of u.value){const Z=Oe.find(E,N=>Oe.isEqual(N.column.id,W.id));Z!==void 0&&(V[q]=Z.allowedFilterTypes)}return V}),f=r.computed(()=>{const E=l.value??[],V={};for(const{column:W,id:q}of u.value){const Z=Oe.find(E,N=>Oe.isEqual(N.column.id,W.id));Z!==void 0&&(V[q]=Z.default)}return V}),m=E=>E!==void 0?E:f.value,y=r.reactive({state:m(e.value.state)});r.watch(()=>e.value,E=>{Oe.isEqual(y.state,E.state)||(y.state=m(E.state))}),r.watch(()=>u.value,E=>{if(y.state!==void 0&&E.length===0)return;const V=y.state??{},W={};for(const{id:q}of E)V[q]!==void 0&&(W[q]=V[q]);y.state=W},{immediate:!0});const T=E=>{switch(E){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: ${E}`)}},S=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],D=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"],k=r.computed(()=>{const E=p.value,V={};for(const{column:W,id:q}of u.value){let N=(W.type==="column"?W.spec.valueType:W.spec.type)==="String"?D:S;const U=E[q];U!==void 0&&(N=N.filter(J=>U.includes(J))),V[q]=N.map(J=>({value:J,text:T(J)}))}return V}),M=r.computed(()=>Oe.some(Object.values(k.value),E=>E.length>0)),C=E=>{const V=E.type;switch(V){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return E.reference;case"number_between":return E.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return E.reference;default:throw Error(`unsupported filter type: ${V}`)}},G=(E,V)=>{switch(E){case"isNotNA":case"isNA":return{type:E};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:E,reference:typeof V=="number"?V:0};case"number_between":return{type:E,lowerBound:typeof V=="number"?V: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:E,reference:typeof V=="string"?V:""};case"string_containsFuzzyMatch":return{type:E,reference:typeof V=="string"?V:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${E}`)}},X=(E,V)=>{const W=y.state[E];y.state[E]=G(V,C(W))},O=(E,V)=>{V?y.state[E]=f.value[E]??G(k.value[E][0].value):delete y.state[E]},P=E=>{const V=Oe.uniq(E);return V.sort(),V.map(W=>({value:W,text:W}))},L=E=>{const V=Number(E);if(!Number.isFinite(V))throw Error("Model value is not a number.");return V},z=E=>{const V=E.type;switch(V){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":case"string_equals":return{operator:"Equal",reference:E.reference};case"number_notEquals":case"string_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:E.reference}};case"number_greaterThan":return{operator:"Greater",reference:E.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:E.reference};case"number_lessThan":return{operator:"Less",reference:E.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:E.reference};case"number_between":return{operator:"And",operands:[{operator:E.includeLowerBound?"GreaterOrEqual":"Greater",reference:E.lowerBound},{operator:E.includeUpperBound?"LessOrEqual":"Less",reference:E.upperBound}]};case"string_contains":return{operator:"StringContains",substring:E.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:"StringContains",substring:E.reference}};case"string_matches":return{operator:"Matches",regex:E.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:E.reference}};case"string_containsFuzzyMatch":return{operator:"StringContainsFuzzy",reference:E.reference,maxEdits:E.maxEdits,substitutionsOnly:E.substitutionsOnly,wildcard:E.wildcard};default:throw Error(`unsupported filter type: ${V}`)}},A=E=>u.value.map(({column:V,id:W})=>{if(!(W in E))return;const q=z(E[W]),{spec:Z,...N}=V;return{type:"bySingleColumn",column:N,predicate:q}}).filter(V=>V!==void 0);return r.watch(()=>y,E=>{Oe.isEqual(E.state,e.value.state)||(e.value={state:Oe.cloneDeep(E.state),filters:A(E.state)})},{immediate:!0,deep:!0}),(E,V)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,({column:W,id:q},Z)=>{var N,U,J,pe,we,Ct,Bt,ht,vr,Vn,_r,$n,Wr,Ps;return r.openBlock(),r.createElementBlock("div",{key:q},[k.value[q].length>0?(r.openBlock(),r.createElementBlock("form",jE,[r.createVNode(r.unref(Nu),{"model-value":!!y.state[q],"onUpdate:modelValue":Ge=>O(q,Ge)},{default:r.withCtx(()=>{var Ge,Cr;return[r.createTextVNode(r.toDisplayString(((Cr=(Ge=W.spec.annotations)==null?void 0:Ge["pl7.app/label"])==null?void 0:Cr.trim())??"Unlabeled "+W.type+" "+Z.toString()),1)]}),_:2},1032,["model-value","onUpdate:modelValue"]),r.createElementVNode("div",{class:r.normalizeClass(["controls d-flex gap-10 flex-column",{open:!!y.state[q]}])},[y.state[q]?(r.openBlock(),r.createBlock(r.unref(uo),{key:0,"model-value":y.state[q].type,options:k.value[q],label:"Predicate","onUpdate:modelValue":Ge=>X(q,Ge)},null,8,["model-value","options","onUpdate:modelValue"])):r.createCommentVNode("",!0),((N=y.state[q])==null?void 0:N.type)==="number_equals"||((U=y.state[q])==null?void 0:U.type)==="number_notEquals"||((J=y.state[q])==null?void 0:J.type)==="number_lessThan"||((pe=y.state[q])==null?void 0:pe.type)==="number_lessThanOrEqualTo"||((we=y.state[q])==null?void 0:we.type)==="number_greaterThan"||((Ct=y.state[q])==null?void 0:Ct.type)==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(Ir),{key:1,modelValue:y.state[q].reference,"onUpdate:modelValue":Ge=>y.state[q].reference=Ge,parse:L,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Bt=y.state[q])==null?void 0:Bt.type)==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createVNode(r.unref(Ir),{modelValue:y.state[q].lowerBound,"onUpdate:modelValue":Ge=>y.state[q].lowerBound=Ge,parse:L,label:"Lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[q].includeLowerBound,"onUpdate:modelValue":Ge=>y.state[q].includeLowerBound=Ge,label:"Include lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(Ir),{modelValue:y.state[q].upperBound,"onUpdate:modelValue":Ge=>y.state[q].upperBound=Ge,parse:L,label:"Upper bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[q].includeUpperBound,"onUpdate:modelValue":Ge=>y.state[q].includeUpperBound=Ge,label:"Include upper bound"},null,8,["modelValue","onUpdate:modelValue"])],64)):r.createCommentVNode("",!0),((ht=y.state[q])==null?void 0:ht.type)==="string_equals"||((vr=y.state[q])==null?void 0:vr.type)==="string_notEquals"||((Vn=y.state[q])==null?void 0:Vn.type)==="string_contains"||((_r=y.state[q])==null?void 0:_r.type)==="string_doesNotContain"||(($n=y.state[q])==null?void 0:$n.type)==="string_matches"||((Wr=y.state[q])==null?void 0:Wr.type)==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(Ir),{key:3,modelValue:y.state[q].reference,"onUpdate:modelValue":Ge=>y.state[q].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Ps=y.state[q])==null?void 0:Ps.type)==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(Ir),{modelValue:y.state[q].reference,"onUpdate:modelValue":Ge=>y.state[q].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(Ku),{modelValue:y.state[q].maxEdits,"onUpdate:modelValue":Ge=>y.state[q].maxEdits=Ge,max:5,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[q].substitutionsOnly,"onUpdate:modelValue":Ge=>y.state[q].substitutionsOnly=Ge,label:"Substitutions only"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(uo),{modelValue:y.state[q].wildcard,"onUpdate:modelValue":Ge=>y.state[q].wildcard=Ge,options:P(y.state[q].reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","onUpdate:modelValue","options"])],64)):r.createCommentVNode("",!0)],2)])):r.createCommentVNode("",!0)])}),128)),M.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",qE,"No filters applicable"))],64))}}),[["__scopeId","data-v-b30bf5ef"]]),YE={key:1,class:"alert-error"},JE={key:2},XE=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),i=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&i.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),i.value?(r.openBlock(),r.createElementBlock("div",YE,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",JE,"Unresolved")):r.createCommentVNode("",!0)]))}}),QE={style:{height:"100%"}},eT=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),i=r.computed(()=>e.params.value);function s(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(i.value):void 0);return(c,u)=>(r.openBlock(),r.createElementBlock("div",QE,[r.createVNode(r.unref(ju),{"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":i.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),Ns=new Map;function tT(t,e){const n=r.getCurrentScope()??r.effectScope(),i=n.run(()=>(r.onScopeDispose(()=>{Ns.delete(t)}),r.reactive(e())));return i[Symbol.dispose]=()=>{n.stop()},i}function nT(t){const e=Symbol();return()=>(Ns.has(e)||Ns.set(e,tT(e,t)),Ns.get(e))}function rT(t){return r.computed(()=>{try{return cd(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function op(t,e,n){const i=r.ref(0),s=r.reactive({loading:r.computed(()=>i.value>0),loadingRef:i,value:void 0,error:void 0}),l=rm(e);return r.watch(t,async c=>{s.error=void 0,i.value++,l(c).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{i.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const _i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,sp=new Set,Bl=typeof process=="object"&&process?process:{},ap=(t,e,n,i)=>{typeof Bl.emitWarning=="function"?Bl.emitWarning(t,e,n,i):console.error(`[${n}] ${e}: ${t}`)};let As=globalThis.AbortController,lp=globalThis.AbortSignal;if(typeof As>"u"){lp=class{constructor(){$e(this,"onabort");$e(this,"_onabort",[]);$e(this,"reason");$e(this,"aborted",!1)}addEventListener(i,s){this._onabort.push(s)}},As=class{constructor(){$e(this,"signal",new lp);e()}abort(i){var s,l;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const c of this.signal._onabort)c(i);(l=(s=this.signal).onabort)==null||l.call(s,i)}}};let t=((dp=Bl.env)==null?void 0:dp.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,ap("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 iT=t=>!sp.has(t),gr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),cp=t=>gr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Vs:null:null;class Vs extends Array{constructor(e){super(e),this.fill(0)}}const zr=class zr{constructor(e,n){$e(this,"heap");$e(this,"length");if(!w(zr,Ci))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=cp(e);if(!n)return[];fe(zr,Ci,!0);const i=new zr(e,n);return fe(zr,Ci,!1),i}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Ci=new WeakMap,Le(zr,Ci,!1);let Nl=zr;const Pl=class Pl{constructor(e){Le(this,te);Le(this,dn);Le(this,Ot);Le(this,un);Le(this,pn);Le(this,wi);Le(this,bi);$e(this,"ttl");$e(this,"ttlResolution");$e(this,"ttlAutopurge");$e(this,"updateAgeOnGet");$e(this,"updateAgeOnHas");$e(this,"allowStale");$e(this,"noDisposeOnSet");$e(this,"noUpdateTTL");$e(this,"maxEntrySize");$e(this,"sizeCalculation");$e(this,"noDeleteOnFetchRejection");$e(this,"noDeleteOnStaleGet");$e(this,"allowStaleOnFetchAbort");$e(this,"allowStaleOnFetchRejection");$e(this,"ignoreFetchAbort");Le(this,st);Le(this,hn);Le(this,it);Le(this,je);Le(this,be);Le(this,Et);Le(this,Gt);Le(this,_t);Le(this,dt);Le(this,fn);Le(this,ut);Le(this,mn);Le(this,gn);Le(this,zt);Le(this,yn);Le(this,yr);Le(this,Tt);Le(this,$r,()=>{});Le(this,zn,()=>{});Le(this,Ao,()=>{});Le(this,$t,()=>!1);Le(this,Ur,e=>{});Le(this,xi,(e,n,i)=>{});Le(this,Vo,(e,n,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});$e(this,up,"LRUCache");const{max:n=0,ttl:i,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:T,maxSize:S=0,maxEntrySize:D=0,sizeCalculation:k,fetchMethod:M,memoMethod:C,noDeleteOnFetchRejection:G,noDeleteOnStaleGet:X,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:P,ignoreFetchAbort:L}=e;if(n!==0&&!gr(n))throw new TypeError("max option must be a nonnegative integer");const z=n?cp(n):Array;if(!z)throw new Error("invalid max value: "+n);if(fe(this,dn,n),fe(this,Ot,S),this.maxEntrySize=D||w(this,Ot),this.sizeCalculation=k,this.sizeCalculation){if(!w(this,Ot)&&!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(fe(this,bi,C),M!==void 0&&typeof M!="function")throw new TypeError("fetchMethod must be a function if specified");if(fe(this,wi,M),fe(this,yr,!!M),fe(this,it,new Map),fe(this,je,new Array(n).fill(void 0)),fe(this,be,new Array(n).fill(void 0)),fe(this,Et,new z(n)),fe(this,Gt,new z(n)),fe(this,_t,0),fe(this,dt,0),fe(this,fn,Nl.create(n)),fe(this,st,0),fe(this,hn,0),typeof f=="function"&&fe(this,un,f),typeof m=="function"?(fe(this,pn,m),fe(this,ut,[])):(fe(this,pn,void 0),fe(this,ut,void 0)),fe(this,yn,!!w(this,un)),fe(this,Tt,!!w(this,pn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!T,this.noDeleteOnFetchRejection=!!G,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!P,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(w(this,Ot)!==0&&!gr(w(this,Ot)))throw new TypeError("maxSize must be a positive integer if specified");if(!gr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");le(this,te,jf).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!X,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!u,this.ttlResolution=gr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=i||0,this.ttl){if(!gr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");le(this,te,td).call(this)}if(w(this,dn)===0&&this.ttl===0&&w(this,Ot)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!w(this,dn)&&!w(this,Ot)){const A="LRU_CACHE_UNBOUNDED";iT(A)&&(sp.add(A),ap("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,Pl))}}static unsafeExposeInternals(e){return{starts:w(e,gn),ttls:w(e,zt),sizes:w(e,mn),keyMap:w(e,it),keyList:w(e,je),valList:w(e,be),next:w(e,Et),prev:w(e,Gt),get head(){return w(e,_t)},get tail(){return w(e,dt)},free:w(e,fn),isBackgroundFetch:n=>{var i;return le(i=e,te,Ke).call(i,n)},backgroundFetch:(n,i,s,l)=>{var c;return le(c=e,te,Ea).call(c,n,i,s,l)},moveToTail:n=>{var i;return le(i=e,te,Xo).call(i,n)},indexes:n=>{var i;return le(i=e,te,Ar).call(i,n)},rindexes:n=>{var i;return le(i=e,te,Vr).call(i,n)},isStale:n=>{var i;return w(i=e,$t).call(i,n)}}}get max(){return w(this,dn)}get maxSize(){return w(this,Ot)}get calculatedSize(){return w(this,hn)}get size(){return w(this,st)}get fetchMethod(){return w(this,wi)}get memoMethod(){return w(this,bi)}get dispose(){return w(this,un)}get disposeAfter(){return w(this,pn)}getRemainingTTL(e){return w(this,it).has(e)?1/0:0}*entries(){for(const e of le(this,te,Ar).call(this))w(this,be)[e]!==void 0&&w(this,je)[e]!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield[w(this,je)[e],w(this,be)[e]])}*rentries(){for(const e of le(this,te,Vr).call(this))w(this,be)[e]!==void 0&&w(this,je)[e]!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield[w(this,je)[e],w(this,be)[e]])}*keys(){for(const e of le(this,te,Ar).call(this)){const n=w(this,je)[e];n!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield n)}}*rkeys(){for(const e of le(this,te,Vr).call(this)){const n=w(this,je)[e];n!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield n)}}*values(){for(const e of le(this,te,Ar).call(this))w(this,be)[e]!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield w(this,be)[e])}*rvalues(){for(const e of le(this,te,Vr).call(this))w(this,be)[e]!==void 0&&!le(this,te,Ke).call(this,w(this,be)[e])&&(yield w(this,be)[e])}[(pp=Symbol.iterator,up=Symbol.toStringTag,pp)](){return this.entries()}find(e,n={}){for(const i of le(this,te,Ar).call(this)){const s=w(this,be)[i],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,w(this,je)[i],this))return this.get(w(this,je)[i],n)}}forEach(e,n=this){for(const i of le(this,te,Ar).call(this)){const s=w(this,be)[i],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,je)[i],this)}}rforEach(e,n=this){for(const i of le(this,te,Vr).call(this)){const s=w(this,be)[i],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,je)[i],this)}}purgeStale(){let e=!1;for(const n of le(this,te,Vr).call(this,{allowStale:!0}))w(this,$t).call(this,n)&&(le(this,te,Pr).call(this,w(this,je)[n],"expire"),e=!0);return e}info(e){const n=w(this,it).get(e);if(n===void 0)return;const i=w(this,be)[n],s=le(this,te,Ke).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;const l={value:s};if(w(this,zt)&&w(this,gn)){const c=w(this,zt)[n],u=w(this,gn)[n];if(c&&u){const p=c-(_i.now()-u);l.ttl=p,l.start=Date.now()}}return w(this,mn)&&(l.size=w(this,mn)[n]),l}dump(){const e=[];for(const n of le(this,te,Ar).call(this,{allowStale:!0})){const i=w(this,je)[n],s=w(this,be)[n],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||i===void 0)continue;const c={value:l};if(w(this,zt)&&w(this,gn)){c.ttl=w(this,zt)[n];const u=_i.now()-w(this,gn)[n];c.start=Math.floor(Date.now()-u)}w(this,mn)&&(c.size=w(this,mn)[n]),e.unshift([i,c])}return e}load(e){this.clear();for(const[n,i]of e){if(i.start){const s=Date.now()-i.start;i.start=_i.now()-s}this.set(n,i.value,i)}}set(e,n,i={}){var T,S,D,k,M;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}=i;let{noUpdateTTL:f=this.noUpdateTTL}=i;const m=w(this,Vo).call(this,e,n,i.size||0,u);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),le(this,te,Pr).call(this,e,"set"),this;let y=w(this,st)===0?void 0:w(this,it).get(e);if(y===void 0)y=w(this,st)===0?w(this,dt):w(this,fn).length!==0?w(this,fn).pop():w(this,st)===w(this,dn)?le(this,te,Sa).call(this,!1):w(this,st),w(this,je)[y]=e,w(this,be)[y]=n,w(this,it).set(e,y),w(this,Et)[w(this,dt)]=y,w(this,Gt)[y]=w(this,dt),fe(this,dt,y),ka(this,st)._++,w(this,xi).call(this,y,m,p),p&&(p.set="add"),f=!1;else{le(this,te,Xo).call(this,y);const C=w(this,be)[y];if(n!==C){if(w(this,yr)&&le(this,te,Ke).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:G}=C;G!==void 0&&!c&&(w(this,yn)&&((T=w(this,un))==null||T.call(this,G,e,"set")),w(this,Tt)&&((S=w(this,ut))==null||S.push([G,e,"set"])))}else c||(w(this,yn)&&((D=w(this,un))==null||D.call(this,C,e,"set")),w(this,Tt)&&((k=w(this,ut))==null||k.push([C,e,"set"])));if(w(this,Ur).call(this,y),w(this,xi).call(this,y,m,p),w(this,be)[y]=n,p){p.set="replace";const G=C&&le(this,te,Ke).call(this,C)?C.__staleWhileFetching:C;G!==void 0&&(p.oldValue=G)}}else p&&(p.set="update")}if(s!==0&&!w(this,zt)&&le(this,te,td).call(this),w(this,zt)&&(f||w(this,Ao).call(this,y,s,l),p&&w(this,zn).call(this,p,y)),!c&&w(this,Tt)&&w(this,ut)){const C=w(this,ut);let G;for(;G=C==null?void 0:C.shift();)(M=w(this,pn))==null||M.call(this,...G)}return this}pop(){var e;try{for(;w(this,st);){const n=w(this,be)[w(this,_t)];if(le(this,te,Sa).call(this,!0),le(this,te,Ke).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(w(this,Tt)&&w(this,ut)){const n=w(this,ut);let i;for(;i=n==null?void 0:n.shift();)(e=w(this,pn))==null||e.call(this,...i)}}}has(e,n={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=n,l=w(this,it).get(e);if(l!==void 0){const c=w(this,be)[l];if(le(this,te,Ke).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(w(this,$t).call(this,l))s&&(s.has="stale",w(this,zn).call(this,s,l));else return i&&w(this,$r).call(this,l),s&&(s.has="hit",w(this,zn).call(this,s,l)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){const{allowStale:i=this.allowStale}=n,s=w(this,it).get(e);if(s===void 0||!i&&w(this,$t).call(this,s))return;const l=w(this,be)[s];return le(this,te,Ke).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:i=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:S=this.ignoreFetchAbort,allowStaleOnFetchAbort:D=this.allowStaleOnFetchAbort,context:k,forceRefresh:M=!1,status:C,signal:G}=n;if(!w(this,yr))return C&&(C.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const X={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:D,ignoreFetchAbort:S,status:C,signal:G};let O=w(this,it).get(e);if(O===void 0){C&&(C.fetch="miss");const P=le(this,te,Ea).call(this,e,O,X,k);return P.__returned=P}else{const P=w(this,be)[O];if(le(this,te,Ke).call(this,P)){const V=i&&P.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",V&&(C.returnedStale=!0)),V?P.__staleWhileFetching:P.__returned=P}const L=w(this,$t).call(this,O);if(!M&&!L)return C&&(C.fetch="hit"),le(this,te,Xo).call(this,O),s&&w(this,$r).call(this,O),C&&w(this,zn).call(this,C,O),P;const z=le(this,te,Ea).call(this,e,O,X,k),E=z.__staleWhileFetching!==void 0&&i;return C&&(C.fetch=L?"stale":"refresh",E&&L&&(C.returnedStale=!0)),E?z.__staleWhileFetching:z.__returned=z}}async forceFetch(e,n={}){const i=await this.fetch(e,n);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,n={}){const i=w(this,bi);if(!i)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=i(e,u,{options:c,context:s});return this.set(e,p,c),p}get(e,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,u=w(this,it).get(e);if(u!==void 0){const p=w(this,be)[u],f=le(this,te,Ke).call(this,p);return c&&w(this,zn).call(this,c,u),w(this,$t).call(this,u)?(c&&(c.get="stale"),f?(c&&i&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),i?p.__staleWhileFetching:void 0):(l||le(this,te,Pr).call(this,e,"expire"),c&&i&&(c.returnedStale=!0),i?p:void 0)):(c&&(c.get="hit"),f?p.__staleWhileFetching:(le(this,te,Xo).call(this,u),s&&w(this,$r).call(this,u),p))}else c&&(c.get="miss")}delete(e){return le(this,te,Pr).call(this,e,"delete")}clear(){return le(this,te,id).call(this,"delete")}};dn=new WeakMap,Ot=new WeakMap,un=new WeakMap,pn=new WeakMap,wi=new WeakMap,bi=new WeakMap,st=new WeakMap,hn=new WeakMap,it=new WeakMap,je=new WeakMap,be=new WeakMap,Et=new WeakMap,Gt=new WeakMap,_t=new WeakMap,dt=new WeakMap,fn=new WeakMap,ut=new WeakMap,mn=new WeakMap,gn=new WeakMap,zt=new WeakMap,yn=new WeakMap,yr=new WeakMap,Tt=new WeakMap,te=new WeakSet,td=function(){const e=new Vs(w(this,dn)),n=new Vs(w(this,dn));fe(this,zt,e),fe(this,gn,n),fe(this,Ao,(l,c,u=_i.now())=>{if(n[l]=c!==0?u:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{w(this,$t).call(this,l)&&le(this,te,Pr).call(this,w(this,je)[l],"expire")},c+1);p.unref&&p.unref()}}),fe(this,$r,l=>{n[l]=e[l]!==0?_i.now():0}),fe(this,zn,(l,c)=>{if(e[c]){const u=e[c],p=n[c];if(!u||!p)return;l.ttl=u,l.start=p,l.now=i||s();const f=l.now-p;l.remainingTTL=u-f}});let i=0;const s=()=>{const l=_i.now();if(this.ttlResolution>0){i=l;const c=setTimeout(()=>i=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=w(this,it).get(l);if(c===void 0)return 0;const u=e[c],p=n[c];if(!u||!p)return 1/0;const f=(i||s())-p;return u-f},fe(this,$t,l=>{const c=n[l],u=e[l];return!!u&&!!c&&(i||s())-c>u})},$r=new WeakMap,zn=new WeakMap,Ao=new WeakMap,$t=new WeakMap,jf=function(){const e=new Vs(w(this,dn));fe(this,hn,0),fe(this,mn,e),fe(this,Ur,n=>{fe(this,hn,w(this,hn)-e[n]),e[n]=0}),fe(this,Vo,(n,i,s,l)=>{if(le(this,te,Ke).call(this,i))return 0;if(!gr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(i,n),!gr(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}),fe(this,xi,(n,i,s)=>{if(e[n]=i,w(this,Ot)){const l=w(this,Ot)-e[n];for(;w(this,hn)>l;)le(this,te,Sa).call(this,!0)}fe(this,hn,w(this,hn)+e[n]),s&&(s.entrySize=i,s.totalCalculatedSize=w(this,hn))})},Ur=new WeakMap,xi=new WeakMap,Vo=new WeakMap,Ar=function*({allowStale:e=this.allowStale}={}){if(w(this,st))for(let n=w(this,dt);!(!le(this,te,nd).call(this,n)||((e||!w(this,$t).call(this,n))&&(yield n),n===w(this,_t)));)n=w(this,Gt)[n]},Vr=function*({allowStale:e=this.allowStale}={}){if(w(this,st))for(let n=w(this,_t);!(!le(this,te,nd).call(this,n)||((e||!w(this,$t).call(this,n))&&(yield n),n===w(this,dt)));)n=w(this,Et)[n]},nd=function(e){return e!==void 0&&w(this,it).get(w(this,je)[e])===e},Sa=function(e){var l,c;const n=w(this,_t),i=w(this,je)[n],s=w(this,be)[n];return w(this,yr)&&le(this,te,Ke).call(this,s)?s.__abortController.abort(new Error("evicted")):(w(this,yn)||w(this,Tt))&&(w(this,yn)&&((l=w(this,un))==null||l.call(this,s,i,"evict")),w(this,Tt)&&((c=w(this,ut))==null||c.push([s,i,"evict"]))),w(this,Ur).call(this,n),e&&(w(this,je)[n]=void 0,w(this,be)[n]=void 0,w(this,fn).push(n)),w(this,st)===1?(fe(this,_t,fe(this,dt,0)),w(this,fn).length=0):fe(this,_t,w(this,Et)[n]),w(this,it).delete(i),ka(this,st)._--,n},Ea=function(e,n,i,s){const l=n===void 0?void 0:w(this,be)[n];if(le(this,te,Ke).call(this,l))return l;const c=new As,{signal:u}=i;u==null||u.addEventListener("abort",()=>c.abort(u.reason),{signal:c.signal});const p={signal:c.signal,options:i,context:s},f=(k,M=!1)=>{const{aborted:C}=c.signal,G=i.ignoreFetchAbort&&k!==void 0;if(i.status&&(C&&!M?(i.status.fetchAborted=!0,i.status.fetchError=c.signal.reason,G&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),C&&!G&&!M)return y(c.signal.reason);const X=S;return w(this,be)[n]===S&&(k===void 0?X.__staleWhileFetching?w(this,be)[n]=X.__staleWhileFetching:le(this,te,Pr).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,k,p.options))),k},m=k=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=k),y(k)),y=k=>{const{aborted:M}=c.signal,C=M&&i.allowStaleOnFetchAbort,G=C||i.allowStaleOnFetchRejection,X=G||i.noDeleteOnFetchRejection,O=S;if(w(this,be)[n]===S&&(!X||O.__staleWhileFetching===void 0?le(this,te,Pr).call(this,e,"fetch"):C||(w(this,be)[n]=O.__staleWhileFetching)),G)return i.status&&O.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),O.__staleWhileFetching;if(O.__returned===O)throw k},T=(k,M)=>{var G;const C=(G=w(this,wi))==null?void 0:G.call(this,e,l,p);C&&C instanceof Promise&&C.then(X=>k(X===void 0?void 0:X),M),c.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(k(void 0),i.allowStaleOnFetchAbort&&(k=X=>f(X,!0)))})};i.status&&(i.status.fetchDispatched=!0);const S=new Promise(T).then(f,m),D=Object.assign(S,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,D,{...p.options,status:void 0}),n=w(this,it).get(e)):w(this,be)[n]=D,D},Ke=function(e){if(!w(this,yr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof As},rd=function(e,n){w(this,Gt)[n]=e,w(this,Et)[e]=n},Xo=function(e){e!==w(this,dt)&&(e===w(this,_t)?fe(this,_t,w(this,Et)[e]):le(this,te,rd).call(this,w(this,Gt)[e],w(this,Et)[e]),le(this,te,rd).call(this,w(this,dt),e),fe(this,dt,e))},Pr=function(e,n){var s,l,c,u;let i=!1;if(w(this,st)!==0){const p=w(this,it).get(e);if(p!==void 0)if(i=!0,w(this,st)===1)le(this,te,id).call(this,n);else{w(this,Ur).call(this,p);const f=w(this,be)[p];if(le(this,te,Ke).call(this,f)?f.__abortController.abort(new Error("deleted")):(w(this,yn)||w(this,Tt))&&(w(this,yn)&&((s=w(this,un))==null||s.call(this,f,e,n)),w(this,Tt)&&((l=w(this,ut))==null||l.push([f,e,n]))),w(this,it).delete(e),w(this,je)[p]=void 0,w(this,be)[p]=void 0,p===w(this,dt))fe(this,dt,w(this,Gt)[p]);else if(p===w(this,_t))fe(this,_t,w(this,Et)[p]);else{const m=w(this,Gt)[p];w(this,Et)[m]=w(this,Et)[p];const y=w(this,Et)[p];w(this,Gt)[y]=w(this,Gt)[p]}ka(this,st)._--,w(this,fn).push(p)}}if(w(this,Tt)&&((c=w(this,ut))!=null&&c.length)){const p=w(this,ut);let f;for(;f=p==null?void 0:p.shift();)(u=w(this,pn))==null||u.call(this,...f)}return i},id=function(e){var n,i,s;for(const l of le(this,te,Vr).call(this,{allowStale:!0})){const c=w(this,be)[l];if(le(this,te,Ke).call(this,c))c.__abortController.abort(new Error("deleted"));else{const u=w(this,je)[l];w(this,yn)&&((n=w(this,un))==null||n.call(this,c,u,e)),w(this,Tt)&&((i=w(this,ut))==null||i.push([c,u,e]))}}if(w(this,it).clear(),w(this,be).fill(void 0),w(this,je).fill(void 0),w(this,zt)&&w(this,gn)&&(w(this,zt).fill(0),w(this,gn).fill(0)),w(this,mn)&&w(this,mn).fill(0),fe(this,_t,0),fe(this,dt,0),w(this,fn).length=0,fe(this,hn,0),fe(this,st,0),w(this,Tt)&&w(this,ut)){const l=w(this,ut);let c;for(;c=l==null?void 0:l.shift();)(s=w(this,pn))==null||s.call(this,...c)}};let Al=Pl;const oT={cacheSize:15e6};class sT{constructor(e){$e(this,"_str");$e(this,"_rawJson");$e(this,"_zodSchema");$e(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 Zr=class Zr{constructor(e){$e(this,"fileDataCache");$e(this,"fileDataRefs",new Map);const n={...oT,...e??{}};this.fileDataCache=new Al({maxSize:n.cacheSize,fetchMethod:async i=>new sT(await vg().blobDriver.getContent(i)),sizeCalculation:i=>i.bytes.length,dispose:(i,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const i=r.shallowRef();return this.fileDataRefs.set(e,i),(async()=>{try{const s=await this.fileDataCache.fetch(e);i.value=s}catch(s){console.error(s)}})(),i}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n.value)==null?void 0:i.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var i;return(i=n==null?void 0:n.value)==null?void 0:i.str})}getContentJson(e,n){if(e===void 0)return;const i=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=i==null?void 0:i.value)==null?void 0:s.rawJson:(l=i==null?void 0:i.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Zr.globalInstance.getContentBytes(e)}static getContentString(e){return Zr.globalInstance.getContentString(e)}static getContentJson(e,n){return Zr.globalInstance.getContentJson(e,n)}};$e(Zr,"globalInstance",new Zr);let Vl=Zr;I.AgGridTheme=qd,I.BlockLayout=EE,I.ContextProvider=pk,I.DataTable=D_,I.DemoData=hE,I.DropdownListItem=di,I.LongText=yl,I.MultiError=Na,I.PlAgCellFile=eT,I.PlAgDataTable=HE,I.PlAgOverlayLoading=Xu,I.PlAgOverlayNoRows=Qu,I.PlAlert=dC,I.PlBlockPage=Y_,I.PlBtnAccent=BC,I.PlBtnDanger=AC,I.PlBtnGhost=ul,I.PlBtnGroup=XC,I.PlBtnLink=FC,I.PlBtnPrimary=cl,I.PlBtnSecondary=dl,I.PlBtnSplit=xC,I.PlCheckbox=Nu,I.PlCheckboxGroup=Xw,I.PlChip=vl,I.PlContainer=X_,I.PlDialogModal=Cl,I.PlDropdown=uo,I.PlDropdownLegacy=Cw,I.PlDropdownLine=Bu,I.PlDropdownMulti=jw,I.PlDropdownRef=K0,I.PlFileDialog=Pu,I.PlFileInput=ju,I.PlGrid=iC,I.PlIcon16=ms,I.PlIcon24=ku,I.PlLogView=Vu,I.PlMaskIcon16=pi,I.PlMaskIcon24=On,I.PlNotificationAlert=qu,I.PlNumberField=Pw,I.PlProgressBar=Sw,I.PlRow=eC,I.PlSlideModal=pb,I.PlSpacer=yu,I.PlTableFilters=KE,I.PlTabs=Fb,I.PlTextArea=N0,I.PlTextField=Ir,I.PlToggleSwitch=gs,I.PlTooltip=kt,I.ReactiveFileContent=Vl,I.Scrollable=nS,I.Slider=Ku,I.SliderRange=Xk,I.SliderRangeTriple=Gk,I.ThemeSwitcher=U_,I.UnresolvedError=Ba,I.ValueOrErrorsComponent=XE,I.activateAgGrid=jd,I.animate=uu,I.animateInfinite=L_,I.call=su,I.computedResult=rT,I.createModel=Ra,I.debounce=pu,I.defineApp=lv,I.defineStore=nT,I.delay=au,I.detectOutside=A0,I.ensureError=Pa,I.eventListener=ml,I.formatZodError=Fa,I.getElementScrollPosition=Eu,I.identity=Va,I.isDefined=lm,I.isElementVisible=Su,I.isJsonEqual=Aa,I.isZodError=Da,I.listToOptions=O_,I.makeEaseInOut=I_,I.makeEaseOut=du,I.maskIcons16=uE,I.maskIcons24=pE,I.normalizeListOptions=ar,I.notEmpty=il,I.randomInt=cu,I.randomString=M_,I.requestTick=ol,I.scrollIntoView=co,I.showContextMenu=tl,I.throttle=hu,I.timeout=lu,I.unwrapOptionalResult=am,I.unwrapValueOrErrors=ld,I.useClickOutside=fs,I.useDraggable=Nk,I.useEventListener=tt,I.useFormState=Tk,I.useHover=iu,I.useInterval=Ek,I.useLabelNotch=Ln,I.useLocalStorage=fu,I.useMouse=ru,I.useMouseCapture=sr,I.usePosition=ui,I.useQuery=Bk,I.useResizeObserver=Yu,I.useScroll=xk,I.useSdkPlugin=Xa,I.useSortable=Sk,I.useTheme=gu,I.useWatchFetch=op,I.wrapOptionalResult=cd,I.wrapValueOrErrors=sm,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});