@platforma-sdk/ui-vue 1.10.18 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/lib.js +5679 -5658
- package/dist/lib.umd.cjs +35 -33
- package/dist/src/aggrid.d.ts.map +1 -1
- package/dist/src/defineApp.d.ts +4 -4
- package/dist/src/defineApp.d.ts.map +1 -1
- package/dist/src/internal/createApp.d.ts +2 -2
- package/dist/src/internal/createApp.d.ts.map +1 -1
- package/dist/src/internal/createAppModel.d.ts +2 -2
- package/dist/src/internal/createAppModel.d.ts.map +1 -1
- package/dist/src/types.d.ts +11 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/aggrid.ts +36 -31
- package/src/components/PlAgDataTable/ag-override.css +3 -0
- package/src/defineApp.ts +11 -10
- package/src/internal/createApp.ts +13 -19
- package/src/internal/createAppModel.ts +18 -7
- package/src/types.ts +12 -1
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,89 +1,91 @@
|
|
|
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,
|
|
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,Qi,tm,ad,nm,ld,cd,rm,om,im,dd,sm){"use strict";var XF=Object.defineProperty;var Xf=I=>{throw TypeError(I)};var QF=(I,r,Re)=>r in I?XF(I,r,{enumerable:!0,configurable:!0,writable:!0,value:Re}):I[r]=Re;var $e=(I,r,Re)=>QF(I,typeof r!="symbol"?r+"":r,Re),nd=(I,r,Re)=>r.has(I)||Xf("Cannot "+Re);var w=(I,r,Re)=>(nd(I,r,"read from private field"),Re?Re.call(I):r.get(I)),Le=(I,r,Re)=>r.has(I)?Xf("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(I):r.set(I,Re),fe=(I,r,Re,b)=>(nd(I,r,"write to private field"),b?b.call(I,Re):r.set(I,Re),Re),le=(I,r,Re)=>(nd(I,r,"access private method"),Re);var ka=(I,r,Re,b)=>({set _(Qi){fe(I,r,Qi,Re)},get _(){return w(I,r,b)}});var yp,wo,vp,_p,dn,Ot,un,pn,bo,xo,st,hn,ot,je,be,Et,Gt,_t,dt,fn,ut,mn,gn,zt,yn,yr,Tt,te,rd,$r,zn,Ni,$t,em,Zr,ko,Vi,Nr,Vr,od,Sa,Ea,Ke,id,Xi,Pr,sd;function am(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}const ud=Array.isArray;function lm(t){return t!==null&&typeof t=="object"}function pd(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function kn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=kn(t[n]);return e}else if(lm(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=kn(t[n])}),e}else return t}function hd(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],s=e[n];pd(o)&&pd(s)||ud(o)&&ud(s)&&o.length===s.length?hd(o,s):t[n]=s}),t}function Ta(t,e,n=!0){let o=0,s;return function(...l){s=()=>{t.apply(this,l),o=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>o&&s()}}function cm(t){let e=0n,n;return async function(...o){const s=++e;try{await n}catch{}if(e!==s)return{ok:!1};const l=t(...o);return n=l,{ok:!0,value:await l}}}var Go=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var um=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,d)=>`${s}${d===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(s)}:${t(e[s])}`},"")}}`};const to=dm(um);class Ba extends Error{}class Aa 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 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">
|
|
3
|
+
`)}}function pm(t){return{ok:!0,value:t}}function fd(t){if(!t)throw new Ba;if(!t.ok)throw Error(t.errors.join(";"));return t.value}function md(t){return{value:t,errors:void 0}}function hm(t){if(t.errors)throw new Aa(t.errors);if(!t.value)throw new Ba;return t.value}function fm(t){return t!==void 0}function Na(t,e){return to(t)===to(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(),o=Object.entries(n).map(([s,l])=>s+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function Ra(t){const e=t.validate??Va,{autoSave:n}=t,o=r.ref(),s=r.ref(),l=D=>{s.value={model:kn(D)}};r.watch(()=>t.get(),D=>l(D),{immediate:!0});const d=()=>{var D;t.onSave(e(kn((D=s.value)==null?void 0:D.model)))},u=()=>{l(t.get()),o.value=void 0},p=D=>{const M=Pa(D);Da(M)?o.value=Error(Fa(M)):o.value=M},f=D=>{o.value=void 0;try{e(D),n&&d()}catch(M){p(M)}},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,M)=>{D&&D===M&&f(D.model)},{deep:!0});const y=r.computed(()=>!o.value),E=r.computed(()=>!Na(t.get(),r.unref(s))),k=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:E,error:o,errorString:k,save:d,revert:u,setError:p})}function mm(t,e,n){const o=t.validate??Va,{autoSave:s}=t,l=r.ref(),d=r.ref(),u=G=>{var C;if(n.deepPatchModel){const B=(C=d.value)==null?void 0:C.model,Y=Object.assign(kn(G),e??{});d.value={model:B?hd(B,Y):Y,stage:Symbol()}}else d.value={model:Object.assign(kn(G),e??{}),stage:Symbol()}};r.watch(()=>t.get(),G=>u(G),{immediate:!0});const p=()=>{var G;t.onSave(o(kn((G=d.value)==null?void 0:G.model)))},f=()=>{u(t.get()),l.value=void 0},m=G=>{const C=Pa(G);Da(C)?l.value=Error(Fa(C)):l.value=C},y=G=>{l.value=void 0;try{o(G),s&&p()}catch(C){m(C)}},E=r.computed({get:()=>{var G;return(G=d.value)==null?void 0:G.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:E.value.args,ui:E.value.ui}),()=>{var G;return(G=d.value)==null?void 0:G.stage}],([G,C],[B,Y])=>{C===Y&&y(G)},{deep:!0});const k=r.computed(()=>!l.value),D=r.computed(()=>{var B;const{args:G,ui:C}=((B=r.unref(d))==null?void 0:B.model)??{};return!Na(t.get(),{args:G,ui:C})}),M=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:E,valid:k,isChanged:D,error:l,errorString:M,save:p,revert:f,setError:m})}const gm=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function ym(t,e,n){const o=(C,...B)=>{n.debug&&console.log(`%c>>> %c${C}`,"color: orange; font-weight: bold","color: orange",...B)},l=Ta(e.setBlockArgs,100),d=Ta(e.setBlockUiState,100),u=Ta(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async C=>{C.forEach(B=>{B.key==="args"&&(p.args=Object.freeze(B.value),o("args patch",p.args)),B.key==="ui"&&(p.ui=Object.freeze(B.value),o("ui patch",p.ui)),B.key==="outputs"&&(p.outputs=Object.freeze(B.value),o("outputs patch",p.outputs)),B.key==="navigationState"&&(p.navigationState=Object.freeze(B.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const f=()=>kn(p.args),m=()=>kn(p.ui),y=()=>kn(p.navigationState),E={createArgsModel(C={}){return Ra({get(){return C.transform?C.transform(p.args):p.args},validate:C.validate,autoSave:!0,onSave(B){l(B)}})},createUiModel(C={},B){return Ra({get(){return C.transform?C.transform(p.ui):p.ui??B()},validate:C.validate,autoSave:!0,onSave(Y){d(Y)}})},useOutputs(...C){const B=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(B,{value:this.unwrapOutputs(...C),errors:void 0})}catch(Y){Object.assign(B,{value:void 0,errors:[String(Y)]})}},{immediate:!0,deep:!0}),B},unwrapOutputs(...C){const B=p.outputs,Y=C.map(L=>[L,fd(B[L])]);return Object.fromEntries(Y)},getOutputField(C){return p.outputs[C]},getOutputFieldOkOptional(C){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const B=this.getOutputField(C);if(B&&B.ok)return B.value},getOutputFieldErrorsOptional(C){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const B=this.getOutputField(C);if(B&&!B.ok)return B.errors},updateArgs(C){const B=f();return C(B),e.setBlockArgs(B)},updateUiState(C){const B=m();return e.setBlockUiState(C(B))},updateNavigationState(C){const B=y();return C(B),e.setNavigationState(B)},navigateTo(C){const B=y();return B.href=C,e.setNavigationState(B)}},k=r.computed(()=>{const C=Object.entries(p.outputs).map(([B,Y])=>[B,Y.ok&&Y.value!==void 0?Y.value:void 0]);return Object.fromEntries(C)}),D=r.computed(()=>{const C=Object.entries(p.outputs).map(([B,Y])=>[B,Y&&!Y.ok?new Aa(Y.errors):void 0]);return Object.fromEntries(C)}),M={snapshot:p,queryParams:r.computed(()=>gm(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(C=>!(C!=null&&C.ok))),outputValues:r.computed(()=>(console.warn("Change app.outputValues to app.model.outputs"),k.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),D.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},G=mm({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(C){u(C.args,C.ui)}},{outputs:k,outputErrors:D},n);return r.reactive(Object.assign(G,E,M))}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 d of s)l[d]=d;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),d={};for(const u of l)d[u]=s[u];return t.objectValues(d)},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 d in s)Object.prototype.hasOwnProperty.call(s,d)&&l.push(d);return l},t.find=(s,l)=>{for(const d of s)if(l(d))return d},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function o(s,l=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=o,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 ie=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 ie.undefined;case"string":return ie.string;case"number":return isNaN(t)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":return Array.isArray(t)?ie.array:t===null?ie.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ie.promise:typeof Map<"u"&&t instanceof Map?ie.map:typeof Set<"u"&&t instanceof Set?ie.set:typeof Date<"u"&&t instanceof Date?ie.date:ie.object;default:return ie.unknown}},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"]),vm=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class It extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},s=l=>{for(const d of l.issues)if(d.code==="invalid_union")d.unionErrors.map(s);else if(d.code==="invalid_return_type")s(d.returnTypeError);else if(d.code==="invalid_arguments")s(d.argumentsError);else if(d.path.length===0)o._errors.push(n(d));else{let u=o,p=0;for(;p<d.path.length;){const f=d.path[p];p===d.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(d))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),o}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={},o=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}It.create=t=>new It(t);const no=(t,e)=>{let n;switch(t.code){case Q.invalid_type:t.received===ie.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 gd=no;function _m(t){gd=t}function es(){return gd}const ts=t=>{const{data:e,path:n,errorMaps:o,issueData:s}=t,l=[...n,...s.path||[]],d={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(d,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},Cm=[];function re(t,e){const n=es(),o=ts({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===no?void 0:no].filter(s=>!!s)});t.common.issues.push(o)}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 o=[];for(const s of n){if(s.status==="aborted")return _e;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,d=await s.value;o.push({key:l,value:d})}return gt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:d}=s;if(l.status==="aborted"||d.status==="aborted")return _e;l.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof d.value<"u"||s.alwaysSet)&&(o[l.value]=d.value)}return{status:e.value,value:o}}}const _e=Object.freeze({status:"aborted"}),ro=t=>({status:"dirty",value:t}),xt=t=>({status:"valid",value:t}),Ia=t=>t.status==="aborted",La=t=>t.status==="dirty",zo=t=>t.status==="valid",$o=t=>typeof Promise<"u"&&t instanceof Promise;function ns(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function yd(t,e,n,o,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var 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 Zo,Uo;class Sn{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const vd=(t,e)=>{if(zo(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:o,description:s}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(d,u)=>{var p,f;const{message:m}=t;return d.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:u.defaultError}:d.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($o(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const s={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qn(e)},l=this._parseSync({data:e,path:s.path,parent:s});return vd(s,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qn(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await($o(s)?s:Promise.resolve(s));return vd(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const d=e(s),u=()=>l.addIssue({code:Q.custom,...o(s)});return typeof Promise<"u"&&d instanceof Promise?d.then(p=>p?!0:(u(),!1)):d?!0:(u(),!1)})}refinement(e,n){return this._refinement((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new sn({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Tn.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 ao.create(this,this._def)}or(e){return qo.create([this,e],this._def)}and(e){return Ko.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 ei({...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 ti({...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 ni.create(this,e)}readonly(){return ri.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wm=/^c[^\s-]{8,}$/i,bm=/^[0-9a-z]+$/,xm=/^[0-9A-HJKMNP-TV-Z]{26}$/,km=/^[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,Sm=/^[a-z0-9_-]{21}$/i,Em=/^[-+]?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)?)??$/,Tm=/^(?!\.)(?!.*\.\.)([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 Am=/^(?:(?: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])$/,Nm=/^(([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})))$/,Vm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_d="((\\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])))",Pm=new RegExp(`^${_d}$`);function Cd(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 Dm(t){return new RegExp(`^${Cd(t)}$`)}function wd(t){let e=`${_d}T${Cd(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 Fm(t,e){return!!((e==="v4"||!e)&&Am.test(t)||(e==="v6"||!e)&&Nm.test(t))}class rn extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ie.string){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:ie.string,received:l.parsedType}),_e}const o=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}),o.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}),o.dirty());else if(l.kind==="length"){const d=e.data.length>l.value,u=e.data.length<l.value;(d||u)&&(s=this._getOrReturnCtx(e,s),d?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}),o.dirty())}else if(l.kind==="email")Tm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"email",code:Q.invalid_string,message:l.message}),o.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}),o.dirty());else if(l.kind==="uuid")km.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"uuid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")Sm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"nanoid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")wm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"cuid",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")bm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"cuid2",code:Q.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")xm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"ulid",code:Q.invalid_string,message:l.message}),o.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}),o.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}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:{startsWith:l.value},message:l.message}),o.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}),o.dirty()):l.kind==="datetime"?wd(l).test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?Pm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Dm(l).test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?Em.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"duration",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Fm(e.data,l.version)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"ip",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?Vm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"base64",code:Q.invalid_string,message:l.message}),o.dirty()):Me.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:Q.invalid_string,...de.errToObj(o)})}_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,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...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 Rm(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),d=parseInt(e.toFixed(s).replace(".",""));return l%d/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)!==ie.number){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:ie.number,received:l.parsedType}),_e}let o;const s=new gt;for(const l of this._def.checks)l.kind==="int"?Me.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{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)&&(o=this._getOrReturnCtx(e,o),re(o,{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)&&(o=this._getOrReturnCtx(e,o),re(o,{code:Q.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?Rm(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),re(o,{code:Q.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{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,o,s){return new er({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,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 o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}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)!==ie.bigint){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:ie.bigint,received:l.parsedType}),_e}let o;const s=new gt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),re(o,{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)&&(o=this._getOrReturnCtx(e,o),re(o,{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)&&(o=this._getOrReturnCtx(e,o),re(o,{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,o,s){return new tr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,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 Wo extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ie.boolean){const o=this._getOrReturnCtx(e);return re(o,{code:Q.invalid_type,expected:ie.boolean,received:o.parsedType}),_e}return xt(e.data)}}Wo.create=t=>new Wo({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)!==ie.date){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_type,expected:ie.date,received:l.parsedType}),_e}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_date}),_e}const o=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"}),o.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"}),o.dirty()):Me.assertNever(l);return{status:o.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)!==ie.symbol){const o=this._getOrReturnCtx(e);return re(o,{code:Q.invalid_type,expected:ie.symbol,received:o.parsedType}),_e}return xt(e.data)}}rs.create=t=>new rs({typeName:ye.ZodSymbol,...Se(t)});class Ho extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const o=this._getOrReturnCtx(e);return re(o,{code:Q.invalid_type,expected:ie.undefined,received:o.parsedType}),_e}return xt(e.data)}}Ho.create=t=>new Ho({typeName:ye.ZodUndefined,...Se(t)});class jo extends Be{_parse(e){if(this._getType(e)!==ie.null){const o=this._getOrReturnCtx(e);return re(o,{code:Q.invalid_type,expected:ie.null,received:o.parsedType}),_e}return xt(e.data)}}jo.create=t=>new jo({typeName:ye.ZodNull,...Se(t)});class oo extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return xt(e.data)}}oo.create=t=>new oo({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:ie.never,received:n.parsedType}),_e}}Mn.create=t=>new Mn({typeName:ye.ZodNever,...Se(t)});class os extends Be{_parse(e){if(this._getType(e)!==ie.undefined){const o=this._getOrReturnCtx(e);return re(o,{code:Q.invalid_type,expected:ie.void,received:o.parsedType}),_e}return xt(e.data)}}os.create=t=>new os({typeName:ye.ZodVoid,...Se(t)});class on extends Be{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==ie.array)return re(n,{code:Q.invalid_type,expected:ie.array,received:n.parsedType}),_e;if(s.exactLength!==null){const d=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(d||u)&&(re(n,{code:d?Q.too_big:Q.too_small,minimum:u?s.exactLength.value:void 0,maximum:d?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(re(n,{code:Q.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(re(n,{code:Q.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((d,u)=>s.type._parseAsync(new Sn(n,d,n.path,u)))).then(d=>gt.mergeArray(o,d));const l=[...n.data].map((d,u)=>s.type._parseSync(new Sn(n,d,n.path,u)));return gt.mergeArray(o,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 io(t){if(t instanceof Je){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Tn.create(io(o))}return new Je({...t._def,shape:()=>e})}else return t instanceof on?new on({...t._def,type:io(t.element)}):t instanceof Tn?Tn.create(io(t.unwrap())):t instanceof rr?rr.create(io(t.unwrap())):t instanceof En?En.create(t.items.map(e=>io(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)!==ie.object){const f=this._getOrReturnCtx(e);return re(f,{code:Q.invalid_type,expected:ie.object,received:f.parsedType}),_e}const{status:o,ctx:s}=this._processInputParams(e),{shape:l,keys:d}=this._getCached(),u=[];if(!(this._def.catchall instanceof Mn&&this._def.unknownKeys==="strip"))for(const f in s.data)d.includes(f)||u.push(f);const p=[];for(const f of d){const m=l[f],y=s.data[f];p.push({key:{status:"valid",value:f},value:m._parse(new Sn(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}),o.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=s.data[m];p.push({key:{status:"valid",value:m},value:f._parse(new Sn(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,E=await m.value;f.push({key:y,value:E,alwaysSet:m.alwaysSet})}return f}).then(f=>gt.mergeObjectSync(o,f)):gt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return de.errToObj,new Je({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var s,l,d,u;const p=(d=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&d!==void 0?d:o.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(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new Je({...this._def,shape:()=>n})}omit(e){const n={};return Me.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new Je({...this._def,shape:()=>n})}deepPartial(){return io(this)}partial(e){const n={};return Me.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new Je({...this._def,shape:()=>n})}required(e){const n={};return Me.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Tn;)l=l._def.innerType;n[o]=l}}),new Je({...this._def,shape:()=>n})}keyof(){return bd(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 qo extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const d=l.map(u=>new It(u.ctx.common.issues));return re(n,{code:Q.invalid_union,unionErrors:d}),_e}if(n.common.async)return Promise.all(o.map(async l=>{const d={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:d}),ctx:d}})).then(s);{let l;const d=[];for(const p of o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&d.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=d.map(p=>new It(p));return re(n,{code:Q.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}qo.create=(t,e)=>new qo({options:t,typeName:ye.ZodUnion,...Se(e)});const In=t=>t instanceof Jo?In(t.schema):t instanceof sn?In(t.innerType()):t instanceof Xo?[t.value]:t instanceof nr?t.options:t instanceof Qo?Me.objectValues(t.enum):t instanceof ei?In(t._def.innerType):t instanceof Ho?[void 0]:t instanceof jo?[null]:t instanceof Tn?[void 0,...In(t.unwrap())]:t instanceof rr?[null,...In(t.unwrap())]:t instanceof za||t instanceof ri?In(t.unwrap()):t instanceof ti?In(t._def.innerType):[];class is extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.object)return re(n,{code:Q.invalid_type,expected:ie.object,received:n.parsedType}),_e;const o=this.discriminator,s=n.data[o],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(re(n,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const d=In(l.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of d){if(s.has(u))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(u)}`);s.set(u,l)}}return new is({typeName:ye.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Se(o)})}}function Ga(t,e){const n=Qn(t),o=Qn(e);if(t===e)return{valid:!0,data:t};if(n===ie.object&&o===ie.object){const s=Me.objectKeys(e),l=Me.objectKeys(t).filter(u=>s.indexOf(u)!==-1),d={...t,...e};for(const u of l){const p=Ga(t[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(n===ie.array&&o===ie.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const d=t[l],u=e[l],p=Ga(d,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===ie.date&&o===ie.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ko extends Be{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,d)=>{if(Ia(l)||Ia(d))return _e;const u=Ga(l.value,d.value);return u.valid?((La(l)||La(d))&&n.dirty(),{status:n.value,value:u.data}):(re(o,{code:Q.invalid_intersection_types}),_e)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,d])=>s(l,d)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Ko.create=(t,e,n)=>new Ko({left:t,right:e,typeName:ye.ZodIntersection,...Se(n)});class En extends Be{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ie.array)return re(o,{code:Q.invalid_type,expected:ie.array,received:o.parsedType}),_e;if(o.data.length<this._def.items.length)return re(o,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&o.data.length>this._def.items.length&&(re(o,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((d,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new Sn(o,d,o.path,u)):null}).filter(d=>!!d);return o.common.async?Promise.all(l).then(d=>gt.mergeArray(n,d)):gt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new En({...this._def,rest:e})}}En.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new En({items:t,typeName:ye.ZodTuple,rest:null,...Se(e)})};class Yo extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ie.object)return re(o,{code:Q.invalid_type,expected:ie.object,received:o.parsedType}),_e;const s=[],l=this._def.keyType,d=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new Sn(o,u,o.path,u)),value:d._parse(new Sn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?gt.mergeObjectAsync(n,s):gt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Be?new Yo({keyType:e,valueType:n,typeName:ye.ZodRecord,...Se(o)}):new Yo({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:o}=this._processInputParams(e);if(o.parsedType!==ie.map)return re(o,{code:Q.invalid_type,expected:ie.map,received:o.parsedType}),_e;const s=this._def.keyType,l=this._def.valueType,d=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new Sn(o,u,o.path,[f,"key"])),value:l._parse(new Sn(o,p,o.path,[f,"value"]))}));if(o.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of d){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 d){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:o}=this._processInputParams(e);if(o.parsedType!==ie.set)return re(o,{code:Q.invalid_type,expected:ie.set,received:o.parsedType}),_e;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(re(o,{code:Q.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(re(o,{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 d(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=[...o.data.values()].map((p,f)=>l._parse(new Sn(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>d(p)):d(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 so extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.function)return re(n,{code:Q.invalid_type,expected:ie.function,received:n.parsedType}),_e;function o(u,p){return ts({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,es(),no].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(),no].filter(f=>!!f),issueData:{code:Q.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},d=n.data;if(this._def.returns instanceof ao){const u=this;return xt(async function(...p){const f=new It([]),m=await u._def.args.parseAsync(p,l).catch(k=>{throw f.addIssue(o(p,k)),f}),y=await Reflect.apply(d,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 xt(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new It([o(p,f.error)]);const m=Reflect.apply(d,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 so({...this._def,args:En.create(e).rest(Fr.create())})}returns(e){return new so({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new so({args:e||En.create([]).rest(Fr.create()),returns:n||Fr.create(),typeName:ye.ZodFunction,...Se(o)})}}class Jo 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})}}Jo.create=(t,e)=>new Jo({getter:t,typeName:ye.ZodLazy,...Se(e)});class Xo 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}}Xo.create=(t,e)=>new Xo({value:t,typeName:ye.ZodLiteral,...Se(e)});function bd(t,e){return new nr({values:t,typeName:ye.ZodEnum,...Se(e)})}class nr extends Be{constructor(){super(...arguments),Zo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return re(n,{expected:Me.joinValues(o),received:n.parsedType,code:Q.invalid_type}),_e}if(ns(this,Zo)||yd(this,Zo,new Set(this._def.values)),!ns(this,Zo).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return re(n,{received:n.data,code:Q.invalid_enum_value,options:o}),_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(o=>!e.includes(o)),{...this._def,...n})}}Zo=new WeakMap,nr.create=bd;class Qo extends Be{constructor(){super(...arguments),Uo.set(this,void 0)}_parse(e){const n=Me.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ie.string&&o.parsedType!==ie.number){const s=Me.objectValues(n);return re(o,{expected:Me.joinValues(s),received:o.parsedType,code:Q.invalid_type}),_e}if(ns(this,Uo)||yd(this,Uo,new Set(Me.getValidEnumValues(this._def.values))),!ns(this,Uo).has(e.data)){const s=Me.objectValues(n);return re(o,{received:o.data,code:Q.invalid_enum_value,options:s}),_e}return xt(e.data)}get enum(){return this._def.values}}Uo=new WeakMap,Qo.create=(t,e)=>new Qo({values:t,typeName:ye.ZodNativeEnum,...Se(e)});class ao extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.promise&&n.common.async===!1)return re(n,{code:Q.invalid_type,expected:ie.promise,received:n.parsedType}),_e;const o=n.parsedType===ie.promise?n.data:Promise.resolve(n.data);return xt(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ao.create=(t,e)=>new ao({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:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:d=>{re(o,d),d.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const d=s.transform(o.data,l);if(o.common.async)return Promise.resolve(d).then(async u=>{if(n.value==="aborted")return _e;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?_e:p.status==="dirty"||n.value==="dirty"?ro(p.value):p});{if(n.value==="aborted")return _e;const u=this._def.schema._parseSync({data:d,path:o.path,parent:o});return u.status==="aborted"?_e:u.status==="dirty"||n.value==="dirty"?ro(u.value):u}}if(s.type==="refinement"){const d=u=>{const p=s.refinement(u,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),d(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?_e:(u.status==="dirty"&&n.dirty(),d(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!zo(d))return d;const u=s.transform(d.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>zo(d)?Promise.resolve(s.transform(d.value,l)).then(u=>({status:n.value,value:u})):d);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 Tn extends Be{_parse(e){return this._getType(e)===ie.undefined?xt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tn.create=(t,e)=>new Tn({innerType:t,typeName:ye.ZodOptional,...Se(e)});class rr extends Be{_parse(e){return this._getType(e)===ie.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 ei extends Be{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ie.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ei.create=(t,e)=>new ei({innerType:t,typeName:ye.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class ti extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return $o(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new It(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new It(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}ti.create=(t,e)=>new ti({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)!==ie.nan){const o=this._getOrReturnCtx(e);return re(o,{code:Q.invalid_type,expected:ie.nan,received:o.parsedType}),_e}return{status:"valid",value:e.data}}}as.create=t=>new as({typeName:ye.ZodNaN,...Se(t)});const Mm=Symbol("zod_brand");class za extends Be{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class ni extends Be{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?_e:l.status==="dirty"?(n.dirty(),ro(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?_e:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new ni({in:e,out:n,typeName:ye.ZodPipeline})}}class ri extends Be{_parse(e){const n=this._def.innerType._parse(e),o=s=>(zo(s)&&(s.value=Object.freeze(s.value)),s);return $o(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}ri.create=(t,e)=>new ri({innerType:t,typeName:ye.ZodReadonly,...Se(e)});function xd(t,e={},n){return t?oo.create().superRefine((o,s)=>{var l,d;if(!t(o)){const u=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(d=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&d!==void 0?d:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):oo.create()}const Im={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 Lm=(t,e={message:`Input not instance of ${t.name}`})=>xd(n=>n instanceof t,e),kd=rn.create,Sd=er.create,Om=as.create,Gm=tr.create,Ed=Wo.create,zm=Dr.create,$m=rs.create,Zm=Ho.create,Um=jo.create,Wm=oo.create,Hm=Fr.create,jm=Mn.create,qm=os.create,Km=on.create,Ym=Je.create,Jm=Je.strictCreate,Xm=qo.create,Qm=is.create,eg=Ko.create,tg=En.create,ng=Yo.create,rg=ss.create,og=Rr.create,ig=so.create,sg=Jo.create,ag=Xo.create,lg=nr.create,cg=Qo.create,dg=ao.create,Td=sn.create,ug=Tn.create,pg=rr.create,hg=sn.createWithPreprocess,fg=ni.create;var ls=Object.freeze({__proto__:null,defaultErrorMap:no,setErrorMap:_m,getErrorMap:es,makeIssue:ts,EMPTY_PATH:Cm,addIssueToContext:re,ParseStatus:gt,INVALID:_e,DIRTY:ro,OK:xt,isAborted:Ia,isDirty:La,isValid:zo,isAsync:$o,get util(){return Me},get objectUtil(){return Ma},ZodParsedType:ie,getParsedType:Qn,ZodType:Be,datetimeRegex:wd,ZodString:rn,ZodNumber:er,ZodBigInt:tr,ZodBoolean:Wo,ZodDate:Dr,ZodSymbol:rs,ZodUndefined:Ho,ZodNull:jo,ZodAny:oo,ZodUnknown:Fr,ZodNever:Mn,ZodVoid:os,ZodArray:on,ZodObject:Je,ZodUnion:qo,ZodDiscriminatedUnion:is,ZodIntersection:Ko,ZodTuple:En,ZodRecord:Yo,ZodMap:ss,ZodSet:Rr,ZodFunction:so,ZodLazy:Jo,ZodLiteral:Xo,ZodEnum:nr,ZodNativeEnum:Qo,ZodPromise:ao,ZodEffects:sn,ZodTransformer:sn,ZodOptional:Tn,ZodNullable:rr,ZodDefault:ei,ZodCatch:ti,ZodNaN:as,BRAND:Mm,ZodBranded:za,ZodPipeline:ni,ZodReadonly:ri,custom:xd,Schema:Be,ZodSchema:Be,late:Im,get ZodFirstPartyTypeKind(){return ye},coerce:{string:t=>rn.create({...t,coerce:!0}),number:t=>er.create({...t,coerce:!0}),boolean:t=>Wo.create({...t,coerce:!0}),bigint:t=>tr.create({...t,coerce:!0}),date:t=>Dr.create({...t,coerce:!0})},any:Wm,array:Km,bigint:Gm,boolean:Ed,date:zm,discriminatedUnion:Qm,effect:Td,enum:lg,function:ig,instanceof:Lm,intersection:eg,lazy:sg,literal:ag,map:rg,nan:Om,nativeEnum:cg,never:jm,null:Um,nullable:pg,number:Sd,object:Ym,oboolean:()=>Ed().optional(),onumber:()=>Sd().optional(),optional:ug,ostring:()=>kd().optional(),pipeline:fg,preprocess:hg,promise:dg,record:ng,set:og,strictObject:Jm,string:kd,symbol:$m,transformer:Td,tuple:tg,undefined:Zm,union:Xm,unknown:Hm,void:qm,NEVER:_e,ZodIssueCode:Q,quotelessJson:vm,ZodError:It});function mg(t){throw new Error("Unexpected object: "+t)}const gg=-2147483648,Bd=-9007199254740991n,yg=NaN,vg=NaN,_g=null,Cg=null;function Ad(t,e){switch(e){case"Int":return t===gg;case"Long":return t===Number(Bd)||t===Bd;case"Float":return t===yg;case"Double":return t===vg;case"String":return t===_g;case"Bytes":return t===Cg;default:throw Error(`unsupported data type: ${e}`)}}function wg(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function Nd(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}function $a(t){return t.map(Nd)}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:mg(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 bg(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 xg="1.10.12";function kg(){return bg({sdkVersion:xg})}function Sg(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function lo(t){return!!t&&typeof t.children<"u"}function or(t){return lo(t)?t.groupId:t.colId}function Vd(t,e,n){const o=(d,u)=>{const p=d.children.map(or),f=b._includes(p,or(u)),m=b._last(d.children),y=m&&or(m)!==or(u);return f&&y};if(!lo(t))return!0;const s=t,l=n;if(o(s,l))return s.children.push(l),!0;if(s.groupId===e){const d=s.children.map(or);if(!b._includes(d,or(l)))return s.children.push(l),!0}for(let d=s.children.length-1;d>=0&&!Vd(s.children[d],e,n);d--);return!1}function Eg(t){const e=(s,l)=>lo(s)&&lo(l)&&or(s)===or(l),n=(s,l)=>{if(!lo(l))return s;const d=s,u=l;return u.children&&u.groupId&&Vd(d,u.groupId,u.children[0])||u.children.forEach(p=>n(d,p)),d},o=[];for(let s=1;s<=t.length;s++){const l=t[s-1],d=t[s];e(l,d)?t[s]=n(l,d):o.push(l)}return o}var Tg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(lo(s)){const d=s,u=typeof d.groupId<"u"?d.groupId:d.headerName,p=new b.AgProvidedColumnGroup(d,u,!1,l),f=[];return d.children.forEach(m=>{const y=n(m,l+1);y&&f.push(y)}),p.setChildren(f),p}else{const d=s,u=d.colId?d.colId:d.field,p=this.columnModel.getColDefCol(u);return p||e.push(d),p}},o=[];return t.forEach(s=>{const l=n(s,0);l&&o.push(l)}),e.length>0&&b._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=Eg(e);t(n)}getLeafPathTrees(){const t=(o,s)=>{let l;if(b.isProvidedColumnGroup(o))if(o.isPadding())l=s;else{const u=Object.assign({},o.getColGroupDef());u.groupId=o.getGroupId(),u.children=[s],l=u}else{const u=Object.assign({},o.getColDef());u.colId=o.getColId(),l=u}const d=o.getOriginalParent();return d?t(d,l):l};return this.columnModel.getCols().filter(o=>{const s=o.getColDef();return o.isPrimary()&&!s.showRowGroup}).map(o=>t(o,o.getColDef()))}};function Bg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function Ag(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function Ng(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Vg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Pg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Dg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function Fg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function Rg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Mg(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function Ig(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Lg=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}},
|
|
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}},Og=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 Lg(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()}},Gg={selector:"AG-SIDE-BAR-BUTTONS",component:Og},Pd={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},Dd={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},Za={columns:Pd,filters:Dd};function Ua(t){if(!t)return;if(t===!0)return{toolPanels:[Pd,Dd],defaultToolPanel:"columns"};if(typeof t=="string")return Ua([t]);if(Array.isArray(t)){const n=[];return t.forEach(o=>{const s=Za[o];if(!s){Fd(o);return}n.push(s)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:zg(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function Fd(t){b._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(Za).join(",")}`)}function zg(t){const e=[];return t&&t.forEach(n=>{let o=null;if(typeof n=="string"){const s=Za[n];if(!s){Fd(n);return}o=s}else o=n;e.push(o)}),e}var $g=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 o=Math.max(this.minWidth,Math.floor(this.startingWidth-t*n));this.maxWidth!=null&&(o=Math.min(this.maxWidth,o)),this.elementToResize.style.width=`${o}px`,this.dispatchResizeEvent(!1,e,o)}setInverted(t){this.inverted=t}setMaxWidth(t){this.maxWidth=t}setMinWidth(t){t!=null?this.minWidth=t:this.minWidth=100}},Zg=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 $g);t.setAttribute("id",`ag-${this.getCompId()}`),e.setElementToResize(t),this.appendChild(e)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(t,e){const{id:n,minWidth:o,maxWidth:s,width:l}=t;this.toolPanelId=n,this.width=l;const d=this.userComponentFactory.getToolPanelCompDetails(t,e),u=d.newAgStackInstance();if(this.params=d.params,u==null){b._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}u.then(this.setToolPanelComponent.bind(this)),o!=null&&this.resizeBar.setMinWidth(o),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",o=e?n:!n;this.resizeBar.setInverted(o)}refresh(){var t;(t=this.toolPanelCompInstance)==null||t.refresh(this.params)}},Ug=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: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,`
|
|
10
|
+
</div>`,[Gg]),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:Ua(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,o=this.getGui(),s=n.getGui(),l=b._getActiveDomElement(this.gos),d=o.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),u=t.target;if(!d)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(s.contains(l)){e.focusInto(d,t.shiftKey)&&t.preventDefault();return}if(!t.shiftKey)return;let p=null;d.contains(l)?p=this.focusService.findNextFocusableElement(d,void 0,!0):e.isTargetUnderManagedComponent(d,u)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(d,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(),o=Array.prototype.slice.call(n.querySelectorAll(".ag-side-button")),s=o.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,o.length-1);break}if(l===null)return;const d=o[l].querySelector("button");d&&(d.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 o=this.sideBar.toolPanels;if(this.createToolPanelsAndSideButtons(o,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(o=>{o.setResizerSizerSide(n)}),this.dispatchSideBarUpdated(),this}setDisplayed(t,e){super.setDisplayed(t,e),this.dispatchSideBarUpdated()}getState(){const t={};return this.toolPanelWrappers.forEach(e=>{var n,o;t[e.getToolPanelId()]=(o=(n=e.getToolPanelInstance())==null?void 0:n.getState)==null?void 0:o.call(n)}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:t}}createToolPanelsAndSideButtons(t,e,n){var o;for(const s of t)this.createToolPanelAndSideButton(s,(o=e==null?void 0:e.toolPanels)==null?void 0:o[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 o=this.sideBarButtons.addButtonComp(t);let s;n?s=n:(s=this.createBean(new Zg),s.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),s.setDisplayed(!1);const l=s.getGui();this.appendChild(l),this.toolPanelWrappers.push(s),b._setAriaControls(o.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 d=t===l.getToolPanelId();l.setDisplayed(d)});const o=this.openedItem();n!==o&&(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 o=!!t&&!!e;e&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:e,visible:!1,switchingToolPanel:o}),t&&this.eventService.dispatchEvent({type:"toolPanelVisibleChanged",source:n,key:t,visible:!0,switchingToolPanel:o})}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=Ua(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(o=>{var f,m;const{id:s}=o;if(!s)return;const l=(f=this.sideBar.toolPanels)==null?void 0:f.find(y=>y.id===s);if(!l||o.toolPanel!==l.toolPanel)return;const d=this.toolPanelWrappers.find(y=>y.getToolPanelId()===s);if(!d)return;const u=this.gos.addGridCommonParams({...o.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=d.getToolPanelInstance())==null?void 0:m.refresh(u))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(y=>y!==d),b._removeFromParent(d.getGui()),e[s]=d)})),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()}},Wg={selector:"AG-SIDE-BAR",component:Ug},Hg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return Wg}},Wa="32.3.3",Rd=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-core`,beans:[Tg,Hg],dependantModules:[Re.EnterpriseCoreModule]}),jg=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:Bg,setSideBarVisible:Ag,setSideBarPosition:Ng,openToolPanel:Vg,closeToolPanel:Pg,getOpenedToolPanel:Dg,refreshToolPanel:Fg,isToolPanelShowing:Rg,getToolPanelInstance:Mg,getSideBar:Ig},dependantModules:[Rd]}),Ha=b._defineModule({version:Wa,moduleName:b.ModuleNames.SideBarModule,dependantModules:[Rd,jg]}),qg={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Kg=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=Yg,t.first=Jg,t.last=Xg,t.min=Qg,t.max=ey,t.count=ty,t.avg=ny,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),o=b._includes(n,e),s=b._exists(this.aggFuncsMap[e]);return o&&s}getDefaultFuncLabel(t){return qg[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 Yg(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];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 Jg(t){return t.values.length>0?t.values[0]:null}function Xg(t){return t.values.length>0?b._last(t.values):null}function Qg(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];(typeof s=="number"||typeof s=="bigint")&&(n===null||n>s)&&(n=s)}return n}function ey(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const s=e[o];(typeof s=="number"||typeof s=="bigint")&&(n===null||n<s)&&(n=s)}return n}function ty(t){var s,l;const{values:e}=t;let n=0;for(let d=0;d<e.length;d++){const u=e[d];n+=u!=null&&typeof u.value=="number"?u.value:1}const o=(l=(s=t.rowNode)==null?void 0:s.aggData)==null?void 0:l[t.column.getColId()];return o&&o.value===n?o:{value:n,toString:function(){return this.value.toString()},toNumber:function(){return this.value}}}function ny(t){var d,u,p;const{values:e}=t;let n=0,o=0;for(let f=0;f<e.length;f++){const m=e[f];let y=null;typeof m=="number"||typeof m=="bigint"?(y=m,o++):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)),o+=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;o>0&&(s=n/(typeof n=="number"?o:BigInt(o)));const l=(p=(d=t.rowNode)==null?void 0:d.aggData)==null?void 0:p[(u=t.column)==null?void 0:u.getColId()];return l&&l.count===o&&l.value===s?l:{count:o,value:s,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var ry=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"),o=t.changedPath&&t.changedPath.isActive();if(e&&n&&o)return;const s=this.createAggDetails(t);this.recursivelyCreateAggData(s)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),o=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!b._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:o,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,o=e.pivotColumns.length===0;let s;e.userAggFunc?s=e.userAggFunc({nodes:t.childrenAfterFilter}):n?s=null:o?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 o=!0;for(let l=0;l<n.length;l++){const d=n[l],u=d.getColDef();if(u.pivotTotalColumnIds!=null){o=!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,d)}if(!o)for(let l=0;l<n.length;l++){const d=n[l],u=d.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,d)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},o=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,o,e.filteredOnly),d=t.aggData;return o.forEach((u,p)=>{n[u.getId()]=this.aggregateValues(l[p],u.getAggFunc(),u,t)}),s&&d&&s.forEach(u=>{n[u.getId()]=d[u.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let o=t;for(let s=0;s<e.length;s++){const l=e[s];o=o?o[l]:null}return o?o.map(s=>this.valueService.getValue(n,s)):[]}getValuesNormal(t,e,n){const o=[];e.forEach(()=>o.push([]));const s=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,d=l.length;for(let u=0;u<d;u++){const p=l[u];for(let f=0;f<s;f++){const m=e[f],y=this.valueService.getValue(m,p);o[f].push(y)}}return o}aggregateValues(t,e,n,o,s){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return b._errorOnce(`unrecognised aggregation function ${e}`),null;const d=l,u=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:s,rowNode:o,data:o?o.data:void 0});return d(u)}},oy=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 o=b._isGroupMultiAutoColumn(this.gos);return n&&o&&(b._warnOnce('you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),o=!1),o?t.forEach((s,l)=>{e.push(this.createOneAutoCol(s,l))}):e.push(this.createOneAutoCol()),e}updateAutoCols(t,e){t.forEach((n,o)=>this.updateOneAutoCol(n,o,e))}createOneAutoCol(t,e){let n;t?n=`${b.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=b.GROUP_AUTO_COLUMN_ID;const o=this.createAutoColDef(n,t,e);o.colId=n;const s=new b.AgColumn(o,null,n,!0);return this.createBean(s),s}updateOneAutoCol(t,e,n){const o=t.getColDef(),s=typeof o.showRowGroup=="string"?o.showRowGroup:void 0,l=s!=null?this.columnModel.getColDefCol(s):void 0,d=this.createAutoColDef(t.getId(),l??void 0,e);t.setColDef(d,null,n),this.columnFactory.applyColumnState(t,d,n)}createAutoColDef(t,e,n){let o=this.createBaseColDef(e);const s=this.gos.get("autoGroupColumnDef");b._mergeDeep(o,s),o=this.columnFactory.addColumnDefaultAndTypes(o,t),this.gos.get("treeData")||b._missing(o.field)&&b._missing(o.valueGetter)&&b._missing(o.filterValueGetter)&&o.filter!=="agGroupColumnFilter"&&(o.filter=!1),n&&n>0&&(o.headerCheckboxSelection=!1);const l=b._isColumnsSortingCoupledToGroup(this.gos),d=o.valueGetter||o.field!=null;return l&&!d&&(o.sortIndex=void 0,o.initialSort=void 0),o}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),o={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(o.cellRenderer="agGroupCellRenderer"),t){const l=t.getColDef();Object.assign(o,{headerName:this.columnNameService.getDisplayNameForColumn(t,"header"),headerValueGetter:l.headerValueGetter}),l.cellRenderer&&Object.assign(o,{cellRendererParams:{innerRenderer:l.cellRenderer,innerRendererParams:l.cellRendererParams}}),o.showRowGroup=t.getColId()}else o.showRowGroup=!0;return o}},iy=class extends Re.PillDragComp{constructor(t,e,n,o,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 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(`
|
|
17
|
+
`,[b.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=o,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"),o=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!o){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(),o=t("ariaDropZoneColumnComponentAggFuncSeparator"," of "),s={asc:t("ariaDropZoneColumnComponentSortAscending","ascending"),desc:t("ariaDropZoneColumnComponentSortDescending","descending")},l=this.column.getSort(),d=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${o}`,e,this.isGroupingZone()&&!d&&l&&`, ${s[l]}`].filter(u=>!!u).join("")}getColumnAndAggFuncName(){const t=this.displayName;let e="";if(this.isAggregationZone()){const n=this.column.getAggFunc(),o=typeof n=="string"?n:"agg";e=this.localeService.getLocaleTextFunc()(o,o)}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=o=>{o.preventDefault();const l=this.gos.get("multiSortKey")==="ctrl"?o.ctrlKey||o.metaKey:o.shiftKey;this.sortController.progressSort(this.column,l,"uiColumnSorted")};this.addGuiEventListener("click",n),this.addGuiEventListener("keydown",o=>{o.key===b.KeyCode.ENTER&&this.isGroupingZone()&&n(o)})}}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(),o=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(o),s.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(s,{focusout:m=>{!s.contains(m.relatedTarget)&&p&&p.hideFunc()}}),d=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:d,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 E=t.getComponentAt(y);E&&E.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")},o=this.localeService.getLocaleTextFunc(),s=e.toString(),l=o(s,s);return new sy(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}},sy=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 o=t.dragSource.getDragItem().columns;this.setColumnsVisible(o,!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 o=t.filter(s=>!s.getColDef().lockVisible);this.columnModel.setColsVisible(o,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,o){return new iy(t,e,n,this.dropZonePurpose,o)}},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()}},ay=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)}},ly={selector:"AG-GRID-HEADER-DROP-ZONES",component:ay},cy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return ly}},dy=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()),o=y=>!y.node.group,s=y=>y.node.leafGroup,l=b._getGroupAggFiltering(this.gos)||(e?s:o),{changedPath:d}=t,u=(y,E=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,E&&y.childrenAfterAggFilter.forEach(k=>u(k,E)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var E;y.childrenAfterAggFilter=((E=y.childrenAfterFilter)==null?void 0:E.filter(k=>{var G;return l({node:k})&&this.filterManager.doesRowPassAggregateFilters({rowNode:k})?(u(k,!0),!0):(G=k.childrenAfterAggFilter)==null?void 0:G.length}))||null,this.setAllChildrenCount(y),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)};d.forEachChangedNodeDepthFirst(n?p:u,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const o=e.length;n=o;for(let s=0;s<o;++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)}},uy=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
|
-
`),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(
|
|
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(o=>{const s=this.filterManager.getOrCreateFilterWrapper(o);s!=null&&s.filterPromise&&e.push(s.filterPromise.then(l=>(l&&n.push({filter:l,column:o}),o.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,o;(n=t.afterGuiAttached)==null||n.call(t,this.afterGuiAttachedParams),!((o=this.afterGuiAttachedParams)!=null&&o.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 o;if(e==="gridDestroyed")return;const n=t.getColId();(o=this.filterColumnPairs)!=null&&o.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()}},py=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(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">
|
|
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(o=>{this.parentFilterInstance=o,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 o,s;this.underlyingFloatingFilter=n,(s=this.underlyingFloatingFilter)==null||s.onParentModelChanged((o=this.parentFilterInstance.getSelectedFilter())==null?void 0:o.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),b.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,o,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=(o=this.underlyingFloatingFilter)==null?void 0:o.onParamsUpdated)==null||s.call(o,e.params))}onParentModelChanged(t,e){var n,o;this.showingUnderlyingFloatingFilter?(o=this.underlyingFloatingFilter)==null||o.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 o;const e=this.allSets[t.id];t.childrenAfterGroup=t.childrenAfterGroup.filter(s=>!e.removeFromChildrenAfterGroup[s.id]),t.allLeafChildren=((o=t.allLeafChildren)==null?void 0:o.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 hy(t){if(!t)return!1;const e=t.length;if(e<2)return!1;let n=!1;for(let o=1;o<e;o++)if(Md(t[o-1],t[o])>0){n=!0;break}return n?(t.sort(Md),!0):!1}function Md(t,e){const n=t.sourceRowIndex,o=e.sourceRowIndex,s=n>=0,l=o>=0,d=s&&l,u=!s&&!l;return d?n-o:u?t.__objectId-e.__objectId:s?1:-1}var fy=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=[],o=[];let s;e.childrenAfterGroup.forEach(l=>{var d;(d=l.childrenAfterGroup)!=null&&d.length?l.key===""&&!s?s=l:o.push(l):n.push(l)}),s&&o.push(s),e.childrenAfterGroup=[...n,...o]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:o,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:o,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 o=n.getAllParents().slice();n.flush(),this.removeEmptyGroups(o,t)}),t.rowNodesOrderChanged&&this.sortChildren(t)}sortChildren(t){t.changedPath.forEachChangedNodeDepthFirst(e=>{hy(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;b._exists(e)&&n(t.rootNode);function n(o){b._exists(o.childrenAfterGroup)&&!o.leafGroup&&(o.childrenAfterGroup.sort((l,d)=>e({nodeA:l,nodeB:d})),o.childrenAfterGroup.forEach(l=>n(l)))}}getExistingPathForNode(t,e){const n=[];let o=t.parent;for(;o&&o!==e.rootNode;)n.push({key:o.key,rowGroupColumn:o.rowGroupColumn,field:o.field}),o=o.parent;return n.reverse(),n}moveNodesInWrongPath(t,e,n){t.forEach(o=>{e.changedPath.isActive()&&e.changedPath.addParentNode(o.parent);const s=p=>p.key,l=this.getExistingPathForNode(o,e).map(s),d=this.getGroupInfo(o,e).map(s);b._areEqual(l,d)||this.moveNode(o,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 o=t.parent;e.changedPath.addParentNode(o)}}removeNodes(t,e,n){this.removeNodesFromParents(t,e,n),e.changedPath.isActive()&&t.forEach(o=>e.changedPath.addParentNode(o.parent))}forEachParentGroup(t,e,n){let o=e;for(;o&&o!==t.rootNode;)n(o),o=o.parent}removeNodesFromParents(t,e,n){const o=n==null,s=n||new Ya;t.forEach(l=>{this.removeFromParent(l,s),this.forEachParentGroup(e,l.parent,d=>{s.removeFromAllLeafChildren(d,l)})}),o&&s.flush()}removeEmptyGroups(t,e){let n=!0;const o=s=>{var p;const l=this.getChildrenMappedKey(s.key,s.rowGroupColumn),d=s.parent;return(d!=null&&d.childrenMapped?!d.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,d=>{o(d)&&(n=!0,this.removeFromParent(d,s),d.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),s.flush()}}removeFromParent(t,e){var o;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);(o=t.parent)!=null&&o.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(o=>{var d;if(!o.group)return;const l={field:o.field,key:o.key,rowGroupColumn:o.rowGroupColumn,leafNode:(d=o.allLeafChildren)==null?void 0:d[0]};this.setGroupData(o,l,t),e(o.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,o=t.rootNode;o.leafGroup=n.length===0,o.childrenAfterGroup=[],o.childrenMapped={},o.updateHasChildren();const s=o.sibling;s&&(s.childrenAfterGroup=o.childrenAfterGroup,s.childrenMapped=o.childrenMapped),this.insertNodes(o.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const o=this.showRowGroupColsService.getShowRowGroupCols(),s=o?o.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 o=this.getGroupInfo(t,e),s=this.findParentForNode(t,o,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=o.length,s.childrenAfterGroup.push(t),s.updateHasChildren()}findParentForNode(t,e,n,o){let s=n.rootNode;return e.forEach((l,d)=>{s=this.getOrCreateNextNode(s,l,d,n),o!=null&&o.isRemoveFromAllLeafChildren(s,t)?o==null||o.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,o){var d;const s=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(d=t==null?void 0:t.childrenMapped)==null?void 0:d[s];return l||(l=this.createGroup(e,t,n,o),this.addToParent(l,t)),l}createGroup(t,e,n,o){const s=new b.RowNode(this.beans);return s.group=!0,s.field=t.field,s.rowGroupColumn=t.rowGroupColumn,this.setGroupData(s,t,o),s.key=t.key,s.id=this.createGroupId(s,e,n),s.level=n,s.leafGroup=n===o.groupedColCount-1,s.allLeafChildren=[],s.setAllChildrenCount(0),s.rowGroupIndex=n,s.childrenAfterGroup=[],s.childrenMapped={},s.updateHasChildren(),s.parent=e,this.setExpandedInitialValue(o,s),s}createGroupId(t,e,n){const o=(s,l)=>{if(!s.rowGroupColumn)return null;const d=l?o(l,l.parent):null;return`${d==null?"":d+"-"}${s.rowGroupColumn.getColId()}-${s.key}`};return b.RowNode.ID_PREFIX_ROW_GROUP+o(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 o={rowNode:e,field:e.field,key:e.key,level:e.level,rowGroupColumn:e.rowGroupColumn};e.expanded=n(o)==!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(o=>{let s=this.valueService.getKeyForNode(o,t),l=s!=null&&s!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(s="",l=!0),l){const u={key:s,field:o.getColDef().field,rowGroupColumn:o,leafNode:t};n.push(u)}}),n}},my=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,ct=Object.freeze([]),gy=ct.values(),ds=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},yy=class Qf{constructor(e,n,o){this.parent=e,this.key=n,this.level=o,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())??gy}upsertKey(e){var o,s;typeof e!="string"&&(e=String(e));let n=(o=this.children)==null?void 0:o.get(e);return n||(n=new Qf(this,e,this.level+1),(s=this.children??(this.children=new Map))==null||s.set(n.key,n)),n}destroy(){var o;const{row:e,parent:n}=this;n!==null&&((o=n==null?void 0:n.children)==null||o.delete(this.key),e!==null&&ds(e,!0),this.parent=null)}setRow(e){const{level:n,row:o,childrenAfterGroup:s}=this;if(n<0)o!==null&&o!==e&&ds(o,!0);else{if(o===e)return!1;o!==null?(e.allLeafChildren=o.allLeafChildren??this.allLeafChildren??ct,ds(o,!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:o,duplicateRows:s,childrenAfterGroup:l}=this;if(o===e){const d=this.popDuplicateRow();d?(this.row=d,d.childrenAfterGroup=l,n>=0&&(d.allLeafChildren=o.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 o=this.duplicateRows;if(o===null)o=new Set,this.duplicateRows=o;else if(o.has(e))return!1;return o.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 o=n;for(const s of e)s.sourceRowIndex<o.sourceRowIndex&&(o=s);return o!==n&&(o.childrenAfterGroup=this.childrenAfterGroup,o.allLeafChildren=n.allLeafChildren??this.allLeafChildren??ct,n.childrenAfterGroup=ct,n.allLeafChildren=ct,e.delete(o),e.add(n),this.row=o),o}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,o;const e=this.parent;e!==null&&!e.childrenChanged&&((((n=this.children)==null?void 0:n.size)??0)>1||!((o=e.row)!=null&&o.data))&&(e.childrenChanged=!0,e.invalidate())}getRowPosition(){var n,o;const e=this.row;return e!=null&&e.data?e.sourceRowIndex:((o=(n=this.childrenAfterGroup[0])==null?void 0:n.treeNode)==null?void 0:o.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,o=this.childrenAfterGroup;o===ct?(o=new Array(e),this.childrenAfterGroup=o,this.row.childrenAfterGroup=o,n=!0):o.length!==e&&(o.length=e,n=!0);let s=0,l=-1,d=!1;for(const p of this.enumChildren()){const f=p.getRowPosition();f<l&&(d=!0),l=f,p.oldSourceRowIndex=f;const m=p.row;o[s]!==m&&(o[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),d&&this.reorderChildrenList(o),n||d}reorderChildrenList(e){const n=e.length,o=this.children;e.sort(my),o.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;o.set(l.key,l)}}updateAllLeafChildren(){var d,u;const{parent:e,row:n,childrenAfterGroup:o}=this;this.leafChildrenChanged=!1;let s=!1;const l=o.length;if(l===0)s=((d=n.allLeafChildren)==null?void 0:d.length)!==0,n.allLeafChildren=ct,this.allLeafChildren=ct;else if(l===1&&((u=o[0].allLeafChildren)!=null&&u.length))n.allLeafChildren=o[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 E=o[y],k=E.allLeafChildren,D=k.length;if(D)for(let M=0;M<D;++M){const G=k[M];(m>=f||p[m]!==G)&&(p[m]=G,s=!0),++m}else(m>=f||p[m]!==E)&&E&&(p[m]=E,s=!0),++m}f!==m&&(p.length=m,s=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,s=!0)}s&&e&&(e.leafChildrenChanged=!0)}},Id=t=>(t.treeNodeFlags&1)!==0,Ld=t=>(t.treeNodeFlags&2)!==0,Od=t=>(t.treeNodeFlags&4)!==0,vy=t=>(t.treeNodeFlags&8)!==0,Gd=t=>(t.treeNodeFlags&16)!==0,zd=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},_y=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},Cy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},ir=t=>{t.treeNodeFlags|=16},$d=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},oi=t=>{t.treeNodeFlags=0},wy=class extends b.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new yy(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),oi(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:o}=t,s=t.rowNode,l=this.gos,d={changedPath:o,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(d,e,n):this.handleRowData(d,s,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var s,l,d;const o=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((d=o.row)==null?void 0:d.childrenAfterGroup);return}this.oldGroupDisplayColIds=u}this.clearTree(o),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:o,update:s,add:l}of e)this.removeRows(o),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,o=t.length;n<o;++n){const s=t[n].treeNode;s&&s.oldSourceRowIndex!==n&&s.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,o=(t==null?void 0:t.length)??0;n<o;++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 o=0,s=(e==null?void 0:e.length)??0;o<s;++o){const l=e[o],d=this.upsertPath(this.getDataPath(t,l));d&&this.addOrUpdateRow(d,l,n)}}removeRows(t){for(let e=0,n=(t==null?void 0:t.length)??0;e<n;++e){const o=t[e],s=o.treeNode;s!==null&&this.removeRow(s,o)}}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 o=0;o<=n;++o){const s=e.upsertKey(t[o]);if(o>=n)return s.invalidate(),s;e=s}return null}addOrUpdateRow(t,e,n){var d;const{level:o,row:s}=t;if(o<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&&!Od(e)&&(_y(e),l=!0),l&&t.invalidate(),(d=this.rowsPendingDestruction)==null||d.delete(e)}removeRow(t,e){const{parent:n,level:o}=t;if(o<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 o;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&ir(n),n.updateHasChildren(),Gd(n)&&(o=t.changedPath)!=null&&o.isActive()&&t.changedPath.addParentNode(n),$d(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 o=e.key;n.key!==o?(n.key=o,Cy(n),this.setGroupData(n,o)):n.groupData||this.setGroupData(n,o)}commitNodePostOrder(t,e,n){var f,m,y;const o=n.row,s=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&ir(o),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const d=!!((f=o.childrenAfterGroup)!=null&&f.length),u=d||!o.data,p=o.group;p!==u?(ir(o),o.setGroup(u),!u&&!o.expanded&&zd(o,!1)):o.hasChildren()!==d&&(ir(o),o.updateHasChildren()),o.group&&!Ld(o)&&(s!==o&&s!==null&&s.group&&Ld(s)&&!t.isGroupOpenByDefault?o.expanded=s.expanded:o.expanded=this.getExpandedInitialValue(t,o),zd(o,!0)),Od(o)&&(ir(e.row),vy(o)&&o.setData(o.data)),s!==o&&(n.oldRow=o,s!==null&&(p||n.hasChildren())&&ir(o),e.childrenChanged=!0,ir(e.row)),Gd(o)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(o):Id(o)||(o.childrenAfterFilter||(o.childrenAfterFilter=o.childrenAfterGroup.slice()),o.childrenAfterAggFilter||(o.childrenAfterAggFilter=o.childrenAfterFilter.slice()),o.childrenAfterSort||(o.childrenAfterSort=o.childrenAfterAggFilter.slice())),$d(o),(y=n.duplicateRows)!=null&&y.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,b._warnOnce("duplicate group keys for row data, keys should be unique",[o.id,o.data,...Array.from(n.duplicateRows).map(E=>E.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,o=t.parent;for(;o!==null;){const s=o.parent;if(s===null)break;n=`${o.level}-${o.key}-${n}`,o=s}return e.id=b.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var s;const n={};t.groupData=n;const o=(s=this.showRowGroupColsService)==null?void 0:s.getShowRowGroupCols();if(o)for(const l of o)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:o,level:s}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&ir(e.row)),o!==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:o}=t;if(e&&(n>=0&&!e.data?this.destroyRow(e,!0):oi(e)),o)for(const s of o)n>=0&&!s.data?this.destroyRow(s,!0):oi(s);for(const s of t.enumChildren())this.destroyTree(s);t.destroy()}destroyRow(t,e){if(!Id(t)){oi(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}oi(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)}}},by=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?wy:fy;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()}},Zd="PivotRowTotal_",xy=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,d=[]){return l.forEach(u=>{u.children!==void 0?n(u.children,d):d.push(u)}),d}const o=n(e);this.addRowGroupTotals(e,o),this.addExpandablePivotGroups(e,o),this.addPivotTotalsToGroups(e,o);const s=o.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,o,s){const l=this.funcColsService.getValueColumns();if(t>=o)return this.buildMeasureCols(n);const d=s[t].getColDef(),u=this.headerNameComparator.bind(this,d.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===o-1){const f=[];return b._iterateObject(e,m=>{const y=[...n,m],E=this.createColDef(l[0],m,y);E.columnGroupShow="open",f.push(E)}),f.sort(u),f}const p=[];return b._iterateObject(e,(f,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,E=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,E,o,s),headerName:f,pivotKeys:E,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(E)})}),p.sort(u),p}buildMeasureCols(t){const e=this.funcColsService.getValueColumns();return e.length===0?[this.createColDef(null,"-",t)]:e.map(n=>{const o=this.columnNameService.getDisplayNameForColumn(n,"header");return{...this.createColDef(n,o,t),columnGroupShow:"open"}})}addExpandablePivotGroups(t,e){const n=this.gos.get("suppressExpandablePivotGroups");if(n||this.gos.get("pivotColumnGroupTotals"))return;const o=(s,l,d)=>{if("children"in s){const f=new Map;s.children.forEach(y=>{o(y,l,f)});const m=!s.children.some(y=>y.children);this.funcColsService.getValueColumns().forEach(y=>{const E=this.columnNameService.getDisplayNameForColumn(y,"header"),k=this.createColDef(y,E,s.pivotKeys);k.pivotTotalColumnIds=f.get(y.getColId()),k.columnGroupShow=n?"open":"closed",k.aggFunc=y.getAggFunc(),m||(s.children.push(k),l.push(k))}),this.merge(d,f);return}if(!s.pivotValueColumn)return;const u=s.pivotValueColumn.getColId();d.has(u)?d.get(u).push(s.colId):d.set(u,[s.colId])};t.forEach(s=>{o(s,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",o=this.funcColsService.getValueColumns(),s=o.map(d=>d.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=o[0];t.forEach(d=>{this.recursivelyAddPivotTotal(d,e,l,n)})}recursivelyAddPivotTotal(t,e,n,o){const s=t;if(!s.children){const d=t;return d.colId?[d.colId]:null}let l=[];if(s.children.forEach(d=>{const u=this.recursivelyAddPivotTotal(d,e,n,o);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;o?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 d=0;d<s.length;d++){const u=s[d],p=this.columnNameService.getDisplayNameForColumn(u,"header"),f=this.createColDef(u,p,[]),m=[];for(let E=0;E<e.length;E++){const k=e[E];k.pivotValueColumn===u&&m.push(k.colId)}f.pivotTotalColumnIds=m,f.colId=Zd+f.colId;const y=l?{children:[f],pivotKeys:[],groupId:`${Zd}_pivotGroup_${u.getColId()}`}:f;e.push(f),n?t.push(y):t.unshift(y)}}createColDef(t,e,n,o=!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&&!o?t.getColId():""),s.field=s.colId,s.valueGetter=l=>{var d;return(d=l.data)==null?void 0:d[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,o)=>{const l=[...t.has(o)?t.get(o):[],...n];t.set(o,l)})}generateColumnGroupId(t){return`pivotGroup_${this.funcColsService.getPivotColumns().map(n=>n.getColId()).join("-")}_${t.join("-")}`}generateColumnId(t,e){return`pivot_${this.funcColsService.getPivotColumns().map(o=>o.getColId()).join("-")}_${t.join("-")}_${e}`}createColDefsFromFields(t){const e={};for(let s=0;s<t.length;s++){const d=t[s].split(this.fieldSeparator);let u=e;for(let p=0;p<d.length;p++){const f=d[p];u[f]==null&&(u[f]={}),u=u[f]}}const n=(s,l,d,u)=>{const p=[];for(const y in d){const E=d[y],k=n(`${s}${this.fieldSeparator}${y}`,y,E,u+1);p.push(k)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const k=this.columnNameService.getDisplayNameForColumn(y,"header")??l,D=this.createColDef(y,k,void 0,!1);return D.colId=s,D.aggFunc=y.getAggFunc(),D.valueGetter=M=>{var G;return(G=M.data)==null?void 0:G[s]},D}return{colId:s,headerName:l,valueGetter:k=>{var D;return(D=k.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}},o=[];for(const s in e){const l=e[s],d=n(s,s,l,0);o.push(d)}return o}},Ud="Exceeded maximum allowed pivot column count.",ky=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 o;try{o=this.bucketUpRowNodes(t)}catch(C){if(C.message===Ud){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:C.message}),this.lastTimeFailed=!0;return}throw C}const s=this.setUniqueValues(o),l=this.funcColsService.getValueColumns(),d=l.map(C=>`${C.getId()}-${C.getColDef().headerName}`).join("#"),u=l.map(C=>C.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==d,f=this.aggregationFuncsHashLastTime!==u;this.aggregationColumnsHashLastTime=d,this.aggregationFuncsHashLastTime=u;const m=this.funcColsService.getRowGroupColumns().map(C=>C.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const E=this.gos.get("pivotRowTotals"),k=this.gos.get("pivotColumnGroupTotals"),D=this.gos.get("suppressExpandablePivotGroups"),M=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),G=E!==this.pivotRowTotalsLastTime||k!==this.pivotColumnGroupTotalsLastTime||D!==this.suppressExpandablePivotGroupsLastTime||M!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=E,this.pivotColumnGroupTotalsLastTime=k,this.suppressExpandablePivotGroupsLastTime=D,this.removePivotHeaderRowWhenSingleValueColumnLastTime=M,this.lastTimeFailed||s||p||y||f||G){const{pivotColumnGroupDefs:C,pivotColumnDefs:B}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=B,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(o=>{o.leafGroup&&(o.childrenMapped=null)});const n=o=>{var s;o.leafGroup?this.bucketRowNode(o,e):(s=o.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,o){const s={},l=e[n];if(t.forEach(d=>{let u=this.valueService.getKeyForNode(l,d);if(b._missing(u)&&(u=""),!o[u]){this.currentUniqueCount+=1,o[u]={};const p=this.maxUniqueValues!==-1,f=this.currentUniqueCount>this.maxUniqueValues;if(p&&f)throw Error(Ud)}s[u]||(s[u]=[]),s[u].push(d)}),n===e.length-1)return s;{const d={};return b._iterateObject(s,(u,p)=>{d[u]=this.bucketChildren(p,e,n+1,o[u])}),d}}getPivotColumnDefs(){return this.pivotColumnDefs}};function Sy(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function Ey(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function Ty(t){t.aggFuncService&&t.aggFuncService.clear()}function By(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function Ay(t){return t.columnModel.isPivotMode()}function Ny(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function Vy(t,e){t.funcColsService.setValueColumns(e,"api")}function Py(t){return t.funcColsService.getValueColumns()}function Dy(t,e){t.funcColsService.removeValueColumns([e],"api")}function Fy(t,e){t.funcColsService.removeValueColumns(e,"api")}function Ry(t,e){t.funcColsService.addValueColumns([e],"api")}function My(t,e){t.funcColsService.addValueColumns(e,"api")}function Iy(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function Ly(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function Oy(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function Gy(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function zy(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function $y(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function Zy(t){return t.funcColsService.getRowGroupColumns()}function Uy(t,e){t.funcColsService.setPivotColumns(e,"api")}function Wy(t,e){t.funcColsService.removePivotColumns([e],"api")}function Hy(t,e){t.funcColsService.removePivotColumns(e,"api")}function jy(t,e){t.funcColsService.addPivotColumns([e],"api")}function qy(t,e){t.funcColsService.addPivotColumns(e,"api")}function Ky(t){return t.funcColsService.getPivotColumns()}function Yy(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function Jy(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var Xy=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,o=typeof n=="string";!o&&!(n===!0)||(this.showRowGroupCols.push(t),o?this.showRowGroupColsMap[n]=t:this.funcColsService.getRowGroupColumns().forEach(d=>{this.showRowGroupColsMap[d.getId()]=t}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(t){return this.showRowGroupColsMap[t]}},ii="32.3.3",Ja=b._defineModule({version:ii,moduleName:`${b.ModuleNames.RowGroupingModule}-core`,beans:[ry,dy,by,xy,ky,Kg,oy,Xy,cy],userComponents:[{name:"agGroupRowRenderer",classImp:Re.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Re.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Re.GroupCellRendererCtrl}],dependantModules:[Re.EnterpriseCoreModule]}),Qy=b._defineModule({version:ii,moduleName:`${b.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:Sy,addAggFuncs:Ey,clearAggFuncs:Ty,setColumnAggFunc:By,isPivotMode:Ay,getPivotResultColumn:Ny,setValueColumns:Vy,getValueColumns:Py,removeValueColumn:Dy,removeValueColumns:Fy,addValueColumn:Ry,addValueColumns:My,setRowGroupColumns:Iy,removeRowGroupColumn:Ly,removeRowGroupColumns:Oy,addRowGroupColumn:Gy,addRowGroupColumns:zy,getRowGroupColumns:Zy,moveRowGroupColumn:$y,setPivotColumns:Uy,removePivotColumn:Wy,removePivotColumns:Hy,addPivotColumn:jy,addPivotColumns:qy,getPivotColumns:Ky,setPivotResultColumns:Yy,getPivotResultColumns:Jy},dependantModules:[Ja]}),Wd=b._defineModule({version:ii,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:uy}],dependantModules:[Ja,b._ColumnFilterModule]}),ev=b._defineModule({version:ii,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:py}],dependantModules:[Wd,b._FloatingFilterModule]}),tv=b._defineModule({version:ii,moduleName:b.ModuleNames.RowGroupingModule,dependantModules:[Ja,Qy,Wd,ev]}),Hd=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()}},jd=300,nv=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,
|
|
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,o=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&&o)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=b._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},jd)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===b.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),jd)}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)}},rv={selector:"AG-PRIMARY-COLS-HEADER",component:nv},qd=class{constructor(t,e,n,o=!1,s){this.localEventService=new b.LocalEventService,this.displayName=t,this.dept=n,this.group=o,o?(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)}},Kd=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),o=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:o("ariaLabelContextMenu","Context Menu"),closedCallback:d=>{d 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)),o=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()}),o&&t.push({name:e.deactivateLabel(this.displayName),icon:b._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},Yd=class extends b.Component{constructor(t,e,n,o){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=o,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(
|
|
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(o=>this.addOrRemoveCssClass(o,!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 o=()=>{const s=t.headerTooltip;this.setTooltip({newTooltipText:s,location:"columnToolPanelColumnGroup",shouldDisplayTooltip:n})};o(),this.addManagedEventListeners({newColumnsLoaded:o})}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 o=this.createBean(new Kd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}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(o=>{const s=o.getId();e[s]=o.isVisible(),n[s]=this.modelItemUtils.createPivotState(o)}),{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(o=>{o.isPassesFilter()&&(o.isGroup()?e(o.getChildren()):t.push(o.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(),o=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} (${o})`),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,o=0;if(e.forEach(s=>{!t&&s.getColDef().lockVisible||(this.isColumnChecked(s,t)?n++:o++)}),!(n>0&&o>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(),o=t.isRowGroupActive(),s=t.isValueActive();return n||o||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)}},ov=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 o=null,s=e.position==="top";if(n instanceof Yd?(o=n.getColumns()[0],s=!0):n&&(o=n.getColumn()),!o)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:o,isBefore:s});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:o}=t;if(!n||!e)return null;const s=this.columnModel.getCols().indexOf(n),l=o?s:s+1,d=this.getMoveDiff(e,l);return l-d}getMoveDiff(t,e){const n=this.columnModel.getCols();if(!t)return 0;const o=t[0],s=t.length;return n.indexOf(o)<e?s:0}},iv=class extends b.Component{constructor(t,e,n,o){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=o,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 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">
|
|
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 o=this.columnDept;this.groupsExist&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${o}`),this.getGui().style.setProperty("--ag-indentation-level",String(o)),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(d=>this.addOrRemoveCssClass(d,!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 o=this.column.getColDef().headerTooltip;this.setTooltip({newTooltipText:o,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 o=this.createBean(new Kd(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}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"),o=t("ariaToggleVisibility","Press SPACE to toggle visibility");b._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${o} (${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 o=this.column.isAnyFunctionActive();this.cbSelect.setValue(o)}else this.cbSelect.setValue(this.column.isVisible());let e=!0,n=!0;if(t){const o=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();e=!o&&!s,n=e}else{const{enableRowGroup:o,enableValue:s,lockPosition:l,suppressMovable:d,lockVisible:u}=this.column.getColDef(),p=!!o||!!s,f=!!l||!!d;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")}},sv=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},av="ag-column-select-list",lv=class extends b.Component{constructor(){super(`<div class="${av}" 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 o=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:o,columnPivotModeChanged:o,columnRowGroupChanged:o,columnValueChanged:o,columnVisible:o,newColumnsLoaded:o}),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 ov(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const o=new Yd(t,this.allowDragging,this.eventType,e);return this.createBean(o),o}const n=new iv(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 o=n.getColumnGroup();if(o){const s=t[o.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=d=>{d.addEventListener("expandedChanged",e);const u=d.removeEventListener.bind(d,"expandedChanged",e);this.destroyColumnItemFuncs.push(u)},o=(d,u,p)=>{d.forEach(f=>{b.isProvidedColumnGroup(f)?s(f,u,p):l(f,u,p)})},s=(d,u,p)=>{const f=d.getColGroupDef();if(f&&f.suppressColumnsToolPanel)return;if(d.isPadding()){o(d.getChildren(),u,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,d,"columnToolPanel"),E=new qd(y,d,u,!0,this.expandGroupsByDefault);p.push(E),n(E),o(d.getChildren(),u+1,E.getChildren())},l=(d,u,p)=>{if(d.getColDef()&&d.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(d,"columnToolPanel");p.push(new qd(m,d,u))};this.destroyColumnTree(),o(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 sv(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"),o=this.displayedColsList.length;b._setAriaLabel(this.virtualList.getAriaElement(),`${e} ${o} ${n}`)}focusRowIfAlive(t){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(t)},0)}forEachItem(t){const e=n=>{n.forEach(o=>{t(o),o.isGroup()&&e(o.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 o=e.filter(s=>!b._includes(n,s));o.length>0&&b._warnOnce("unable to find group(s) for supplied groupIds:",o)}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(o=>{if(o.isGroup()||!o.isPassesFilter())return;const s=o.getColumn(),l=s.getColDef();let d;if(n){if(!s.isAllowPivot()&&!s.isAllowRowGroup()&&!s.isAllowValue())return;d=s.isValueActive()||s.isPivotActive()||s.isRowGroupActive()}else{if(l.lockVisible)return;d=s.isVisible()}d?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 o=n.getDisplayName();return o==null||o.toLowerCase().indexOf(this.filterText)!==-1},e=(n,o)=>{let s=!1;if(n.isGroup()){const d=t(n);n.getChildren().forEach(u=>{const p=e(u,d||o);p&&(s=p)})}const l=o||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}},cv={selector:"AG-PRIMARY-COLS-LIST",component:lv},dv=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
|
-
</div>`,[
|
|
41
|
+
</div>`,[rv,cv]),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 o=this.params.suppressColumnFilter,s=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&o&&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()}},Jd=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 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">
|
|
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)}},uv=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 Jd),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new dv),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 Hd(!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 Jd),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 Hd(!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)"),o=b._last(n);o&&o.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let n=0;n<e.length;n++){const o=e[n];o.style.removeProperty("height"),o.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()}},pv=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 o=this.extractAllLeafColumns(t);this.setAllColumns(o,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=o=>{o.forEach(s=>{s.isPassesFilter()&&(s.isGroup()?n(s.getChildren()):e.push(s.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const o=[];t.forEach(s=>{s.getColDef().lockVisible||s.isVisible()!=e&&o.push({colId:s.getId(),hide:!e})}),o.length>0&&this.columnApplyStateService.applyColumnState({state:o},n)}setAllPivot(t,e,n){this.setAllPivotActive(t,e,n)}setAllPivotActive(t,e,n){const o=[],d=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);o.push({colId:u.getId(),aggFunc:f})}else u.isAllowRowGroup()?o.push({colId:u.getId(),rowGroup:!0}):u.isAllowPivot()&&o.push({colId:u.getId(),pivot:!0})}:u=>{(u.isPivotActive()||u.isRowGroupActive()||u.isValueActive())&&o.push({colId:u.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(d),o.length>0&&this.columnApplyStateService.applyColumnState({state:o},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:o,eventType:s}=t,l=e.map(d=>{const u=d.getColId();if(this.columnModel.isPivotMode()){const p=o==null?void 0:o[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}}},hv="32.3.3",Xd=b._defineModule({version:hv,moduleName:b.ModuleNames.ColumnsToolPanelModule,beans:[pv],userComponents:[{name:"agColumnsToolPanel",classImp:uv},{name:"agMenuItem",classImp:Re.AgMenuItemRenderer}],dependantModules:[Re.EnterpriseCoreModule,tv,Ha]});const fv=`.ag-header {
|
|
44
|
+
border-bottom: 1px solid var(--border-color-default);
|
|
45
|
+
}`;function Qd(){b.ModuleRegistry.registerModules([Qi.ClientSideRowModelModule,tm.InfiniteRowModelModule,ad.ServerSideRowModelModule,nm.CsvExportModule,ld.ClipboardModule,cd.RangeSelectionModule,rm.RichSelectModule,om.MenuModule,im.ExcelExportModule,Ha,Xd]);const t=Sg("AGGRID_LICENSE");t?(Re.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const mv=dd.createPart("headerBottomBorder").withCSS(fv),eu=dd.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"}).withPart(mv),tu=Symbol("sdk-vue");function Xa(){return r.inject(tu)}function gv(t,e,n={}){let o;Qd();const s=()=>{t.loadBlockState().then(d=>{l.loaded=!0;const u=ym(d,t,n),p=e(u),f=Object.fromEntries(Object.entries(p.routes).map(([m,y])=>{const E=typeof y=="function"?y():y;return[m,r.markRaw(E)]}));o=Object.assign(u,{...p,getRoute(m){return f[m]}})}).catch(d=>{console.error("load initial state error",d),l.error=d})},l=r.reactive({loaded:!1,error:void 0,useApp(){return am(o,"App is not loaded")},install(d){d.provide(tu,this),s()}});return l}var yv=Object.defineProperty,vv=(t,e,n)=>e in t?yv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_v=(t,e,n)=>vv(t,e+"",n);function nu(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function Cv(t,e,n){const o=Math.min(e,n),s=Math.max(e,n);return t>=o&&t<=s}function wv(t){return new Promise(e=>setTimeout(e,t))}function bv(t){return t()}function us(t,e,n){return e>t?e:t>n?n:t}function ru(t,e){return e(t)}function Mr(t,e){if(t!=null)return e(t)}function xv(t){if(t&&t.ok)return t.value}async function kv(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const ou=t=>t;function Sv(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Ev(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(Sv(65,91));return e}function Tv(){return Ev(42)}const Qa=Array.isArray;function si(t){return t!==null&&typeof t=="object"}function el(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function Bv(t,e){return Object.keys(t).map(n=>e(t[n],n))}function ai(t,e){return si(t)&&si(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ai(t[n],e[n])):t===e}function li(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=li(t[n]);return e}else if(si(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=li(t[n])}),e}else return t}function Av(t){return Array.isArray(t)?Object.assign([],t):si(t)?Object.assign({},t):t}function Nv(t,e){const n={};for(const o in e)e[o]!==t[o]&&(n[o]=t[o]);return n}function Vv(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function Pv(t,e,n){return t[e]=n,t}function Dv(t,e){return t[e]}function Fv(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function Rv(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function Mv(t,...e){return e.map(n=>t[n])}function Iv(t,...e){const n=Object.assign({},t);return e.forEach(o=>delete n[o]),n}function iu(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],s=e[n];el(o)&&el(s)||Qa(o)&&Qa(s)&&o.length===s.length?iu(o,s):t[n]=s}),t}const tl=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:Vv,deepClone:li,deepEqual:ai,deepPatch:iu,getProp:Dv,isArray:Qa,isObject:si,isPlainObject:el,map:Bv,omit:Iv,pick:Rv,pickValues:Mv,setProp:Pv,shallowClone:Av,shallowDiff:Nv,shiftProp:Fv},Symbol.toStringTag,{value:"Module"}));function Lv(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,o)}function su(t,e,n){let o;return function(...s){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,t.apply(this,s)},e)}}const Ov=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Gv=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],zv=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],$v=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],au=(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 nl(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?$v:zv:e.binary?Gv:Ov;if(e.signed&&t===0)return` 0 ${n[0]}`;const o=t<0,s=o?"-":e.signed?"+":"";if(o&&(t=-t),t<1){const p=au(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 d=au(Number(t),e.locale),u=n[l];return s+d+" "+u}const Zv={class:"context-menu"},Uv=["onClick"],Wv=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,o=s=>{s.cb(),n("close")};return(s,l)=>(r.openBlock(),r.createElementBlock("div",Zv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(d,u)=>(r.openBlock(),r.createElementBlock("div",{key:u,onClick:r.withModifiers(p=>o(d),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(d.text),1)],8,Uv))),128))]))}}),Bn=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},Hv=Bn(Wv,[["__scopeId","data-v-12530966"]]);function rl(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},o=r.h(Hv,{options:e,onClose:()=>{n()}});r.render(o,document.body);const s=o.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 lu=Symbol(),ps=()=>r.inject(lu),jv=["value"],qv={key:1},Kv=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=r.reactive({edit:!1}),l=r.computed(()=>o.valueType),d=f=>{var m;let y=(m=f.target)==null?void 0:m.value;const E=r.unref(l),k=bv(()=>E==="integer"?parseInt(y,10):E==="float"?Number(y):y);n("update:modelValue",k),s.edit=!1},u=r.ref(),p=f=>{!f.metaKey&&o.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:d},null,40,jv)):(r.openBlock(),r.createElementBlock("div",qv,r.toDisplayString(f.modelValue),1))],2))}}),Yv=["^data-row-index"],Jv={key:0,class:"control-cell"},Xv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=ps(),o=r.computed(()=>e.cell.column.valueType),s=f=>{Mr(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,E={...y.dataRow,[e.cell.id]:f};m({...y,dataRow:E})})},l=f=>{f.metaKey&&n.selectRow(e.cell.row.primaryKey)},d=(f,m)=>{if(f.type==="contextmenu")f.preventDefault();else return;const y=n.settings??{},E=[],{onSelectedRows:k,onSelectedColumns:D}=y.value,M=n.data.selectedRows.has(m.primaryKey);k&&k.length&&(M?E.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):E.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),D&&D.length&&(E.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),E.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),E.length&&rl(f,E)},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=>d(y,f.cell.row))},[f.cell.control?(r.openBlock(),r.createElementBlock("div",Jv,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(Kv,{key:2,"model-value":f.cell.value,"value-type":o.value,editable:f.cell.column.editable,"onUpdate:modelValue":s},null,8,["model-value","value-type","editable"]))],42,Yv))}}),Qv={},e_={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function t_(t,e){return r.openBlock(),r.createElementBlock("svg",e_,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 n_=Bn(Qv,[["render",t_]]),r_={class:"tr-head"},o_=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",r_,[r.renderSlot(e.$slots,"default")]))}});function i_(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function s_(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let s=n;s<t.length;s++)if(!e(t[s],s))return s;return t.length})();return t.slice(n,o)}const a_=["^data-col-id"],l_=r.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(t,{emit:e}){const n=e;function o(l){l.preventDefault();const d=[];d.length&&rl(l,d)}function s(l){var d;const u=((d=l.sort)==null?void 0:d.direction)??"DESC";n("change:sort",{colId:l.id,direction:i_(u,["DESC","ASC"])})}return(l,d)=>(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:o},[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:d[0]||(d[0]=r.withModifiers(()=>s(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,a_))}}),c_=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{Mr(e.value,o=>o.scrollLeft=0)})};return(o,s)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"trRef",ref:e,class:r.normalizeClass(["tr-body",{selected:o.row.selected}]),scroll:"no",style:r.normalizeStyle(o.row.style),onScroll:n},[r.renderSlot(o.$slots,"default")],38))}}),d_=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=ps(),n=t,o=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:o.value,frozen:s.column.frozen}])},null,2))}});function tt(t,e,n,o){r.onMounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.addEventListener(e,n,o)}),r.onUnmounted(()=>{var s;return(s=r.unref(t))==null?void 0:s.removeEventListener(e,n,o)})}function u_(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function p_(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function h_(t,e){let n;function o(l){n={...l}}u_(()=>{n=void 0,e()});const s=p_(t);return tt(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:o}}const co=1,f_=10,m_=30,cu=60;function du(){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 uu(t,e={}){const{delayEnter:n=0,delayLeave:o=0}=e,s=r.ref(!1);let l;const d=u=>{const p=u?n:o;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>s.value=u,p):s.value=u};return window&&(tt(t,"mouseenter",()=>d(!0)),tt(t,"mouseleave",()=>d(!1))),s}function g_(t){var e;const n=Mr((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),o=>[...o])??[];return n.map(o=>{const{width:s,x:l}=o.getBoundingClientRect(),d=o.getAttribute("data-col-id");return ou({colId:d,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function y_(t,e){const n=du(),o=uu(e,{}),{data:s}=t,l=h_(u=>{Mr(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=us(u.width+u.diff,m_,1e4),t.adjustWidth())})},()=>{s.resize=!1,s.resizeTh=void 0,document.body.style.cursor=""}),d=u=>{s.resizeTh&&(s.resize=!0,l.start({x:u.x,width:s.resizeTh.width}))};return r.watchEffect(()=>{if(!o.value){document.body.style.cursor="";return}if(s.resize)return;const u=g_(e).find(p=>Math.abs(n.x-p.right)<f_);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:d}}const v_={key:0,class:"command-menu"},__={key:0},C_=["onClick"],w_=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=ps(),n=r.computed(()=>e.getSelectedRows()),o=r.computed(()=>n.value.length>0),s=r.computed(()=>{var d;return((d=e.settings)==null?void 0:d.value.onSelectedRows)??[]}),l=r.computed(()=>s.value.map(d=>({label:d.label,cb:()=>{d.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(d,u)=>o.value?(r.openBlock(),r.createElementBlock("div",v_,[n.value.length?(r.openBlock(),r.createElementBlock("span",__,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,C_))),128))])):r.createCommentVNode("",!0)}}),b_={key:0,class:"command-menu"},x_={key:0},k_=["onClick"],S_=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=ps(),n=r.computed(()=>e.getSelectedColumns()),o=r.computed(()=>n.value.length>0),s=r.computed(()=>{var d;return((d=e.settings)==null?void 0:d.value.onSelectedColumns)??[]}),l=r.computed(()=>s.value.map(d=>({label:d.label,cb:()=>{d.cb(n.value),e.data.selectedColumns.clear()}})));return(d,u)=>o.value?(r.openBlock(),r.createElementBlock("div",b_,[n.value.length?(r.openBlock(),r.createElementBlock("span",x_,"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,k_))),128))])):r.createCommentVNode("",!0)}});function sr(t,e){const n={el:void 0,x:0,y:0},o=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({...o(s),stop:!0},n))}),tt(document,"mousemove",s=>{n.el&&e(o(s),n)})}const E_=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.windowSize-12),d=r.computed(()=>o.windowSize<o.dataSize),u=r.computed(()=>Math.ceil(o.offset*(l.value/o.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/o.dataSize)),f=r.computed(()=>({top:`${u.value}px`,height:`${p.value}px`}));return sr(s,(m,y)=>{const E=(u.value+m.dy)*o.dataSize/l.value;n("change:offset",E),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,[d.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 T_(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:o,scrollLeft:s}=e,l=[...e.columns],d=Tv();n.value.controlColumn&&l.unshift({id:d,label:"#",width:60,frozen:!0});let u=0;const p=l.map(m=>{const y={...m,offset:u};return u+=m.width+co,y}),f=p.filter(m=>m.frozen);return Lv(p,m=>m.frozen?!1:s<m.offset+m.width&&m.offset<o+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===d}))})}function B_(t,e){const n=r.computed(()=>e.value.reduce((o,s)=>(o[s.id]=s.justify?"justify-"+s.justify:"",o),{}));return r.computed(()=>t.rows.map(o=>{const s=n.value,{primaryKey:l,offset:d,dataRow:u,height:p}=o,f=e.value.map(m=>({id:m.id,column:m,row:o,value:u[m.id],class:s[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return ou({style:{top:`${d-t.scrollTop}px`,height:`${o.height}px`},primaryKey:l,offset:d,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const A_=async(t,e)=>{const{scrollTop:n,bodyHeight:o}=t;return await wv(0),kv({rows:e.getRows(n,o),dataWindow:t})};function N_(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=li(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),o=r.computed(()=>e.columns.reduce((m,y)=>m+y.width+co,0)),s=r.computed(()=>ru(f.data.dataHeight-f.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>ru(o.value-f.data.bodyWidth,m=>m>0?m:0)),d=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=T_({data:e,settings:n}),p=B_(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((E,k)=>E+k.width+co,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const E=e.columns[e.columns.length-1];E.width=E.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,E=m>y?y:m;e.bodyHeight=E},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(d,(m,y)=>{const E=m.current;(!E||m.scrollTop<E.scrollTop||m.scrollTop+m.bodyHeight>E.bodyHeight+E.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-cu,bodyHeight:m.bodyHeight+cu*2},A_(li(e.currentWindow),n.value.dataSource).then(({rows:k,dataWindow:D})=>{ai(e.currentWindow,D)&&(e.rows=k)}))},{deep:!0,immediate:!0}),r.provide(lu,f),f}const V_={class:"command-menu__container"},P_={key:0,class:"table-body__no-data"},D_={class:"carets"},ol=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,o=t,s=N_(o),l=r.computed(()=>s.data.rows.length===0),d=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,M=>n("update:data",M),{deep:!0}),r.watch(o,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Mr(f.value,M=>{s.updateDimensions(M.getBoundingClientRect())})},y=s.tableColumns,E=s.tableRows,{mouseDown:k}=y_(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),tt(window,"resize",()=>r.nextTick(m));const D=M=>{M.preventDefault(),s.updateOffsets(M)};return(M,G)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:G[2]||(G[2]=(...C)=>r.unref(k)&&r.unref(k)(...C))},[r.createElementVNode("div",V_,[r.createVNode(w_),G[3]||(G[3]=r.createTextVNode()),r.createVNode(S_)]),G[7]||(G[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(o_,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,B)=>(r.openBlock(),r.createBlock(l_,{key:B,col:C,style:r.normalizeStyle(C.style),"onChange:sort":G[0]||(G[0]=Y=>M.$emit("change:sort",Y))},null,8,["col","style"]))),128))]),_:1})],512),G[8]||(G[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(d.value),onWheel:D},[l.value?(r.openBlock(),r.createElementBlock("div",P_,[r.createElementVNode("div",null,[r.createVNode(n_),G[4]||(G[4]=r.createTextVNode()),G[5]||(G[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),G[6]||(G[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(E),(C,B)=>(r.openBlock(),r.createBlock(c_,{key:B,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,Y=>(r.openBlock(),r.createBlock(Xv,{key:Y.column.id+":"+B,cell:Y,style:r.normalizeStyle(Y.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),G[9]||(G[9]=r.createTextVNode()),r.createElementVNode("div",D_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,B)=>(r.openBlock(),r.createBlock(d_,{key:B,column:C,style:r.normalizeStyle(C.style),"onChange:sort":G[1]||(G[1]=Y=>M.$emit("change:sort",Y))},null,8,["column","style"]))),128))]),G[10]||(G[10]=r.createTextVNode()),r.createVNode(E_,{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))}}),pu=new WeakMap;class F_{constructor(e,n,o){_v(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=o;const s=e.reduce((d,u,p)=>(d.indices.set(p,d.total),d.total+=this.resolveHeight(u,p)+co,d),{total:0,indices:new Map});this.dataHeight=s.total;const l=e.map((d,u)=>({dataRow:d,index:u,primaryKey:this.resolvePrimaryKey(d,u),offset:nu(s.indices.get(u)),height:this.resolveHeight(d,u)}));pu.set(this,l)}get rows(){return pu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return s_(this.rows,o=>{const s=o.offset;return e<s+o.height&&s<n+e})}}class R_{constructor(e,n,o){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=o}get height(){return this.rowHeight+co}async getHeight(){return await this.api.count()*this.height}async getRows(e,n){const o=us(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),s=Math.ceil(n+40/this.height);return(await this.api.query({offset:o,limit:s})).map((l,d)=>({dataRow:l,index:o+d,primaryKey:this.resolvePrimaryKey(l,o+d),offset:(o+d)*(this.rowHeight+co),height:this.rowHeight}))}}function M_(t){return Object.freeze(t)}function I_(t){return r.h(ol,{settings:Object.freeze(t)})}function il(t,e){const n=new F_(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function L_(t,e){return r.computed(()=>{const n=r.unref(t);return il(n,r.unref(e))})}function O_(t,e){const n=r.computed(()=>{const s=r.unref(t);return il(s,r.unref(e))}),o=r.reactive({settings:n});return r.computed(()=>r.h(ol,o))}const G_=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:R_,Component:ol,factory:I_,rawDataSettings:il,settings:M_,useRawData:L_,useRawDataComponent:O_},Symbol.toStringTag,{value:"Module"}));function*z_(t,e){for(const n of t)yield e(n)}function $_(t){const e=[];for(const n of t)e.push(n);return e}function hu(t){return t()}function sl(t,e){if(t==null)throw Error(e);return t}function al(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function fu(t){return new Promise(e=>setTimeout(e,t))}function mu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function gu(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Z_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(gu(65,91));return e}function yu(t){return function(e){return 1-t(1-e)}}function U_(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function vu(t){const{duration:e,draw:n,timing:o}=t,s=performance.now();let l=!1;return requestAnimationFrame(function d(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=o(p);n(f),p<1&&requestAnimationFrame(d)}),function(){l=!0}}function W_(t){const{getFraction:e,draw:n,timing:o}=t,s=performance.now();let l=!1;return requestAnimationFrame(function d(u){let p=e(u-s);if(l)return;p>1&&(p=1);const f=o(p);n(f),p<1&&requestAnimationFrame(d)}),function(){l=!0}}function _u(t,e){let n=-1;return(...o)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...o),e)}}function Cu(t,e,n=!0){let o=0,s;return function(...l){s=()=>{t.apply(this,l),o=new Date().getTime()+e,s=null,n&&setTimeout(()=>{s&&s()},e)},new Date().getTime()>o&&s()}}function H_(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 ll=new Map;function j_(t){return ll.has(t)||ll.set(t,r.ref(localStorage.getItem(t))),sl(ll.get(t),"...")}function q_(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function wu(t){const e=j_(t);return r.watch(e,n=>q_(t,n)),e}const cl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{$_(z_(cl.values(),e=>e(t.matches?"dark":"light")))});const K_=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",bu=r.ref(K_),dl=wu("theme");function xu(t){const e=r.computed(()=>dl.value?dl.value:bu.value),n=s=>{bu.value=s,t&&t(s)};function o(){dl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,s=>{t&&t(r.unref(s))}),r.onMounted(()=>{cl.add(n)}),r.onUnmounted(()=>{cl.delete(n)}),[e,o]}const Y_=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=xu();return(o,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))}}),J_={class:"pl-layout-component pl-block-page"},X_={key:0,class:"pl-block-page__title"},Q_={class:"pl-block-page__title__append"},eC={key:1},tC={class:"pl-block-page__body"},nC={name:"PlBlockPage"},rC=r.defineComponent({...nC,setup(t){const e=r.useSlots();return(n,o)=>(r.openBlock(),r.createElementBlock("div",J_,[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",X_,[r.createElementVNode("h1",null,[r.renderSlot(n.$slots,"title")]),o[0]||(o[0]=r.createTextVNode()),r.createElementVNode("div",Q_,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",eC)),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",tC,[r.renderSlot(n.$slots,"default")])]))}}),oC={name:"PlContainer"},iC=r.defineComponent({...oC,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),sC={name:"PlRow"},aC=r.defineComponent({...sC,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))}}),lC={class:"pl-layout-component",style:{"flex-grow":"1"}},cC={name:"PlSpacer"},ku=r.defineComponent({...cC,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",lC))}}),dC={name:"PlGrid"},uC=r.defineComponent({...dC,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),pC={key:0,class:"pl-alert__icon"},hC={class:"pl-alert__main"},fC={key:0},mC={class:"pl-alert__main__text"},gC={name:"PlAlert"},yC=r.defineComponent({...gC,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,o)=>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",pC,[r.createElementVNode("div",{class:r.normalizeClass(`icon-24 icon-${e[n.type]}`)},null,2)])):r.createCommentVNode("",!0),o[2]||(o[2]=r.createTextVNode()),r.createElementVNode("div",hC,[n.label?(r.openBlock(),r.createElementBlock("label",fC,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",mC,[r.renderSlot(n.$slots,"default")])]),o[3]||(o[3]=r.createTextVNode()),n.closeable?(r.openBlock(),r.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:o[0]||(o[0]=s=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),vC=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
44
46
|
<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
47
|
</svg>
|
|
46
|
-
`,
|
|
48
|
+
`,_C=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
47
49
|
<rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
|
|
48
50
|
<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
51
|
</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 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:"pl-btn-group__helper"},YC={key:2,class:"pl-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(["pl-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:"pl-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(["pl-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
|
+
`,CC=["innerHTML"],wC={class:"dropdown-list-item__title-container"},bC={class:"dropdown-list-item__title text-s"},xC={key:0,class:"dropdown-list-item__description text-description"},kC={key:1,class:"dropdown-list-item__icon flex-self-start"},uo=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(" ")}),o=r.computed(()=>{const l=["dropdown-list-item__checkbox","flex-self-start"];return e.isSelected&&l.push("checked"),l.join(" ")}),s=r.computed(()=>e.isSelected?_C:vC);return(l,d)=>(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(o.value),innerHTML:s.value},null,10,CC)):r.createCommentVNode("",!0),d[1]||(d[1]=r.createTextVNode()),r.createElementVNode("div",wC,[r.createElementVNode("div",bC,r.toDisplayString(l.option.label),1),d[0]||(d[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",xC,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),d[2]||(d[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",kC)):r.createCommentVNode("",!0)],2))}});function po(t,e){const n=al(()=>{if(t.value){const{scrollTop:o,scrollLeft:s,scrollHeight:l,scrollWidth:d,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:o,scrollLeft:s,scrollHeight:l,scrollWidth:d,clientHeight:u,clientWidth:p,offsetY:o+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 SC=r.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--mask-size: 24px":""),o=r.computed(()=>`mask-16 mask-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,s.$style.icon])},null,6))}}),EC="_icon_1ugxm_2",TC={icon:EC},BC={$style:TC},ho=Bn(SC,[["__cssModules",BC]]),AC=["onKeyup"],NC=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 o=t,s=n,l=r.useModel(t,"modelValue"),d=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 E=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),k=r.computed(()=>(o.options??[]).findIndex(P=>ai(P.value,l.value))),D=r.computed(()=>ar(o.options??[]).map((P,O)=>({...P,index:O,isSelected:O===k.value,isActive:O===m.activeIndex}))),M=r.computed(()=>o.loading||o.options===void 0),G=r.computed(()=>{var P;return((P=D.value.find(O=>ai(O.value,l.value)))==null?void 0:P.label)??(o.options===void 0?"...":"")});po(d,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=d==null?void 0:d.value)==null||O.focus()};function B(){s("click")}const Y=P=>{var O,z;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(P.code))P.preventDefault();else return;if(P.target===f.value&&P.code==="Enter"){B();return}const{open:N,activeIndex:S}=m;if(!N&&P.target===p.value){P.code==="Enter"&&(m.open=!0);return}P.code==="Escape"&&(m.open=!1,(O=d.value)==null||O.focus());const V=r.unref(D),{length:W}=V;if(!W)return;P.code==="Enter"&&C((z=V.find(Z=>Z.index===S))==null?void 0:z.value);const q=V.findIndex(Z=>Z.index===S)??-1,U=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0,A=Math.abs(q+U+W)%W;m.activeIndex=D.value[A].index??-1},L=P=>{var O,z;const N=P.relatedTarget;!((O=d.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:d,class:r.normalizeClass([{disabled:P.disabled||M.value,loading:M.value},"pl-btn-split d-flex"]),onFocusout:L,onKeydown:Y},[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:B,onKeyup:r.withKeys(r.withModifiers(B,["stop"]),["enter"])},r.toDisplayString(G.value),41,AC),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)},[M.value?(r.openBlock(),r.createBlock(ho,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([E.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(D.value,(z,N)=>(r.openBlock(),r.createBlock(uo,{key:N,option:z,"is-selected":z.isSelected,"is-hovered":z.isActive,size:"medium",onClick:r.withModifiers(S=>C(z.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function Su(t){function e(n){const o=n.currentTarget,s=document.createElement("span"),l=Math.max(o.clientWidth,o.clientHeight),d=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-o.offsetLeft-d}px`,s.style.top=`${n.clientY-o.offsetTop-d}px`,s.classList.add("ripple");const u=o.getElementsByClassName("ripple")[0];u&&u.remove(),o.appendChild(s)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const VC={key:0},PC={inheritAttrs:!1},hs=r.defineComponent({...PC,__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(),o=r.computed(()=>e.small||e.size==="small"),s=r.computed(()=>e.large||e.size==="large");return Su(n),(l,d)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btn",ref:n,tabindex:"0",class:{loading:l.loading,small:o.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",VC,[r.renderSlot(l.$slots,"default")])),d[0]||(d[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(ho),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(ho),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),DC={name:"PlBtnPrimary"},ul=r.defineComponent({...DC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(hs,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),FC={name:"PlBtnAccent"},RC=r.defineComponent({...FC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(hs,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),MC={name:"PlBtnDanger"},IC=r.defineComponent({...MC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(hs,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),LC={name:"PlBtnSecondary"},pl=r.defineComponent({...LC,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(t){const e=t;return(n,o)=>(r.openBlock(),r.createBlock(hs,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),OC={key:0},GC={name:"PlBtnGhost"},hl=r.defineComponent({...GC,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"),o=r.computed(()=>e.size==="large"),s=r.ref(),l=r.useSlots();return Su(s),(d,u)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:s,tabindex:"0",class:["pl-btn-ghost",{loading:d.loading,small:n.value,large:o.value,round:d.round,reverse:d.reverse,justifyCenter:d.justifyCenter,[d.$attrs.class+""]:!0}]},{...d.$attrs,disabled:!!d.$attrs.disabled||d.loading}),[r.unref(l).default&&!d.round?(r.openBlock(),r.createElementBlock("span",OC,[r.renderSlot(d.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),d.loading?(r.openBlock(),r.createBlock(r.unref(ho),{key:1,name:"loading",size:d.size},null,8,["size"])):d.icon?(r.openBlock(),r.createBlock(r.unref(ho),{key:2,name:d.icon,size:d.size},null,8,["name","size"])):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),r.renderSlot(d.$slots,"append")],16))}}),zC=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(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:o.disabled,loading:o.loading,hover:n.value}]),onMouseover:s[0]||(s[0]=l=>n.value=!0),onMouseleave:s[1]||(s[1]=l=>n.value=!1)},[r.createVNode(pl,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),s[2]||(s[2]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],34))}});function $C(t,e){const n=r.ref();return po(t,o=>{n.value=o}),r.computed(()=>{const o=r.unref(n),s=r.unref(e),l=s.position??"top",d=s.gap??8;if(!o)return"";const u=o.offsetY+Math.floor(o.height/2),p=o.offsetX+Math.floor(o.width/2);return l==="top-left"?`left: ${o.offsetX}px; top: ${o.offsetY-d}px;`:l==="top"?`left: ${p}px; top: ${o.offsetY-d}px;`:l==="right"?`left: ${o.offsetX+o.width+d}px; top: ${u}px;`:l==="left"?`right: ${o.scrollWidth-o.x+d}px; top: ${u}px;`:""})}function ci(t,e){return e(t)}function it(t,e){if(t!=null)return e(t)}function ZC(t){return Array.isArray(t)?t:[t]}function UC(t,e,...n){n.forEach(o=>{t[o]=e[o]})}function fs(t,e){tt(document,"click",n=>{document.contains(n.target)&&(ZC(t).map(o=>o.value).filter(o=>!!o).some(o=>o==null?void 0:o.contains(n.target))||e())})}const WC={},HC={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function jC(t,e){return r.openBlock(),r.createElementBlock("svg",HC,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 qC=Bn(WC,[["render",jC]]),fl=new Map,KC={name:"PlTooltip"},kt=r.defineComponent({...KC,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,o=Symbol(),s=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});fl.set(o,()=>f()),r.watch(()=>l.open,M=>{requestAnimationFrame(()=>{l.tooltipOpen=M})});let d=()=>{};const u=Cu(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[M,G]of fl.entries())M!==o&&G()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,d(),await fu(100),l.over&&p())},y=()=>{l.over=!1,d=mu(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,M=>{M&&f()});const E=r.ref(),k=r.ref(),D=$C(E,r.toRef(s));return fs([E,k],()=>f()),r.onUnmounted(()=>{fl.delete(o)}),(M,G)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(M.element),r.mergeProps(M.$attrs,{ref_key:"rootRef",ref:E,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(M.$slots,"default"),G[1]||(G[1]=r.createTextVNode()),M.$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:k,class:r.normalizeClass(["pl-tooltip",M.position]),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(M.$slots,"tooltip")]),G[0]||(G[0]=r.createTextVNode()),r.createVNode(qC)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),YC={},JC={class:"inner-border"};function XC(t,e,n,o,s,l){return r.openBlock(),r.createElementBlock("div",JC,[r.renderSlot(t.$slots,"default")])}const QC=Bn(YC,[["render",XC]]),ew={key:0},tw=["tabindex","onKeydown","onClick"],nw={key:1,class:"pl-btn-group__helper"},rw={key:2,class:"pl-btn-group__error"},ow={name:"PlBtnGroup"},iw=r.defineComponent({...ow,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=r.useSlots(),o=e,s=u=>o("update:modelValue",u),l=t,d=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(["pl-btn-group",{disabled:u.disabled}])},[u.label?(r.openBlock(),r.createElementBlock("label",ew,[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(QC,{class:"pl-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,(f,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["pl-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,tw))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",nw,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",rw,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}}),sw={inheritAttrs:!1},aw={class:"double-contour"};function lw(t,e,n,o,s,l){return r.openBlock(),r.createElementBlock("div",aw,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const lr=Bn(sw,[["render",lw]]);function Eu(t){r.onMounted(t),r.onUpdated(t)}const ml=new WeakMap,gl=new ResizeObserver(t=>{for(const e of t)it(ml.get(e.target),n=>n(e))});function Tu(t,e){ml.set(t,e),gl.unobserve(t),gl.observe(t)}function Bu(t){gl.unobserve(t),ml.delete(t)}const cw=8,Au=4;function Ln(t,e="label"){const n=new Set;Eu(()=>{it(t==null?void 0:t.value,o=>{const s=o.querySelector(e);s&&(n.add(s),Tu(s,()=>{const l=hu(()=>s.getBoundingClientRect().width+ci(cw,d=>Number.isNaN(d)?Au:d+Au));o.style.getPropertyValue("--label-offset-right-x")!==`${l}px`&&o.style.setProperty("--label-offset-right-x",`${l}px`)}))})}),r.onBeforeUnmount(()=>{Array.from(n.values()).map(o=>Bu(o))})}function dw(t,e){const n=[];return e&&e.length>0&&e.forEach(o=>{const s=o(t);typeof s=="string"&&n.push(s)}),{isValid:n.length===0,errors:n}}function Nu(t,e){return r.computed(()=>dw(t.value,e))}const uw=r.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>e.size==="large"?"--icon-size: 24px":""),o=r.computed(()=>`icon-16 icon-${e.name}`);return(s,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,s.$style.icon])},null,6))}}),pw="_icon_1ugxm_2",hw={icon:pw},fw={$style:hw},ms=Bn(uw,[["__cssModules",fw]]),mw=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(o,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),gw="_icon_1ugxm_2",yw={icon:gw},vw={$style:yw},Vu=Bn(mw,[["__cssModules",vw]]),_w={class:"pl-text-field__envelope"},Cw={key:0,ref:"label"},ww={key:0,class:"required-icon"},bw={key:1,class:"pl-text-field__prefix"},xw=["disabled","placeholder","type"],kw={class:"pl-text-field__append"},Sw={key:0,class:"pl-text-field__error"},Ew={key:1,class:"pl-text-field__helper"},Tw={name:"PlTextField"},Ir=r.defineComponent({...Tw,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"),o=t,s=r.ref(void 0),l=r.ref(),d=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,o.parse)try{n.value=o.parse(L)}catch(P){u.cached={error:P instanceof Error?P.message:String(P),value:L}}else n.value=L}}),f=r.computed(()=>o.type&&o.type==="password"?d.value?"text":o.type:"text"),m=r.computed(()=>d.value?"view-show":"view-hide"),y=()=>{o.clearable&&(u.cached=void 0,n.value=o.clearable===!0?"":o.clearable())},E=Nu(p,o.rules||[]),k=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),D=r.computed(()=>!k.value),M=r.computed(()=>{const L=[];return o.error&&L.push(o.error),u.cached&&L.push(u.cached.error),E.value.isValid||L.push(...E.value.errors),L}),G=r.computed(()=>M.value.length>0),C=r.computed(()=>o.clearable&&D.value&&o.type!=="password"),B=()=>d.value=!d.value,Y=()=>{u.cached=void 0};return Ln(s),(L,P)=>(r.openBlock(),r.createElementBlock("div",_w,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:G.value,disabled:L.disabled,dashed:L.dashed,nonEmpty:D.value}])},[L.label?(r.openBlock(),r.createElementBlock("label",Cw,[L.required?(r.openBlock(),r.createElementBlock("i",ww)):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(kt),{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",bw,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:Y},null,40,xw),[[r.vModelDynamic,p.value]]),P[7]||(P[7]=r.createTextVNode()),r.createElementVNode("div",kw,[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(Vu),{key:1,name:m.value,style:{cursor:"pointer"},onClick:B},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()),G.value?(r.openBlock(),r.createElementBlock("div",Sw,r.toDisplayString(M.value.join(" ")),1)):L.helper?(r.openBlock(),r.createElementBlock("div",Ew,r.toDisplayString(L.helper),1)):r.createCommentVNode("",!0)]))}}),Bw={class:"ui-text-area__envelope"},Aw={key:0,ref:"label"},Nw={key:0,class:"required-icon"},Vw=["readonly","rows","disabled","placeholder"],Pw={class:"ui-text-area__append"},Dw={key:0,class:"ui-text-area__error"},Fw={key:1,class:"ui-text-area__helper"},Rw={name:"PlTextArea"},Mw=r.defineComponent({...Rw,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(),o=e,s=t,l=r.ref(),d=r.ref(),u=r.computed({get(){return s.modelValue??""},set(k){o("update:modelValue",k)}}),p=r.computed(()=>!!s.modelValue),f=Nu(u,s.rules||[]);Ln(l);const m=r.computed(()=>{const k=[];return s.error&&k.push(s.error),k.push(...f.value.errors),k}),y=r.computed(()=>m.value.length>0),E=()=>{if(!s.autogrow)return;const k=d.value;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight}px`)};return r.onMounted(()=>{E()}),(k,D)=>(r.openBlock(),r.createElementBlock("div",Bw,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:k.disabled,dashed:k.dashed,nonEmpty:p.value}])},[k.label?(r.openBlock(),r.createElementBlock("label",Aw,[k.required?(r.openBlock(),r.createElementBlock("i",Nw)):r.createCommentVNode("",!0),D[1]||(D[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(k.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(k.$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:d,"onUpdate:modelValue":D[0]||(D[0]=M=>u.value=M),readonly:k.readonly,rows:k.rows,disabled:k.disabled,placeholder:k.placeholder??"...",spellcheck:"false",onInput:E},null,40,Vw),[[r.vModelText,u.value]]),D[4]||(D[4]=r.createTextVNode()),r.createElementVNode("div",Pw,[r.renderSlot(k.$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",Dw,r.toDisplayString(m.value.join(" ")),1)):k.helper?(r.openBlock(),r.createElementBlock("div",Fw,r.toDisplayString(k.helper),1)):r.createCommentVNode("",!0)]))}});function Pu(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<o+n&&s>n}function Du(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,s=e.offsetTop,l=e.getBoundingClientRect().height;return s+l<o+n?"ceil":s>n?"floor":"visible"}function di(t,e,n={}){const o=t.scrollTop,s=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,d=e.offsetTop,u=Du(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?d-(s-l):d;t.scrollTop=o+f*(m-o)};Pu(t,e)||vu({duration:n.duration||100,timing:yu(f=>f),draw:p})}function yl(t,e,n,o){return t.addEventListener(e,n,o),function(){t.removeEventListener(e,n)}}function Iw(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 Fu(t){return t!==null&&typeof t=="object"}function Pt(t,e){return Fu(t)&&Fu(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Pt(t[n],e[n])):t===e}function vl(t,e){return t.some(n=>Pt(n,e))}const _l=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":d.value}));const e=r.ref(!1),n=r.ref(),o=r.ref(!1),s=r.computed(()=>o.value&&e.value?"ui-lt-animate":""),l=_u(m=>o.value=m,500),d=r.computed(()=>{var m;return n.value?`${((m=n.value)==null?void 0:m.innerHTML.length)*.4}s`:"5s"});function u(){const m=sl(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))}}),Lw=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(o,s)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),Ow="_icon_1ugxm_2",Gw={icon:Ow},zw={$style:Gw},On=Bn(Lw,[["__cssModules",zw]]),$w={class:"pl-dropdown__envelope"},Zw=["tabindex"],Uw={class:"pl-dropdown__container"},Ww={class:"pl-dropdown__field"},Hw=["disabled","placeholder"],jw={class:"pl-dropdown__controls"},qw={key:0},Kw={key:0,class:"required-icon"},Yw={key:0,class:"nothing-found"},Jw={key:0,class:"pl-dropdown__error"},Xw={key:1,class:"pl-dropdown__helper"},Qw={key:2,class:"pl-dropdown__helper"},e0={name:"PlDropdown"},ui=r.defineComponent({...e0,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,o=t,s=r.useSlots(),l=r.ref(),d=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>ci(Y.value.findIndex(A=>Pt(A.value,o.modelValue)),A=>A<0?0:A),m=()=>p.activeIndex=f(),y=r.computed(()=>o.options===void 0),E=r.computed(()=>y.value?!0:o.disabled),k=r.computed(()=>(o.options??[]).findIndex(A=>Pt(A.value,o.modelValue))),D=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&k.value===-1)return"The selected value is not one of the options"}}),M=r.computed(()=>ar(o.options??[]).map((A,Z)=>({...A,index:Z,isSelected:Z===k.value,isActive:Z===p.activeIndex}))),G=r.computed(()=>{const A=r.unref(M).find(Z=>Pt(Z.value,o.modelValue));return(A==null?void 0:A.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(G.value):o.placeholder),B=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),Y=r.computed(()=>{const A=M.value;return p.search?A.filter(Z=>{const X=p.search.toLowerCase();return Z.label.toLowerCase().includes(X)||Z.description&&Z.description.toLowerCase().includes(X)?!0:typeof Z.value=="string"?Z.value.toLowerCase().includes(X):Z.value===p.search}):A}),L=r.computed(()=>E.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,S=()=>p.open=!0,V=A=>{var Z,X;const pe=A.relatedTarget;!((Z=l.value)!=null&&Z.contains(pe))&&!((X=d.value)!=null&&X.contains(pe))&&(p.search="",p.open=!1)},W=()=>{const A=d.value;A&&it(A.querySelector(".hovered-item"),Z=>{di(A,Z)})},q=A=>{var Z,X;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(Y),{length:Bt}=Ct;if(!Bt)return;A.code==="Enter"&&P((X=Ct.find(_r=>_r.index===we))==null?void 0:X.value);const ht=Ct.findIndex(_r=>_r.index===we)??-1,vr=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0,Pn=Math.abs(ht+vr+Bt)%Bt;p.activeIndex=Y.value[Pn].index??-1};Ln(l),r.watch(()=>o.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 U=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(d,A=>{if(A){const Z=A.getBoundingClientRect();p.optionsHeight=Z.height,window.dispatchEvent(new CustomEvent("adjust"))}}),po(l,A=>{const Z=A.top+A.height+3;Z+p.optionsHeight>A.clientHeight?U.top=A.top-p.optionsHeight-3+"px":U.top=Z+"px",U.left=A.left+"px",U.width=A.width+"px"}),(A,Z)=>(r.openBlock(),r.createElementBlock("div",$w,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:L.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:A.error,disabled:E.value}]),onKeydown:q,onFocusout:V},[r.createElementVNode("div",Uw,[r.createElementVNode("div",Ww,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":Z[0]||(Z[0]=X=>p.search=X),type:"text",tabindex:"-1",disabled:E.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:S},null,40,Hw),[[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(_l,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(G.value),1)]),_:1})])),Z[5]||(Z[5]=r.createTextVNode()),r.createElementVNode("div",jw,[y.value?(r.openBlock(),r.createBlock(r.unref(On),{key:0,name:"loading"})):r.createCommentVNode("",!0),Z[1]||(Z[1]=r.createTextVNode()),A.clearable&&B.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",qw,[A.required?(r.openBlock(),r.createElementBlock("i",Kw)):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(kt),{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:d,class:"pl-dropdown__options",style:r.normalizeStyle(U),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Y.value,(X,pe)=>(r.openBlock(),r.createBlock(uo,{key:pe,option:X,"is-selected":X.isSelected,"is-hovered":X.isActive,size:A.optionSize,onClick:r.withModifiers(we=>P(X.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),Z[8]||(Z[8]=r.createTextVNode()),Y.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Yw,"Nothing found"))],4)])):r.createCommentVNode("",!0),Z[11]||(Z[11]=r.createTextVNode()),r.createVNode(lr,{class:"pl-dropdown__contour"})])],42,Zw),Z[12]||(Z[12]=r.createTextVNode()),D.value?(r.openBlock(),r.createElementBlock("div",Jw,r.toDisplayString(D.value),1)):y.value&&A.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",Xw,r.toDisplayString(A.loadingOptionsHelper),1)):A.helper?(r.openBlock(),r.createElementBlock("div",Qw,r.toDisplayString(A.helper),1)):r.createCommentVNode("",!0)]))}}),t0={name:"PlDropdownRef"},n0=r.defineComponent({...t0,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}))}),o=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(s,l)=>(r.openBlock(),r.createBlock(r.unref(ui),r.mergeProps(e,{options:n.value,"loading-options-helper":s.loadingOptionsHelper,"arrow-icon-large":o.value,"onUpdate:modelValue":l[0]||(l[0]=d=>s.$emit("update:modelValue",d))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function r0(t,e){return r.computed(()=>{const n=ar(t.value);return e.value?n.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):n})}const o0={class:"resizable-input"},i0=["placeholder","value","disabled"],s0=r.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,o=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 d(u){const p=u.target.value;o("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",o0,[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:d}),null,16,i0)]))}}),a0={class:"dropdown-tab-item__title text-caps13"},l0=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),o=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([o.value,"dropdown-tab-item"])},[r.createElementVNode("div",a0,r.toDisplayString(n.value),1)],2))}}),c0={class:"pl-line-dropdown__prefix"},d0={class:"pl-line-dropdown__icon-wrapper"},u0={class:"pl-line-dropdown__icon"},p0={key:0,class:"pl-line-dropdown__no-item"},h0={key:0,class:"pl-line-dropdown__no-item"},Ru=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,o=t,s=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),d=r.ref(),u=r.computed(()=>{const V=[];return s.isOpen&&V.push("open"),o.disabled&&V.push("disabled"),V.join(" ")}),p=r.ref(""),f=r0(r.toRef(o,"options"),p),m=r.computed(()=>!!(o.clearable&&s.isOpen&&o.modelValue&&y.value)),y=r.computed(()=>{if(o.modelValue){const V=D();if(V!==-1){const W=ar(o.options)[V];return typeof W.label=="object"?W.label.title:W.label}}return""}),E=r.ref(y.value),k=r.computed(()=>s.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");fs(l,()=>{o.mode==="list"&&(s.isOpen=!1)}),r.watch(()=>E.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(()=>o.modelValue,()=>M(),{immediate:!0});function D(){return o.options.findIndex(V=>Pt(V.value,o.modelValue))}function M(){s.activeOption=ci(f.value.findIndex(V=>Pt(V.value,o.modelValue)),V=>V<0?0:V),E.value=y.value}function G(){p.value=""}function C(){o.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function B(){o.mode==="list"&&(s.isOpen=!1)}function Y(V){V&&(n("update:modelValue",V.value),B(),G())}function L(V){return Pt(V.value,o.modelValue)}const P=V=>{var W,q;const U=V.relatedTarget;!((W=l.value)!=null&&W.contains(U))&&!((q=d.value)!=null&&q.contains(U))&&(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"&&Y(f.value[W]);const U=V.code==="ArrowDown"?1:V.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(W+U+q)%q,requestAnimationFrame(z)}function z(){const V=d.value;V&&it(V.querySelector(".hovered-item"),W=>{o.mode==="list"?di(V,W):W.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function N(){n("update:modelValue",void 0)}const S=r.reactive({top:"0px",left:"0px"});return r.watch(d,V=>{if(V){const W=V.getBoundingClientRect();s.optionsHeight=W.height,window.dispatchEvent(new CustomEvent("adjust"))}}),po(l,V=>{const W=V.top+V.height+2;W+s.optionsHeight>V.clientHeight?S.top=V.top-s.optionsHeight-2+"px":S.top=W+"px",S.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",c0,r.toDisplayString(o==null?void 0:o.prefix),1),W[6]||(W[6]=r.createTextVNode()),r.createVNode(s0,{modelValue:E.value,"onUpdate:modelValue":W[0]||(W[0]=q=>E.value=q),placeholder:k.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),W[7]||(W[7]=r.createTextVNode()),r.createElementVNode("div",d0,[r.withDirectives(r.createElementVNode("div",u0,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"},[o.mode==="list"?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"list",ref:d,style:r.normalizeStyle(S),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(q,U)=>r.renderSlot(V.$slots,"item",{key:U,item:q,textItem:"text",isSelected:L(q),isHovered:s.activeOption==U,onClick:r.withModifiers(A=>Y(q),["stop"])},()=>[r.createVNode(uo,{option:q,"text-item":"text","is-selected":L(q),"is-hovered":s.activeOption==U,size:"medium",onClick:r.withModifiers(A=>Y(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",p0,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)):o.mode==="tabs"?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:d,style:r.normalizeStyle(S),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(q,U)=>r.renderSlot(V.$slots,"item",{key:U,item:q,isSelected:L(q),isHovered:s.activeOption==U,onClick:r.withModifiers(A=>Y(q),["stop"])},()=>[r.createVNode(l0,{option:q,"is-selected":L(q),"is-hovered":s.activeOption==U,onClick:r.withModifiers(A=>Y(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",h0,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))}}),f0={class:"ui-dropdown__envelope"},m0=["tabindex"],g0={class:"ui-dropdown__container"},y0={class:"ui-dropdown__field"},v0=["disabled","placeholder"],_0={class:"ui-dropdown__controls"},C0={key:0},w0={key:0,class:"required-icon"},b0={key:0,class:"nothing-found"},x0={key:0,class:"ui-dropdown__error"},k0={key:1,class:"ui-dropdown__helper"},S0={key:2,class:"ui-dropdown__helper"},E0={name:"PlDropdown"},T0=r.defineComponent({...E0,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,o=t,s=r.useSlots(),l=r.ref(),d=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>ci(Y.value.findIndex(U=>Pt(U.value,o.modelValue)),U=>U<0?0:U),m=()=>p.activeIndex=f(),y=r.computed(()=>o.options===void 0),E=r.computed(()=>y.value?!0:o.disabled),k=r.computed(()=>(o.options??[]).findIndex(U=>Pt(U.value,o.modelValue))),D=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&k.value===-1)return"The selected value is not one of the options"}}),M=r.computed(()=>ar(o.options??[]).map((U,A)=>({...U,index:A,isSelected:A===k.value,isActive:A===p.activeIndex}))),G=r.computed(()=>{const U=r.unref(M).find(A=>Pt(A.value,o.modelValue));return(U==null?void 0:U.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(G.value):o.placeholder),B=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),Y=r.computed(()=>{const U=M.value;return p.search?U.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}):U}),L=r.computed(()=>E.value?void 0:"0"),P=U=>{var A;n("update:modelValue",U),p.search="",p.open=!1,(A=l==null?void 0:l.value)==null||A.focus()},O=()=>n("update:modelValue",void 0),z=()=>{var U;return(U=u.value)==null?void 0:U.focus()},N=()=>p.open=!p.open,S=()=>p.open=!0,V=U=>{var A;(A=l==null?void 0:l.value)!=null&&A.contains(U.relatedTarget)||(p.search="",p.open=!1)},W=()=>{const U=d.value;U&&it(U.querySelector(".hovered-item"),A=>{di(U,A)})},q=U=>{var A,Z;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(U.code))U.preventDefault();else return;const{open:X,activeIndex:pe}=p;if(!X){U.code==="Enter"&&(p.open=!0);return}U.code==="Escape"&&(p.open=!1,(A=l.value)==null||A.focus());const we=r.unref(Y),{length:Ct}=we;if(!Ct)return;U.code==="Enter"&&P((Z=we.find(Pn=>Pn.index===pe))==null?void 0:Z.value);const Bt=we.findIndex(Pn=>Pn.index===pe)??-1,ht=U.code==="ArrowDown"?1:U.code==="ArrowUp"?-1:0,vr=Math.abs(Bt+ht+Ct)%Ct;p.activeIndex=Y.value[vr].index??-1};return Ln(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,U=>{var A;return U?(A=u.value)==null?void 0:A.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&W()}),(U,A)=>(r.openBlock(),r.createElementBlock("div",f0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:L.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:U.error,disabled:E.value}]),onKeydown:q,onFocusout:V},[r.createElementVNode("div",g0,[r.createElementVNode("div",y0,[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:E.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:S},null,40,v0),[[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(_l,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(G.value),1)]),_:1})])),A[5]||(A[5]=r.createTextVNode()),r.createElementVNode("div",_0,[y.value?(r.openBlock(),r.createBlock(r.unref(On),{key:0,name:"loading"})):r.createCommentVNode("",!0),A[1]||(A[1]=r.createTextVNode()),U.clearable&&B.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(U.$slots,"append"),A[3]||(A[3]=r.createTextVNode()),U.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${U.arrowIconLarge}`]]),onClick:r.withModifiers(N,["stop"])},null,2)):U.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${U.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()),U.label?(r.openBlock(),r.createElementBlock("label",C0,[U.required?(r.openBlock(),r.createElementBlock("i",w0)):r.createCommentVNode("",!0),A[6]||(A[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(U.label),1),A[7]||(A[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(U.$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:d,class:"ui-dropdown__options"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Y.value,(Z,X)=>(r.openBlock(),r.createBlock(uo,{key:X,option:Z,"is-selected":Z.isSelected,"is-hovered":Z.isActive,size:U.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()),Y.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",b0,"Nothing found"))],512)):r.createCommentVNode("",!0),A[11]||(A[11]=r.createTextVNode()),r.createVNode(lr,{class:"ui-dropdown__contour"})])],42,m0),A[12]||(A[12]=r.createTextVNode()),D.value?(r.openBlock(),r.createElementBlock("div",x0,r.toDisplayString(D.value),1)):y.value&&U.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",k0,r.toDisplayString(U.loadingOptionsHelper),1)):U.helper?(r.openBlock(),r.createElementBlock("div",S0,r.toDisplayString(U.helper),1)):r.createCommentVNode("",!0)]))}}),B0={key:0,class:"ui-progress-bar"},A0={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},N0={class:"ui-progress-bar__message flex-grow-1"},V0={class:"ui-progress-bar__percent"},P0=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(o,s)=>o.loading?(r.openBlock(),r.createElementBlock("div",B0,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:o.progress+"%"})},null,4),s[1]||(s[1]=r.createTextVNode()),r.createElementVNode("div",A0,[r.createElementVNode("div",N0,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",V0,r.toDisplayString(o.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),D0={class:"mi-number-field__main-wrapper d-flex"},F0={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},R0={key:0,class:"text-description"},M0=["disabled","placeholder"],I0={class:"mi-number-field__icons d-flex-column"},L0={key:0,class:"mi-number-field__hint text-description"},O0=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,o=e,s=r.ref(),l=r.useSlots(),d=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 B;C=C.replace(/,/g,""),E(C)?(o("update:modelValue",+C),C.toString()!==((B=n.modelValue)==null?void 0:B.toString())&&+C===n.modelValue&&C[C.length-1]!=="."&&(u.value=!1,r.nextTick(()=>{u.value=!0}))):(C.trim()===""&&o("update:modelValue",void 0),u.value=!1,r.nextTick(()=>{u.value=!0}))}}),f=r.computed(()=>{let C=[];return n.errorMessage&&C.push(n.errorMessage),E(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 E(C){return C!==void 0?(C=C==null?void 0:C.toString(),!isNaN(+C)&&!isNaN(parseFloat(C))):!1}function k(){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 M(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?k():C.code==="ArrowDown"&&D()}const G=C=>{C.detail>1&&C.preventDefault()};return(C,B)=>(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:G,onKeydown:B[1]||(B[1]=Y=>M(Y))},[r.createElementVNode("div",D0,[r.createVNode(lr,{class:"mi-number-field__contour"}),B[6]||(B[6]=r.createTextVNode()),r.createElementVNode("div",F0,[C.label?(r.openBlock(),r.createElementBlock("label",R0,[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),B[2]||(B[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":B[0]||(B[0]=Y=>p.value=Y),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,M0),[[r.vModelText,p.value]])]),B[7]||(B[7]=r.createTextVNode()),r.createElementVNode("div",I0,[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:k},B[3]||(B[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),B[5]||(B[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},B[4]||(B[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)])]),B[8]||(B[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",L0,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),G0={class:"pl-chip__text"},Cl=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 o;e.value&&(n.value=((o=e.value)==null?void 0:o.clientWidth)>=256)}),(o,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:o.small}])},[r.createElementVNode("div",G0,[r.renderSlot(o.$slots,"default")]),s[3]||(s[3]=r.createTextVNode()),o.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:s[0]||(s[0]=r.withKeys(l=>o.$emit("close"),["enter"])),onClick:s[1]||(s[1]=r.withModifiers(l=>o.$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(o.$slots,"default")]),key:"0"}:void 0]),1024))}}),z0={class:"pl-multi-dropdown__envelope"},$0=["tabindex"],Z0={class:"pl-multi-dropdown__container"},U0={class:"pl-multi-dropdown__field"},W0=["disabled","placeholder"],H0={class:"pl-multi-dropdown__append"},j0={key:0},q0={key:0,class:"required-icon"},K0={class:"pl-multi-dropdown__open-chips-container"},Y0={key:0,class:"nothing-found"},J0={key:0,class:"pl-multi-dropdown__error"},X0={key:1,class:"pl-multi-dropdown__helper"},Q0={name:"PlDropdownMulti"},eb=r.defineComponent({...Q0,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,o=N=>n("update:modelValue",N),s=r.useSlots(),l=t,d=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),E=r.computed(()=>ar(l.options).filter(N=>vl(m.value,N.value))),k=r.computed(()=>{const N=r.unref(m),S=ar(l.options);return(f.search?S.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}):[...S]).map(V=>({...V,selected:vl(N,V.value)}))}),D=r.computed(()=>l.disabled?void 0:"0"),M=()=>{f.activeOption=ci(k.value.findIndex(N=>Pt(N.value,l.modelValue)),N=>N<0?0:N)},G=N=>{var S;const V=r.unref(m);o(vl(V,N)?V.filter(W=>!Pt(W,N)):[...V,N]),f.search="",(S=d==null?void 0:d.value)==null||S.focus()},C=N=>o(r.unref(m).filter(S=>!Pt(S,N))),B=()=>{var N;return(N=p.value)==null?void 0:N.focus()},Y=()=>f.open=!f.open,L=N=>{var S,V;const W=N.relatedTarget;!((S=d.value)!=null&&S.contains(W))&&!((V=u.value)!=null&&V.contains(W))&&(f.search="",f.open=!1)},P=()=>{const N=u.value;N&&it(N.querySelector(".hovered-item"),S=>{di(N,S)})},O=N=>{var S;const{open:V,activeOption:W}=f;if(!V){N.code==="Enter"&&(f.open=!0);return}N.code==="Escape"&&(f.open=!1,(S=d.value)==null||S.focus());const q=r.unref(k),{length:U}=q;if(!U)return;["ArrowDown","ArrowUp","Enter"].includes(N.code)&&N.preventDefault(),N.code==="Enter"&&G(q[W].value);const A=N.code==="ArrowDown"?1:N.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(W+A+U)%U,requestAnimationFrame(P)};Ln(d),r.watch(()=>l.modelValue,()=>M(),{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 S=N.getBoundingClientRect();f.optionsHeight=S.height,window.dispatchEvent(new CustomEvent("adjust"))}}),po(d,N=>{const S=N.top+N.height+5;S+f.optionsHeight>N.clientHeight?z.top=N.top-f.optionsHeight-5+"px":z.top=S+"px",z.left=N.left+"px",z.width=N.width+"px"}),(N,S)=>(r.openBlock(),r.createElementBlock("div",z0,[r.createElementVNode("div",{ref_key:"rootRef",ref:d,tabindex:D.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:N.error,disabled:N.disabled}]),onKeydown:O,onFocusout:L},[r.createElementVNode("div",Z0,[r.createElementVNode("div",U0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":S[0]||(S[0]=V=>f.search=V),type:"text",tabindex:"-1",disabled:N.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:S[1]||(S[1]=V=>f.open=!0)},null,40,W0),[[r.vModelText,f.search]]),S[3]||(S[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:B},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,(V,W)=>(r.openBlock(),r.createBlock(r.unref(Cl),{key:W,closeable:"",small:"",onClick:S[2]||(S[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))])),S[4]||(S[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(Y,["stop"])}),S[5]||(S[5]=r.createTextVNode()),r.createElementVNode("div",H0,[r.renderSlot(N.$slots,"append")])]),S[10]||(S[10]=r.createTextVNode()),N.label?(r.openBlock(),r.createElementBlock("label",j0,[N.required?(r.openBlock(),r.createElementBlock("i",q0)):r.createCommentVNode("",!0),S[6]||(S[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(N.label),1),S[7]||(S[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),S[11]||(S[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",K0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,(V,W)=>(r.openBlock(),r.createBlock(r.unref(Cl),{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))]),S[8]||(S[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(V,W)=>(r.openBlock(),r.createBlock(uo,{key:W,option:V,"text-item":"text","is-selected":V.selected,"is-hovered":f.activeOption==W,size:"medium","use-checkbox":"",onClick:r.withModifiers(q=>G(V.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),S[9]||(S[9]=r.createTextVNode()),k.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Y0,"Nothing found"))],36)])):r.createCommentVNode("",!0),S[12]||(S[12]=r.createTextVNode()),r.createVNode(lr,{class:"pl-multi-dropdown__contour"})])],42,$0),S[13]||(S[13]=r.createTextVNode()),N.error?(r.openBlock(),r.createElementBlock("div",J0,r.toDisplayString(N.error),1)):N.helper?(r.openBlock(),r.createElementBlock("div",X0,r.toDisplayString(N.helper),1)):r.createCommentVNode("",!0)]))}}),wl=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(o,s)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:o.disabled}]),onClick:s[0]||(s[0]=l=>o.$emit("update:modelValue",!o.modelValue)),onKeydown:s[1]||(s[1]=r.withKeys(l=>o.$emit("update:modelValue",!o.modelValue),["enter"]))},null,34))}}),tb={name:"PlCheckbox"},Mu=r.defineComponent({...tb,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(o,s)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:o.disabled}])},[r.createVNode(wl,r.mergeProps(e,{"onUpdate:modelValue":s[0]||(s[0]=l=>o.$emit("update:modelValue",l))}),null,16),s[3]||(s[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:s[1]||(s[1]=l=>o.$emit("update:modelValue",!o.$props.modelValue))},[r.renderSlot(o.$slots,"default")])],2)):(r.openBlock(),r.createBlock(wl,r.mergeProps({key:1},e,{"onUpdate:modelValue":s[2]||(s[2]=l=>o.$emit("update:modelValue",l))}),null,16))}}),nb={key:0},rb=["onClick"],ob={name:"PlCheckboxGroup"},ib=r.defineComponent({...ob,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=d=>o.modelValue.includes(d),l=d=>{const u=o.modelValue??[];n("update:modelValue",s(d)?u.filter(p=>p!==d):[...u,d])};return(d,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:d.disabled}])},[d.label?(r.openBlock(),r.createElementBlock("label",nb,r.toDisplayString(d.label),1)):r.createCommentVNode("",!0),u[1]||(u[1]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.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(wl,{disabled:d.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,rb)]))),128))],2))}}),sb="_component_tupwt_1",ab={component:sb},lb={};function cb(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 db={$style:ab},ub=Bn(lb,[["render",cb],["__cssModules",db]]),pb={key:1,class:"pl-dialog-modal__title"},hb={inheritAttrs:!1},bl=r.defineComponent({...hb,__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(),o=e,s=t,l=r.ref(),d=r.useAttrs();function u(p){l.value&&s.closeOnOutsideClick&&document.contains(p.target)&&!l.value.contains(p.target)&&o("update:modelValue",!1)}return tt(document.body,"keyup",p=>{s.modelValue&&p.code==="Escape"&&o("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(d),{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(ub,{key:0,class:"close-modal-btn",onClick:f[0]||(f[0]=r.withModifiers(m=>o("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),f[1]||(f[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",pb,[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})]))}}),fb=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(o,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),mb={key:0,class:"pl-slide-modal__title"},gb={class:"pl-slide-modal__content"},yb={key:1,class:"pl-slide-modal__actions"},vb={name:"PlSlideModal",inheritAttrs:!1},_b=r.defineComponent({...vb,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(),o=e,s=t,l=r.ref(),d=r.useAttrs();return fs(l,()=>{s.modelValue&&s.closeOnOutsideClick&&o("update:modelValue",!1)}),tt(document,"keydown",u=>{u.key==="Escape"&&o("update:modelValue",!1)}),(u,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(fb,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(d),{class:["pl-slide-modal",{"has-title":r.unref(n).title,"has-actions":r.unref(n).actions}],onKeyup:p[1]||(p[1]=r.withKeys(f=>o("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=f=>o("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",mb,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",gb,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",yb,[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=>o("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),Cb={key:0,class:"label"},wb={name:"PlToggleSwitch"},gs=r.defineComponent({...wb,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]=o=>e.$emit("update:modelValue",!e.modelValue)),onKeydown:n[1]||(n[1]=r.withKeys(o=>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",Cb,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function Iu(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function bb(t){return r.unref(t)}const xb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function kb(t,e,n={}){const{immediate:o=!0}=n,s=r.ref(!1);let l=null;function d(){l&&(clearTimeout(l),l=null)}function u(){s.value=!1,d()}function p(...f){d(),s.value=!0,l=setTimeout(()=>{s.value=!1,l=null,t(...f)},bb(e))}return o&&(s.value=!0,xb&&p()),Iu(u),{isPending:r.readonly(s),start:p,stop:u}}function Sb(t,e,n){return r.watch(t,(o,s,l)=>{o&&e(o,s,l)},{...n,once:!1})}function Eb(t,e,n){const{start:o}=kb(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),o())}function d(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&d(),Iu(u),{isActive:s,pause:u,resume:d}}const Tb="[==PROGRESS==]";function Bb(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ab(t){const e=r.ref(),n=r.reactive({errorCount:0});async function o(){var l;let d=e.value;if(d===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(d.logHandle,100,d.lastOffset);if(d.error=void 0,n.errorCount=0,p.shouldUpdateHandle||d.logHandle!==((l=e.value)==null?void 0:l.logHandle))return;const f=t.progressPrefix??Tb,m=new TextDecoder().decode(p.data).replace(new RegExp(`${Bb(f)}`,"g"),"");if(d=Object.assign(d,{lines:d.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=Eb(()=>o().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 Sb(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>s.pause()),r.watch(()=>t.logHandle,l=>{var d;l===void 0?(e.value=void 0,s.pause()):l!==((d=e.value)==null?void 0:d.logHandle)&&(e.value={logHandle:l,lastOffset:0,lines:"",finished:!1,error:void 0},n.errorCount=0,s.resume())},{immediate:!0}),e}const Nb={key:0},Vb={class:"pl-log-view__copy"},Pb={key:1,class:"pl-log-view__error"},Db={name:"PlLogView"},Lu=r.defineComponent({...Db,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=D=>{if(D&&D.ok===!1)return D.errors.join(`
|
|
53
|
+
`)},n=t,o=Ab(n),s=r.ref(!0),l=r.ref(),d=r.ref(),u=r.computed(()=>{var D;return((D=o.value)==null?void 0:D.error)??n.error??e(n.output)}),p=r.computed(()=>{var D;return((D=o.value)==null?void 0:D.lines)??n.value??xv(n.output)}),f=r.ref(!1);Ln(d);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)},E=()=>{Mr(l.value,D=>{s.value&&D.scrollTo(D.scrollLeft,D.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{E()})},{immediate:!0});const k=D=>{const M=D.target;s.value=M.scrollTop+20>=M.scrollHeight-M.offsetHeight};return(D,M)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:d,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[D.label?(r.openBlock(),r.createElementBlock("label",Nb,r.toDisplayString(D.label),1)):r.createCommentVNode("",!0),M[1]||(M[1]=r.createTextVNode()),r.createVNode(lr,{class:"pl-log-view__contour"}),M[2]||(M[2]=r.createTextVNode()),r.createElementVNode("div",Vb,[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"]),M[0]||(M[0]=r.createTextVNode())]),_:1})]),M[3]||(M[3]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",Pb,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:k},r.toDisplayString(p.value),545))],2))}}),Fb="_component_1ukal_1",Rb="_tab_1ukal_14",Mb="_disabled_1ukal_27",Ib="_active_1ukal_56",Lb="_topLine_1ukal_69",fo={component:Fb,tab:Rb,disabled:Mb,active:Ib,topLine:Lb},Ob=r.defineComponent({__name:"Tab",props:{option:{}},setup(t){const e=r.ref(),n=r.reactive({isOverflown:!1});return r.onMounted(()=>{const o=r.unref(e);if(!o)return;const s=o.$el.querySelector("span");s&&requestAnimationFrame(()=>{s.offsetWidth<s.scrollWidth&&(n.isOverflown=!0),console.log("el.offsetWidth, el.scrollWidth",s.offsetWidth,s.scrollWidth)})}),(o,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(o.option.label),1)]),default:r.withCtx(()=>[r.renderSlot(o.$slots,"default"),s[0]||(s[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Gb={name:"PlTabs"},zb=r.defineComponent({...Gb,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=s=>n("update:modelValue",s);return(s,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(fo).component,{[r.unref(fo).disabled]:s.disabled,[r.unref(fo).topLine]:s.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.options,(d,u)=>(r.openBlock(),r.createBlock(Ob,{key:u,tabindex:s.modelValue===d.value||s.disabled||d.disabled?void 0:0,option:d,class:r.normalizeClass([{[r.unref(fo).active]:s.modelValue===d.value,[r.unref(fo).disabled]:d.disabled},r.unref(fo).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":d.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>o(d.value),["enter"]),onClick:p=>o(d.value)},{default:r.withCtx(()=>[r.renderSlot(s.$slots,d.value,{option:d},()=>[r.createElementVNode("span",null,r.toDisplayString(d.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}});function $b(t){const e=t.split("/"),n=[];for(let o=0;o<e.length;o++)n.push({index:o,name:o===0?"Root":e[o],path:e.slice(0,o+1).join("/")});return n}const Zb={class:"file-dialog"},Ub={class:"file-dialog__search"},Wb={class:"ls-container"},Hb={class:"ls-head"},jb={class:"ls-head__breadcrumbs"},qb=["title","onClick"],Kb={key:0,class:"icon-16 icon-chevron-right"},Yb={class:"d-flex ml-auto align-center gap-12"},Jb={class:"ls-head__selected"},Xb={key:0,class:"ls-loader"},Qb={key:1,class:"ls-empty"},ex={key:2,class:"ls-error"},tx={class:"ls-error__message"},nx={key:3,class:"ls-body"},rx=["onClick"],ox=["title"],ix=["onClick"],sx=["title"],Ou=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,o=t,s=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),l=r.reactive(s()),d=r.computed(()=>l.showHiddenItems?l.items:l.items.filter(z=>!z.name.startsWith("."))),u=r.computed(()=>{var z;return{modelValue:o.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(S=>{N===l.dirPath&&(l.items=nu(S).entries.map(V=>({path:V.fullPath,name:V.name,isDir:V.type==="dir",canBeSelected:V.type==="file"&&(!o.extensions||o.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(S=>l.error=String(S)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:z,dirPath:N,modelValue:S}=u.value;z&&S&&p(z,N)},m=su(z=>{l.dirPath=z??""},1e3),y=r.computed(()=>$b(l.dirPath)),E=r.computed(()=>l.items.filter(z=>z.canBeSelected&&z.selected&&!z.isDir)),k=r.computed(()=>E.value.length>0),D=()=>{n("update:modelValue",!1)},M=()=>{var z;k.value&&(z=l.storageEntry)!=null&&z.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:E.value.map(N=>N.handle)}),D())},G=z=>{l.dirPath=z,l.storageEntry&&f()},C=(z,N)=>{const{shiftKey:S,metaKey:V}=z,{lastSelected:W}=l;if(z.preventDefault(),N.canBeSelected){if(o.multi||l.items.forEach(q=>q.selected=!1),N.selected=!0,!o.multi)return;!V&&!S&&l.items.forEach(q=>{q.id!==N.id&&(q.selected=!1)}),S&&W!==void 0&&l.items.forEach(q=>{Cv(q.id,W,N.id)&&(q.selected=!0)}),N.selected&&(l.lastSelected=N.id)}},B=z=>{z&&!o.multi||l.items.filter(N=>N.canBeSelected).forEach(N=>{N.selected=z})},Y=()=>B(!0),L=()=>B(!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})),o.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(()=>o.modelValue,z=>{z?P():Object.assign(l,s())},{immediate:!0}),tt(document,"keydown",z=>{o.modelValue&&z.target===document.body&&(z.metaKey&&z.code==="KeyA"&&(z.preventDefault(),Y()),z.metaKey&&z.shiftKey&&z.code==="Period"&&(z.preventDefault(),l.showHiddenItems=!l.showHiddenItems),z.code==="Enter"&&M())}),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(bl),{"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(L,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(z.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(ul),{style:{"min-width":"160px"},disabled:!k.value,onClick:r.withModifiers(M,["stop"])},{default:r.withCtx(()=>N[14]||(N[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),N[16]||(N[16]=r.createTextVNode()),r.createVNode(r.unref(hl),{"justify-center":!1,onClick:r.withModifiers(D,["stop"])},{default:r.withCtx(()=>N[15]||(N[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[N[17]||(N[17]=r.createTextVNode()),r.createElementVNode("div",Zb,[r.createElementVNode("div",Ub,[r.createVNode(r.unref(ui),{modelValue:l.storageEntry,"onUpdate:modelValue":N[0]||(N[0]=S=>l.storageEntry=S),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",Wb,[r.createElementVNode("div",Hb,[r.createElementVNode("div",jb,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(S,V)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:V},[r.createElementVNode("div",{title:S.path,onClick:W=>G(S.path)},r.toDisplayString(S.name),9,qb),N[2]||(N[2]=r.createTextVNode()),S.index!==y.value.length-1?(r.openBlock(),r.createElementBlock("i",Kb)):r.createCommentVNode("",!0)],64))),128))]),N[3]||(N[3]=r.createTextVNode()),r.createElementVNode("div",Yb,[r.createElementVNode("span",Jb,"Selected: "+r.toDisplayString(E.value.length),1)])]),N[12]||(N[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",Xb,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",ex,[N[6]||(N[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),N[7]||(N[7]=r.createTextVNode()),r.createElementVNode("div",tx,r.toDisplayString(l.error),1)])):(r.openBlock(),r.createElementBlock("div",nx,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,S=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:S.id},[S.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:V=>G(S.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:S.name},[r.createTextVNode(r.toDisplayString(S.name),1)],8,ox)),[[O]])],8,rx)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:S.canBeSelected,selected:S.selected}),onClick:r.withModifiers(V=>C(V,S),["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:S.name},[r.createTextVNode(r.toDisplayString(S.name),1)],8,sx)),[[O]])],10,ix))],64))),128))])):(r.openBlock(),r.createElementBlock("div",Qb,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 d of s)l[d]=d;return l},t.getValidEnumValues=s=>{const l=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),d={};for(const u of l)d[u]=s[u];return t.objectValues(d)},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 d in s)Object.prototype.hasOwnProperty.call(s,d)&&l.push(d);return l},t.find=(s,l)=>{for(const d of s)if(l(d))return d},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function o(s,l=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Ie||(Ie={}));var xl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(xl||(xl={}));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"]),ax=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Lt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},s=l=>{for(const d of l.issues)if(d.code==="invalid_union")d.unionErrors.map(s);else if(d.code==="invalid_return_type")s(d.returnTypeError);else if(d.code==="invalid_arguments")s(d.argumentsError);else if(d.path.length===0)o._errors.push(n(d));else{let u=o,p=0;for(;p<d.path.length;){const f=d.path[p];p===d.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(d))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),o}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={},o=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):o.push(e(s));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Lt.create=t=>new Lt(t);const mo=(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 Gu=mo;function lx(t){Gu=t}function ys(){return Gu}const vs=t=>{const{data:e,path:n,errorMaps:o,issueData:s}=t,l=[...n,...s.path||[]],d={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(d,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},cx=[];function oe(t,e){const n=ys(),o=vs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===mo?void 0:mo].filter(s=>!!s)});t.common.issues.push(o)}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 o=[];for(const s of n){if(s.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,d=await s.value;o.push({key:l,value:d})}return yt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:d}=s;if(l.status==="aborted"||d.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof d.value<"u"||s.alwaysSet)&&(o[l.value]=d.value)}return{status:e.value,value:o}}}const Ce=Object.freeze({status:"aborted"}),_s=t=>({status:"dirty",value:t}),St=t=>({status:"valid",value:t}),kl=t=>t.status==="aborted",Sl=t=>t.status==="dirty",pi=t=>t.status==="valid",hi=t=>typeof Promise<"u"&&t instanceof Promise;function Cs(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function zu(t,e,n,o,s){if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}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 fi,mi;class An{constructor(e,n,o,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $u=(t,e)=>{if(pi(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:o,description:s}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(l,d)=>{var u,p;const{message:f}=t;return l.code==="invalid_enum_value"?{message:f??d.defaultError}:typeof d.data>"u"?{message:(u=f??o)!==null&&u!==void 0?u:d.defaultError}:l.code!=="invalid_type"?{message:d.defaultError}:{message:(p=f??n)!==null&&p!==void 0?p:d.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(hi(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const s={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},l=this._parseSync({data:e,path:s.path,parent:s});return $u(s,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cr(e)},s=this._parse({data:e,path:o.path,parent:o}),l=await(hi(s)?s:Promise.resolve(s));return $u(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const d=e(s),u=()=>l.addIssue({code:ee.custom,...o(s)});return typeof Promise<"u"&&d instanceof Promise?d.then(p=>p?!0:(u(),!1)):d?!0:(u(),!1)})}refinement(e,n){return this._refinement((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new cn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Vn.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 _o.create(this,this._def)}or(e){return _i.create([this,e],this._def)}and(e){return Ci.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 Si({...Ee(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new Bl({typeName:ve.ZodBranded,type:this,...Ee(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Ei({...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 Ti.create(this,e)}readonly(){return Bi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const dx=/^c[^\s-]{8,}$/i,ux=/^[0-9a-z]+$/,px=/^[0-9A-HJKMNP-TV-Z]{26}$/,hx=/^[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,fx=/^[a-z0-9_-]{21}$/i,mx=/^[-+]?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)?)??$/,gx=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let El;const vx=/^(?:(?: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])$/,_x=/^(([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})))$/,Cx=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Zu="((\\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])))",wx=new RegExp(`^${Zu}$`);function Uu(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 bx(t){return new RegExp(`^${Uu(t)}$`)}function Wu(t){let e=`${Zu}T${Uu(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 xx(t,e){return!!((e==="v4"||!e)&&vx.test(t)||(e==="v6"||!e)&&_x.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 oe(s,{code:ee.invalid_type,expected:se.string,received:s.parsedType}),Ce}const n=new yt;let o;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),oe(o,{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&&(o=this._getOrReturnCtx(e,o),oe(o,{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,d=e.data.length<s.value;(l||d)&&(o=this._getOrReturnCtx(e,o),l?oe(o,{code:ee.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):d&&oe(o,{code:ee.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")gx.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"email",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")El||(El=new RegExp(yx,"u")),El.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"emoji",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")hx.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"uuid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")fx.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"nanoid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")dx.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"cuid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")ux.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"cuid2",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")px.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"ulid",code:ee.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),oe(o,{validation:"url",code:ee.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{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)||(o=this._getOrReturnCtx(e,o),oe(o,{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)||(o=this._getOrReturnCtx(e,o),oe(o,{code:ee.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),oe(o,{code:ee.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Wu(s).test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{code:ee.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?wx.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{code:ee.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?bx(s).test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{code:ee.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?mx.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"duration",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?xx(e.data,s.version)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"ip",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Cx.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"base64",code:ee.invalid_string,message:s.message}),n.dirty()):Ie.assertNever(s);return{status:n.value,value:e.data}}_regex(e,n,o){return this.refinement(s=>e.test(s),{validation:n,code:ee.invalid_string,...ue.errToObj(o)})}_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,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...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 kx(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),d=parseInt(e.toFixed(s).replace(".",""));return l%d/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 oe(s,{code:ee.invalid_type,expected:se.number,received:s.parsedType}),Ce}let n;const o=new yt;for(const s of this._def.checks)s.kind==="int"?Ie.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),oe(n,{code:ee.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),oe(n,{code:ee.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),oe(n,{code:ee.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?kx(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),oe(n,{code:ee.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),oe(n,{code:ee.not_finite,message:s.message}),o.dirty()):Ie.assertNever(s);return{status:o.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,o,s){return new dr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,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 o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}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 oe(s,{code:ee.invalid_type,expected:se.bigint,received:s.parsedType}),Ce}let n;const o=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),oe(n,{code:ee.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),oe(n,{code:ee.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),oe(n,{code:ee.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):Ie.assertNever(s);return{status:o.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,o,s){return new ur({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,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 gi extends Ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==se.boolean){const n=this._getOrReturnCtx(e);return oe(n,{code:ee.invalid_type,expected:se.boolean,received:n.parsedType}),Ce}return St(e.data)}}gi.create=t=>new gi({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class Lr 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 oe(s,{code:ee.invalid_type,expected:se.date,received:s.parsedType}),Ce}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return oe(s,{code:ee.invalid_date}),Ce}const n=new yt;let o;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),oe(o,{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&&(o=this._getOrReturnCtx(e,o),oe(o,{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 Ae{_parse(e){if(this._getType(e)!==se.symbol){const n=this._getOrReturnCtx(e);return oe(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 yi extends Ae{_parse(e){if(this._getType(e)!==se.undefined){const n=this._getOrReturnCtx(e);return oe(n,{code:ee.invalid_type,expected:se.undefined,received:n.parsedType}),Ce}return St(e.data)}}yi.create=t=>new yi({typeName:ve.ZodUndefined,...Ee(t)});class vi extends Ae{_parse(e){if(this._getType(e)!==se.null){const n=this._getOrReturnCtx(e);return oe(n,{code:ee.invalid_type,expected:se.null,received:n.parsedType}),Ce}return St(e.data)}}vi.create=t=>new vi({typeName:ve.ZodNull,...Ee(t)});class go extends Ae{constructor(){super(...arguments),this._any=!0}_parse(e){return St(e.data)}}go.create=t=>new go({typeName:ve.ZodAny,...Ee(t)});class Or extends Ae{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 Ae{_parse(e){const n=this._getOrReturnCtx(e);return oe(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 oe(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 Ae{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),s=this._def;if(n.parsedType!==se.array)return oe(n,{code:ee.invalid_type,expected:se.array,received:n.parsedType}),Ce;if(s.exactLength!==null){const d=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(d||u)&&(oe(n,{code:d?ee.too_big:ee.too_small,minimum:u?s.exactLength.value:void 0,maximum:d?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),o.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(oe(n,{code:ee.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(oe(n,{code:ee.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((d,u)=>s.type._parseAsync(new An(n,d,n.path,u)))).then(d=>yt.mergeArray(o,d));const l=[...n.data].map((d,u)=>s.type._parseSync(new An(n,d,n.path,u)));return yt.mergeArray(o,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 yo(t){if(t instanceof Xe){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Vn.create(yo(o))}return new Xe({...t._def,shape:()=>e})}else return t instanceof ln?new ln({...t._def,type:yo(t.element)}):t instanceof Vn?Vn.create(yo(t.unwrap())):t instanceof fr?fr.create(yo(t.unwrap())):t instanceof Nn?Nn.create(t.items.map(e=>yo(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 oe(p,{code:ee.invalid_type,expected:se.object,received:p.parsedType}),Ce}const{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),d=[];if(!(this._def.catchall instanceof Gn&&this._def.unknownKeys==="strip"))for(const p in o.data)l.includes(p)||d.push(p);const u=[];for(const p of l){const f=s[p],m=o.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new An(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof Gn){const p=this._def.unknownKeys;if(p==="passthrough")for(const f of d)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(p==="strict")d.length>0&&(oe(o,{code:ee.unrecognized_keys,keys:d}),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 d){const m=o.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new An(o,m,o.path,f)),alwaysSet:f in o.data})}}return o.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,o)=>{var s,l,d,u;const p=(d=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&d!==void 0?d:o.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(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new Xe({...this._def,shape:()=>n})}omit(e){const n={};return Ie.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new Xe({...this._def,shape:()=>n})}deepPartial(){return yo(this)}partial(e){const n={};return Ie.objectKeys(this.shape).forEach(o=>{const s=this.shape[o];e&&!e[o]?n[o]=s:n[o]=s.optional()}),new Xe({...this._def,shape:()=>n})}required(e){const n={};return Ie.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let s=this.shape[o];for(;s instanceof Vn;)s=s._def.innerType;n[o]=s}}),new Xe({...this._def,shape:()=>n})}keyof(){return Hu(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 _i extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function s(l){for(const u of l)if(u.result.status==="valid")return u.result;for(const u of l)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const d=l.map(u=>new Lt(u.ctx.common.issues));return oe(n,{code:ee.invalid_union,unionErrors:d}),Ce}if(n.common.async)return Promise.all(o.map(async l=>{const d={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:d}),ctx:d}})).then(s);{let l;const d=[];for(const p of o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&d.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=d.map(p=>new Lt(p));return oe(n,{code:ee.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}_i.create=(t,e)=>new _i({options:t,typeName:ve.ZodUnion,...Ee(e)});const pr=t=>t instanceof bi?pr(t.schema):t instanceof cn?pr(t.innerType()):t instanceof xi?[t.value]:t instanceof hr?t.options:t instanceof ki?Ie.objectValues(t.enum):t instanceof Si?pr(t._def.innerType):t instanceof yi?[void 0]:t instanceof vi?[null]:t instanceof Vn?[void 0,...pr(t.unwrap())]:t instanceof fr?[null,...pr(t.unwrap())]:t instanceof Bl||t instanceof Bi?pr(t.unwrap()):t instanceof Ei?pr(t._def.innerType):[];class xs extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.object)return oe(n,{code:ee.invalid_type,expected:se.object,received:n.parsedType}),Ce;const o=this.discriminator,s=n.data[o],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(oe(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const d=pr(l.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const u of d){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(o)})}}function Tl(t,e){const n=cr(t),o=cr(e);if(t===e)return{valid:!0,data:t};if(n===se.object&&o===se.object){const s=Ie.objectKeys(e),l=Ie.objectKeys(t).filter(u=>s.indexOf(u)!==-1),d={...t,...e};for(const u of l){const p=Tl(t[u],e[u]);if(!p.valid)return{valid:!1};d[u]=p.data}return{valid:!0,data:d}}else if(n===se.array&&o===se.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const d=t[l],u=e[l],p=Tl(d,u);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return n===se.date&&o===se.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ci extends Ae{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=(l,d)=>{if(kl(l)||kl(d))return Ce;const u=Tl(l.value,d.value);return u.valid?((Sl(l)||Sl(d))&&n.dirty(),{status:n.value,value:u.data}):(oe(o,{code:ee.invalid_intersection_types}),Ce)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,d])=>s(l,d)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Ci.create=(t,e,n)=>new Ci({left:t,right:e,typeName:ve.ZodIntersection,...Ee(n)});class Nn extends Ae{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.array)return oe(o,{code:ee.invalid_type,expected:se.array,received:o.parsedType}),Ce;if(o.data.length<this._def.items.length)return oe(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&o.data.length>this._def.items.length&&(oe(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...o.data].map((l,d)=>{const u=this._def.items[d]||this._def.rest;return u?u._parse(new An(o,l,o.path,d)):null}).filter(l=>!!l);return o.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 wi extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==se.object)return oe(o,{code:ee.invalid_type,expected:se.object,received:o.parsedType}),Ce;const s=[],l=this._def.keyType,d=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new An(o,u,o.path,u)),value:d._parse(new An(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?yt.mergeObjectAsync(n,s):yt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Ae?new wi({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ee(o)}):new wi({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:o}=this._processInputParams(e);if(o.parsedType!==se.map)return oe(o,{code:ee.invalid_type,expected:se.map,received:o.parsedType}),Ce;const s=this._def.keyType,l=this._def.valueType,d=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new An(o,u,o.path,[f,"key"])),value:l._parse(new An(o,p,o.path,[f,"value"]))}));if(o.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of d){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 d){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:o}=this._processInputParams(e);if(o.parsedType!==se.set)return oe(o,{code:ee.invalid_type,expected:se.set,received:o.parsedType}),Ce;const s=this._def;s.minSize!==null&&o.data.size<s.minSize.value&&(oe(o,{code:ee.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&o.data.size>s.maxSize.value&&(oe(o,{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 d(p){const f=new Set;for(const m of p){if(m.status==="aborted")return Ce;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...o.data.values()].map((p,f)=>l._parse(new An(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>d(p)):d(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 vo extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.function)return oe(n,{code:ee.invalid_type,expected:se.function,received:n.parsedType}),Ce;function o(u,p){return vs({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ys(),mo].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(),mo].filter(f=>!!f),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},d=n.data;if(this._def.returns instanceof _o){const u=this;return St(async function(...p){const f=new Lt([]),m=await u._def.args.parseAsync(p,l).catch(E=>{throw f.addIssue(o(p,E)),f}),y=await Reflect.apply(d,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(E=>{throw f.addIssue(s(y,E)),f})})}else{const u=this;return St(function(...p){const f=u._def.args.safeParse(p,l);if(!f.success)throw new Lt([o(p,f.error)]);const m=Reflect.apply(d,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 vo({...this._def,args:Nn.create(e).rest(Or.create())})}returns(e){return new vo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new vo({args:e||Nn.create([]).rest(Or.create()),returns:n||Or.create(),typeName:ve.ZodFunction,...Ee(o)})}}class bi 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})}}bi.create=(t,e)=>new bi({getter:t,typeName:ve.ZodLazy,...Ee(e)});class xi extends Ae{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return oe(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}}xi.create=(t,e)=>new xi({value:t,typeName:ve.ZodLiteral,...Ee(e)});function Hu(t,e){return new hr({values:t,typeName:ve.ZodEnum,...Ee(e)})}class hr extends Ae{constructor(){super(...arguments),fi.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return oe(n,{expected:Ie.joinValues(o),received:n.parsedType,code:ee.invalid_type}),Ce}if(Cs(this,fi)||zu(this,fi,new Set(this._def.values)),!Cs(this,fi).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return oe(n,{received:n.data,code:ee.invalid_enum_value,options:o}),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(o=>!e.includes(o)),{...this._def,...n})}}fi=new WeakMap,hr.create=Hu;class ki extends Ae{constructor(){super(...arguments),mi.set(this,void 0)}_parse(e){const n=Ie.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==se.string&&o.parsedType!==se.number){const s=Ie.objectValues(n);return oe(o,{expected:Ie.joinValues(s),received:o.parsedType,code:ee.invalid_type}),Ce}if(Cs(this,mi)||zu(this,mi,new Set(Ie.getValidEnumValues(this._def.values))),!Cs(this,mi).has(e.data)){const s=Ie.objectValues(n);return oe(o,{received:o.data,code:ee.invalid_enum_value,options:s}),Ce}return St(e.data)}get enum(){return this._def.values}}mi=new WeakMap,ki.create=(t,e)=>new ki({values:t,typeName:ve.ZodNativeEnum,...Ee(e)});class _o 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 oe(n,{code:ee.invalid_type,expected:se.promise,received:n.parsedType}),Ce;const o=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return St(o.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}_o.create=(t,e)=>new _o({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:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:d=>{oe(o,d),d.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const d=s.transform(o.data,l);if(o.common.async)return Promise.resolve(d).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?_s(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:d,path:o.path,parent:o});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?_s(u.value):u}}if(s.type==="refinement"){const d=u=>{const p=s.refinement(u,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),d(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),d(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!pi(d))return d;const u=s.transform(d.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>pi(d)?Promise.resolve(s.transform(d.value,l)).then(u=>({status:n.value,value:u})):d);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 Vn extends Ae{_parse(e){return this._getType(e)===se.undefined?St(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Vn.create=(t,e)=>new Vn({innerType:t,typeName:ve.ZodOptional,...Ee(e)});class fr extends Ae{_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 Si extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===se.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Si.create=(t,e)=>new Si({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});class Ei extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return hi(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Lt(o.common.issues)},input:o.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Ei.create=(t,e)=>new Ei({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 oe(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 Sx=Symbol("zod_brand");class Bl extends Ae{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class Ti extends Ae{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),_s(s.value)):this._def.out._parseAsync({data:s.value,path:o.path,parent:o})})();{const s=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:o.path,parent:o})}}static create(e,n){return new Ti({in:e,out:n,typeName:ve.ZodPipeline})}}class Bi extends Ae{_parse(e){const n=this._def.innerType._parse(e),o=s=>(pi(s)&&(s.value=Object.freeze(s.value)),s);return hi(n)?n.then(s=>o(s)):o(n)}unwrap(){return this._def.innerType}}Bi.create=(t,e)=>new Bi({innerType:t,typeName:ve.ZodReadonly,...Ee(e)});function ju(t,e={},n){return t?go.create().superRefine((o,s)=>{var l,d;if(!t(o)){const u=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(d=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&d!==void 0?d:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):go.create()}const Ex={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 Tx=(t,e={message:`Input not instance of ${t.name}`})=>ju(n=>n instanceof t,e),qu=an.create,Ku=dr.create,Bx=Ss.create,Ax=ur.create,Yu=gi.create,Nx=Lr.create,Vx=ws.create,Px=yi.create,Dx=vi.create,Fx=go.create,Rx=Or.create,Mx=Gn.create,Ix=bs.create,Lx=ln.create,Ox=Xe.create,Gx=Xe.strictCreate,zx=_i.create,$x=xs.create,Zx=Ci.create,Ux=Nn.create,Wx=wi.create,Hx=ks.create,jx=Gr.create,qx=vo.create,Kx=bi.create,Yx=xi.create,Jx=hr.create,Xx=ki.create,Qx=_o.create,Ju=cn.create,ek=Vn.create,tk=fr.create,nk=cn.createWithPreprocess,rk=Ti.create;var Es=Object.freeze({__proto__:null,defaultErrorMap:mo,setErrorMap:lx,getErrorMap:ys,makeIssue:vs,EMPTY_PATH:cx,addIssueToContext:oe,ParseStatus:yt,INVALID:Ce,DIRTY:_s,OK:St,isAborted:kl,isDirty:Sl,isValid:pi,isAsync:hi,get util(){return Ie},get objectUtil(){return xl},ZodParsedType:se,getParsedType:cr,ZodType:Ae,datetimeRegex:Wu,ZodString:an,ZodNumber:dr,ZodBigInt:ur,ZodBoolean:gi,ZodDate:Lr,ZodSymbol:ws,ZodUndefined:yi,ZodNull:vi,ZodAny:go,ZodUnknown:Or,ZodNever:Gn,ZodVoid:bs,ZodArray:ln,ZodObject:Xe,ZodUnion:_i,ZodDiscriminatedUnion:xs,ZodIntersection:Ci,ZodTuple:Nn,ZodRecord:wi,ZodMap:ks,ZodSet:Gr,ZodFunction:vo,ZodLazy:bi,ZodLiteral:xi,ZodEnum:hr,ZodNativeEnum:ki,ZodPromise:_o,ZodEffects:cn,ZodTransformer:cn,ZodOptional:Vn,ZodNullable:fr,ZodDefault:Si,ZodCatch:Ei,ZodNaN:Ss,BRAND:Sx,ZodBranded:Bl,ZodPipeline:Ti,ZodReadonly:Bi,custom:ju,Schema:Ae,ZodSchema:Ae,late:Ex,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>an.create({...t,coerce:!0}),number:t=>dr.create({...t,coerce:!0}),boolean:t=>gi.create({...t,coerce:!0}),bigint:t=>ur.create({...t,coerce:!0}),date:t=>Lr.create({...t,coerce:!0})},any:Fx,array:Lx,bigint:Ax,boolean:Yu,date:Nx,discriminatedUnion:$x,effect:Ju,enum:Jx,function:qx,instanceof:Tx,intersection:Zx,lazy:Kx,literal:Yx,map:Hx,nan:Bx,nativeEnum:Xx,never:Mx,null:Dx,nullable:tk,number:Ku,object:Ox,oboolean:()=>Yu().optional(),onumber:()=>Ku().optional(),optional:ek,ostring:()=>qu().optional(),pipeline:rk,preprocess:nk,promise:Qx,record:Wx,set:jx,strictObject:Gx,string:qu,symbol:Vx,transformer:Ju,tuple:Ux,undefined:Px,union:zx,unknown:Rx,void:Ix,NEVER:Ce,ZodIssueCode:ee,quotelessJson:ax,ZodError:Lt});function ok(t){throw new Error("Unexpected object: "+t)}const Xu="upload://upload/",Qu="index://index/";function ik(t){return t.startsWith(Xu)}function sk(t){return t.startsWith(Qu)}function ak(t){if(sk(t)){const e=t.slice(Qu.length);return JSON.parse(decodeURIComponent(e)).path}else if(ik(t)){const e=t.slice(Xu.length);return JSON.parse(decodeURIComponent(e)).localPath}ok(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 lk(t){return t.replace(/^.*[\\/]/,"")}const ck={key:0,ref:"label"},dk={key:0,class:"required-icon"},uk=["data-placeholder"],pk={key:5,class:"pl-file-input__stats"},hk={key:0,class:"pl-file-input__error"},fk={key:1,class:"upl-file-input__helper"},ep=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}),o=r.useSlots(),s=e,l=t,d=r.computed(()=>{if(l.modelValue)try{const C=ak(l.modelValue).trim();return l.showFilenameOnly?lk(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:B}=l.progress??{};return!C||!C.bytesTotal?"":C.bytesProcessed&&!B?nl(C.bytesProcessed,{})+" / "+nl(C.bytesTotal,{}):nl(C.bytesTotal,{})}),E=r.computed(()=>{var C;const{progress:B}=l;return B?{width:B.done?"100%":Math.round((((C=B.status)==null?void 0:C.progress)??0)*100)+"%"}:{}}),k=()=>{n.fileDialogOpen=!0},D=C=>{C.files.length&&s("update:modelValue",C.files[0])},M=()=>s("update:modelValue",void 0),G=r.ref();return l.cellStyle||Ln(G),(C,B)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!C.cellStyle,"has-file":!!d.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:G,class:r.normalizeClass(["pl-file-input",{dashed:C.dashed,error:f.value}]),tabindex:"0",onKeyup:r.withKeys(k,["enter"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(E.value)},null,4),B[3]||(B[3]=r.createTextVNode()),!C.cellStyle&&C.label?(r.openBlock(),r.createElementBlock("label",ck,[C.required?(r.openBlock(),r.createElementBlock("i",dk)):r.createCommentVNode("",!0),B[1]||(B[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(C.label),1),B[2]||(B[2]=r.createTextVNode()),r.unref(o).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),B[4]||(B[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"})),B[5]||(B[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":C.placeholder??"Choose file",class:"pl-file-input__filename",onClick:r.withModifiers(k,["stop"])},r.toDisplayString(d.value),9,uk),B[6]||(B[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",pk,r.toDisplayString(y.value),1)):r.createCommentVNode("",!0),B[7]||(B[7]=r.createTextVNode()),C.modelValue?(r.openBlock(),r.createBlock(r.unref(On),{key:6,name:"close",onClick:r.withModifiers(M,["stop"])})):r.createCommentVNode("",!0),B[8]||(B[8]=r.createTextVNode()),r.createVNode(lr,{class:"pl-file-input__contour"})],34),B[9]||(B[9]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",hk,r.toDisplayString(m.value),1)):C.helper?(r.openBlock(),r.createElementBlock("div",fk,r.toDisplayString(C.helper),1)):r.createCommentVNode("",!0)],2),B[10]||(B[10]=r.createTextVNode()),r.createVNode(r.unref(Ou),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":B[0]||(B[0]=Y=>n.fileDialogOpen=Y),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))}}),mk={class:"pl-notification-alert__wrapper d-flex"},gk={class:"pl-notification-alert__content flex-grow-1"},yk={key:0,class:"pl-notification-alert__close"},vk={key:0,class:"pl-notification-alert__actions d-flex"},tp=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 o(){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",mk,[r.createElementVNode("div",gk,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",yk,[r.createVNode(r.unref(hl),{icon:"close",onClick:o})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),s.$slots.actions?(r.openBlock(),r.createElementBlock("div",vk,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),_k=r.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(t){const e=t;return r.provide(e.contextKey,r.computed(()=>e.context)),(n,o)=>r.renderSlot(n.$slots,"default")}});function vt(t,e,n){return e>t?e:t>n?n:t}const Al=t=>r.computed(()=>{const e=[100],{min:n,max:o,step:s}=t.value;let l=n;for(;l<o;){l+=s;const d=(1-(vt(l,n,o)-n)/(o-n))*100;e.push(d)}return e}),Ck={class:"ui-slider__wrapper"},wk={class:"ui-slider__label-section"},bk={key:0,class:"text-s"},xk={key:1,class:"ui-slider__value-static text-s"},kk={class:"ui-slider__base"},Sk={class:"ui-slider__container"},Ek={class:"ui-slider__container ui-slider__container-thumb"},Tk={class:"ui-slider__input-wrapper d-flex"},Bk=["value"],Ak={key:0,class:"ui-slider__error"},np=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(),o=e,s=t,l=r.reactive({deltaValue:0}),d=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=Al(m),E=r.computed(()=>(u.value-s.min)/d.value),k=r.computed(()=>({right:Math.ceil((1-E.value)*100)+"%"})),D=r.computed(()=>({right:`calc(${Math.ceil((1-E.value)*100)}%) `})),M=r.ref(),G=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(G,P=>{var O;it((O=r.unref(M))==null?void 0:O.getBoundingClientRect(),z=>{const{dx:N}=P;l.deltaValue=N/z.width*d.value,p.value=C(vt((s.modelValue??0)+l.deltaValue,s.min,s.max)),P.stop&&(o("update:modelValue",C(u.value)),l.deltaValue=0)})});function B(P){o("update:modelValue",C(P))}function Y(P){B(+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;B(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",Ck,[r.createElementVNode("div",wk,[P.label?(r.openBlock(),r.createElementBlock("label",bk,[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(kt),{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",xk,r.toDisplayString(p.value)+r.toDisplayString(P.measure),1)):r.createCommentVNode("",!0)]),O[6]||(O[6]=r.createTextVNode()),r.createElementVNode("div",kk,[r.createElementVNode("div",Sk,[r.createElementVNode("div",{ref_key:"barRef",ref:M,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(k.value)},null,4)],512)]),O[5]||(O[5]=r.createTextVNode()),r.createElementVNode("div",Ek,[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:G,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(D.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",Tk,[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=>Y(z))},null,40,Bk)):r.createCommentVNode("",!0)])],2),O[8]||(O[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",Ak,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function Nk(t,e=null,n=null){function o(u){const{scrollTop:p,scrollHeight:f,clientHeight:m}=u;if(!(f>m)||!e)return null;const y=f-p-m,E=p>e?e:0,k=y>e?m-e-E:m;return`linear-gradient(
|
|
52
54
|
to bottom,
|
|
53
55
|
transparent,
|
|
54
|
-
black ${
|
|
55
|
-
black ${
|
|
56
|
+
black ${E}px,
|
|
57
|
+
black ${k}px,
|
|
56
58
|
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,
|
|
59
|
+
)`}function s(u){const{scrollLeft:p,scrollWidth:f,clientWidth:m}=u;if(!(f>m)||!n)return null;const y=f-p-m,E=p>n?n:0,k=y>n?m-n-E:m;return`linear-gradient(
|
|
58
60
|
to right,
|
|
59
61
|
transparent,
|
|
60
|
-
black ${
|
|
61
|
-
black ${
|
|
62
|
+
black ${E}px,
|
|
63
|
+
black ${k}px,
|
|
62
64
|
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"},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:{}};/**
|
|
65
|
+
)`}function l(){const u=t.value;if(!u)return;const p=[o(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 d=al(l);r.onMounted(l),tt(window,"scroll",d,!0),tt(window,"resize",d,!0)}function rp(t,e){Eu(()=>{it(r.unref(t),n=>{Tu(n,()=>e(n))})}),r.onUnmounted(()=>{it(r.unref(t),n=>{Bu(n)})})}const mr={item:"sortable__item",animate:"sortable__animate"},Ai=t=>t.getBoundingClientRect().y,op=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},Vk=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function Pk(t,e){const n={item:void 0,options(){var k;return[...((k=t.value)==null?void 0:k.children)??[]]}},o=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function d(k){const D=e.handle?this.querySelector(e.handle):null;D&&!D.contains(k.target)||(this.classList.remove(mr.animate),this.classList.add(mr.item),n.item={el:this,y:k.y,dy:0,orderChanged:!1})}function u(k){const D=n.options();return D.slice(0,D.indexOf(k))}function p(k){const D=n.options();return D.slice(D.indexOf(k)+1)}function f(k,D){const M=n.options().filter(C=>C!==D),G=M.indexOf(k);return M.splice(G,0,D),M}function m(k,D){const M=n.options().filter(C=>C!==D),G=M.indexOf(k);return M.splice(G+1,0,D),M}function y(k,D){k.dy=D-k.y,k.el.style.setProperty("transform",`translateY(${k.dy}px)`)}function E(k){var D;if(!n.item)return;const{el:M}=n.item;if(!M.isConnected){n.item=void 0;return}const G=k.map(O=>Ai(O)),C=Ai(M);(D=t.value)==null||D.replaceChildren(...k);const B=Ai(M),Y=k.map(O=>Ai(O)),L=[];for(let O=0;O<Y.length;O++){const z=k[O];if(z===n.item.el)continue;const N=Y[O],S=G[O]-N;z.style.transform=`translateY(${S}px)`,L.push(z)}const P=B-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",k=>{if(!n.item)return;const{el:D}=n.item;y(n.item,k.y);const M=Ai(n.item.el),G=Vk(n.item.el),C=u(D),B=p(D);C.forEach(Y=>{const L=op(Y);M+s<L&&E(f(Y,D))}),B.forEach(Y=>{const L=op(Y);G-s>L&&E(m(Y,D))})}),tt(window,"mouseup",()=>{if(!n.item)return;const{el:k,orderChanged:D}=n.item;k.classList.add(mr.animate),k.style.removeProperty("transform"),k.addEventListener("transitionend",()=>{k.classList.remove(mr.animate,mr.item)}),setTimeout(()=>{if(!D)return;const M=n.options().map(C=>Number(C.getAttribute("data-index"))),G=t.value;if(G){for(const C of n.options())G.removeChild(C);o.value.forEach(C=>{G.appendChild(C)})}e.onChange(M)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((k,D)=>{k.removeEventListener("mousedown",d),k.addEventListener("mousedown",d),k.setAttribute("data-index",String(D))})})}function Dk(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function Fk(t,e,n){const o=r.reactive({data:tl.deepClone(e(t.value)),changed:!1});return r.watch(()=>o.data,s=>{o.changed?n(tl.deepClone(s)):o.changed=!0},{deep:!0}),r.watch(t,s=>{Object.assign(o,{data:tl.deepClone(e(s)),changed:!1})},{deep:!0,immediate:!0}),o}function Rk(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(o){this.error=o}finally{this.isLoading=!1}},debounce(n,o=1e3){return su(()=>{const s=n();this.run(...s).catch(console.error)},o)}});return e.run=e.run.bind(e),e}function Mk(t,e){function n(d,u){const p=r.unref(t);if(!p)return;const f=`translate(${u.x-d.x}px, ${u.y-d.y}px)`;p.style.setProperty("transform",f),e(u)}function o(d){const u=p=>n(d,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 d;(d=r.unref(t))==null||d.addEventListener("mousedown",o)}function l(){var d;(d=r.unref(t))==null||d.removeEventListener("mousedown",o)}r.onMounted(s),r.onUnmounted(l)}const Ik={class:"ui-slider__wrapper"},Lk={class:"ui-slider__label-section"},Ok={key:0,class:"text-s"},Gk={class:"ui-slider__base"},zk={class:"ui-slider__container"},$k={class:"ui-slider__container ui-slider__container-thumb"},Zk=["data-percent"],Uk=["data-percent"],Wk=["data-percent"],Hk={key:0,class:"ui-slider__error"},jk=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(),o=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),d=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.computed(()=>s.max-s.min),y=r.computed(()=>s),E=Al(y),k=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)),M=r.computed(()=>vt((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),G=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 X=[];return[...s.modelValue].forEach(pe=>{pe>s.max&&X.push(`Max model value must be lower than max props ${s.max}.`),pe<s.min&&X.push("Min model value must be greater than max props.")}),X.length>0?X.join(" "):s.error}),C=r.computed(()=>(k.value-s.min)/m.value),B=r.computed(()=>(D.value-s.min)/m.value),Y=r.computed(()=>(M.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-B.value)*100)+"%"})),N=r.computed(()=>({right:Math.ceil((1-Y.value)*100)+"%"}));sr(u,Z=>{var X;it((X=r.unref(d))==null?void 0:X.getBoundingClientRect(),pe=>{const{dx:we}=Z;l.deltaValue1=we/pe.width*m.value,u.value&&S(u.value,s.modelValue[0],l.deltaValue1),Z.stop&&(q([W(k.value),W(D.value),W(M.value)]),l.deltaValue1=0)})}),sr(p,Z=>{var X;it((X=r.unref(d))==null?void 0:X.getBoundingClientRect(),pe=>{const{dx:we}=Z;l.deltaValue2=we/pe.width*m.value,p.value&&S(p.value,s.modelValue[1],l.deltaValue2),Z.stop&&(q([W(k.value),W(D.value),W(M.value)]),l.deltaValue2=0)})}),sr(f,Z=>{var X;it((X=r.unref(d))==null?void 0:X.getBoundingClientRect(),pe=>{const{dx:we}=Z;l.deltaValue3=we/pe.width*m.value,f.value&&S(f.value,s.modelValue[2],l.deltaValue3),Z.stop&&(q([W(k.value),W(D.value),W(M.value)]),l.deltaValue3=0)})});function S(Z,X,pe){const we=W(vt((X??0)+pe,s.min,s.max));Z.dataset.percent=`${we}${s.measure}`,U()}function V(){const Z=Math.ceil((1-C.value)*100),X=Math.ceil((1-B.value)*100),pe=Math.ceil((1-Y.value)*100);return[Z,X,pe].sort((we,Ct)=>we-Ct)}function W(Z){const X=vt(Z,s.min,s.max);return Math.round((X+Number.EPSILON)*(1/s.step))/(1/s.step)}function q(Z){o("update:modelValue",Z)}function U(){const Z=Number(O.value.right.substring(0,O.value.right.length-1)),X=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:X,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 A(Z,X){["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[X]=vt(we[X]+pe,s.min,s.max),q(we),U()}return r.onMounted(()=>{U()}),(Z,X)=>(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",Ik,[r.createElementVNode("div",Lk,[Z.label?(r.openBlock(),r.createElementBlock("label",Ok,[r.createElementVNode("span",null,r.toDisplayString(Z.label),1),X[3]||(X[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)]),X[11]||(X[11]=r.createTextVNode()),r.createElementVNode("div",Gk,[r.createElementVNode("div",zk,[r.createElementVNode("div",{ref_key:"barRef",ref:d,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(P.value)},null,4)],512)]),X[10]||(X[10]=r.createTextVNode()),r.createElementVNode("div",$k,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(E),(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),X[7]||(X[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:X[0]||(X[0]=pe=>A(pe,0))},X[4]||(X[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Zk),X[8]||(X[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:X[1]||(X[1]=pe=>A(pe,1))},X[5]||(X[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Uk),X[9]||(X[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:X[2]||(X[2]=pe=>A(pe,2))},X[6]||(X[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Wk)])])]),X[12]||(X[12]=r.createTextVNode()),X[13]||(X[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),X[14]||(X[14]=r.createTextVNode()),G.value?(r.openBlock(),r.createElementBlock("div",Hk,r.toDisplayString(G.value),1)):r.createCommentVNode("",!0)],2))}}),qk={class:"ui-input-range__separator"},Kk=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,s=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),d=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(){o("update:modelValue",[+s.left,+s.right]),o("change",[+s.left,+s.right])}function f(m,y){const E=y.target.value;/^[0-9]{0,2}$/.test(E)?m?s.left=+E:s.right=+E:m?s.left=+E.slice(0,E.length-1):s.right=+E.slice(0,E.length-1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:[d.value,"ui-input-range"]},m.$attrs),[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=E=>u.value.left=E),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=E=>l.value=!0),onFocusout:y[2]||(y[2]=E=>l.value=!1),onInput:y[3]||(y[3]=E=>f(!0,E))},null,544),[[r.vModelText,u.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",qk,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=E=>u.value.right=E),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=E=>l.value=!0),onFocusout:y[6]||(y[6]=E=>l.value=!1),onInput:y[7]||(y[7]=E=>f(!1,E))},null,544),[[r.vModelText,u.value.right]])],16))}}),Yk={class:"ui-slider__wrapper"},Jk={class:"ui-slider__label-section"},Xk={key:0,class:"text-s"},Qk={key:1,class:"ui-slider__value-static text-s"},eS={class:"ui-slider__base"},tS={class:"ui-slider__container"},nS={class:"ui-slider__container ui-slider__container-thumb"},rS={class:"ui-slider__input-wrapper d-flex"},oS={key:0,class:"ui-slider__error"},iS=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(),o=e,s=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),d=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]),E=r.computed(()=>s),k=Al(E),D=r.computed(()=>[m.value,y.value].sort((U,A)=>U-A).join("-")),M=r.computed(()=>s.max-s.min),G=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)),B=r.computed(()=>{const U=s.modelValue;return Array.isArray(U)&&U.length===2&&U.every(A=>Number.isFinite(A))?s.error:"Expected model [number, number]"}),Y=r.computed(()=>(G.value-s.min)/M.value),L=r.computed(()=>(C.value-s.min)/M.value),P=r.computed(()=>S()),O=r.computed(()=>({right:P.value[0]+"%",left:100-P.value[1]+"%"})),z=r.computed(()=>({right:Math.ceil((1-Y.value)*100)+"%"})),N=r.computed(()=>({right:Math.ceil((1-L.value)*100)+"%"}));r.watch(()=>s.modelValue,U=>{f.value=U,m.value=+U[0],y.value=+U[1]},{immediate:!0}),sr(u,U=>{var A;it((A=r.unref(d))==null?void 0:A.getBoundingClientRect(),Z=>{const{dx:X}=U;l.deltaValue1=X/Z.width*M.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),U.stop&&(W([V(G.value),V(C.value)]),l.deltaValue1=0)})}),sr(p,U=>{var A;it((A=r.unref(d))==null?void 0:A.getBoundingClientRect(),Z=>{const{dx:X}=U;l.deltaValue2=X/Z.width*M.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),U.stop&&(W([V(G.value),V(C.value)]),l.deltaValue2=0)})});function S(){const U=Math.ceil((1-Y.value)*100),A=Math.ceil((1-L.value)*100);return[U,A].sort((Z,X)=>Z-X)}function V(U){const A=vt(U,s.min,s.max);return Math.round((A+Number.EPSILON)*(1/s.step))/(1/s.step)}function W(U){o("update:modelValue",U)}function q(U,A){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(U.code)&&U.preventDefault();const Z=U.code==="ArrowUp"||U.code==="ArrowRight"?s.step*1:U.code==="ArrowDown"||U.code==="ArrowLeft"?s.step*-1:0,X=[...s.modelValue];X[A]=vt(X[A]+Z,s.min,s.max),W(X)}return(U,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",Yk,[r.createElementVNode("div",Jk,[U.label?(r.openBlock(),r.createElementBlock("label",Xk,[r.createElementVNode("span",null,r.toDisplayString(U.label),1),A[3]||(A[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),A[4]||(A[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",Qk,r.toDisplayString(D.value),1)):r.createCommentVNode("",!0)]),A[10]||(A[10]=r.createTextVNode()),r.createElementVNode("div",eS,[r.createElementVNode("div",tS,[r.createElementVNode("div",{ref_key:"barRef",ref:d,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",nS,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(k),(Z,X)=>(r.openBlock(),r.createElementBlock("div",{key:X,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",rS,[s.mode==="input"?(r.openBlock(),r.createBlock(Kk,{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()),B.value?(r.openBlock(),r.createElementBlock("div",oS,r.toDisplayString(B.value),1)):r.createCommentVNode("",!0)],2))}}),sS=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.clientHeight/(o.scrollHeight||1)),d=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{top:o.scrollTop*p+"px",height:Math.floor(o.clientHeight*p)+"px"}});return tt(s,"pointerdown",p=>{const f={clientY:p.clientY},m=yl(document,"mousemove",y=>{const E=(y.clientY-f.clientY)/l.value;n("update:scrollTop",o.scrollTop+E),f.clientY=y.clientY});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,f)=>d.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)}}),aS=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,o=t,s=r.ref(),l=r.computed(()=>o.clientWidth/(o.scrollWidth||1)),d=r.computed(()=>l.value<1),u=r.computed(()=>{const p=r.unref(l);return{left:o.scrollLeft*p+"px",width:Math.floor(o.clientWidth*p)+"px"}});return tt(s,"pointerdown",p=>{const f={clientX:p.clientX},m=yl(document,"mousemove",y=>{const E=(y.clientX-f.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+E),f.clientX=y.clientX});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,f)=>d.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)}}),lS={class:"ui-scrollable"},cS=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 o(u){UC(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,o(p)};function l(u){it(r.unref(e),p=>{p.scrollTop=u,o(p)})}function d(u){it(r.unref(e),p=>{p.scrollLeft=u,o(p)})}return rp(e,u=>{it(u,p=>o(p))}),r.onMounted(()=>{it(r.unref(e),u=>{o(u),u.addEventListener("wheel",s)})}),r.onUnmounted(()=>{it(r.unref(e),u=>u.removeEventListener("wheel",s))}),(u,p)=>(r.openBlock(),r.createElementBlock("div",lS,[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(sS,{"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(aS,{"scroll-left":n.scrollLeft,"client-width":n.clientWidth,"scroll-width":n.scrollWidth,onWheel:p[1]||(p[1]=r.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":d},null,8,["scroll-left","client-width","scroll-width"])]))}}),dS="add.svg",uS="box.svg",pS="calendar.svg",hS="checkmark.svg",fS="clipboard.svg",mS="close.svg",gS="copy.svg",yS="download.svg",vS="duplicate.svg",_S="edit.svg",CS="error.svg",wS="filter.svg",bS="help.svg",xS="info.svg",kS="link.svg",SS="loading.svg",ES="lock.svg",TS="maximize.svg",BS="minimize.svg",AS="minus.svg",NS="more.svg",VS="open.svg",PS="pause.svg",DS="play.svg",FS="renew.svg",RS="restart.svg",MS="reverse.svg",IS="settings.svg",LS="sort.svg",OS="stop.svg",GS="success.svg",zS="time.svg",$S="tune.svg",ZS="warning.svg",US="zip.svg",WS={add:dS,"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:uS,calendar:pS,"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:hS,"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:fS,close:mS,copy:gS,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:yS,"drag-dots":"drag-dots.svg",duplicate:vS,edit:_S,error:CS,export:"export.svg","filter-on":"filter-on.svg",filter:wS,"help-outline":"help-outline.svg",help:bS,"info-outline":"info-outline.svg",info:xS,"jump-link":"jump-link.svg",link:kS,loading:SS,lock:ES,maximize:TS,minimize:BS,minus:AS,more:NS,open:VS,"paper-clip":"paper-clip.svg",pause:PS,play:DS,renew:FS,restart:RS,reverse:MS,settings:IS,sort:LS,stop:OS,success:GS,time:zS,tune:$S,warning:ZS,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:US},HS="add.svg",jS="annotate.svg",qS="annotation.svg",KS="area.svg",YS="axes.svg",JS="bar.svg",XS="bindot.svg",QS="box.svg",e1="boxplot.svg",t1="bubble.svg",n1="calendar.svg",r1="canvas.svg",o1="checkbox.svg",i1="checkmark.svg",s1="clipboard.svg",a1="close.svg",l1="cluster.svg",c1="code.svg",d1="color.svg",u1="columns.svg",p1="container.svg",h1="cookie.svg",f1="copy.svg",m1="cpu.svg",g1="debug.svg",y1="dna.svg",v1="download.svg",_1="duplicate.svg",C1="edit.svg",w1="error.svg",b1="filter.svg",x1="generate.svg",k1="graph.svg",S1="heatmap.svg",E1="help.svg",T1="info.svg",B1="jitter.svg",A1="lasso.svg",N1="layers.svg",V1="learn.svg",P1="legend.svg",D1="line.svg",F1="link.svg",R1="loading.svg",M1="lock.svg",I1="maximize.svg",L1="menu.svg",O1="minimize.svg",G1="minus.svg",z1="more.svg",$1="pause.svg",Z1="pin.svg",U1="play.svg",W1="product.svg",H1="publications.svg",j1="renew.svg",q1="restart.svg",K1="reverse.svg",Y1="search.svg",J1="server.svg",X1="settings.svg",Q1="sina.svg",eE="skatterplot.svg",tE="slice.svg",nE="sort.svg",rE="statistics.svg",oE="stop.svg",iE="success.svg",sE="table.svg",aE="template.svg",lE="terminal.svg",cE="time.svg",dE="tune.svg",uE="venn.svg",pE="violin.svg",hE="warning.svg",fE="wetlab.svg",mE="zip.svg",gE={"add-layer":"add-layer.svg",add:HS,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:jS,annotation:qS,area:KS,"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:YS,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:JS,bindot:XS,box:QS,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:e1,bubble:t1,calendar:n1,canvas:r1,"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:o1,checkmark:i1,"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:s1,close:a1,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:l1,code:c1,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:d1,columns:u1,"connected-points":"connected-points.svg",container:p1,cookie:h1,copy:f1,cpu:m1,"data-dimentions":"data-dimentions.svg",debug:g1,"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:y1,download:v1,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:_1,edit:C1,"error-bar":"error-bar.svg",error:w1,"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:b1,"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:x1,graph:k1,heatmap:S1,"help-outline":"help-outline.svg",help:E1,"info-outline":"info-outline.svg",info:T1,jitter:B1,"jump-link":"jump-link.svg",lasso:A1,layers:N1,learn:V1,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:P1,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:D1,"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:F1,loading:R1,lock:M1,maximize:I1,menu:L1,minimize:O1,minus:G1,more:z1,"paper-clip":"paper-clip.svg",pause:$1,pin:Z1,play:U1,"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:W1,publications:H1,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:j1,restart:q1,reverse:K1,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:Y1,"server-on":"server-on.svg",server:J1,settings:X1,sina:Q1,skatterplot:eE,slice:tE,"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:nE,statistics:rE,stop:oE,"strip-plot":"strip-plot.svg",success:iE,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:sE,template:aE,terminal:lE,"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:cE,tune:dE,venn:uE,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:pE,warning:hE,wetlab:fE,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:mE,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function yE(){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 vE=["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"],_E=["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"],CE={allCssVariables:yE(),icons16:WS,icons24:gE},wE={class:"block__not-found"},bE=r.defineComponent({__name:"NotFound",setup(t){const n=Xa().useApp(),o=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",wE,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(pl),{onClick:r.withModifiers(o,["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[o,s]of e)n[o]=s;return n},xE={},kE={class:"block__loader-page"};function SE(t,e){return r.openBlock(),r.createElementBlock("div",kE,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const EE=Ts(xE,[["render",SE]]),TE={class:"pl-app-notification-alert"},BE={class:"pl-app-notification-alert__content"},AE={class:"pl-app-notification-alert__title"},NE=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),o=r.ref(!0),s=r.computed(()=>Object.entries(e.errors).filter(d=>!!d[1]));function l(){n.value=!0}return r.watch(()=>e.errors,d=>{o.value=Object.values(d).some(u=>!!u)},{immediate:!0,deep:!0}),(d,u)=>(r.openBlock(),r.createElementBlock("div",TE,[r.createVNode(r.unref(bl),{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",BE,[(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",AE,r.toDisplayString(p[0]),1),r.createVNode(r.unref(Lu),{value:(f=p[1])==null?void 0:f.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(tp),{modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=p=>o.value=p),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(ul),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>u[3]||(u[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(ku))]),default:r.withCtx(()=>[u[4]||(u[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),VE={class:"block block__layout"},PE={key:0},DE=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}},o=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),d=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",VE,[r.unref(e).error?(r.openBlock(),r.createElementBlock("div",PE,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value),{key:o.value})):(r.openBlock(),r.createBlock(bE,{key:3})):(r.openBlock(),r.createBlock(EE,{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(NE),{key:4,errors:d.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var Bs={exports:{}};/**
|
|
64
66
|
* @license
|
|
65
67
|
* Lodash <https://lodash.com/>
|
|
66
68
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
67
69
|
* Released under MIT license <https://lodash.com/license>
|
|
68
70
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
69
71
|
* 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,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={"&":"&","<":"<",">":">",'"':""","'":"'"},cB={"&":"&","<":"<",">":">",""":'"',"'":"'"},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,`{
|
|
72
|
+
*/Bs.exports,function(t,e){(function(){var n,o="4.17.21",s=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",y=1,E=2,k=4,D=1,M=2,G=1,C=2,B=4,Y=8,L=16,P=32,O=64,z=128,N=256,S=512,V=30,W="...",q=800,U=16,A=1,Z=2,X=3,pe=1/0,we=9007199254740991,Ct=17976931348623157e292,Bt=NaN,ht=4294967295,vr=ht-1,Pn=ht>>>1,_r=[["ary",z],["bind",G],["bindKey",C],["curry",Y],["curryRight",L],["flip",S],["partial",P],["partialRight",O],["rearg",N]],$n="[object Arguments]",Wr="[object Array]",Ps="[object AsyncFunction]",Ge="[object Boolean]",Cr="[object Date]",fT="[object DOMException]",Ds="[object Error]",Fs="[object Function]",Cp="[object GeneratorFunction]",vn="[object Map]",Pi="[object Number]",mT="[object Null]",Zn="[object Object]",wp="[object Promise]",gT="[object Proxy]",Di="[object RegExp]",_n="[object Set]",Fi="[object String]",Rs="[object Symbol]",yT="[object Undefined]",Ri="[object WeakMap]",vT="[object WeakSet]",Mi="[object ArrayBuffer]",So="[object DataView]",Rl="[object Float32Array]",Ml="[object Float64Array]",Il="[object Int8Array]",Ll="[object Int16Array]",Ol="[object Int32Array]",Gl="[object Uint8Array]",zl="[object Uint8ClampedArray]",$l="[object Uint16Array]",Zl="[object Uint32Array]",_T=/\b__p \+= '';/g,CT=/\b(__p \+=) '' \+/g,wT=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bp=/&(?:amp|lt|gt|quot|#39);/g,xp=/[&<>"']/g,bT=RegExp(bp.source),xT=RegExp(xp.source),kT=/<%-([\s\S]+?)%>/g,ST=/<%([\s\S]+?)%>/g,kp=/<%=([\s\S]+?)%>/g,ET=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TT=/^\w*$/,BT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ul=/[\\^$.*+?()[\]{}|]/g,AT=RegExp(Ul.source),Wl=/^\s+/,NT=/\s/,VT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,PT=/\{\n\/\* \[wrapped with (.+)\] \*/,DT=/,? & /,FT=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,RT=/[()=,{}\[\]\/\s]/,MT=/\\(\\)?/g,IT=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sp=/\w*$/,LT=/^[-+]0x[0-9a-f]+$/i,OT=/^0b[01]+$/i,GT=/^\[object .+?Constructor\]$/,zT=/^0o[0-7]+$/i,$T=/^(?:0|[1-9]\d*)$/,ZT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ms=/($^)/,UT=/['\n\r\u2028\u2029\\]/g,Is="\\ud800-\\udfff",WT="\\u0300-\\u036f",HT="\\ufe20-\\ufe2f",jT="\\u20d0-\\u20ff",Ep=WT+HT+jT,Tp="\\u2700-\\u27bf",Bp="a-z\\xdf-\\xf6\\xf8-\\xff",qT="\\xac\\xb1\\xd7\\xf7",KT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",YT="\\u2000-\\u206f",JT=" \\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",Ap="A-Z\\xc0-\\xd6\\xd8-\\xde",Np="\\ufe0e\\ufe0f",Vp=qT+KT+YT+JT,Hl="['’]",XT="["+Is+"]",Pp="["+Vp+"]",Ls="["+Ep+"]",Dp="\\d+",QT="["+Tp+"]",Fp="["+Bp+"]",Rp="[^"+Is+Vp+Dp+Tp+Bp+Ap+"]",jl="\\ud83c[\\udffb-\\udfff]",eB="(?:"+Ls+"|"+jl+")",Mp="[^"+Is+"]",ql="(?:\\ud83c[\\udde6-\\uddff]){2}",Kl="[\\ud800-\\udbff][\\udc00-\\udfff]",Eo="["+Ap+"]",Ip="\\u200d",Lp="(?:"+Fp+"|"+Rp+")",tB="(?:"+Eo+"|"+Rp+")",Op="(?:"+Hl+"(?:d|ll|m|re|s|t|ve))?",Gp="(?:"+Hl+"(?:D|LL|M|RE|S|T|VE))?",zp=eB+"?",$p="["+Np+"]?",nB="(?:"+Ip+"(?:"+[Mp,ql,Kl].join("|")+")"+$p+zp+")*",rB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Zp=$p+zp+nB,iB="(?:"+[QT,ql,Kl].join("|")+")"+Zp,sB="(?:"+[Mp+Ls+"?",Ls,ql,Kl,XT].join("|")+")",aB=RegExp(Hl,"g"),lB=RegExp(Ls,"g"),Yl=RegExp(jl+"(?="+jl+")|"+sB+Zp,"g"),cB=RegExp([Eo+"?"+Fp+"+"+Op+"(?="+[Pp,Eo,"$"].join("|")+")",tB+"+"+Gp+"(?="+[Pp,Eo+Lp,"$"].join("|")+")",Eo+"?"+Lp+"+"+Op,Eo+"+"+Gp,oB,rB,Dp,iB].join("|"),"g"),dB=RegExp("["+Ip+Is+Ep+Np+"]"),uB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,pB=["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"],hB=-1,qe={};qe[Rl]=qe[Ml]=qe[Il]=qe[Ll]=qe[Ol]=qe[Gl]=qe[zl]=qe[$l]=qe[Zl]=!0,qe[$n]=qe[Wr]=qe[Mi]=qe[Ge]=qe[So]=qe[Cr]=qe[Ds]=qe[Fs]=qe[vn]=qe[Pi]=qe[Zn]=qe[Di]=qe[_n]=qe[Fi]=qe[Ri]=!1;var He={};He[$n]=He[Wr]=He[Mi]=He[So]=He[Ge]=He[Cr]=He[Rl]=He[Ml]=He[Il]=He[Ll]=He[Ol]=He[vn]=He[Pi]=He[Zn]=He[Di]=He[_n]=He[Fi]=He[Rs]=He[Gl]=He[zl]=He[$l]=He[Zl]=!0,He[Ds]=He[Fs]=He[Ri]=!1;var fB={À:"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"},mB={"&":"&","<":"<",">":">",'"':""","'":"'"},gB={"&":"&","<":"<",">":">",""":'"',"'":"'"},yB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},vB=parseFloat,_B=parseInt,Up=typeof Go=="object"&&Go&&Go.Object===Object&&Go,CB=typeof self=="object"&&self&&self.Object===Object&&self,ft=Up||CB||Function("return this")(),Jl=e&&!e.nodeType&&e,Hr=Jl&&!0&&t&&!t.nodeType&&t,Wp=Hr&&Hr.exports===Jl,Xl=Wp&&Up.process,Kt=function(){try{var F=Hr&&Hr.require&&Hr.require("util").types;return F||Xl&&Xl.binding&&Xl.binding("util")}catch{}}(),Hp=Kt&&Kt.isArrayBuffer,jp=Kt&&Kt.isDate,qp=Kt&&Kt.isMap,Kp=Kt&&Kt.isRegExp,Yp=Kt&&Kt.isSet,Jp=Kt&&Kt.isTypedArray;function Zt(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 wB(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 bB(F,H){for(var $=F==null?0:F.length;$--&&H(F[$],$,F)!==!1;);return F}function Xp(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!!$&&To(F,H,0)>-1}function Ql(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 ec(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 xB(F,H,$,ae){var xe=F==null?0:F.length;for(ae&&xe&&($=F[--xe]);xe--;)$=H($,F[xe],xe,F);return $}function tc(F,H){for(var $=-1,ae=F==null?0:F.length;++$<ae;)if(H(F[$],$,F))return!0;return!1}var kB=nc("length");function SB(F){return F.split("")}function EB(F){return F.match(FT)||[]}function Qp(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 To(F,H,$){return H===H?LB(F,H,$):Gs(F,eh,$)}function TB(F,H,$,ae){for(var xe=$-1,ze=F.length;++xe<ze;)if(ae(F[xe],H))return xe;return-1}function eh(F){return F!==F}function th(F,H){var $=F==null?0:F.length;return $?oc(F,H)/$:Bt}function nc(F){return function(H){return H==null?n:H[F]}}function rc(F){return function(H){return F==null?n:F[H]}}function nh(F,H,$,ae,xe){return xe(F,function(ze,at,We){$=ae?(ae=!1,ze):H($,ze,at,We)}),$}function BB(F,H){var $=F.length;for(F.sort(H);$--;)F[$]=F[$].value;return F}function oc(F,H){for(var $,ae=-1,xe=F.length;++ae<xe;){var ze=H(F[ae]);ze!==n&&($=$===n?ze:$+ze)}return $}function ic(F,H){for(var $=-1,ae=Array(F);++$<F;)ae[$]=H($);return ae}function AB(F,H){return Ye(H,function($){return[$,F[$]]})}function rh(F){return F&&F.slice(0,ah(F)+1).replace(Wl,"")}function Ut(F){return function(H){return F(H)}}function sc(F,H){return Ye(H,function($){return F[$]})}function Ii(F,H){return F.has(H)}function oh(F,H){for(var $=-1,ae=F.length;++$<ae&&To(H,F[$],0)>-1;);return $}function ih(F,H){for(var $=F.length;$--&&To(H,F[$],0)>-1;);return $}function NB(F,H){for(var $=F.length,ae=0;$--;)F[$]===H&&++ae;return ae}var VB=rc(fB),PB=rc(mB);function DB(F){return"\\"+yB[F]}function FB(F,H){return F==null?n:F[H]}function Bo(F){return dB.test(F)}function RB(F){return uB.test(F)}function MB(F){for(var H,$=[];!(H=F.next()).done;)$.push(H.value);return $}function ac(F){var H=-1,$=Array(F.size);return F.forEach(function(ae,xe){$[++H]=[xe,ae]}),$}function sh(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 IB(F){var H=-1,$=Array(F.size);return F.forEach(function(ae){$[++H]=[ae,ae]}),$}function LB(F,H,$){for(var ae=$-1,xe=F.length;++ae<xe;)if(F[ae]===H)return ae;return-1}function OB(F,H,$){for(var ae=$+1;ae--;)if(F[ae]===H)return ae;return ae}function Ao(F){return Bo(F)?zB(F):kB(F)}function Cn(F){return Bo(F)?$B(F):SB(F)}function ah(F){for(var H=F.length;H--&&NT.test(F.charAt(H)););return H}var GB=rc(gB);function zB(F){for(var H=Yl.lastIndex=0;Yl.test(F);)++H;return H}function $B(F){return F.match(Yl)||[]}function ZB(F){return F.match(cB)||[]}var UB=function F(H){H=H==null?ft:No.defaults(ft.Object(),H,No.pick(ft,pB));var $=H.Array,ae=H.Date,xe=H.Error,ze=H.Function,at=H.Math,We=H.Object,lc=H.RegExp,WB=H.String,Jt=H.TypeError,$s=$.prototype,HB=ze.prototype,Vo=We.prototype,Zs=H["__core-js_shared__"],Us=HB.toString,Ue=Vo.hasOwnProperty,jB=0,lh=function(){var i=/[^.]+$/.exec(Zs&&Zs.keys&&Zs.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Ws=Vo.toString,qB=Us.call(We),KB=ft._,YB=lc("^"+Us.call(Ue).replace(Ul,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hs=Wp?H.Buffer:n,kr=H.Symbol,js=H.Uint8Array,ch=Hs?Hs.allocUnsafe:n,qs=sh(We.getPrototypeOf,We),dh=We.create,uh=Vo.propertyIsEnumerable,Ks=$s.splice,ph=kr?kr.isConcatSpreadable:n,Li=kr?kr.iterator:n,jr=kr?kr.toStringTag:n,Ys=function(){try{var i=Xr(We,"defineProperty");return i({},"",{}),i}catch{}}(),JB=H.clearTimeout!==ft.clearTimeout&&H.clearTimeout,XB=ae&&ae.now!==ft.Date.now&&ae.now,QB=H.setTimeout!==ft.setTimeout&&H.setTimeout,Js=at.ceil,Xs=at.floor,cc=We.getOwnPropertySymbols,eA=Hs?Hs.isBuffer:n,hh=H.isFinite,tA=$s.join,nA=sh(We.keys,We),lt=at.max,wt=at.min,rA=ae.now,oA=H.parseInt,fh=at.random,iA=$s.reverse,dc=Xr(H,"DataView"),Oi=Xr(H,"Map"),uc=Xr(H,"Promise"),Po=Xr(H,"Set"),Gi=Xr(H,"WeakMap"),zi=Xr(We,"create"),Qs=Gi&&new Gi,Do={},sA=Qr(dc),aA=Qr(Oi),lA=Qr(uc),cA=Qr(Po),dA=Qr(Gi),ea=kr?kr.prototype:n,$i=ea?ea.valueOf:n,mh=ea?ea.toString:n;function v(i){if(et(i)&&!ke(i)&&!(i instanceof De)){if(i instanceof Xt)return i;if(Ue.call(i,"__wrapped__"))return yf(i)}return new Xt(i)}var Fo=function(){function i(){}return function(a){if(!Qe(a))return{};if(dh)return dh(a);i.prototype=a;var c=new i;return i.prototype=n,c}}();function ta(){}function Xt(i,a){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}v.templateSettings={escape:kT,evaluate:ST,interpolate:kp,variable:"",imports:{_:v}},v.prototype=ta.prototype,v.prototype.constructor=v,Xt.prototype=Fo(ta.prototype),Xt.prototype.constructor=Xt;function De(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ht,this.__views__=[]}function uA(){var i=new De(this.__wrapped__);return i.__actions__=Dt(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=Dt(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=Dt(this.__views__),i}function pA(){if(this.__filtered__){var i=new De(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function hA(){var i=this.__wrapped__.value(),a=this.__dir__,c=ke(i),h=a<0,g=c?i.length:0,_=SN(0,g,this.__views__),x=_.start,T=_.end,R=T-x,j=h?T:x-1,K=this.__iteratees__,J=K.length,ne=0,ce=wt(R,this.__takeCount__);if(!c||!h&&g==R&&ce==R)return Oh(i,this.__actions__);var me=[];e:for(;R--&&ne<ce;){j+=a;for(var Ne=-1,ge=i[j];++Ne<J;){var Pe=K[Ne],Fe=Pe.iteratee,jt=Pe.type,Vt=Fe(ge);if(jt==Z)ge=Vt;else if(!Vt){if(jt==A)continue e;break e}}me[ne++]=ge}return me}De.prototype=Fo(ta.prototype),De.prototype.constructor=De;function qr(i){var a=-1,c=i==null?0:i.length;for(this.clear();++a<c;){var h=i[a];this.set(h[0],h[1])}}function fA(){this.__data__=zi?zi(null):{},this.size=0}function mA(i){var a=this.has(i)&&delete this.__data__[i];return this.size-=a?1:0,a}function gA(i){var a=this.__data__;if(zi){var c=a[i];return c===p?n:c}return Ue.call(a,i)?a[i]:n}function yA(i){var a=this.__data__;return zi?a[i]!==n:Ue.call(a,i)}function vA(i,a){var c=this.__data__;return this.size+=this.has(i)?0:1,c[i]=zi&&a===n?p:a,this}qr.prototype.clear=fA,qr.prototype.delete=mA,qr.prototype.get=gA,qr.prototype.has=yA,qr.prototype.set=vA;function Un(i){var a=-1,c=i==null?0:i.length;for(this.clear();++a<c;){var h=i[a];this.set(h[0],h[1])}}function _A(){this.__data__=[],this.size=0}function CA(i){var a=this.__data__,c=na(a,i);if(c<0)return!1;var h=a.length-1;return c==h?a.pop():Ks.call(a,c,1),--this.size,!0}function wA(i){var a=this.__data__,c=na(a,i);return c<0?n:a[c][1]}function bA(i){return na(this.__data__,i)>-1}function xA(i,a){var c=this.__data__,h=na(c,i);return h<0?(++this.size,c.push([i,a])):c[h][1]=a,this}Un.prototype.clear=_A,Un.prototype.delete=CA,Un.prototype.get=wA,Un.prototype.has=bA,Un.prototype.set=xA;function Wn(i){var a=-1,c=i==null?0:i.length;for(this.clear();++a<c;){var h=i[a];this.set(h[0],h[1])}}function kA(){this.size=0,this.__data__={hash:new qr,map:new(Oi||Un),string:new qr}}function SA(i){var a=fa(this,i).delete(i);return this.size-=a?1:0,a}function EA(i){return fa(this,i).get(i)}function TA(i){return fa(this,i).has(i)}function BA(i,a){var c=fa(this,i),h=c.size;return c.set(i,a),this.size+=c.size==h?0:1,this}Wn.prototype.clear=kA,Wn.prototype.delete=SA,Wn.prototype.get=EA,Wn.prototype.has=TA,Wn.prototype.set=BA;function Kr(i){var a=-1,c=i==null?0:i.length;for(this.__data__=new Wn;++a<c;)this.add(i[a])}function AA(i){return this.__data__.set(i,p),this}function NA(i){return this.__data__.has(i)}Kr.prototype.add=Kr.prototype.push=AA,Kr.prototype.has=NA;function wn(i){var a=this.__data__=new Un(i);this.size=a.size}function VA(){this.__data__=new Un,this.size=0}function PA(i){var a=this.__data__,c=a.delete(i);return this.size=a.size,c}function DA(i){return this.__data__.get(i)}function FA(i){return this.__data__.has(i)}function RA(i,a){var c=this.__data__;if(c instanceof Un){var h=c.__data__;if(!Oi||h.length<s-1)return h.push([i,a]),this.size=++c.size,this;c=this.__data__=new Wn(h)}return c.set(i,a),this.size=c.size,this}wn.prototype.clear=VA,wn.prototype.delete=PA,wn.prototype.get=DA,wn.prototype.has=FA,wn.prototype.set=RA;function gh(i,a){var c=ke(i),h=!c&&eo(i),g=!c&&!h&&Ar(i),_=!c&&!h&&!g&&Lo(i),x=c||h||g||_,T=x?ic(i.length,WB):[],R=T.length;for(var j in i)(a||Ue.call(i,j))&&!(x&&(j=="length"||g&&(j=="offset"||j=="parent")||_&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||Kn(j,R)))&&T.push(j);return T}function yh(i){var a=i.length;return a?i[bc(0,a-1)]:n}function MA(i,a){return ma(Dt(i),Yr(a,0,i.length))}function IA(i){return ma(Dt(i))}function pc(i,a,c){(c!==n&&!bn(i[a],c)||c===n&&!(a in i))&&Hn(i,a,c)}function Zi(i,a,c){var h=i[a];(!(Ue.call(i,a)&&bn(h,c))||c===n&&!(a in i))&&Hn(i,a,c)}function na(i,a){for(var c=i.length;c--;)if(bn(i[c][0],a))return c;return-1}function LA(i,a,c,h){return Sr(i,function(g,_,x){a(h,g,c(g),x)}),h}function vh(i,a){return i&&Fn(a,pt(a),i)}function OA(i,a){return i&&Fn(a,Rt(a),i)}function Hn(i,a,c){a=="__proto__"&&Ys?Ys(i,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):i[a]=c}function hc(i,a){for(var c=-1,h=a.length,g=$(h),_=i==null;++c<h;)g[c]=_?n:jc(i,a[c]);return g}function Yr(i,a,c){return i===i&&(c!==n&&(i=i<=c?i:c),a!==n&&(i=i>=a?i:a)),i}function Qt(i,a,c,h,g,_){var x,T=a&y,R=a&E,j=a&k;if(c&&(x=g?c(i,h,g,_):c(i)),x!==n)return x;if(!Qe(i))return i;var K=ke(i);if(K){if(x=TN(i),!T)return Dt(i,x)}else{var J=bt(i),ne=J==Fs||J==Cp;if(Ar(i))return $h(i,T);if(J==Zn||J==$n||ne&&!g){if(x=R||ne?{}:lf(i),!T)return R?gN(i,OA(x,i)):mN(i,vh(x,i))}else{if(!He[J])return g?i:{};x=BN(i,J,T)}}_||(_=new wn);var ce=_.get(i);if(ce)return ce;_.set(i,x),If(i)?i.forEach(function(ge){x.add(Qt(ge,a,c,ge,i,_))}):Rf(i)&&i.forEach(function(ge,Pe){x.set(Pe,Qt(ge,a,c,Pe,i,_))});var me=j?R?Dc:Pc:R?Rt:pt,Ne=K?n:me(i);return Yt(Ne||i,function(ge,Pe){Ne&&(Pe=ge,ge=i[Pe]),Zi(x,Pe,Qt(ge,a,c,Pe,i,_))}),x}function GA(i){var a=pt(i);return function(c){return _h(c,i,a)}}function _h(i,a,c){var h=c.length;if(i==null)return!h;for(i=We(i);h--;){var g=c[h],_=a[g],x=i[g];if(x===n&&!(g in i)||!_(x))return!1}return!0}function Ch(i,a,c){if(typeof i!="function")throw new Jt(d);return Yi(function(){i.apply(n,c)},a)}function Ui(i,a,c,h){var g=-1,_=Os,x=!0,T=i.length,R=[],j=a.length;if(!T)return R;c&&(a=Ye(a,Ut(c))),h?(_=Ql,x=!1):a.length>=s&&(_=Ii,x=!1,a=new Kr(a));e:for(;++g<T;){var K=i[g],J=c==null?K:c(K);if(K=h||K!==0?K:0,x&&J===J){for(var ne=j;ne--;)if(a[ne]===J)continue e;R.push(K)}else _(a,J,h)||R.push(K)}return R}var Sr=jh(Dn),wh=jh(mc,!0);function zA(i,a){var c=!0;return Sr(i,function(h,g,_){return c=!!a(h,g,_),c}),c}function ra(i,a,c){for(var h=-1,g=i.length;++h<g;){var _=i[h],x=a(_);if(x!=null&&(T===n?x===x&&!Ht(x):c(x,T)))var T=x,R=_}return R}function $A(i,a,c,h){var g=i.length;for(c=Te(c),c<0&&(c=-c>g?0:g+c),h=h===n||h>g?g:Te(h),h<0&&(h+=g),h=c>h?0:Of(h);c<h;)i[c++]=a;return i}function bh(i,a){var c=[];return Sr(i,function(h,g,_){a(h,g,_)&&c.push(h)}),c}function mt(i,a,c,h,g){var _=-1,x=i.length;for(c||(c=NN),g||(g=[]);++_<x;){var T=i[_];a>0&&c(T)?a>1?mt(T,a-1,c,h,g):br(g,T):h||(g[g.length]=T)}return g}var fc=qh(),xh=qh(!0);function Dn(i,a){return i&&fc(i,a,pt)}function mc(i,a){return i&&xh(i,a,pt)}function oa(i,a){return wr(a,function(c){return Yn(i[c])})}function Jr(i,a){a=Tr(a,i);for(var c=0,h=a.length;i!=null&&c<h;)i=i[Rn(a[c++])];return c&&c==h?i:n}function kh(i,a,c){var h=a(i);return ke(i)?h:br(h,c(i))}function At(i){return i==null?i===n?yT:mT:jr&&jr in We(i)?kN(i):IN(i)}function gc(i,a){return i>a}function ZA(i,a){return i!=null&&Ue.call(i,a)}function UA(i,a){return i!=null&&a in We(i)}function WA(i,a,c){return i>=wt(a,c)&&i<lt(a,c)}function yc(i,a,c){for(var h=c?Ql:Os,g=i[0].length,_=i.length,x=_,T=$(_),R=1/0,j=[];x--;){var K=i[x];x&&a&&(K=Ye(K,Ut(a))),R=wt(K.length,R),T[x]=!c&&(a||g>=120&&K.length>=120)?new Kr(x&&K):n}K=i[0];var J=-1,ne=T[0];e:for(;++J<g&&j.length<R;){var ce=K[J],me=a?a(ce):ce;if(ce=c||ce!==0?ce:0,!(ne?Ii(ne,me):h(j,me,c))){for(x=_;--x;){var Ne=T[x];if(!(Ne?Ii(Ne,me):h(i[x],me,c)))continue e}ne&&ne.push(me),j.push(ce)}}return j}function HA(i,a,c,h){return Dn(i,function(g,_,x){a(h,c(g),_,x)}),h}function Wi(i,a,c){a=Tr(a,i),i=pf(i,a);var h=i==null?i:i[Rn(tn(a))];return h==null?n:Zt(h,i,c)}function Sh(i){return et(i)&&At(i)==$n}function jA(i){return et(i)&&At(i)==Mi}function qA(i){return et(i)&&At(i)==Cr}function Hi(i,a,c,h,g){return i===a?!0:i==null||a==null||!et(i)&&!et(a)?i!==i&&a!==a:KA(i,a,c,h,Hi,g)}function KA(i,a,c,h,g,_){var x=ke(i),T=ke(a),R=x?Wr:bt(i),j=T?Wr:bt(a);R=R==$n?Zn:R,j=j==$n?Zn:j;var K=R==Zn,J=j==Zn,ne=R==j;if(ne&&Ar(i)){if(!Ar(a))return!1;x=!0,K=!1}if(ne&&!K)return _||(_=new wn),x||Lo(i)?of(i,a,c,h,g,_):bN(i,a,R,c,h,g,_);if(!(c&D)){var ce=K&&Ue.call(i,"__wrapped__"),me=J&&Ue.call(a,"__wrapped__");if(ce||me){var Ne=ce?i.value():i,ge=me?a.value():a;return _||(_=new wn),g(Ne,ge,c,h,_)}}return ne?(_||(_=new wn),xN(i,a,c,h,g,_)):!1}function YA(i){return et(i)&&bt(i)==vn}function vc(i,a,c,h){var g=c.length,_=g,x=!h;if(i==null)return!_;for(i=We(i);g--;){var T=c[g];if(x&&T[2]?T[1]!==i[T[0]]:!(T[0]in i))return!1}for(;++g<_;){T=c[g];var R=T[0],j=i[R],K=T[1];if(x&&T[2]){if(j===n&&!(R in i))return!1}else{var J=new wn;if(h)var ne=h(j,K,R,i,a,J);if(!(ne===n?Hi(K,j,D|M,h,J):ne))return!1}}return!0}function Eh(i){if(!Qe(i)||PN(i))return!1;var a=Yn(i)?YB:GT;return a.test(Qr(i))}function JA(i){return et(i)&&At(i)==Di}function XA(i){return et(i)&&bt(i)==_n}function QA(i){return et(i)&&wa(i.length)&&!!qe[At(i)]}function Th(i){return typeof i=="function"?i:i==null?Mt:typeof i=="object"?ke(i)?Nh(i[0],i[1]):Ah(i):Yf(i)}function _c(i){if(!Ki(i))return nA(i);var a=[];for(var c in We(i))Ue.call(i,c)&&c!="constructor"&&a.push(c);return a}function eN(i){if(!Qe(i))return MN(i);var a=Ki(i),c=[];for(var h in i)h=="constructor"&&(a||!Ue.call(i,h))||c.push(h);return c}function Cc(i,a){return i<a}function Bh(i,a){var c=-1,h=Ft(i)?$(i.length):[];return Sr(i,function(g,_,x){h[++c]=a(g,_,x)}),h}function Ah(i){var a=Rc(i);return a.length==1&&a[0][2]?df(a[0][0],a[0][1]):function(c){return c===i||vc(c,i,a)}}function Nh(i,a){return Ic(i)&&cf(a)?df(Rn(i),a):function(c){var h=jc(c,i);return h===n&&h===a?qc(c,i):Hi(a,h,D|M)}}function ia(i,a,c,h,g){i!==a&&fc(a,function(_,x){if(g||(g=new wn),Qe(_))tN(i,a,x,c,ia,h,g);else{var T=h?h(Oc(i,x),_,x+"",i,a,g):n;T===n&&(T=_),pc(i,x,T)}},Rt)}function tN(i,a,c,h,g,_,x){var T=Oc(i,c),R=Oc(a,c),j=x.get(R);if(j){pc(i,c,j);return}var K=_?_(T,R,c+"",i,a,x):n,J=K===n;if(J){var ne=ke(R),ce=!ne&&Ar(R),me=!ne&&!ce&&Lo(R);K=R,ne||ce||me?ke(T)?K=T:nt(T)?K=Dt(T):ce?(J=!1,K=$h(R,!0)):me?(J=!1,K=Zh(R,!0)):K=[]:Ji(R)||eo(R)?(K=T,eo(T)?K=Gf(T):(!Qe(T)||Yn(T))&&(K=lf(R))):J=!1}J&&(x.set(R,K),g(K,R,h,_,x),x.delete(R)),pc(i,c,K)}function Vh(i,a){var c=i.length;if(c)return a+=a<0?c:0,Kn(a,c)?i[a]:n}function Ph(i,a,c){a.length?a=Ye(a,function(_){return ke(_)?function(x){return Jr(x,_.length===1?_[0]:_)}:_}):a=[Mt];var h=-1;a=Ye(a,Ut(he()));var g=Bh(i,function(_,x,T){var R=Ye(a,function(j){return j(_)});return{criteria:R,index:++h,value:_}});return BB(g,function(_,x){return fN(_,x,c)})}function nN(i,a){return Dh(i,a,function(c,h){return qc(i,h)})}function Dh(i,a,c){for(var h=-1,g=a.length,_={};++h<g;){var x=a[h],T=Jr(i,x);c(T,x)&&ji(_,Tr(x,i),T)}return _}function rN(i){return function(a){return Jr(a,i)}}function wc(i,a,c,h){var g=h?TB:To,_=-1,x=a.length,T=i;for(i===a&&(a=Dt(a)),c&&(T=Ye(i,Ut(c)));++_<x;)for(var R=0,j=a[_],K=c?c(j):j;(R=g(T,K,R,h))>-1;)T!==i&&Ks.call(T,R,1),Ks.call(i,R,1);return i}function Fh(i,a){for(var c=i?a.length:0,h=c-1;c--;){var g=a[c];if(c==h||g!==_){var _=g;Kn(g)?Ks.call(i,g,1):Sc(i,g)}}return i}function bc(i,a){return i+Xs(fh()*(a-i+1))}function oN(i,a,c,h){for(var g=-1,_=lt(Js((a-i)/(c||1)),0),x=$(_);_--;)x[h?_:++g]=i,i+=c;return x}function xc(i,a){var c="";if(!i||a<1||a>we)return c;do a%2&&(c+=i),a=Xs(a/2),a&&(i+=i);while(a);return c}function Ve(i,a){return Gc(uf(i,a,Mt),i+"")}function iN(i){return yh(Oo(i))}function sN(i,a){var c=Oo(i);return ma(c,Yr(a,0,c.length))}function ji(i,a,c,h){if(!Qe(i))return i;a=Tr(a,i);for(var g=-1,_=a.length,x=_-1,T=i;T!=null&&++g<_;){var R=Rn(a[g]),j=c;if(R==="__proto__"||R==="constructor"||R==="prototype")return i;if(g!=x){var K=T[R];j=h?h(K,R,T):n,j===n&&(j=Qe(K)?K:Kn(a[g+1])?[]:{})}Zi(T,R,j),T=T[R]}return i}var Rh=Qs?function(i,a){return Qs.set(i,a),i}:Mt,aN=Ys?function(i,a){return Ys(i,"toString",{configurable:!0,enumerable:!1,value:Yc(a),writable:!0})}:Mt;function lN(i){return ma(Oo(i))}function en(i,a,c){var h=-1,g=i.length;a<0&&(a=-a>g?0:g+a),c=c>g?g:c,c<0&&(c+=g),g=a>c?0:c-a>>>0,a>>>=0;for(var _=$(g);++h<g;)_[h]=i[h+a];return _}function cN(i,a){var c;return Sr(i,function(h,g,_){return c=a(h,g,_),!c}),!!c}function sa(i,a,c){var h=0,g=i==null?h:i.length;if(typeof a=="number"&&a===a&&g<=Pn){for(;h<g;){var _=h+g>>>1,x=i[_];x!==null&&!Ht(x)&&(c?x<=a:x<a)?h=_+1:g=_}return g}return kc(i,a,Mt,c)}function kc(i,a,c,h){var g=0,_=i==null?0:i.length;if(_===0)return 0;a=c(a);for(var x=a!==a,T=a===null,R=Ht(a),j=a===n;g<_;){var K=Xs((g+_)/2),J=c(i[K]),ne=J!==n,ce=J===null,me=J===J,Ne=Ht(J);if(x)var ge=h||me;else j?ge=me&&(h||ne):T?ge=me&&ne&&(h||!ce):R?ge=me&&ne&&!ce&&(h||!Ne):ce||Ne?ge=!1:ge=h?J<=a:J<a;ge?g=K+1:_=K}return wt(_,vr)}function Mh(i,a){for(var c=-1,h=i.length,g=0,_=[];++c<h;){var x=i[c],T=a?a(x):x;if(!c||!bn(T,R)){var R=T;_[g++]=x===0?0:x}}return _}function Ih(i){return typeof i=="number"?i:Ht(i)?Bt:+i}function Wt(i){if(typeof i=="string")return i;if(ke(i))return Ye(i,Wt)+"";if(Ht(i))return mh?mh.call(i):"";var a=i+"";return a=="0"&&1/i==-pe?"-0":a}function Er(i,a,c){var h=-1,g=Os,_=i.length,x=!0,T=[],R=T;if(c)x=!1,g=Ql;else if(_>=s){var j=a?null:CN(i);if(j)return zs(j);x=!1,g=Ii,R=new Kr}else R=a?[]:T;e:for(;++h<_;){var K=i[h],J=a?a(K):K;if(K=c||K!==0?K:0,x&&J===J){for(var ne=R.length;ne--;)if(R[ne]===J)continue e;a&&R.push(J),T.push(K)}else g(R,J,c)||(R!==T&&R.push(J),T.push(K))}return T}function Sc(i,a){return a=Tr(a,i),i=pf(i,a),i==null||delete i[Rn(tn(a))]}function Lh(i,a,c,h){return ji(i,a,c(Jr(i,a)),h)}function aa(i,a,c,h){for(var g=i.length,_=h?g:-1;(h?_--:++_<g)&&a(i[_],_,i););return c?en(i,h?0:_,h?_+1:g):en(i,h?_+1:0,h?g:_)}function Oh(i,a){var c=i;return c instanceof De&&(c=c.value()),ec(a,function(h,g){return g.func.apply(g.thisArg,br([h],g.args))},c)}function Ec(i,a,c){var h=i.length;if(h<2)return h?Er(i[0]):[];for(var g=-1,_=$(h);++g<h;)for(var x=i[g],T=-1;++T<h;)T!=g&&(_[g]=Ui(_[g]||x,i[T],a,c));return Er(mt(_,1),a,c)}function Gh(i,a,c){for(var h=-1,g=i.length,_=a.length,x={};++h<g;){var T=h<_?a[h]:n;c(x,i[h],T)}return x}function Tc(i){return nt(i)?i:[]}function Bc(i){return typeof i=="function"?i:Mt}function Tr(i,a){return ke(i)?i:Ic(i,a)?[i]:gf(Ze(i))}var dN=Ve;function Br(i,a,c){var h=i.length;return c=c===n?h:c,!a&&c>=h?i:en(i,a,c)}var zh=JB||function(i){return ft.clearTimeout(i)};function $h(i,a){if(a)return i.slice();var c=i.length,h=ch?ch(c):new i.constructor(c);return i.copy(h),h}function Ac(i){var a=new i.constructor(i.byteLength);return new js(a).set(new js(i)),a}function uN(i,a){var c=a?Ac(i.buffer):i.buffer;return new i.constructor(c,i.byteOffset,i.byteLength)}function pN(i){var a=new i.constructor(i.source,Sp.exec(i));return a.lastIndex=i.lastIndex,a}function hN(i){return $i?We($i.call(i)):{}}function Zh(i,a){var c=a?Ac(i.buffer):i.buffer;return new i.constructor(c,i.byteOffset,i.length)}function Uh(i,a){if(i!==a){var c=i!==n,h=i===null,g=i===i,_=Ht(i),x=a!==n,T=a===null,R=a===a,j=Ht(a);if(!T&&!j&&!_&&i>a||_&&x&&R&&!T&&!j||h&&x&&R||!c&&R||!g)return 1;if(!h&&!_&&!j&&i<a||j&&c&&g&&!h&&!_||T&&c&&g||!x&&g||!R)return-1}return 0}function fN(i,a,c){for(var h=-1,g=i.criteria,_=a.criteria,x=g.length,T=c.length;++h<x;){var R=Uh(g[h],_[h]);if(R){if(h>=T)return R;var j=c[h];return R*(j=="desc"?-1:1)}}return i.index-a.index}function Wh(i,a,c,h){for(var g=-1,_=i.length,x=c.length,T=-1,R=a.length,j=lt(_-x,0),K=$(R+j),J=!h;++T<R;)K[T]=a[T];for(;++g<x;)(J||g<_)&&(K[c[g]]=i[g]);for(;j--;)K[T++]=i[g++];return K}function Hh(i,a,c,h){for(var g=-1,_=i.length,x=-1,T=c.length,R=-1,j=a.length,K=lt(_-T,0),J=$(K+j),ne=!h;++g<K;)J[g]=i[g];for(var ce=g;++R<j;)J[ce+R]=a[R];for(;++x<T;)(ne||g<_)&&(J[ce+c[x]]=i[g++]);return J}function Dt(i,a){var c=-1,h=i.length;for(a||(a=$(h));++c<h;)a[c]=i[c];return a}function Fn(i,a,c,h){var g=!c;c||(c={});for(var _=-1,x=a.length;++_<x;){var T=a[_],R=h?h(c[T],i[T],T,c,i):n;R===n&&(R=i[T]),g?Hn(c,T,R):Zi(c,T,R)}return c}function mN(i,a){return Fn(i,Mc(i),a)}function gN(i,a){return Fn(i,sf(i),a)}function la(i,a){return function(c,h){var g=ke(c)?wB:LA,_=a?a():{};return g(c,i,he(h,2),_)}}function Ro(i){return Ve(function(a,c){var h=-1,g=c.length,_=g>1?c[g-1]:n,x=g>2?c[2]:n;for(_=i.length>3&&typeof _=="function"?(g--,_):n,x&&Nt(c[0],c[1],x)&&(_=g<3?n:_,g=1),a=We(a);++h<g;){var T=c[h];T&&i(a,T,h,_)}return a})}function jh(i,a){return function(c,h){if(c==null)return c;if(!Ft(c))return i(c,h);for(var g=c.length,_=a?g:-1,x=We(c);(a?_--:++_<g)&&h(x[_],_,x)!==!1;);return c}}function qh(i){return function(a,c,h){for(var g=-1,_=We(a),x=h(a),T=x.length;T--;){var R=x[i?T:++g];if(c(_[R],R,_)===!1)break}return a}}function yN(i,a,c){var h=a&G,g=qi(i);function _(){var x=this&&this!==ft&&this instanceof _?g:i;return x.apply(h?c:this,arguments)}return _}function Kh(i){return function(a){a=Ze(a);var c=Bo(a)?Cn(a):n,h=c?c[0]:a.charAt(0),g=c?Br(c,1).join(""):a.slice(1);return h[i]()+g}}function Mo(i){return function(a){return ec(qf(jf(a).replace(aB,"")),i,"")}}function qi(i){return function(){var a=arguments;switch(a.length){case 0:return new i;case 1:return new i(a[0]);case 2:return new i(a[0],a[1]);case 3:return new i(a[0],a[1],a[2]);case 4:return new i(a[0],a[1],a[2],a[3]);case 5:return new i(a[0],a[1],a[2],a[3],a[4]);case 6:return new i(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new i(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var c=Fo(i.prototype),h=i.apply(c,a);return Qe(h)?h:c}}function vN(i,a,c){var h=qi(i);function g(){for(var _=arguments.length,x=$(_),T=_,R=Io(g);T--;)x[T]=arguments[T];var j=_<3&&x[0]!==R&&x[_-1]!==R?[]:xr(x,R);if(_-=j.length,_<c)return ef(i,a,ca,g.placeholder,n,x,j,n,n,c-_);var K=this&&this!==ft&&this instanceof g?h:i;return Zt(K,this,x)}return g}function Yh(i){return function(a,c,h){var g=We(a);if(!Ft(a)){var _=he(c,3);a=pt(a),c=function(T){return _(g[T],T,g)}}var x=i(a,c,h);return x>-1?g[_?a[x]:x]:n}}function Jh(i){return qn(function(a){var c=a.length,h=c,g=Xt.prototype.thru;for(i&&a.reverse();h--;){var _=a[h];if(typeof _!="function")throw new Jt(d);if(g&&!x&&ha(_)=="wrapper")var x=new Xt([],!0)}for(h=x?h:c;++h<c;){_=a[h];var T=ha(_),R=T=="wrapper"?Fc(_):n;R&&Lc(R[0])&&R[1]==(z|Y|P|N)&&!R[4].length&&R[9]==1?x=x[ha(R[0])].apply(x,R[3]):x=_.length==1&&Lc(_)?x[T]():x.thru(_)}return function(){var j=arguments,K=j[0];if(x&&j.length==1&&ke(K))return x.plant(K).value();for(var J=0,ne=c?a[J].apply(this,j):K;++J<c;)ne=a[J].call(this,ne);return ne}})}function ca(i,a,c,h,g,_,x,T,R,j){var K=a&z,J=a&G,ne=a&C,ce=a&(Y|L),me=a&S,Ne=ne?n:qi(i);function ge(){for(var Pe=arguments.length,Fe=$(Pe),jt=Pe;jt--;)Fe[jt]=arguments[jt];if(ce)var Vt=Io(ge),qt=NB(Fe,Vt);if(h&&(Fe=Wh(Fe,h,g,ce)),_&&(Fe=Hh(Fe,_,x,ce)),Pe-=qt,ce&&Pe<j){var rt=xr(Fe,Vt);return ef(i,a,ca,ge.placeholder,c,Fe,rt,T,R,j-Pe)}var xn=J?c:this,Xn=ne?xn[i]:i;return Pe=Fe.length,T?Fe=LN(Fe,T):me&&Pe>1&&Fe.reverse(),K&&R<Pe&&(Fe.length=R),this&&this!==ft&&this instanceof ge&&(Xn=Ne||qi(Xn)),Xn.apply(xn,Fe)}return ge}function Xh(i,a){return function(c,h){return HA(c,i,a(h),{})}}function da(i,a){return function(c,h){var g;if(c===n&&h===n)return a;if(c!==n&&(g=c),h!==n){if(g===n)return h;typeof c=="string"||typeof h=="string"?(c=Wt(c),h=Wt(h)):(c=Ih(c),h=Ih(h)),g=i(c,h)}return g}}function Nc(i){return qn(function(a){return a=Ye(a,Ut(he())),Ve(function(c){var h=this;return i(a,function(g){return Zt(g,h,c)})})})}function ua(i,a){a=a===n?" ":Wt(a);var c=a.length;if(c<2)return c?xc(a,i):a;var h=xc(a,Js(i/Ao(a)));return Bo(a)?Br(Cn(h),0,i).join(""):h.slice(0,i)}function _N(i,a,c,h){var g=a&G,_=qi(i);function x(){for(var T=-1,R=arguments.length,j=-1,K=h.length,J=$(K+R),ne=this&&this!==ft&&this instanceof x?_:i;++j<K;)J[j]=h[j];for(;R--;)J[j++]=arguments[++T];return Zt(ne,g?c:this,J)}return x}function Qh(i){return function(a,c,h){return h&&typeof h!="number"&&Nt(a,c,h)&&(c=h=n),a=Jn(a),c===n?(c=a,a=0):c=Jn(c),h=h===n?a<c?1:-1:Jn(h),oN(a,c,h,i)}}function pa(i){return function(a,c){return typeof a=="string"&&typeof c=="string"||(a=nn(a),c=nn(c)),i(a,c)}}function ef(i,a,c,h,g,_,x,T,R,j){var K=a&Y,J=K?x:n,ne=K?n:x,ce=K?_:n,me=K?n:_;a|=K?P:O,a&=~(K?O:P),a&B||(a&=~(G|C));var Ne=[i,a,g,ce,J,me,ne,T,R,j],ge=c.apply(n,Ne);return Lc(i)&&hf(ge,Ne),ge.placeholder=h,ff(ge,i,a)}function Vc(i){var a=at[i];return function(c,h){if(c=nn(c),h=h==null?0:wt(Te(h),292),h&&hh(c)){var g=(Ze(c)+"e").split("e"),_=a(g[0]+"e"+(+g[1]+h));return g=(Ze(_)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(c)}}var CN=Po&&1/zs(new Po([,-0]))[1]==pe?function(i){return new Po(i)}:Qc;function tf(i){return function(a){var c=bt(a);return c==vn?ac(a):c==_n?IB(a):AB(a,i(a))}}function jn(i,a,c,h,g,_,x,T){var R=a&C;if(!R&&typeof i!="function")throw new Jt(d);var j=h?h.length:0;if(j||(a&=~(P|O),h=g=n),x=x===n?x:lt(Te(x),0),T=T===n?T:Te(T),j-=g?g.length:0,a&O){var K=h,J=g;h=g=n}var ne=R?n:Fc(i),ce=[i,a,c,h,g,K,J,_,x,T];if(ne&&RN(ce,ne),i=ce[0],a=ce[1],c=ce[2],h=ce[3],g=ce[4],T=ce[9]=ce[9]===n?R?0:i.length:lt(ce[9]-j,0),!T&&a&(Y|L)&&(a&=~(Y|L)),!a||a==G)var me=yN(i,a,c);else a==Y||a==L?me=vN(i,a,T):(a==P||a==(G|P))&&!g.length?me=_N(i,a,c,h):me=ca.apply(n,ce);var Ne=ne?Rh:hf;return ff(Ne(me,ce),i,a)}function nf(i,a,c,h){return i===n||bn(i,Vo[c])&&!Ue.call(h,c)?a:i}function rf(i,a,c,h,g,_){return Qe(i)&&Qe(a)&&(_.set(a,i),ia(i,a,n,rf,_),_.delete(a)),i}function wN(i){return Ji(i)?n:i}function of(i,a,c,h,g,_){var x=c&D,T=i.length,R=a.length;if(T!=R&&!(x&&R>T))return!1;var j=_.get(i),K=_.get(a);if(j&&K)return j==a&&K==i;var J=-1,ne=!0,ce=c&M?new Kr:n;for(_.set(i,a),_.set(a,i);++J<T;){var me=i[J],Ne=a[J];if(h)var ge=x?h(Ne,me,J,a,i,_):h(me,Ne,J,i,a,_);if(ge!==n){if(ge)continue;ne=!1;break}if(ce){if(!tc(a,function(Pe,Fe){if(!Ii(ce,Fe)&&(me===Pe||g(me,Pe,c,h,_)))return ce.push(Fe)})){ne=!1;break}}else if(!(me===Ne||g(me,Ne,c,h,_))){ne=!1;break}}return _.delete(i),_.delete(a),ne}function bN(i,a,c,h,g,_,x){switch(c){case So:if(i.byteLength!=a.byteLength||i.byteOffset!=a.byteOffset)return!1;i=i.buffer,a=a.buffer;case Mi:return!(i.byteLength!=a.byteLength||!_(new js(i),new js(a)));case Ge:case Cr:case Pi:return bn(+i,+a);case Ds:return i.name==a.name&&i.message==a.message;case Di:case Fi:return i==a+"";case vn:var T=ac;case _n:var R=h&D;if(T||(T=zs),i.size!=a.size&&!R)return!1;var j=x.get(i);if(j)return j==a;h|=M,x.set(i,a);var K=of(T(i),T(a),h,g,_,x);return x.delete(i),K;case Rs:if($i)return $i.call(i)==$i.call(a)}return!1}function xN(i,a,c,h,g,_){var x=c&D,T=Pc(i),R=T.length,j=Pc(a),K=j.length;if(R!=K&&!x)return!1;for(var J=R;J--;){var ne=T[J];if(!(x?ne in a:Ue.call(a,ne)))return!1}var ce=_.get(i),me=_.get(a);if(ce&&me)return ce==a&&me==i;var Ne=!0;_.set(i,a),_.set(a,i);for(var ge=x;++J<R;){ne=T[J];var Pe=i[ne],Fe=a[ne];if(h)var jt=x?h(Fe,Pe,ne,a,i,_):h(Pe,Fe,ne,i,a,_);if(!(jt===n?Pe===Fe||g(Pe,Fe,c,h,_):jt)){Ne=!1;break}ge||(ge=ne=="constructor")}if(Ne&&!ge){var Vt=i.constructor,qt=a.constructor;Vt!=qt&&"constructor"in i&&"constructor"in a&&!(typeof Vt=="function"&&Vt instanceof Vt&&typeof qt=="function"&&qt instanceof qt)&&(Ne=!1)}return _.delete(i),_.delete(a),Ne}function qn(i){return Gc(uf(i,n,Cf),i+"")}function Pc(i){return kh(i,pt,Mc)}function Dc(i){return kh(i,Rt,sf)}var Fc=Qs?function(i){return Qs.get(i)}:Qc;function ha(i){for(var a=i.name+"",c=Do[a],h=Ue.call(Do,a)?c.length:0;h--;){var g=c[h],_=g.func;if(_==null||_==i)return g.name}return a}function Io(i){var a=Ue.call(v,"placeholder")?v:i;return a.placeholder}function he(){var i=v.iteratee||Jc;return i=i===Jc?Th:i,arguments.length?i(arguments[0],arguments[1]):i}function fa(i,a){var c=i.__data__;return VN(a)?c[typeof a=="string"?"string":"hash"]:c.map}function Rc(i){for(var a=pt(i),c=a.length;c--;){var h=a[c],g=i[h];a[c]=[h,g,cf(g)]}return a}function Xr(i,a){var c=FB(i,a);return Eh(c)?c:n}function kN(i){var a=Ue.call(i,jr),c=i[jr];try{i[jr]=n;var h=!0}catch{}var g=Ws.call(i);return h&&(a?i[jr]=c:delete i[jr]),g}var Mc=cc?function(i){return i==null?[]:(i=We(i),wr(cc(i),function(a){return uh.call(i,a)}))}:ed,sf=cc?function(i){for(var a=[];i;)br(a,Mc(i)),i=qs(i);return a}:ed,bt=At;(dc&&bt(new dc(new ArrayBuffer(1)))!=So||Oi&&bt(new Oi)!=vn||uc&&bt(uc.resolve())!=wp||Po&&bt(new Po)!=_n||Gi&&bt(new Gi)!=Ri)&&(bt=function(i){var a=At(i),c=a==Zn?i.constructor:n,h=c?Qr(c):"";if(h)switch(h){case sA:return So;case aA:return vn;case lA:return wp;case cA:return _n;case dA:return Ri}return a});function SN(i,a,c){for(var h=-1,g=c.length;++h<g;){var _=c[h],x=_.size;switch(_.type){case"drop":i+=x;break;case"dropRight":a-=x;break;case"take":a=wt(a,i+x);break;case"takeRight":i=lt(i,a-x);break}}return{start:i,end:a}}function EN(i){var a=i.match(PT);return a?a[1].split(DT):[]}function af(i,a,c){a=Tr(a,i);for(var h=-1,g=a.length,_=!1;++h<g;){var x=Rn(a[h]);if(!(_=i!=null&&c(i,x)))break;i=i[x]}return _||++h!=g?_:(g=i==null?0:i.length,!!g&&wa(g)&&Kn(x,g)&&(ke(i)||eo(i)))}function TN(i){var a=i.length,c=new i.constructor(a);return a&&typeof i[0]=="string"&&Ue.call(i,"index")&&(c.index=i.index,c.input=i.input),c}function lf(i){return typeof i.constructor=="function"&&!Ki(i)?Fo(qs(i)):{}}function BN(i,a,c){var h=i.constructor;switch(a){case Mi:return Ac(i);case Ge:case Cr:return new h(+i);case So:return uN(i,c);case Rl:case Ml:case Il:case Ll:case Ol:case Gl:case zl:case $l:case Zl:return Zh(i,c);case vn:return new h;case Pi:case Fi:return new h(i);case Di:return pN(i);case _n:return new h;case Rs:return hN(i)}}function AN(i,a){var c=a.length;if(!c)return i;var h=c-1;return a[h]=(c>1?"& ":"")+a[h],a=a.join(c>2?", ":" "),i.replace(VT,`{
|
|
71
73
|
/* [wrapped with `+a+`] */
|
|
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
|
-
`;
|
|
74
|
+
`)}function NN(i){return ke(i)||eo(i)||!!(ph&&i&&i[ph])}function Kn(i,a){var c=typeof i;return a=a??we,!!a&&(c=="number"||c!="symbol"&&$T.test(i))&&i>-1&&i%1==0&&i<a}function Nt(i,a,c){if(!Qe(c))return!1;var h=typeof a;return(h=="number"?Ft(c)&&Kn(a,c.length):h=="string"&&a in c)?bn(c[a],i):!1}function Ic(i,a){if(ke(i))return!1;var c=typeof i;return c=="number"||c=="symbol"||c=="boolean"||i==null||Ht(i)?!0:TT.test(i)||!ET.test(i)||a!=null&&i in We(a)}function VN(i){var a=typeof i;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?i!=="__proto__":i===null}function Lc(i){var a=ha(i),c=v[a];if(typeof c!="function"||!(a in De.prototype))return!1;if(i===c)return!0;var h=Fc(c);return!!h&&i===h[0]}function PN(i){return!!lh&&lh in i}var DN=Zs?Yn:td;function Ki(i){var a=i&&i.constructor,c=typeof a=="function"&&a.prototype||Vo;return i===c}function cf(i){return i===i&&!Qe(i)}function df(i,a){return function(c){return c==null?!1:c[i]===a&&(a!==n||i in We(c))}}function FN(i){var a=_a(i,function(h){return c.size===f&&c.clear(),h}),c=a.cache;return a}function RN(i,a){var c=i[1],h=a[1],g=c|h,_=g<(G|C|z),x=h==z&&c==Y||h==z&&c==N&&i[7].length<=a[8]||h==(z|N)&&a[7].length<=a[8]&&c==Y;if(!(_||x))return i;h&G&&(i[2]=a[2],g|=c&G?0:B);var T=a[3];if(T){var R=i[3];i[3]=R?Wh(R,T,a[4]):T,i[4]=R?xr(i[3],m):a[4]}return T=a[5],T&&(R=i[5],i[5]=R?Hh(R,T,a[6]):T,i[6]=R?xr(i[5],m):a[6]),T=a[7],T&&(i[7]=T),h&z&&(i[8]=i[8]==null?a[8]:wt(i[8],a[8])),i[9]==null&&(i[9]=a[9]),i[0]=a[0],i[1]=g,i}function MN(i){var a=[];if(i!=null)for(var c in We(i))a.push(c);return a}function IN(i){return Ws.call(i)}function uf(i,a,c){return a=lt(a===n?i.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 T=$(a+1);++g<a;)T[g]=h[g];return T[a]=c(x),Zt(i,this,T)}}function pf(i,a){return a.length<2?i:Jr(i,en(a,0,-1))}function LN(i,a){for(var c=i.length,h=wt(a.length,c),g=Dt(i);h--;){var _=a[h];i[h]=Kn(_,c)?g[_]:n}return i}function Oc(i,a){if(!(a==="constructor"&&typeof i[a]=="function")&&a!="__proto__")return i[a]}var hf=mf(Rh),Yi=QB||function(i,a){return ft.setTimeout(i,a)},Gc=mf(aN);function ff(i,a,c){var h=a+"";return Gc(i,AN(h,ON(EN(h),c)))}function mf(i){var a=0,c=0;return function(){var h=rA(),g=U-(h-c);if(c=h,g>0){if(++a>=q)return arguments[0]}else a=0;return i.apply(n,arguments)}}function ma(i,a){var c=-1,h=i.length,g=h-1;for(a=a===n?h:a;++c<a;){var _=bc(c,g),x=i[_];i[_]=i[c],i[c]=x}return i.length=a,i}var gf=FN(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(BT,function(c,h,g,_){a.push(g?_.replace(MT,"$1"):h||c)}),a});function Rn(i){if(typeof i=="string"||Ht(i))return i;var a=i+"";return a=="0"&&1/i==-pe?"-0":a}function Qr(i){if(i!=null){try{return Us.call(i)}catch{}try{return i+""}catch{}}return""}function ON(i,a){return Yt(_r,function(c){var h="_."+c[0];a&c[1]&&!Os(i,h)&&i.push(h)}),i.sort()}function yf(i){if(i instanceof De)return i.clone();var a=new Xt(i.__wrapped__,i.__chain__);return a.__actions__=Dt(i.__actions__),a.__index__=i.__index__,a.__values__=i.__values__,a}function GN(i,a,c){(c?Nt(i,a,c):a===n)?a=1:a=lt(Te(a),0);var h=i==null?0:i.length;if(!h||a<1)return[];for(var g=0,_=0,x=$(Js(h/a));g<h;)x[_++]=en(i,g,g+=a);return x}function zN(i){for(var a=-1,c=i==null?0:i.length,h=0,g=[];++a<c;){var _=i[a];_&&(g[h++]=_)}return g}function $N(){var i=arguments.length;if(!i)return[];for(var a=$(i-1),c=arguments[0],h=i;h--;)a[h-1]=arguments[h];return br(ke(c)?Dt(c):[c],mt(a,1))}var ZN=Ve(function(i,a){return nt(i)?Ui(i,mt(a,1,nt,!0)):[]}),UN=Ve(function(i,a){var c=tn(a);return nt(c)&&(c=n),nt(i)?Ui(i,mt(a,1,nt,!0),he(c,2)):[]}),WN=Ve(function(i,a){var c=tn(a);return nt(c)&&(c=n),nt(i)?Ui(i,mt(a,1,nt,!0),n,c):[]});function HN(i,a,c){var h=i==null?0:i.length;return h?(a=c||a===n?1:Te(a),en(i,a<0?0:a,h)):[]}function jN(i,a,c){var h=i==null?0:i.length;return h?(a=c||a===n?1:Te(a),a=h-a,en(i,0,a<0?0:a)):[]}function qN(i,a){return i&&i.length?aa(i,he(a,3),!0,!0):[]}function KN(i,a){return i&&i.length?aa(i,he(a,3),!0):[]}function YN(i,a,c,h){var g=i==null?0:i.length;return g?(c&&typeof c!="number"&&Nt(i,a,c)&&(c=0,h=g),$A(i,a,c,h)):[]}function vf(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=c==null?0:Te(c);return g<0&&(g=lt(h+g,0)),Gs(i,he(a,3),g)}function _f(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=h-1;return c!==n&&(g=Te(c),g=c<0?lt(h+g,0):wt(g,h-1)),Gs(i,he(a,3),g,!0)}function Cf(i){var a=i==null?0:i.length;return a?mt(i,1):[]}function JN(i){var a=i==null?0:i.length;return a?mt(i,pe):[]}function XN(i,a){var c=i==null?0:i.length;return c?(a=a===n?1:Te(a),mt(i,a)):[]}function QN(i){for(var a=-1,c=i==null?0:i.length,h={};++a<c;){var g=i[a];h[g[0]]=g[1]}return h}function wf(i){return i&&i.length?i[0]:n}function eV(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=c==null?0:Te(c);return g<0&&(g=lt(h+g,0)),To(i,a,g)}function tV(i){var a=i==null?0:i.length;return a?en(i,0,-1):[]}var nV=Ve(function(i){var a=Ye(i,Tc);return a.length&&a[0]===i[0]?yc(a):[]}),rV=Ve(function(i){var a=tn(i),c=Ye(i,Tc);return a===tn(c)?a=n:c.pop(),c.length&&c[0]===i[0]?yc(c,he(a,2)):[]}),oV=Ve(function(i){var a=tn(i),c=Ye(i,Tc);return a=typeof a=="function"?a:n,a&&c.pop(),c.length&&c[0]===i[0]?yc(c,n,a):[]});function iV(i,a){return i==null?"":tA.call(i,a)}function tn(i){var a=i==null?0:i.length;return a?i[a-1]:n}function sV(i,a,c){var h=i==null?0:i.length;if(!h)return-1;var g=h;return c!==n&&(g=Te(c),g=g<0?lt(h+g,0):wt(g,h-1)),a===a?OB(i,a,g):Gs(i,eh,g,!0)}function aV(i,a){return i&&i.length?Vh(i,Te(a)):n}var lV=Ve(bf);function bf(i,a){return i&&i.length&&a&&a.length?wc(i,a):i}function cV(i,a,c){return i&&i.length&&a&&a.length?wc(i,a,he(c,2)):i}function dV(i,a,c){return i&&i.length&&a&&a.length?wc(i,a,n,c):i}var uV=qn(function(i,a){var c=i==null?0:i.length,h=hc(i,a);return Fh(i,Ye(a,function(g){return Kn(g,c)?+g:g}).sort(Uh)),h});function pV(i,a){var c=[];if(!(i&&i.length))return c;var h=-1,g=[],_=i.length;for(a=he(a,3);++h<_;){var x=i[h];a(x,h,i)&&(c.push(x),g.push(h))}return Fh(i,g),c}function zc(i){return i==null?i:iA.call(i)}function hV(i,a,c){var h=i==null?0:i.length;return h?(c&&typeof c!="number"&&Nt(i,a,c)?(a=0,c=h):(a=a==null?0:Te(a),c=c===n?h:Te(c)),en(i,a,c)):[]}function fV(i,a){return sa(i,a)}function mV(i,a,c){return kc(i,a,he(c,2))}function gV(i,a){var c=i==null?0:i.length;if(c){var h=sa(i,a);if(h<c&&bn(i[h],a))return h}return-1}function yV(i,a){return sa(i,a,!0)}function vV(i,a,c){return kc(i,a,he(c,2),!0)}function _V(i,a){var c=i==null?0:i.length;if(c){var h=sa(i,a,!0)-1;if(bn(i[h],a))return h}return-1}function CV(i){return i&&i.length?Mh(i):[]}function wV(i,a){return i&&i.length?Mh(i,he(a,2)):[]}function bV(i){var a=i==null?0:i.length;return a?en(i,1,a):[]}function xV(i,a,c){return i&&i.length?(a=c||a===n?1:Te(a),en(i,0,a<0?0:a)):[]}function kV(i,a,c){var h=i==null?0:i.length;return h?(a=c||a===n?1:Te(a),a=h-a,en(i,a<0?0:a,h)):[]}function SV(i,a){return i&&i.length?aa(i,he(a,3),!1,!0):[]}function EV(i,a){return i&&i.length?aa(i,he(a,3)):[]}var TV=Ve(function(i){return Er(mt(i,1,nt,!0))}),BV=Ve(function(i){var a=tn(i);return nt(a)&&(a=n),Er(mt(i,1,nt,!0),he(a,2))}),AV=Ve(function(i){var a=tn(i);return a=typeof a=="function"?a:n,Er(mt(i,1,nt,!0),n,a)});function NV(i){return i&&i.length?Er(i):[]}function VV(i,a){return i&&i.length?Er(i,he(a,2)):[]}function PV(i,a){return a=typeof a=="function"?a:n,i&&i.length?Er(i,n,a):[]}function $c(i){if(!(i&&i.length))return[];var a=0;return i=wr(i,function(c){if(nt(c))return a=lt(c.length,a),!0}),ic(a,function(c){return Ye(i,nc(c))})}function xf(i,a){if(!(i&&i.length))return[];var c=$c(i);return a==null?c:Ye(c,function(h){return Zt(a,n,h)})}var DV=Ve(function(i,a){return nt(i)?Ui(i,a):[]}),FV=Ve(function(i){return Ec(wr(i,nt))}),RV=Ve(function(i){var a=tn(i);return nt(a)&&(a=n),Ec(wr(i,nt),he(a,2))}),MV=Ve(function(i){var a=tn(i);return a=typeof a=="function"?a:n,Ec(wr(i,nt),n,a)}),IV=Ve($c);function LV(i,a){return Gh(i||[],a||[],Zi)}function OV(i,a){return Gh(i||[],a||[],ji)}var GV=Ve(function(i){var a=i.length,c=a>1?i[a-1]:n;return c=typeof c=="function"?(i.pop(),c):n,xf(i,c)});function kf(i){var a=v(i);return a.__chain__=!0,a}function zV(i,a){return a(i),i}function ga(i,a){return a(i)}var $V=qn(function(i){var a=i.length,c=a?i[0]:0,h=this.__wrapped__,g=function(_){return hc(_,i)};return a>1||this.__actions__.length||!(h instanceof De)||!Kn(c)?this.thru(g):(h=h.slice(c,+c+(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 ZV(){return kf(this)}function UV(){return new Xt(this.value(),this.__chain__)}function WV(){this.__values__===n&&(this.__values__=Lf(this.value()));var i=this.__index__>=this.__values__.length,a=i?n:this.__values__[this.__index__++];return{done:i,value:a}}function HV(){return this}function jV(i){for(var a,c=this;c instanceof ta;){var h=yf(c);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;c=c.__wrapped__}return g.__wrapped__=i,a}function qV(){var i=this.__wrapped__;if(i instanceof De){var a=i;return this.__actions__.length&&(a=new De(this)),a=a.reverse(),a.__actions__.push({func:ga,args:[zc],thisArg:n}),new Xt(a,this.__chain__)}return this.thru(zc)}function KV(){return Oh(this.__wrapped__,this.__actions__)}var YV=la(function(i,a,c){Ue.call(i,c)?++i[c]:Hn(i,c,1)});function JV(i,a,c){var h=ke(i)?Xp:zA;return c&&Nt(i,a,c)&&(a=n),h(i,he(a,3))}function XV(i,a){var c=ke(i)?wr:bh;return c(i,he(a,3))}var QV=Yh(vf),eP=Yh(_f);function tP(i,a){return mt(ya(i,a),1)}function nP(i,a){return mt(ya(i,a),pe)}function rP(i,a,c){return c=c===n?1:Te(c),mt(ya(i,a),c)}function Sf(i,a){var c=ke(i)?Yt:Sr;return c(i,he(a,3))}function Ef(i,a){var c=ke(i)?bB:wh;return c(i,he(a,3))}var oP=la(function(i,a,c){Ue.call(i,c)?i[c].push(a):Hn(i,c,[a])});function iP(i,a,c,h){i=Ft(i)?i:Oo(i),c=c&&!h?Te(c):0;var g=i.length;return c<0&&(c=lt(g+c,0)),ba(i)?c<=g&&i.indexOf(a,c)>-1:!!g&&To(i,a,c)>-1}var sP=Ve(function(i,a,c){var h=-1,g=typeof a=="function",_=Ft(i)?$(i.length):[];return Sr(i,function(x){_[++h]=g?Zt(a,x,c):Wi(x,a,c)}),_}),aP=la(function(i,a,c){Hn(i,c,a)});function ya(i,a){var c=ke(i)?Ye:Bh;return c(i,he(a,3))}function lP(i,a,c,h){return i==null?[]:(ke(a)||(a=a==null?[]:[a]),c=h?n:c,ke(c)||(c=c==null?[]:[c]),Ph(i,a,c))}var cP=la(function(i,a,c){i[c?0:1].push(a)},function(){return[[],[]]});function dP(i,a,c){var h=ke(i)?ec:nh,g=arguments.length<3;return h(i,he(a,4),c,g,Sr)}function uP(i,a,c){var h=ke(i)?xB:nh,g=arguments.length<3;return h(i,he(a,4),c,g,wh)}function pP(i,a){var c=ke(i)?wr:bh;return c(i,Ca(he(a,3)))}function hP(i){var a=ke(i)?yh:iN;return a(i)}function fP(i,a,c){(c?Nt(i,a,c):a===n)?a=1:a=Te(a);var h=ke(i)?MA:sN;return h(i,a)}function mP(i){var a=ke(i)?IA:lN;return a(i)}function gP(i){if(i==null)return 0;if(Ft(i))return ba(i)?Ao(i):i.length;var a=bt(i);return a==vn||a==_n?i.size:_c(i).length}function yP(i,a,c){var h=ke(i)?tc:cN;return c&&Nt(i,a,c)&&(a=n),h(i,he(a,3))}var vP=Ve(function(i,a){if(i==null)return[];var c=a.length;return c>1&&Nt(i,a[0],a[1])?a=[]:c>2&&Nt(a[0],a[1],a[2])&&(a=[a[0]]),Ph(i,mt(a,1),[])}),va=XB||function(){return ft.Date.now()};function _P(i,a){if(typeof a!="function")throw new Jt(d);return i=Te(i),function(){if(--i<1)return a.apply(this,arguments)}}function Tf(i,a,c){return a=c?n:a,a=i&&a==null?i.length:a,jn(i,z,n,n,n,n,a)}function Bf(i,a){var c;if(typeof a!="function")throw new Jt(d);return i=Te(i),function(){return--i>0&&(c=a.apply(this,arguments)),i<=1&&(a=n),c}}var Zc=Ve(function(i,a,c){var h=G;if(c.length){var g=xr(c,Io(Zc));h|=P}return jn(i,h,a,c,g)}),Af=Ve(function(i,a,c){var h=G|C;if(c.length){var g=xr(c,Io(Af));h|=P}return jn(a,h,i,c,g)});function Nf(i,a,c){a=c?n:a;var h=jn(i,Y,n,n,n,n,n,a);return h.placeholder=Nf.placeholder,h}function Vf(i,a,c){a=c?n:a;var h=jn(i,L,n,n,n,n,n,a);return h.placeholder=Vf.placeholder,h}function Pf(i,a,c){var h,g,_,x,T,R,j=0,K=!1,J=!1,ne=!0;if(typeof i!="function")throw new Jt(d);a=nn(a)||0,Qe(c)&&(K=!!c.leading,J="maxWait"in c,_=J?lt(nn(c.maxWait)||0,a):_,ne="trailing"in c?!!c.trailing:ne);function ce(rt){var xn=h,Xn=g;return h=g=n,j=rt,x=i.apply(Xn,xn),x}function me(rt){return j=rt,T=Yi(Pe,a),K?ce(rt):x}function Ne(rt){var xn=rt-R,Xn=rt-j,Jf=a-xn;return J?wt(Jf,_-Xn):Jf}function ge(rt){var xn=rt-R,Xn=rt-j;return R===n||xn>=a||xn<0||J&&Xn>=_}function Pe(){var rt=va();if(ge(rt))return Fe(rt);T=Yi(Pe,Ne(rt))}function Fe(rt){return T=n,ne&&h?ce(rt):(h=g=n,x)}function jt(){T!==n&&zh(T),j=0,h=R=g=T=n}function Vt(){return T===n?x:Fe(va())}function qt(){var rt=va(),xn=ge(rt);if(h=arguments,g=this,R=rt,xn){if(T===n)return me(R);if(J)return zh(T),T=Yi(Pe,a),ce(R)}return T===n&&(T=Yi(Pe,a)),x}return qt.cancel=jt,qt.flush=Vt,qt}var CP=Ve(function(i,a){return Ch(i,1,a)}),wP=Ve(function(i,a,c){return Ch(i,nn(a)||0,c)});function bP(i){return jn(i,S)}function _a(i,a){if(typeof i!="function"||a!=null&&typeof a!="function")throw new Jt(d);var c=function(){var h=arguments,g=a?a.apply(this,h):h[0],_=c.cache;if(_.has(g))return _.get(g);var x=i.apply(this,h);return c.cache=_.set(g,x)||_,x};return c.cache=new(_a.Cache||Wn),c}_a.Cache=Wn;function Ca(i){if(typeof i!="function")throw new Jt(d);return function(){var a=arguments;switch(a.length){case 0:return!i.call(this);case 1:return!i.call(this,a[0]);case 2:return!i.call(this,a[0],a[1]);case 3:return!i.call(this,a[0],a[1],a[2])}return!i.apply(this,a)}}function xP(i){return Bf(2,i)}var kP=dN(function(i,a){a=a.length==1&&ke(a[0])?Ye(a[0],Ut(he())):Ye(mt(a,1),Ut(he()));var c=a.length;return Ve(function(h){for(var g=-1,_=wt(h.length,c);++g<_;)h[g]=a[g].call(this,h[g]);return Zt(i,this,h)})}),Uc=Ve(function(i,a){var c=xr(a,Io(Uc));return jn(i,P,n,a,c)}),Df=Ve(function(i,a){var c=xr(a,Io(Df));return jn(i,O,n,a,c)}),SP=qn(function(i,a){return jn(i,N,n,n,n,a)});function EP(i,a){if(typeof i!="function")throw new Jt(d);return a=a===n?a:Te(a),Ve(i,a)}function TP(i,a){if(typeof i!="function")throw new Jt(d);return a=a==null?0:lt(Te(a),0),Ve(function(c){var h=c[a],g=Br(c,0,a);return h&&br(g,h),Zt(i,this,g)})}function BP(i,a,c){var h=!0,g=!0;if(typeof i!="function")throw new Jt(d);return Qe(c)&&(h="leading"in c?!!c.leading:h,g="trailing"in c?!!c.trailing:g),Pf(i,a,{leading:h,maxWait:a,trailing:g})}function AP(i){return Tf(i,1)}function NP(i,a){return Uc(Bc(a),i)}function VP(){if(!arguments.length)return[];var i=arguments[0];return ke(i)?i:[i]}function PP(i){return Qt(i,k)}function DP(i,a){return a=typeof a=="function"?a:n,Qt(i,k,a)}function FP(i){return Qt(i,y|k)}function RP(i,a){return a=typeof a=="function"?a:n,Qt(i,y|k,a)}function MP(i,a){return a==null||_h(i,a,pt(a))}function bn(i,a){return i===a||i!==i&&a!==a}var IP=pa(gc),LP=pa(function(i,a){return i>=a}),eo=Sh(function(){return arguments}())?Sh:function(i){return et(i)&&Ue.call(i,"callee")&&!uh.call(i,"callee")},ke=$.isArray,OP=Hp?Ut(Hp):jA;function Ft(i){return i!=null&&wa(i.length)&&!Yn(i)}function nt(i){return et(i)&&Ft(i)}function GP(i){return i===!0||i===!1||et(i)&&At(i)==Ge}var Ar=eA||td,zP=jp?Ut(jp):qA;function $P(i){return et(i)&&i.nodeType===1&&!Ji(i)}function ZP(i){if(i==null)return!0;if(Ft(i)&&(ke(i)||typeof i=="string"||typeof i.splice=="function"||Ar(i)||Lo(i)||eo(i)))return!i.length;var a=bt(i);if(a==vn||a==_n)return!i.size;if(Ki(i))return!_c(i).length;for(var c in i)if(Ue.call(i,c))return!1;return!0}function UP(i,a){return Hi(i,a)}function WP(i,a,c){c=typeof c=="function"?c:n;var h=c?c(i,a):n;return h===n?Hi(i,a,n,c):!!h}function Wc(i){if(!et(i))return!1;var a=At(i);return a==Ds||a==fT||typeof i.message=="string"&&typeof i.name=="string"&&!Ji(i)}function HP(i){return typeof i=="number"&&hh(i)}function Yn(i){if(!Qe(i))return!1;var a=At(i);return a==Fs||a==Cp||a==Ps||a==gT}function Ff(i){return typeof i=="number"&&i==Te(i)}function wa(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=we}function Qe(i){var a=typeof i;return i!=null&&(a=="object"||a=="function")}function et(i){return i!=null&&typeof i=="object"}var Rf=qp?Ut(qp):YA;function jP(i,a){return i===a||vc(i,a,Rc(a))}function qP(i,a,c){return c=typeof c=="function"?c:n,vc(i,a,Rc(a),c)}function KP(i){return Mf(i)&&i!=+i}function YP(i){if(DN(i))throw new xe(l);return Eh(i)}function JP(i){return i===null}function XP(i){return i==null}function Mf(i){return typeof i=="number"||et(i)&&At(i)==Pi}function Ji(i){if(!et(i)||At(i)!=Zn)return!1;var a=qs(i);if(a===null)return!0;var c=Ue.call(a,"constructor")&&a.constructor;return typeof c=="function"&&c instanceof c&&Us.call(c)==qB}var Hc=Kp?Ut(Kp):JA;function QP(i){return Ff(i)&&i>=-we&&i<=we}var If=Yp?Ut(Yp):XA;function ba(i){return typeof i=="string"||!ke(i)&&et(i)&&At(i)==Fi}function Ht(i){return typeof i=="symbol"||et(i)&&At(i)==Rs}var Lo=Jp?Ut(Jp):QA;function eD(i){return i===n}function tD(i){return et(i)&&bt(i)==Ri}function nD(i){return et(i)&&At(i)==vT}var rD=pa(Cc),oD=pa(function(i,a){return i<=a});function Lf(i){if(!i)return[];if(Ft(i))return ba(i)?Cn(i):Dt(i);if(Li&&i[Li])return MB(i[Li]());var a=bt(i),c=a==vn?ac:a==_n?zs:Oo;return c(i)}function Jn(i){if(!i)return i===0?i:0;if(i=nn(i),i===pe||i===-pe){var a=i<0?-1:1;return a*Ct}return i===i?i:0}function Te(i){var a=Jn(i),c=a%1;return a===a?c?a-c:a:0}function Of(i){return i?Yr(Te(i),0,ht):0}function nn(i){if(typeof i=="number")return i;if(Ht(i))return Bt;if(Qe(i)){var a=typeof i.valueOf=="function"?i.valueOf():i;i=Qe(a)?a+"":a}if(typeof i!="string")return i===0?i:+i;i=rh(i);var c=OT.test(i);return c||zT.test(i)?_B(i.slice(2),c?2:8):LT.test(i)?Bt:+i}function Gf(i){return Fn(i,Rt(i))}function iD(i){return i?Yr(Te(i),-we,we):i===0?i:0}function Ze(i){return i==null?"":Wt(i)}var sD=Ro(function(i,a){if(Ki(a)||Ft(a)){Fn(a,pt(a),i);return}for(var c in a)Ue.call(a,c)&&Zi(i,c,a[c])}),zf=Ro(function(i,a){Fn(a,Rt(a),i)}),xa=Ro(function(i,a,c,h){Fn(a,Rt(a),i,h)}),aD=Ro(function(i,a,c,h){Fn(a,pt(a),i,h)}),lD=qn(hc);function cD(i,a){var c=Fo(i);return a==null?c:vh(c,a)}var dD=Ve(function(i,a){i=We(i);var c=-1,h=a.length,g=h>2?a[2]:n;for(g&&Nt(a[0],a[1],g)&&(h=1);++c<h;)for(var _=a[c],x=Rt(_),T=-1,R=x.length;++T<R;){var j=x[T],K=i[j];(K===n||bn(K,Vo[j])&&!Ue.call(i,j))&&(i[j]=_[j])}return i}),uD=Ve(function(i){return i.push(n,rf),Zt($f,n,i)});function pD(i,a){return Qp(i,he(a,3),Dn)}function hD(i,a){return Qp(i,he(a,3),mc)}function fD(i,a){return i==null?i:fc(i,he(a,3),Rt)}function mD(i,a){return i==null?i:xh(i,he(a,3),Rt)}function gD(i,a){return i&&Dn(i,he(a,3))}function yD(i,a){return i&&mc(i,he(a,3))}function vD(i){return i==null?[]:oa(i,pt(i))}function _D(i){return i==null?[]:oa(i,Rt(i))}function jc(i,a,c){var h=i==null?n:Jr(i,a);return h===n?c:h}function CD(i,a){return i!=null&&af(i,a,ZA)}function qc(i,a){return i!=null&&af(i,a,UA)}var wD=Xh(function(i,a,c){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),i[a]=c},Yc(Mt)),bD=Xh(function(i,a,c){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),Ue.call(i,a)?i[a].push(c):i[a]=[c]},he),xD=Ve(Wi);function pt(i){return Ft(i)?gh(i):_c(i)}function Rt(i){return Ft(i)?gh(i,!0):eN(i)}function kD(i,a){var c={};return a=he(a,3),Dn(i,function(h,g,_){Hn(c,a(h,g,_),h)}),c}function SD(i,a){var c={};return a=he(a,3),Dn(i,function(h,g,_){Hn(c,g,a(h,g,_))}),c}var ED=Ro(function(i,a,c){ia(i,a,c)}),$f=Ro(function(i,a,c,h){ia(i,a,c,h)}),TD=qn(function(i,a){var c={};if(i==null)return c;var h=!1;a=Ye(a,function(_){return _=Tr(_,i),h||(h=_.length>1),_}),Fn(i,Dc(i),c),h&&(c=Qt(c,y|E|k,wN));for(var g=a.length;g--;)Sc(c,a[g]);return c});function BD(i,a){return Zf(i,Ca(he(a)))}var AD=qn(function(i,a){return i==null?{}:nN(i,a)});function Zf(i,a){if(i==null)return{};var c=Ye(Dc(i),function(h){return[h]});return a=he(a),Dh(i,c,function(h,g){return a(h,g[0])})}function ND(i,a,c){a=Tr(a,i);var h=-1,g=a.length;for(g||(g=1,i=n);++h<g;){var _=i==null?n:i[Rn(a[h])];_===n&&(h=g,_=c),i=Yn(_)?_.call(i):_}return i}function VD(i,a,c){return i==null?i:ji(i,a,c)}function PD(i,a,c,h){return h=typeof h=="function"?h:n,i==null?i:ji(i,a,c,h)}var Uf=tf(pt),Wf=tf(Rt);function DD(i,a,c){var h=ke(i),g=h||Ar(i)||Lo(i);if(a=he(a,4),c==null){var _=i&&i.constructor;g?c=h?new _:[]:Qe(i)?c=Yn(_)?Fo(qs(i)):{}:c={}}return(g?Yt:Dn)(i,function(x,T,R){return a(c,x,T,R)}),c}function FD(i,a){return i==null?!0:Sc(i,a)}function RD(i,a,c){return i==null?i:Lh(i,a,Bc(c))}function MD(i,a,c,h){return h=typeof h=="function"?h:n,i==null?i:Lh(i,a,Bc(c),h)}function Oo(i){return i==null?[]:sc(i,pt(i))}function ID(i){return i==null?[]:sc(i,Rt(i))}function LD(i,a,c){return c===n&&(c=a,a=n),c!==n&&(c=nn(c),c=c===c?c:0),a!==n&&(a=nn(a),a=a===a?a:0),Yr(nn(i),a,c)}function OD(i,a,c){return a=Jn(a),c===n?(c=a,a=0):c=Jn(c),i=nn(i),WA(i,a,c)}function GD(i,a,c){if(c&&typeof c!="boolean"&&Nt(i,a,c)&&(a=c=n),c===n&&(typeof a=="boolean"?(c=a,a=n):typeof i=="boolean"&&(c=i,i=n)),i===n&&a===n?(i=0,a=1):(i=Jn(i),a===n?(a=i,i=0):a=Jn(a)),i>a){var h=i;i=a,a=h}if(c||i%1||a%1){var g=fh();return wt(i+g*(a-i+vB("1e-"+((g+"").length-1))),a)}return bc(i,a)}var zD=Mo(function(i,a,c){return a=a.toLowerCase(),i+(c?Hf(a):a)});function Hf(i){return Kc(Ze(i).toLowerCase())}function jf(i){return i=Ze(i),i&&i.replace(ZT,VB).replace(lB,"")}function $D(i,a,c){i=Ze(i),a=Wt(a);var h=i.length;c=c===n?h:Yr(Te(c),0,h);var g=c;return c-=a.length,c>=0&&i.slice(c,g)==a}function ZD(i){return i=Ze(i),i&&xT.test(i)?i.replace(xp,PB):i}function UD(i){return i=Ze(i),i&&AT.test(i)?i.replace(Ul,"\\$&"):i}var WD=Mo(function(i,a,c){return i+(c?"-":"")+a.toLowerCase()}),HD=Mo(function(i,a,c){return i+(c?" ":"")+a.toLowerCase()}),jD=Kh("toLowerCase");function qD(i,a,c){i=Ze(i),a=Te(a);var h=a?Ao(i):0;if(!a||h>=a)return i;var g=(a-h)/2;return ua(Xs(g),c)+i+ua(Js(g),c)}function KD(i,a,c){i=Ze(i),a=Te(a);var h=a?Ao(i):0;return a&&h<a?i+ua(a-h,c):i}function YD(i,a,c){i=Ze(i),a=Te(a);var h=a?Ao(i):0;return a&&h<a?ua(a-h,c)+i:i}function JD(i,a,c){return c||a==null?a=0:a&&(a=+a),oA(Ze(i).replace(Wl,""),a||0)}function XD(i,a,c){return(c?Nt(i,a,c):a===n)?a=1:a=Te(a),xc(Ze(i),a)}function QD(){var i=arguments,a=Ze(i[0]);return i.length<3?a:a.replace(i[1],i[2])}var eF=Mo(function(i,a,c){return i+(c?"_":"")+a.toLowerCase()});function tF(i,a,c){return c&&typeof c!="number"&&Nt(i,a,c)&&(a=c=n),c=c===n?ht:c>>>0,c?(i=Ze(i),i&&(typeof a=="string"||a!=null&&!Hc(a))&&(a=Wt(a),!a&&Bo(i))?Br(Cn(i),0,c):i.split(a,c)):[]}var nF=Mo(function(i,a,c){return i+(c?" ":"")+Kc(a)});function rF(i,a,c){return i=Ze(i),c=c==null?0:Yr(Te(c),0,i.length),a=Wt(a),i.slice(c,c+a.length)==a}function oF(i,a,c){var h=v.templateSettings;c&&Nt(i,a,c)&&(a=n),i=Ze(i),a=xa({},a,h,nf);var g=xa({},a.imports,h.imports,nf),_=pt(g),x=sc(g,_),T,R,j=0,K=a.interpolate||Ms,J="__p += '",ne=lc((a.escape||Ms).source+"|"+K.source+"|"+(K===kp?IT:Ms).source+"|"+(a.evaluate||Ms).source+"|$","g"),ce="//# sourceURL="+(Ue.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++hB+"]")+`
|
|
75
|
+
`;i.replace(ne,function(ge,Pe,Fe,jt,Vt,qt){return Fe||(Fe=jt),J+=i.slice(j,qt).replace(UT,DB),Pe&&(T=!0,J+=`' +
|
|
74
76
|
__e(`+Pe+`) +
|
|
75
|
-
'`),Vt&&(R=!0,
|
|
77
|
+
'`),Vt&&(R=!0,J+=`';
|
|
76
78
|
`+Vt+`;
|
|
77
|
-
__p += '`),Fe&&(
|
|
79
|
+
__p += '`),Fe&&(J+=`' +
|
|
78
80
|
((__t = (`+Fe+`)) == null ? '' : __t) +
|
|
79
|
-
'`),j=qt+ge.length,ge}),
|
|
80
|
-
`;var me=
|
|
81
|
-
`+
|
|
81
|
+
'`),j=qt+ge.length,ge}),J+=`';
|
|
82
|
+
`;var me=Ue.call(a,"variable")&&a.variable;if(!me)J=`with (obj) {
|
|
83
|
+
`+J+`
|
|
82
84
|
}
|
|
83
|
-
`;else if(
|
|
85
|
+
`;else if(RT.test(me))throw new xe(u);J=(R?J.replace(_T,""):J).replace(CT,"$1").replace(wT,"$1;"),J="function("+(me||"obj")+`) {
|
|
84
86
|
`+(me?"":`obj || (obj = {});
|
|
85
|
-
`)+"var __t, __p = ''"+(
|
|
87
|
+
`)+"var __t, __p = ''"+(T?", __e = _.escape":"")+(R?`, __j = Array.prototype.join;
|
|
86
88
|
function print() { __p += __j.call(arguments, '') }
|
|
87
89
|
`:`;
|
|
88
|
-
`)+
|
|
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"})});
|
|
90
|
+
`)+J+`return __p
|
|
91
|
+
}`;var Ne=Kf(function(){return ze(_,ce+"return "+J).apply(n,x)});if(Ne.source=J,Wc(Ne))throw Ne;return Ne}function iF(i){return Ze(i).toLowerCase()}function sF(i){return Ze(i).toUpperCase()}function aF(i,a,c){if(i=Ze(i),i&&(c||a===n))return rh(i);if(!i||!(a=Wt(a)))return i;var h=Cn(i),g=Cn(a),_=oh(h,g),x=ih(h,g)+1;return Br(h,_,x).join("")}function lF(i,a,c){if(i=Ze(i),i&&(c||a===n))return i.slice(0,ah(i)+1);if(!i||!(a=Wt(a)))return i;var h=Cn(i),g=ih(h,Cn(a))+1;return Br(h,0,g).join("")}function cF(i,a,c){if(i=Ze(i),i&&(c||a===n))return i.replace(Wl,"");if(!i||!(a=Wt(a)))return i;var h=Cn(i),g=oh(h,Cn(a));return Br(h,g).join("")}function dF(i,a){var c=V,h=W;if(Qe(a)){var g="separator"in a?a.separator:g;c="length"in a?Te(a.length):c,h="omission"in a?Wt(a.omission):h}i=Ze(i);var _=i.length;if(Bo(i)){var x=Cn(i);_=x.length}if(c>=_)return i;var T=c-Ao(h);if(T<1)return h;var R=x?Br(x,0,T).join(""):i.slice(0,T);if(g===n)return R+h;if(x&&(T+=R.length-T),Hc(g)){if(i.slice(T).search(g)){var j,K=R;for(g.global||(g=lc(g.source,Ze(Sp.exec(g))+"g")),g.lastIndex=0;j=g.exec(K);)var J=j.index;R=R.slice(0,J===n?T:J)}}else if(i.indexOf(Wt(g),T)!=T){var ne=R.lastIndexOf(g);ne>-1&&(R=R.slice(0,ne))}return R+h}function uF(i){return i=Ze(i),i&&bT.test(i)?i.replace(bp,GB):i}var pF=Mo(function(i,a,c){return i+(c?" ":"")+a.toUpperCase()}),Kc=Kh("toUpperCase");function qf(i,a,c){return i=Ze(i),a=c?n:a,a===n?RB(i)?ZB(i):EB(i):i.match(a)||[]}var Kf=Ve(function(i,a){try{return Zt(i,n,a)}catch(c){return Wc(c)?c:new xe(c)}}),hF=qn(function(i,a){return Yt(a,function(c){c=Rn(c),Hn(i,c,Zc(i[c],i))}),i});function fF(i){var a=i==null?0:i.length,c=he();return i=a?Ye(i,function(h){if(typeof h[1]!="function")throw new Jt(d);return[c(h[0]),h[1]]}):[],Ve(function(h){for(var g=-1;++g<a;){var _=i[g];if(Zt(_[0],this,h))return Zt(_[1],this,h)}})}function mF(i){return GA(Qt(i,y))}function Yc(i){return function(){return i}}function gF(i,a){return i==null||i!==i?a:i}var yF=Jh(),vF=Jh(!0);function Mt(i){return i}function Jc(i){return Th(typeof i=="function"?i:Qt(i,y))}function _F(i){return Ah(Qt(i,y))}function CF(i,a){return Nh(i,Qt(a,y))}var wF=Ve(function(i,a){return function(c){return Wi(c,i,a)}}),bF=Ve(function(i,a){return function(c){return Wi(i,c,a)}});function Xc(i,a,c){var h=pt(a),g=oa(a,h);c==null&&!(Qe(a)&&(g.length||!h.length))&&(c=a,a=i,i=this,g=oa(a,pt(a)));var _=!(Qe(c)&&"chain"in c)||!!c.chain,x=Yn(i);return Yt(g,function(T){var R=a[T];i[T]=R,x&&(i.prototype[T]=function(){var j=this.__chain__;if(_||j){var K=i(this.__wrapped__),J=K.__actions__=Dt(this.__actions__);return J.push({func:R,args:arguments,thisArg:i}),K.__chain__=j,K}return R.apply(i,br([this.value()],arguments))})}),i}function xF(){return ft._===this&&(ft._=KB),this}function Qc(){}function kF(i){return i=Te(i),Ve(function(a){return Vh(a,i)})}var SF=Nc(Ye),EF=Nc(Xp),TF=Nc(tc);function Yf(i){return Ic(i)?nc(Rn(i)):rN(i)}function BF(i){return function(a){return i==null?n:Jr(i,a)}}var AF=Qh(),NF=Qh(!0);function ed(){return[]}function td(){return!1}function VF(){return{}}function PF(){return""}function DF(){return!0}function FF(i,a){if(i=Te(i),i<1||i>we)return[];var c=ht,h=wt(i,ht);a=he(a),i-=ht;for(var g=ic(h,a);++c<i;)a(c);return g}function RF(i){return ke(i)?Ye(i,Rn):Ht(i)?[i]:Dt(gf(Ze(i)))}function MF(i){var a=++jB;return Ze(i)+a}var IF=da(function(i,a){return i+a},0),LF=Vc("ceil"),OF=da(function(i,a){return i/a},1),GF=Vc("floor");function zF(i){return i&&i.length?ra(i,Mt,gc):n}function $F(i,a){return i&&i.length?ra(i,he(a,2),gc):n}function ZF(i){return th(i,Mt)}function UF(i,a){return th(i,he(a,2))}function WF(i){return i&&i.length?ra(i,Mt,Cc):n}function HF(i,a){return i&&i.length?ra(i,he(a,2),Cc):n}var jF=da(function(i,a){return i*a},1),qF=Vc("round"),KF=da(function(i,a){return i-a},0);function YF(i){return i&&i.length?oc(i,Mt):0}function JF(i,a){return i&&i.length?oc(i,he(a,2)):0}return v.after=_P,v.ary=Tf,v.assign=sD,v.assignIn=zf,v.assignInWith=xa,v.assignWith=aD,v.at=lD,v.before=Bf,v.bind=Zc,v.bindAll=hF,v.bindKey=Af,v.castArray=VP,v.chain=kf,v.chunk=GN,v.compact=zN,v.concat=$N,v.cond=fF,v.conforms=mF,v.constant=Yc,v.countBy=YV,v.create=cD,v.curry=Nf,v.curryRight=Vf,v.debounce=Pf,v.defaults=dD,v.defaultsDeep=uD,v.defer=CP,v.delay=wP,v.difference=ZN,v.differenceBy=UN,v.differenceWith=WN,v.drop=HN,v.dropRight=jN,v.dropRightWhile=qN,v.dropWhile=KN,v.fill=YN,v.filter=XV,v.flatMap=tP,v.flatMapDeep=nP,v.flatMapDepth=rP,v.flatten=Cf,v.flattenDeep=JN,v.flattenDepth=XN,v.flip=bP,v.flow=yF,v.flowRight=vF,v.fromPairs=QN,v.functions=vD,v.functionsIn=_D,v.groupBy=oP,v.initial=tV,v.intersection=nV,v.intersectionBy=rV,v.intersectionWith=oV,v.invert=wD,v.invertBy=bD,v.invokeMap=sP,v.iteratee=Jc,v.keyBy=aP,v.keys=pt,v.keysIn=Rt,v.map=ya,v.mapKeys=kD,v.mapValues=SD,v.matches=_F,v.matchesProperty=CF,v.memoize=_a,v.merge=ED,v.mergeWith=$f,v.method=wF,v.methodOf=bF,v.mixin=Xc,v.negate=Ca,v.nthArg=kF,v.omit=TD,v.omitBy=BD,v.once=xP,v.orderBy=lP,v.over=SF,v.overArgs=kP,v.overEvery=EF,v.overSome=TF,v.partial=Uc,v.partialRight=Df,v.partition=cP,v.pick=AD,v.pickBy=Zf,v.property=Yf,v.propertyOf=BF,v.pull=lV,v.pullAll=bf,v.pullAllBy=cV,v.pullAllWith=dV,v.pullAt=uV,v.range=AF,v.rangeRight=NF,v.rearg=SP,v.reject=pP,v.remove=pV,v.rest=EP,v.reverse=zc,v.sampleSize=fP,v.set=VD,v.setWith=PD,v.shuffle=mP,v.slice=hV,v.sortBy=vP,v.sortedUniq=CV,v.sortedUniqBy=wV,v.split=tF,v.spread=TP,v.tail=bV,v.take=xV,v.takeRight=kV,v.takeRightWhile=SV,v.takeWhile=EV,v.tap=zV,v.throttle=BP,v.thru=ga,v.toArray=Lf,v.toPairs=Uf,v.toPairsIn=Wf,v.toPath=RF,v.toPlainObject=Gf,v.transform=DD,v.unary=AP,v.union=TV,v.unionBy=BV,v.unionWith=AV,v.uniq=NV,v.uniqBy=VV,v.uniqWith=PV,v.unset=FD,v.unzip=$c,v.unzipWith=xf,v.update=RD,v.updateWith=MD,v.values=Oo,v.valuesIn=ID,v.without=DV,v.words=qf,v.wrap=NP,v.xor=FV,v.xorBy=RV,v.xorWith=MV,v.zip=IV,v.zipObject=LV,v.zipObjectDeep=OV,v.zipWith=GV,v.entries=Uf,v.entriesIn=Wf,v.extend=zf,v.extendWith=xa,Xc(v,v),v.add=IF,v.attempt=Kf,v.camelCase=zD,v.capitalize=Hf,v.ceil=LF,v.clamp=LD,v.clone=PP,v.cloneDeep=FP,v.cloneDeepWith=RP,v.cloneWith=DP,v.conformsTo=MP,v.deburr=jf,v.defaultTo=gF,v.divide=OF,v.endsWith=$D,v.eq=bn,v.escape=ZD,v.escapeRegExp=UD,v.every=JV,v.find=QV,v.findIndex=vf,v.findKey=pD,v.findLast=eP,v.findLastIndex=_f,v.findLastKey=hD,v.floor=GF,v.forEach=Sf,v.forEachRight=Ef,v.forIn=fD,v.forInRight=mD,v.forOwn=gD,v.forOwnRight=yD,v.get=jc,v.gt=IP,v.gte=LP,v.has=CD,v.hasIn=qc,v.head=wf,v.identity=Mt,v.includes=iP,v.indexOf=eV,v.inRange=OD,v.invoke=xD,v.isArguments=eo,v.isArray=ke,v.isArrayBuffer=OP,v.isArrayLike=Ft,v.isArrayLikeObject=nt,v.isBoolean=GP,v.isBuffer=Ar,v.isDate=zP,v.isElement=$P,v.isEmpty=ZP,v.isEqual=UP,v.isEqualWith=WP,v.isError=Wc,v.isFinite=HP,v.isFunction=Yn,v.isInteger=Ff,v.isLength=wa,v.isMap=Rf,v.isMatch=jP,v.isMatchWith=qP,v.isNaN=KP,v.isNative=YP,v.isNil=XP,v.isNull=JP,v.isNumber=Mf,v.isObject=Qe,v.isObjectLike=et,v.isPlainObject=Ji,v.isRegExp=Hc,v.isSafeInteger=QP,v.isSet=If,v.isString=ba,v.isSymbol=Ht,v.isTypedArray=Lo,v.isUndefined=eD,v.isWeakMap=tD,v.isWeakSet=nD,v.join=iV,v.kebabCase=WD,v.last=tn,v.lastIndexOf=sV,v.lowerCase=HD,v.lowerFirst=jD,v.lt=rD,v.lte=oD,v.max=zF,v.maxBy=$F,v.mean=ZF,v.meanBy=UF,v.min=WF,v.minBy=HF,v.stubArray=ed,v.stubFalse=td,v.stubObject=VF,v.stubString=PF,v.stubTrue=DF,v.multiply=jF,v.nth=aV,v.noConflict=xF,v.noop=Qc,v.now=va,v.pad=qD,v.padEnd=KD,v.padStart=YD,v.parseInt=JD,v.random=GD,v.reduce=dP,v.reduceRight=uP,v.repeat=XD,v.replace=QD,v.result=ND,v.round=qF,v.runInContext=F,v.sample=hP,v.size=gP,v.snakeCase=eF,v.some=yP,v.sortedIndex=fV,v.sortedIndexBy=mV,v.sortedIndexOf=gV,v.sortedLastIndex=yV,v.sortedLastIndexBy=vV,v.sortedLastIndexOf=_V,v.startCase=nF,v.startsWith=rF,v.subtract=KF,v.sum=YF,v.sumBy=JF,v.template=oF,v.times=FF,v.toFinite=Jn,v.toInteger=Te,v.toLength=Of,v.toLower=iF,v.toNumber=nn,v.toSafeInteger=iD,v.toString=Ze,v.toUpper=sF,v.trim=aF,v.trimEnd=lF,v.trimStart=cF,v.truncate=dF,v.unescape=uF,v.uniqueId=MF,v.upperCase=pF,v.upperFirst=Kc,v.each=Sf,v.eachRight=Ef,v.first=wf,Xc(v,function(){var i={};return Dn(v,function(a,c){Ue.call(v.prototype,c)||(i[c]=a)}),i}(),{chain:!1}),v.VERSION=o,Yt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){v[i].placeholder=v}),Yt(["drop","take"],function(i,a){De.prototype[i]=function(c){c=c===n?1:lt(Te(c),0);var h=this.__filtered__&&!a?new De(this):this.clone();return h.__filtered__?h.__takeCount__=wt(c,h.__takeCount__):h.__views__.push({size:wt(c,ht),type:i+(h.__dir__<0?"Right":"")}),h},De.prototype[i+"Right"]=function(c){return this.reverse()[i](c).reverse()}}),Yt(["filter","map","takeWhile"],function(i,a){var c=a+1,h=c==A||c==X;De.prototype[i]=function(g){var _=this.clone();return _.__iteratees__.push({iteratee:he(g,3),type:c}),_.__filtered__=_.__filtered__||h,_}}),Yt(["head","last"],function(i,a){var c="take"+(a?"Right":"");De.prototype[i]=function(){return this[c](1).value()[0]}}),Yt(["initial","tail"],function(i,a){var c="drop"+(a?"":"Right");De.prototype[i]=function(){return this.__filtered__?new De(this):this[c](1)}}),De.prototype.compact=function(){return this.filter(Mt)},De.prototype.find=function(i){return this.filter(i).head()},De.prototype.findLast=function(i){return this.reverse().find(i)},De.prototype.invokeMap=Ve(function(i,a){return typeof i=="function"?new De(this):this.map(function(c){return Wi(c,i,a)})}),De.prototype.reject=function(i){return this.filter(Ca(he(i)))},De.prototype.slice=function(i,a){i=Te(i);var c=this;return c.__filtered__&&(i>0||a<0)?new De(c):(i<0?c=c.takeRight(-i):i&&(c=c.drop(i)),a!==n&&(a=Te(a),c=a<0?c.dropRight(-a):c.take(a-i)),c)},De.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},De.prototype.toArray=function(){return this.take(ht)},Dn(De.prototype,function(i,a){var c=/^(?: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__,T=h?[1]:arguments,R=x instanceof De,j=T[0],K=R||ke(x),J=function(Pe){var Fe=g.apply(v,br([Pe],T));return h&&ne?Fe[0]:Fe};K&&c&&typeof j=="function"&&j.length!=1&&(R=K=!1);var ne=this.__chain__,ce=!!this.__actions__.length,me=_&&!ne,Ne=R&&!ce;if(!_&&K){x=Ne?x:new De(this);var ge=i.apply(x,T);return ge.__actions__.push({func:ga,args:[J],thisArg:n}),new Xt(ge,ne)}return me&&Ne?i.apply(this,T):(ge=this.thru(J),me?h?ge.value()[0]:ge.value():ge)})}),Yt(["pop","push","shift","sort","splice","unshift"],function(i){var a=$s[i],c=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",h=/^(?:pop|shift)$/.test(i);v.prototype[i]=function(){var g=arguments;if(h&&!this.__chain__){var _=this.value();return a.apply(ke(_)?_:[],g)}return this[c](function(x){return a.apply(ke(x)?x:[],g)})}}),Dn(De.prototype,function(i,a){var c=v[a];if(c){var h=c.name+"";Ue.call(Do,h)||(Do[h]=[]),Do[h].push({name:a,func:c})}}),Do[ca(n,C).name]=[{name:"wrapper",func:n}],De.prototype.clone=uA,De.prototype.reverse=pA,De.prototype.value=hA,v.prototype.at=$V,v.prototype.chain=ZV,v.prototype.commit=UV,v.prototype.next=WV,v.prototype.plant=jV,v.prototype.reverse=qV,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=KV,v.prototype.first=v.prototype.head,Li&&(v.prototype[Li]=HV),v},No=UB();Hr?((Hr.exports=No)._=No,Jl._=No):ft._=No}).call(Go)}(Bs,Bs.exports);var Oe=Bs.exports;const FE={class:"grid-overlay-container"},ip=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",FE,[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))]))}}),RE={},ME={class:"grid-overlay-container"};function IE(t,e){return r.openBlock(),r.createElementBlock("div",ME,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const sp=Ts(RE,[["render",IE]]);async function LE(t,e){throw Error("not implemented")}function OE(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function GE(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const s=OE(t[o].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const d=Nd(l),u=t.findIndex(p=>Oe.isEqual(p.id,d));if(u===-1)throw console.error("axis not found",o,d,t),Error("axis not found");n.push({columnIdx:o,axisIdx:u})}}return n}const ap=(t,e)=>(t+e).toString();function zE(t,e,n,o,s,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const d=t[0];let u=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===d.axisIdx&&(u=y),l[y]===d.columnIdx&&(p=y);const f=(()=>{const E=o[u].data.filter(k=>k!==null);return Array.from(new Set(E))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=$E(s,o,u,p,f,e.rows);for(let y=0;y<f.length;++y){const E=f[y],k=E+"@"+y;n.push({colId:k,field:ap(o.length,y),headerName:E,valueFormatter:cp})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function $E(t,e,n,o,s,l){const d=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let M=0;M<e.length;++M){if(M===n||M===o)continue;const G=t[M].toString();m[G]=e[M].data[f]}let y;const E=to(Object.values(m))??"";d.has(E)?y=d.get(E):(d.set(E,m),y=m,y.id=u.toString(),u++);const k=s.indexOf(e[n].data[f]);if(k===-1)throw Error("index not found");const D=ap(e.length,k);y[D]=e[o].data[f]}return Array.from(d.values())}function ZE(t){return to(t)}function lp(t){return JSON.parse(t)}const cp=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function UE(t,e,n){var s,l,d;const o=ZE(e);return{colId:o,field:t.toString(),headerName:((l=(s=e.spec.annotations)==null?void 0:s["pl7.app/label"])==null?void 0:l.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(o))??((d=e.spec.annotations)==null?void 0:d["pl7.app/table/visibility"])==="optional",valueFormatter:cp,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 dp(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 up(t){const e=[];return cs(t,n=>(e.push(n),n)),e}async function WE(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 HE(t,e,n){const o=up(n),l=(await WE(t,e,o)).filter(d=>!Oe.find(o,u=>d.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(d=>({type:"column",column:d}))}}async function jE(t,e,n,o){const s=n.filter(m=>m.type!=="Bytes"),l=up(o),d=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 E=0;E<y.length;++E){const k=Oe.findIndex(s,D=>Oe.isEqual(D,y[E]));k===-1||u[k]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(d[k]=[[m,E]],u[k]=l[m].columnId):d[k].push([m,E]))}}for(let m=s.length-1;m>=0;--m)d[m].length||(u.splice(m,1),d.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,E]of d[m]){const k=await t.getUniqueValues(e,{columnId:l[y].columnId,...!u[m]&&{axis:Oe.cloneDeep(s[m])},filters:[],limit:p});if(k.overflow){u.splice(m,1),d.splice(m,1),s.splice(m,1);continue e}const D=k.values.type;for(const M of k.values.data)if(!(Ad(M,D)||M===null)&&(f[m].add(dp(M,D)),f[m].size===p)){u.splice(m,1),d.splice(m,1),s.splice(m,1);continue e}}if(!f[m].size){u.splice(m,1),d.splice(m,1),s.splice(m,1);continue e}}return s.map((m,y)=>{const E=[...f[y]].map(D=>({value:D,text:D.toString()})),k=E[0].value;return{axis:Oe.cloneDeep(m),...u[y]&&{column:u[y]},options:E,defaultValue:k}})}function qE(t,e,n,o){const s=t.length,l=[];for(let d=0;d<e[0].data.length;++d){const u=[],p=(o++).toString();for(const m of n)u.push(e[m].data[d]);const f={key:u,id:p};for(let m=0;m<s;++m){const y=t[m].toString(),E=e[m].data[d],k=e[m].type;wg(e[m].absent,d)?f[y]=void 0:Ad(E,k)||E===null?f[y]=null:f[y]=dp(E,k)}l.push(f)}return l}const KE=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function YE(t,e,n,o){const s=await t.getSpec(e);let l=s.findIndex(C=>C.type==="column");l===-1&&(l=s.length);const d=[...s.keys()].filter(C=>!Oe.find(n,B=>Oe.isEqual(B.axis,s[C].id)||Oe.isEqual(B.column,s[C].id))).sort((C,B)=>{var P,O;if(s[C].type!==s[B].type)return s[C].type==="axis"?-1:1;const Y=(P=s[C].spec.annotations)==null?void 0:P["pl7.app/table/orderPriority"],L=(O=s[B].spec.annotations)==null?void 0:O["pl7.app/table/orderPriority"];return Y===void 0?L===void 0?0:1:L===void 0?-1:Number(L)-Number(Y)}),u=Oe.cloneDeep(d),p=GE(s,d);for(let C=d.length-1;C>=0;--C){const B=d[C];if(!KE(s[B]))continue;const Y=$a(s[B].spec.axesSpec)[0],L=Oe.findIndex(d,P=>Oe.isEqual(s[P].id,Y));if(L!==-1){d[L]=B;for(const P of p)P.axisIdx===B&&(P.axisIdx=L);d.splice(C,1),u.splice(C,1)}}const f=await t.getShape(e),m=f.rows,y=u.map(C=>UE(C,s[C],o));if(p.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",p.length," transposition will not be applied."),p.length===1)return zE(p,f,y,await t.getData(e,d),u,d);const E=[...d],k=new Map;for(let C=0;C<l;++C)k.set(C,-1);for(let C=0;C<E.length;++C){const B=E[C];k.has(B)&&k.set(B,C)}for(const[C,B]of k)B===-1&&(k.set(C,E.length),E.push(C));const D=[];for(let C=0;C<l;++C){const B=k.get(C);if(B===void 0||B===-1)throw new Error("assertion exception");D.push(B)}let M;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(M&&!Oe.isEqual(M.request.sortModel,C.request.sortModel)){M=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}M=C;let B=0,Y=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(B=Math.min(m,C.request.endRow)-C.request.startRow,B>0)){const L=await t.getData(e,E,{offset:C.request.startRow,length:B});Y=qE(u,L,D,C.request.startRow)}C.success({rowData:Y,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(B){C.api.setGridOption("loading",!0),C.fail(),console.trace(B)}}}}}const JE={class:"ap-ag-data-table-container"},XE={key:0,class:"ap-ag-data-table-sheets"},QE=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([Qi.ClientSideRowModelModule,ld.ClipboardModule,ad.ServerSideRowModelModule,cd.RangeSelectionModule,Ha,Xd]);const n=r.useModel(t,"modelValue"),o=t,{settings:s}=r.toRefs(o),l=e;r.watch(()=>s.value,async(L,P)=>{if(L.sourceType!=="pframe"||!L.pFrame||!L.join||P&&P.sourceType==="pframe"&&Oe.isEqual(L.pFrame,P.pFrame)&&Oe.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 HE(z,L.pFrame,L.join),S=n.value;S.pTableParams||(S.pTableParams={sorting:[],filters:[]}),S.pTableParams.join=N,n.value=S});const d=pp(()=>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 S=s.value.pFrame,V=(O=n.value.pTableParams)==null?void 0:O.join;return V?await jE(N,S,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}=lp(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=k.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=>to(L);function m(L){var P;if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return((P=d.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,d.value],(L,P)=>{const[O,z]=L;if(!z)return;if(P){const[S,V]=P;if((O.sourceType==="ptable"||O.sourceType==="pframe")&&O.sourceType===(S==null?void 0:S.sourceType)&&Oe.isEqual(z,V))return}if(O.sourceType!=="ptable"&&O.sourceType!=="pframe"){y.value={};return}const N=y.value;for(const S of z){const V=f(S.axis);N[V]||(N[V]=S.defaultValue??S.options[0].value)}y.value=N},{immediate:!0});const E=r.shallowRef(),k=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:ip,noRowsOverlayComponent:sp,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=L=>{const P=L.api;E.value=new Proxy(P,{get(O,z,N){switch(z){case"setGridOption":return(S,V)=>{const W=k.value;W[S]=V,k.value=W,P.updateGridOptions(W)};case"updateGridOptions":return S=>{k.value={...k.value,...S},P.updateGridOptions(S)};default:return Reflect.get(O,z,N)}}})},M=L=>({columnOrder:L.columnOrder,sort:L.sort,columnVisibility:L.columnVisibility??(L.columnOrder?{hiddenColIds:[]}:void 0)}),G=L=>{k.value.initialState=p.value=M(L.state),L.api.autoSizeAllColumns()},C=()=>{k.value.initialState=p.value=M(E.value.getState()),E.value=void 0},B=r.ref(0);r.watch(()=>[E.value,p.value],(L,P)=>{if(Oe.isEqual(L,P))return;const[O,z]=L;if(!O)return;const N=M(O.getState());Oe.isEqual(z,N)||(k.value.initialState=z,++B.value)}),r.watch(()=>k.value,(L,P)=>{var O;if(P&&(L.rowModelType!=P.rowModelType&&++B.value,!Oe.isEqual(L.columnDefs,P.columnDefs)&&L.columnDefs)){const z=V=>!("children"in V),N=(O=L.columnDefs)==null?void 0:O.filter(z),S=N==null?void 0:N.map(V=>V.colId).filter(V=>V!==void 0).map(V=>lp(V));l("columnsChanged",S??[])}});const Y=(L,P)=>{var z;const O=y.value;O[L]!==P&&(O[L]=P,y.value=O,(z=E.value)==null||z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))};return r.watch(()=>[E.value,s.value,d.value],async(L,P)=>{var W,q;if(Oe.isEqual(L,P))return;const[O,z,N]=L;if(!O)return;const S=window.platforma;if(!S)throw Error("platforma not set");const V=z.sourceType;switch(V){case"pframe":case"ptable":{const U=S.pFrameDriver;if(!U)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,X=await YE(U,A,N,Z);return O.updateGridOptions({loading:X.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...X})}case"xsv":{const U=S.blobDriver;if(!U)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 LE(U,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",JE,[r.createVNode(r.Transition,{name:"ap-ag-data-table-sheets-transition"},{default:r.withCtx(()=>[r.unref(d).value&&r.unref(d).value.length>0?(r.openBlock(),r.createElementBlock("div",XE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d).value,(O,z)=>(r.openBlock(),r.createBlock(r.unref(Ru),{key:z,"model-value":y.value[f(O.axis)],options:O.options,"onUpdate:modelValue":N=>Y(f(O.axis),N)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0)]),_:1}),(r.openBlock(),r.createBlock(r.unref(sm.AgGridVue),{key:B.value,theme:r.unref(eu),class:"ap-ag-data-table-grid","grid-options":k.value,onGridReady:D,onStateUpdated:G,onGridPreDestroyed:C},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-278d42fe"]]),eT={key:0,class:"d-flex gap-10 flex-column"},tT={key:0},nT=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:o,restrictions:s,defaults:l}=r.toRefs(n),d=S=>to(S.id),u=r.computed(()=>o.value.filter(S=>{const V=S.type;switch(V){case"axis":return S.spec.type!=="Bytes";case"column":return S.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${V}`)}}).map(S=>({column:S,id:d(S)}))),p=r.computed(()=>{const S=s.value??[],V={};for(const{column:W,id:q}of u.value){const U=Oe.find(S,A=>Oe.isEqual(A.column.id,W.id));U!==void 0&&(V[q]=U.allowedFilterTypes)}return V}),f=r.computed(()=>{const S=l.value??[],V={};for(const{column:W,id:q}of u.value){const U=Oe.find(S,A=>Oe.isEqual(A.column.id,W.id));U!==void 0&&(V[q]=U.default)}return V}),m=S=>S!==void 0?S:f.value,y=r.reactive({state:m(e.value.state)});r.watch(()=>e.value,S=>{Oe.isEqual(y.state,S.state)||(y.state=m(S.state))}),r.watch(()=>u.value,S=>{if(y.state!==void 0&&S.length===0)return;const V=y.state??{},W={};for(const{id:q}of S)V[q]!==void 0&&(W[q]=V[q]);y.state=W},{immediate:!0});const E=S=>{switch(S){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: ${S}`)}},k=["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"],M=r.computed(()=>{const S=p.value,V={};for(const{column:W,id:q}of u.value){let A=(W.type==="column"?W.spec.valueType:W.spec.type)==="String"?D:k;const Z=S[q];Z!==void 0&&(A=A.filter(X=>Z.includes(X))),V[q]=A.map(X=>({value:X,text:E(X)}))}return V}),G=r.computed(()=>Oe.some(Object.values(M.value),S=>S.length>0)),C=S=>{const V=S.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 S.reference;case"number_between":return S.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return S.reference;default:throw Error(`unsupported filter type: ${V}`)}},B=(S,V)=>{switch(S){case"isNotNA":case"isNA":return{type:S};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:S,reference:typeof V=="number"?V:0};case"number_between":return{type:S,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:S,reference:typeof V=="string"?V:""};case"string_containsFuzzyMatch":return{type:S,reference:typeof V=="string"?V:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${S}`)}},Y=(S,V)=>{const W=y.state[S];y.state[S]=B(V,C(W))},L=(S,V)=>{V?y.state[S]=f.value[S]??B(M.value[S][0].value):delete y.state[S]},P=S=>{const V=Oe.uniq(S);return V.sort(),V.map(W=>({value:W,text:W}))},O=S=>{const V=Number(S);if(!Number.isFinite(V))throw Error("Model value is not a number.");return V},z=S=>{const V=S.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:S.reference};case"number_notEquals":case"string_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:S.reference}};case"number_greaterThan":return{operator:"Greater",reference:S.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:S.reference};case"number_lessThan":return{operator:"Less",reference:S.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:S.reference};case"number_between":return{operator:"And",operands:[{operator:S.includeLowerBound?"GreaterOrEqual":"Greater",reference:S.lowerBound},{operator:S.includeUpperBound?"LessOrEqual":"Less",reference:S.upperBound}]};case"string_contains":return{operator:"StringContains",substring:S.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:"StringContains",substring:S.reference}};case"string_matches":return{operator:"Matches",regex:S.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:S.reference}};case"string_containsFuzzyMatch":return{operator:"StringContainsFuzzy",reference:S.reference,maxEdits:S.maxEdits,substitutionsOnly:S.substitutionsOnly,wildcard:S.wildcard};default:throw Error(`unsupported filter type: ${V}`)}},N=S=>u.value.map(({column:V,id:W})=>{if(!(W in S))return;const q=z(S[W]),{spec:U,...A}=V;return{type:"bySingleColumn",column:A,predicate:q}}).filter(V=>V!==void 0);return r.watch(()=>y,S=>{Oe.isEqual(S.state,e.value.state)||(e.value={state:Oe.cloneDeep(S.state),filters:N(S.state)})},{immediate:!0,deep:!0}),(S,V)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,({column:W,id:q},U)=>{var A,Z,X,pe,we,Ct,Bt,ht,vr,Pn,_r,$n,Wr,Ps;return r.openBlock(),r.createElementBlock("div",{key:q},[M.value[q].length>0?(r.openBlock(),r.createElementBlock("form",eT,[r.createVNode(r.unref(Mu),{"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+" "+U.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(ui),{key:0,"model-value":y.state[q].type,options:M.value[q],label:"Predicate","onUpdate:modelValue":Ge=>Y(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"||((X=y.state[q])==null?void 0:X.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),((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: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"||((Pn=y.state[q])==null?void 0:Pn.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(np),{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(ui),{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)),G.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",tT,"No filters applicable"))],64))}}),[["__scopeId","data-v-b30bf5ef"]]),rT={key:1,class:"alert-error"},oT={key:2},iT=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&o.value===void 0);return(l,d)=>(r.openBlock(),r.createElementBlock("div",null,[n.value!==void 0?r.renderSlot(l.$slots,"default",r.normalizeProps(r.mergeProps({key:0},{value:n.value}))):r.createCommentVNode("",!0),o.value?(r.openBlock(),r.createElementBlock("div",rT,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",oT,"Unresolved")):r.createCommentVNode("",!0)]))}}),sT={style:{height:"100%"}},aT=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function s(d){e.params.setValue(d)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(d,u)=>(r.openBlock(),r.createElementBlock("div",sT,[r.createVNode(r.unref(ep),{"show-filename-only":"",clearable:"","cell-style":"","file-dialog-title":"Select any file",placeholder:`Choose file ${n.value?n.value[0]:""}`,extensions:n.value,"model-value":o.value,progress:l.value,"onUpdate:modelValue":s},null,8,["placeholder","extensions","model-value","progress"])]))}}),As=new Map;function lT(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{As.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function cT(t){const e=Symbol();return()=>(As.has(e)||As.set(e,lT(e,t)),As.get(e))}function dT(t){return r.computed(()=>{try{return md(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function pp(t,e,n){const o=r.ref(0),s=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=cm(e);return r.watch(t,async d=>{s.error=void 0,o.value++,l(d).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const Co=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,hp=new Set,Nl=typeof process=="object"&&process?process:{},fp=(t,e,n,o)=>{typeof Nl.emitWarning=="function"?Nl.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let Ns=globalThis.AbortController,mp=globalThis.AbortSignal;if(typeof Ns>"u"){mp=class{constructor(){$e(this,"onabort");$e(this,"_onabort",[]);$e(this,"reason");$e(this,"aborted",!1)}addEventListener(o,s){this._onabort.push(s)}},Ns=class{constructor(){$e(this,"signal",new mp);e()}abort(o){var s,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const d of this.signal._onabort)d(o);(l=(s=this.signal).onabort)==null||l.call(s,o)}}};let t=((yp=Nl.env)==null?void 0:yp.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,fp("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 uT=t=>!hp.has(t),gr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),gp=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,wo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=gp(e);if(!n)return[];fe(zr,wo,!0);const o=new zr(e,n);return fe(zr,wo,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};wo=new WeakMap,Le(zr,wo,!1);let Vl=zr;const Fl=class Fl{constructor(e){Le(this,te);Le(this,dn);Le(this,Ot);Le(this,un);Le(this,pn);Le(this,bo);Le(this,xo);$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,ot);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,Ni,()=>{});Le(this,$t,()=>!1);Le(this,Zr,e=>{});Le(this,ko,(e,n,o)=>{});Le(this,Vi,(e,n,o,s)=>{if(o||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});$e(this,vp,"LRUCache");const{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:d,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:E,maxSize:k=0,maxEntrySize:D=0,sizeCalculation:M,fetchMethod:G,memoMethod:C,noDeleteOnFetchRejection:B,noDeleteOnStaleGet:Y,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?gp(n):Array;if(!z)throw new Error("invalid max value: "+n);if(fe(this,dn,n),fe(this,Ot,k),this.maxEntrySize=D||w(this,Ot),this.sizeCalculation=M,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,xo,C),G!==void 0&&typeof G!="function")throw new TypeError("fetchMethod must be a function if specified");if(fe(this,bo,G),fe(this,yr,!!G),fe(this,ot,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,Vl.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=!!E,this.noDeleteOnFetchRejection=!!B,this.allowStaleOnFetchRejection=!!L,this.allowStaleOnFetchAbort=!!P,this.ignoreFetchAbort=!!O,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,em).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!Y,this.updateAgeOnGet=!!d,this.updateAgeOnHas=!!u,this.ttlResolution=gr(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!gr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");le(this,te,rd).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 N="LRU_CACHE_UNBOUNDED";uT(N)&&(hp.add(N),fp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",N,Fl))}}static unsafeExposeInternals(e){return{starts:w(e,gn),ttls:w(e,zt),sizes:w(e,mn),keyMap:w(e,ot),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 o;return le(o=e,te,Ke).call(o,n)},backgroundFetch:(n,o,s,l)=>{var d;return le(d=e,te,Ea).call(d,n,o,s,l)},moveToTail:n=>{var o;return le(o=e,te,Xi).call(o,n)},indexes:n=>{var o;return le(o=e,te,Nr).call(o,n)},rindexes:n=>{var o;return le(o=e,te,Vr).call(o,n)},isStale:n=>{var o;return w(o=e,$t).call(o,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,bo)}get memoMethod(){return w(this,xo)}get dispose(){return w(this,un)}get disposeAfter(){return w(this,pn)}getRemainingTTL(e){return w(this,ot).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])}[(_p=Symbol.iterator,vp=Symbol.toStringTag,_p)](){return this.entries()}find(e,n={}){for(const o of le(this,te,Nr).call(this)){const s=w(this,be)[o],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,w(this,je)[o],this))return this.get(w(this,je)[o],n)}}forEach(e,n=this){for(const o of le(this,te,Nr).call(this)){const s=w(this,be)[o],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,je)[o],this)}}rforEach(e,n=this){for(const o of le(this,te,Vr).call(this)){const s=w(this,be)[o],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,w(this,je)[o],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,ot).get(e);if(n===void 0)return;const o=w(this,be)[n],s=le(this,te,Ke).call(this,o)?o.__staleWhileFetching:o;if(s===void 0)return;const l={value:s};if(w(this,zt)&&w(this,gn)){const d=w(this,zt)[n],u=w(this,gn)[n];if(d&&u){const p=d-(Co.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 o=w(this,je)[n],s=w(this,be)[n],l=le(this,te,Ke).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||o===void 0)continue;const d={value:l};if(w(this,zt)&&w(this,gn)){d.ttl=w(this,zt)[n];const u=Co.now()-w(this,gn)[n];d.start=Math.floor(Date.now()-u)}w(this,mn)&&(d.size=w(this,mn)[n]),e.unshift([o,d])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const s=Date.now()-o.start;o.start=Co.now()-s}this.set(n,o.value,o)}}set(e,n,o={}){var E,k,D,M,G;if(n===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:l,noDisposeOnSet:d=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=o;let{noUpdateTTL:f=this.noUpdateTTL}=o;const m=w(this,Vi).call(this,e,n,o.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,ot).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,ot).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,ko).call(this,y,m,p),p&&(p.set="add"),f=!1;else{le(this,te,Xi).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:B}=C;B!==void 0&&!d&&(w(this,yn)&&((E=w(this,un))==null||E.call(this,B,e,"set")),w(this,Tt)&&((k=w(this,ut))==null||k.push([B,e,"set"])))}else d||(w(this,yn)&&((D=w(this,un))==null||D.call(this,C,e,"set")),w(this,Tt)&&((M=w(this,ut))==null||M.push([C,e,"set"])));if(w(this,Zr).call(this,y),w(this,ko).call(this,y,m,p),w(this,be)[y]=n,p){p.set="replace";const B=C&&le(this,te,Ke).call(this,C)?C.__staleWhileFetching:C;B!==void 0&&(p.oldValue=B)}}else p&&(p.set="update")}if(s!==0&&!w(this,zt)&&le(this,te,rd).call(this),w(this,zt)&&(f||w(this,Ni).call(this,y,s,l),p&&w(this,zn).call(this,p,y)),!d&&w(this,Tt)&&w(this,ut)){const C=w(this,ut);let B;for(;B=C==null?void 0:C.shift();)(G=w(this,pn))==null||G.call(this,...B)}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 o;for(;o=n==null?void 0:n.shift();)(e=w(this,pn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:s}=n,l=w(this,ot).get(e);if(l!==void 0){const d=w(this,be)[l];if(le(this,te,Ke).call(this,d)&&d.__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 o&&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:o=this.allowStale}=n,s=w(this,ot).get(e);if(s===void 0||!o&&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:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:d=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:E=this.allowStaleOnFetchRejection,ignoreFetchAbort:k=this.ignoreFetchAbort,allowStaleOnFetchAbort:D=this.allowStaleOnFetchAbort,context:M,forceRefresh:G=!1,status:C,signal:B}=n;if(!w(this,yr))return C&&(C.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const Y={allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:d,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:D,ignoreFetchAbort:k,status:C,signal:B};let L=w(this,ot).get(e);if(L===void 0){C&&(C.fetch="miss");const P=le(this,te,Ea).call(this,e,L,Y,M);return P.__returned=P}else{const P=w(this,be)[L];if(le(this,te,Ke).call(this,P)){const V=o&&P.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",V&&(C.returnedStale=!0)),V?P.__staleWhileFetching:P.__returned=P}const O=w(this,$t).call(this,L);if(!G&&!O)return C&&(C.fetch="hit"),le(this,te,Xi).call(this,L),s&&w(this,$r).call(this,L),C&&w(this,zn).call(this,C,L),P;const z=le(this,te,Ea).call(this,e,L,Y,M),S=z.__staleWhileFetching!==void 0&&o;return C&&(C.fetch=O?"stale":"refresh",S&&O&&(C.returnedStale=!0)),S?z.__staleWhileFetching:z.__returned=z}}async forceFetch(e,n={}){const o=await this.fetch(e,n);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,n={}){const o=w(this,xo);if(!o)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:l,...d}=n,u=this.get(e,d);if(!l&&u!==void 0)return u;const p=o(e,u,{options:d,context:s});return this.set(e,p,d),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:d}=n,u=w(this,ot).get(e);if(u!==void 0){const p=w(this,be)[u],f=le(this,te,Ke).call(this,p);return d&&w(this,zn).call(this,d,u),w(this,$t).call(this,u)?(d&&(d.get="stale"),f?(d&&o&&p.__staleWhileFetching!==void 0&&(d.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||le(this,te,Pr).call(this,e,"expire"),d&&o&&(d.returnedStale=!0),o?p:void 0)):(d&&(d.get="hit"),f?p.__staleWhileFetching:(le(this,te,Xi).call(this,u),s&&w(this,$r).call(this,u),p))}else d&&(d.get="miss")}delete(e){return le(this,te,Pr).call(this,e,"delete")}clear(){return le(this,te,sd).call(this,"delete")}};dn=new WeakMap,Ot=new WeakMap,un=new WeakMap,pn=new WeakMap,bo=new WeakMap,xo=new WeakMap,st=new WeakMap,hn=new WeakMap,ot=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,rd=function(){const e=new Vs(w(this,dn)),n=new Vs(w(this,dn));fe(this,zt,e),fe(this,gn,n),fe(this,Ni,(l,d,u=Co.now())=>{if(n[l]=d!==0?u:0,e[l]=d,d!==0&&this.ttlAutopurge){const p=setTimeout(()=>{w(this,$t).call(this,l)&&le(this,te,Pr).call(this,w(this,je)[l],"expire")},d+1);p.unref&&p.unref()}}),fe(this,$r,l=>{n[l]=e[l]!==0?Co.now():0}),fe(this,zn,(l,d)=>{if(e[d]){const u=e[d],p=n[d];if(!u||!p)return;l.ttl=u,l.start=p,l.now=o||s();const f=l.now-p;l.remainingTTL=u-f}});let o=0;const s=()=>{const l=Co.now();if(this.ttlResolution>0){o=l;const d=setTimeout(()=>o=0,this.ttlResolution);d.unref&&d.unref()}return l};this.getRemainingTTL=l=>{const d=w(this,ot).get(l);if(d===void 0)return 0;const u=e[d],p=n[d];if(!u||!p)return 1/0;const f=(o||s())-p;return u-f},fe(this,$t,l=>{const d=n[l],u=e[l];return!!u&&!!d&&(o||s())-d>u})},$r=new WeakMap,zn=new WeakMap,Ni=new WeakMap,$t=new WeakMap,em=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,Vi,(n,o,s,l)=>{if(le(this,te,Ke).call(this,o))return 0;if(!gr(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(o,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,ko,(n,o,s)=>{if(e[n]=o,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=o,s.totalCalculatedSize=w(this,hn))})},Zr=new WeakMap,ko=new WeakMap,Vi=new WeakMap,Nr=function*({allowStale:e=this.allowStale}={}){if(w(this,st))for(let n=w(this,dt);!(!le(this,te,od).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,od).call(this,n)||((e||!w(this,$t).call(this,n))&&(yield n),n===w(this,dt)));)n=w(this,Et)[n]},od=function(e){return e!==void 0&&w(this,ot).get(w(this,je)[e])===e},Sa=function(e){var l,d;const n=w(this,_t),o=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,o,"evict")),w(this,Tt)&&((d=w(this,ut))==null||d.push([s,o,"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,Et)[n]),w(this,ot).delete(o),ka(this,st)._--,n},Ea=function(e,n,o,s){const l=n===void 0?void 0:w(this,be)[n];if(le(this,te,Ke).call(this,l))return l;const d=new Ns,{signal:u}=o;u==null||u.addEventListener("abort",()=>d.abort(u.reason),{signal:d.signal});const p={signal:d.signal,options:o,context:s},f=(M,G=!1)=>{const{aborted:C}=d.signal,B=o.ignoreFetchAbort&&M!==void 0;if(o.status&&(C&&!G?(o.status.fetchAborted=!0,o.status.fetchError=d.signal.reason,B&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),C&&!B&&!G)return y(d.signal.reason);const Y=k;return w(this,be)[n]===k&&(M===void 0?Y.__staleWhileFetching?w(this,be)[n]=Y.__staleWhileFetching:le(this,te,Pr).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,M,p.options))),M},m=M=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=M),y(M)),y=M=>{const{aborted:G}=d.signal,C=G&&o.allowStaleOnFetchAbort,B=C||o.allowStaleOnFetchRejection,Y=B||o.noDeleteOnFetchRejection,L=k;if(w(this,be)[n]===k&&(!Y||L.__staleWhileFetching===void 0?le(this,te,Pr).call(this,e,"fetch"):C||(w(this,be)[n]=L.__staleWhileFetching)),B)return o.status&&L.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),L.__staleWhileFetching;if(L.__returned===L)throw M},E=(M,G)=>{var B;const C=(B=w(this,bo))==null?void 0:B.call(this,e,l,p);C&&C instanceof Promise&&C.then(Y=>M(Y===void 0?void 0:Y),G),d.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(M(void 0),o.allowStaleOnFetchAbort&&(M=Y=>f(Y,!0)))})};o.status&&(o.status.fetchDispatched=!0);const k=new Promise(E).then(f,m),D=Object.assign(k,{__abortController:d,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,D,{...p.options,status:void 0}),n=w(this,ot).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 Ns},id=function(e,n){w(this,Gt)[n]=e,w(this,Et)[e]=n},Xi=function(e){e!==w(this,dt)&&(e===w(this,_t)?fe(this,_t,w(this,Et)[e]):le(this,te,id).call(this,w(this,Gt)[e],w(this,Et)[e]),le(this,te,id).call(this,w(this,dt),e),fe(this,dt,e))},Pr=function(e,n){var s,l,d,u;let o=!1;if(w(this,st)!==0){const p=w(this,ot).get(e);if(p!==void 0)if(o=!0,w(this,st)===1)le(this,te,sd).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,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,ot).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)&&((d=w(this,ut))!=null&&d.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 o},sd=function(e){var n,o,s;for(const l of le(this,te,Vr).call(this,{allowStale:!0})){const d=w(this,be)[l];if(le(this,te,Ke).call(this,d))d.__abortController.abort(new Error("deleted"));else{const u=w(this,je)[l];w(this,yn)&&((n=w(this,un))==null||n.call(this,d,u,e)),w(this,Tt)&&((o=w(this,ut))==null||o.push([d,u,e]))}}if(w(this,ot).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 d;for(;d=l==null?void 0:l.shift();)(s=w(this,pn))==null||s.call(this,...d)}};let Pl=Fl;const pT={cacheSize:15e6};class hT{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 Ur=class Ur{constructor(e){$e(this,"fileDataCache");$e(this,"fileDataRefs",new Map);const n={...pT,...e??{}};this.fileDataCache=new Pl({maxSize:n.cacheSize,fetchMethod:async o=>new hT(await kg().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,s)=>{this.fileDataRefs.delete(s)}})}getDataRef(e){const n=this.fileDataRefs.get(e);if(n!==void 0)return n;const o=r.shallowRef();return this.fileDataRefs.set(e,o),(async()=>{try{const s=await this.fileDataCache.fetch(e);o.value=s}catch(s){console.error(s)}})(),o}getContentBytes(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n.value)==null?void 0:o.bytes})}getContentString(e){if(e===void 0)return;const n=this.getDataRef(e);return r.computed(()=>{var o;return(o=n==null?void 0:n.value)==null?void 0:o.str})}getContentJson(e,n){if(e===void 0)return;const o=this.getDataRef(e);return r.computed(()=>{var s,l;return n===void 0?(s=o==null?void 0:o.value)==null?void 0:s.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return Ur.globalInstance.getContentBytes(e)}static getContentString(e){return Ur.globalInstance.getContentString(e)}static getContentJson(e,n){return Ur.globalInstance.getContentJson(e,n)}};$e(Ur,"globalInstance",new Ur);let Dl=Ur;I.AgGridTheme=eu,I.BlockLayout=DE,I.ContextProvider=_k,I.DataTable=G_,I.DemoData=CE,I.DropdownListItem=uo,I.LongText=_l,I.MultiError=Aa,I.PlAgCellFile=aT,I.PlAgDataTable=QE,I.PlAgOverlayLoading=ip,I.PlAgOverlayNoRows=sp,I.PlAlert=yC,I.PlBlockPage=rC,I.PlBtnAccent=RC,I.PlBtnDanger=IC,I.PlBtnGhost=hl,I.PlBtnGroup=iw,I.PlBtnLink=zC,I.PlBtnPrimary=ul,I.PlBtnSecondary=pl,I.PlBtnSplit=NC,I.PlCheckbox=Mu,I.PlCheckboxGroup=ib,I.PlChip=Cl,I.PlContainer=iC,I.PlDialogModal=bl,I.PlDropdown=ui,I.PlDropdownLegacy=T0,I.PlDropdownLine=Ru,I.PlDropdownMulti=eb,I.PlDropdownRef=n0,I.PlFileDialog=Ou,I.PlFileInput=ep,I.PlGrid=uC,I.PlIcon16=ms,I.PlIcon24=Vu,I.PlLogView=Lu,I.PlMaskIcon16=ho,I.PlMaskIcon24=On,I.PlNotificationAlert=tp,I.PlNumberField=O0,I.PlProgressBar=P0,I.PlRow=aC,I.PlSlideModal=_b,I.PlSpacer=ku,I.PlTableFilters=nT,I.PlTabs=zb,I.PlTextArea=Mw,I.PlTextField=Ir,I.PlToggleSwitch=gs,I.PlTooltip=kt,I.ReactiveFileContent=Dl,I.Scrollable=cS,I.Slider=np,I.SliderRange=iS,I.SliderRangeTriple=jk,I.ThemeSwitcher=Y_,I.UnresolvedError=Ba,I.ValueOrErrorsComponent=iT,I.activateAgGrid=Qd,I.animate=vu,I.animateInfinite=W_,I.call=hu,I.computedResult=dT,I.createModel=Ra,I.debounce=_u,I.defineApp=gv,I.defineStore=cT,I.delay=fu,I.detectOutside=Iw,I.ensureError=Pa,I.eventListener=yl,I.formatZodError=Fa,I.getElementScrollPosition=Du,I.identity=Va,I.isDefined=fm,I.isElementVisible=Pu,I.isJsonEqual=Na,I.isZodError=Da,I.listToOptions=H_,I.makeEaseInOut=U_,I.makeEaseOut=yu,I.maskIcons16=vE,I.maskIcons24=_E,I.normalizeListOptions=ar,I.notEmpty=sl,I.randomInt=gu,I.randomString=Z_,I.requestTick=al,I.scrollIntoView=di,I.showContextMenu=rl,I.throttle=Cu,I.timeout=mu,I.unwrapOptionalResult=hm,I.unwrapValueOrErrors=fd,I.useClickOutside=fs,I.useDraggable=Mk,I.useEventListener=tt,I.useFormState=Fk,I.useHover=uu,I.useInterval=Dk,I.useLabelNotch=Ln,I.useLocalStorage=wu,I.useMouse=du,I.useMouseCapture=sr,I.usePosition=po,I.useQuery=Rk,I.useResizeObserver=rp,I.useScroll=Nk,I.useSdkPlugin=Xa,I.useSortable=Pk,I.useTheme=xu,I.useWatchFetch=pp,I.wrapOptionalResult=md,I.wrapValueOrErrors=pm,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
|