@platforma-sdk/ui-vue 1.11.2 → 1.11.3
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 +7 -0
- package/dist/lib.js +5956 -5837
- package/dist/lib.umd.cjs +22 -22
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
(function(M,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@ag-grid-enterprise/core"),require("@ag-grid-community/core"),require("@ag-grid-community/client-side-row-model"),require("@ag-grid-community/infinite-row-model"),require("@ag-grid-enterprise/server-side-row-model"),require("@ag-grid-community/csv-export"),require("@ag-grid-enterprise/clipboard"),require("@ag-grid-enterprise/range-selection"),require("@ag-grid-enterprise/rich-select"),require("@ag-grid-enterprise/menu"),require("@ag-grid-enterprise/excel-export"),require("@ag-grid-community/theming"),require("@ag-grid-community/vue3")):typeof define=="function"&&define.amd?define(["exports","vue","@ag-grid-enterprise/core","@ag-grid-community/core","@ag-grid-community/client-side-row-model","@ag-grid-community/infinite-row-model","@ag-grid-enterprise/server-side-row-model","@ag-grid-community/csv-export","@ag-grid-enterprise/clipboard","@ag-grid-enterprise/range-selection","@ag-grid-enterprise/rich-select","@ag-grid-enterprise/menu","@ag-grid-enterprise/excel-export","@ag-grid-community/theming","@ag-grid-community/vue3"],r):(M=typeof globalThis<"u"?globalThis:M||self,r(M.SdkVueLib={},M.Vue,M.core$1,M.core,M.clientSideRowModel,M.infiniteRowModel,M.serverSideRowModel,M.csvExport,M.clipboard,M.rangeSelection,M.richSelect,M.menu,M.excelExport,M.theming,M.vue3))})(this,function(M,r,Re,b,Qi,
|
|
1
|
+
(function(M,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@ag-grid-enterprise/core"),require("@ag-grid-community/core"),require("@ag-grid-community/client-side-row-model"),require("@ag-grid-community/infinite-row-model"),require("@ag-grid-enterprise/server-side-row-model"),require("@ag-grid-community/csv-export"),require("@ag-grid-enterprise/clipboard"),require("@ag-grid-enterprise/range-selection"),require("@ag-grid-enterprise/rich-select"),require("@ag-grid-enterprise/menu"),require("@ag-grid-enterprise/excel-export"),require("@ag-grid-community/theming"),require("@ag-grid-community/vue3")):typeof define=="function"&&define.amd?define(["exports","vue","@ag-grid-enterprise/core","@ag-grid-community/core","@ag-grid-community/client-side-row-model","@ag-grid-community/infinite-row-model","@ag-grid-enterprise/server-side-row-model","@ag-grid-community/csv-export","@ag-grid-enterprise/clipboard","@ag-grid-enterprise/range-selection","@ag-grid-enterprise/rich-select","@ag-grid-enterprise/menu","@ag-grid-enterprise/excel-export","@ag-grid-community/theming","@ag-grid-community/vue3"],r):(M=typeof globalThis<"u"?globalThis:M||self,r(M.SdkVueLib={},M.Vue,M.core$1,M.core,M.clientSideRowModel,M.infiniteRowModel,M.serverSideRowModel,M.csvExport,M.clipboard,M.rangeSelection,M.richSelect,M.menu,M.excelExport,M.theming,M.vue3))})(this,function(M,r,Re,b,Qi,rm,ad,om,ld,cd,im,sm,am,dd,lm){"use strict";var fR=Object.defineProperty;var em=M=>{throw TypeError(M)};var mR=(M,r,Re)=>r in M?fR(M,r,{enumerable:!0,configurable:!0,writable:!0,value:Re}):M[r]=Re;var $e=(M,r,Re)=>mR(M,typeof r!="symbol"?r+"":r,Re),nd=(M,r,Re)=>r.has(M)||em("Cannot "+Re);var w=(M,r,Re)=>(nd(M,r,"read from private field"),Re?Re.call(M):r.get(M)),Le=(M,r,Re)=>r.has(M)?em("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(M):r.set(M,Re),fe=(M,r,Re,b)=>(nd(M,r,"write to private field"),b?b.call(M,Re):r.set(M,Re),Re),le=(M,r,Re)=>(nd(M,r,"access private method"),Re);var ka=(M,r,Re,b)=>({set _(Qi){fe(M,r,Qi,Re)},get _(){return w(M,r,b)}});var vp,wo,Cp,wp,un,Ot,pn,hn,bo,xo,st,fn,ot,je,be,Et,Gt,vt,dt,mn,ut,gn,yn,zt,_n,yr,Tt,te,rd,Zr,zn,Ni,$t,nm,Ur,ko,Vi,Nr,Vr,od,Sa,Ea,Ke,id,Xi,Pr,sd;function cm(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}const ud=Array.isArray;function dm(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 Sn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Sn(t[n]);return e}else if(dm(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Sn(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 um(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 pm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hm=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((s,l,c)=>`${s}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,s)=>{if(e[s]===void 0||typeof e[s]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(s)}:${t(e[s])}`},"")}}`};const no=pm(hm);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 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=P=>{s.value={model:kn(P)}};r.watch(()=>t.get(),P=>l(P),{immediate:!0});const d=()=>{var P;t.onSave(e(kn((P=s.value)==null?void 0:P.model)))},u=()=>{l(t.get()),o.value=void 0},p=P=>{const R=Pa(P);Da(R)?o.value=Error(Fa(R)):o.value=R},f=P=>{o.value=void 0;try{e(P),n&&d()}catch(R){p(R)}},m=r.computed({get:()=>{var P;return(P=s.value)==null?void 0:P.model},set(P){l(P),f(P)}});r.watch(s,(P,R)=>{P&&P===R&&f(P.model)},{deep:!0});const y=r.computed(()=>!o.value),B=r.computed(()=>!Na(t.get(),r.unref(s))),E=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:B,error:o,errorString:E,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=L=>{var C;if(n.deepPatchModel){const V=(C=d.value)==null?void 0:C.model,q=Object.assign(kn(L),e??{});d.value={model:V?hd(V,q):q,stage:Symbol()}}else d.value={model:Object.assign(kn(L),e??{}),stage:Symbol()}};r.watch(()=>t.get(),L=>u(L),{immediate:!0});const p=()=>{var L;t.onSave(o(kn((L=d.value)==null?void 0:L.model)))},f=()=>{u(t.get()),l.value=void 0},m=L=>{const C=Pa(L);Da(C)?l.value=Error(Fa(C)):l.value=C},y=L=>{l.value=void 0;try{o(L),s&&p()}catch(C){m(C)}},B=r.computed({get:()=>{var L;return(L=d.value)==null?void 0:L.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:B.value.args,ui:B.value.ui}),()=>{var L;return(L=d.value)==null?void 0:L.stage}],([L,C],[V,q])=>{C===q&&y(L)},{deep:!0});const E=r.computed(()=>!l.value),P=r.computed(()=>{var V;const{args:L,ui:C}=((V=r.unref(d))==null?void 0:V.model)??{};return!Na(t.get(),{args:L,ui:C})}),R=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:B,valid:E,isChanged:P,error:l,errorString:R,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,...V)=>{n.debug&&console.log(`%c>>> %c${C}`,"color: orange; font-weight: bold","color: orange",...V)},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(V=>{V.key==="args"&&(p.args=Object.freeze(V.value),o("args patch",p.args)),V.key==="ui"&&(p.ui=Object.freeze(V.value),o("ui patch",p.ui)),V.key==="outputs"&&(p.outputs=Object.freeze(V.value),o("outputs patch",p.outputs)),V.key==="navigationState"&&(p.navigationState=Object.freeze(V.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const f=()=>kn(p.args),m=()=>kn(p.ui),y=()=>kn(p.navigationState),B={createArgsModel(C={}){return Ra({get(){return C.transform?C.transform(p.args):p.args},validate:C.validate,autoSave:!0,onSave(V){l(V)}})},createUiModel(C={},V){return Ra({get(){return C.transform?C.transform(p.ui):p.ui??V()},validate:C.validate,autoSave:!0,onSave(q){d(q)}})},useOutputs(...C){const V=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(V,{value:this.unwrapOutputs(...C),errors:void 0})}catch(q){Object.assign(V,{value:void 0,errors:[String(q)]})}},{immediate:!0,deep:!0}),V},unwrapOutputs(...C){const V=p.outputs,q=C.map(X=>[X,fd(V[X])]);return Object.fromEntries(q)},getOutputField(C){return p.outputs[C]},getOutputFieldOkOptional(C){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const V=this.getOutputField(C);if(V&&V.ok)return V.value},getOutputFieldErrorsOptional(C){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const V=this.getOutputField(C);if(V&&!V.ok)return V.errors},updateArgs(C){const V=f();return C(V),e.setBlockArgs(V)},updateUiState(C){const V=m();return e.setBlockUiState(C(V))},updateNavigationState(C){const V=y();return C(V),e.setNavigationState(V)},navigateTo(C){const V=y();return V.href=C,e.setNavigationState(V)}},E=r.computed(()=>{const C=Object.entries(p.outputs).map(([V,q])=>[V,q.ok&&q.value!==void 0?q.value:void 0]);return Object.fromEntries(C)}),P=r.computed(()=>{const C=Object.entries(p.outputs).map(([V,q])=>[V,q&&!q.ok?new Aa(q.errors):void 0]);return Object.fromEntries(C)}),R={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"),E.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),P.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},L=mm({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(C){u(C.args,C.ui)}},{outputs:E,outputErrors:P},n);return r.reactive(Object.assign(L,B,R))}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,B=await m.value;f.push({key:y,value:B,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(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 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">
|
|
3
|
+
`)}}function fm(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 mm(t){if(t.errors)throw new Aa(t.errors);if(!t.value)throw new Ba;return t.value}function gm(t){return t!==void 0}function Na(t,e){return no(t)===no(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=P=>{s.value={model:Sn(P)}};r.watch(()=>t.get(),P=>l(P),{immediate:!0});const c=()=>{var P;t.onSave(e(Sn((P=s.value)==null?void 0:P.model)))},u=()=>{l(t.get()),o.value=void 0},p=P=>{const R=Pa(P);Da(R)?o.value=Error(Fa(R)):o.value=R},f=P=>{o.value=void 0;try{e(P),n&&c()}catch(R){p(R)}},m=r.computed({get:()=>{var P;return(P=s.value)==null?void 0:P.model},set(P){l(P),f(P)}});r.watch(s,(P,R)=>{P&&P===R&&f(P.model)},{deep:!0});const y=r.computed(()=>!o.value),B=r.computed(()=>!Na(t.get(),r.unref(s))),E=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:B,error:o,errorString:E,save:c,revert:u,setError:p})}function ym(t,e,n){const o=t.validate??Va,{autoSave:s}=t,l=r.ref(),c=r.ref(),u=L=>{var C;if(n.deepPatchModel){const V=(C=c.value)==null?void 0:C.model,q=Object.assign(Sn(L),e??{});c.value={model:V?hd(V,q):q,stage:Symbol()}}else c.value={model:Object.assign(Sn(L),e??{}),stage:Symbol()}};r.watch(()=>t.get(),L=>u(L),{immediate:!0});const p=()=>{var L;t.onSave(o(Sn((L=c.value)==null?void 0:L.model)))},f=()=>{u(t.get()),l.value=void 0},m=L=>{const C=Pa(L);Da(C)?l.value=Error(Fa(C)):l.value=C},y=L=>{l.value=void 0;try{o(L),s&&p()}catch(C){m(C)}},B=r.computed({get:()=>{var L;return(L=c.value)==null?void 0:L.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:B.value.args,ui:B.value.ui}),()=>{var L;return(L=c.value)==null?void 0:L.stage}],([L,C],[V,q])=>{C===q&&y(L)},{deep:!0});const E=r.computed(()=>!l.value),P=r.computed(()=>{var V;const{args:L,ui:C}=((V=r.unref(c))==null?void 0:V.model)??{};return!Na(t.get(),{args:L,ui:C})}),R=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:B,valid:E,isChanged:P,error:l,errorString:R,save:p,revert:f,setError:m})}const _m=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function vm(t,e,n){const o=(C,...V)=>{n.debug&&console.log(`%c>>> %c${C}`,"color: orange; font-weight: bold","color: orange",...V)},l=Ta(e.setBlockArgs,100),c=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(V=>{V.key==="args"&&(p.args=Object.freeze(V.value),o("args patch",p.args)),V.key==="ui"&&(p.ui=Object.freeze(V.value),o("ui patch",p.ui)),V.key==="outputs"&&(p.outputs=Object.freeze(V.value),o("outputs patch",p.outputs)),V.key==="navigationState"&&(p.navigationState=Object.freeze(V.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const f=()=>Sn(p.args),m=()=>Sn(p.ui),y=()=>Sn(p.navigationState),B={createArgsModel(C={}){return Ra({get(){return C.transform?C.transform(p.args):p.args},validate:C.validate,autoSave:!0,onSave(V){l(V)}})},createUiModel(C={},V){return Ra({get(){return C.transform?C.transform(p.ui):p.ui??V()},validate:C.validate,autoSave:!0,onSave(q){c(q)}})},useOutputs(...C){const V=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(V,{value:this.unwrapOutputs(...C),errors:void 0})}catch(q){Object.assign(V,{value:void 0,errors:[String(q)]})}},{immediate:!0,deep:!0}),V},unwrapOutputs(...C){const V=p.outputs,q=C.map(X=>[X,fd(V[X])]);return Object.fromEntries(q)},getOutputField(C){return p.outputs[C]},getOutputFieldOkOptional(C){console.warn("use reactive app.outputValues.fieldName instead instead of getOutputFieldOkOptional(fieldName)");const V=this.getOutputField(C);if(V&&V.ok)return V.value},getOutputFieldErrorsOptional(C){console.warn("use reactive app.outputErrors.fieldName instead instead of getOutputFieldErrorsOptional(fieldName)");const V=this.getOutputField(C);if(V&&!V.ok)return V.errors},updateArgs(C){const V=f();return C(V),e.setBlockArgs(V)},updateUiState(C){const V=m();return e.setBlockUiState(C(V))},updateNavigationState(C){const V=y();return C(V),e.setNavigationState(V)},navigateTo(C){const V=y();return V.href=C,e.setNavigationState(V)}},E=r.computed(()=>{const C=Object.entries(p.outputs).map(([V,q])=>[V,q.ok&&q.value!==void 0?q.value:void 0]);return Object.fromEntries(C)}),P=r.computed(()=>{const C=Object.entries(p.outputs).map(([V,q])=>[V,q&&!q.ok?new Aa(q.errors):void 0]);return Object.fromEntries(C)}),R={snapshot:p,queryParams:r.computed(()=>_m(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"),E.value)),outputErrors:r.computed(()=>(console.warn("Change app.outputErrors to app.model.outputErrors"),P.value)),args:r.computed(()=>(console.warn("Change app.args to app.snapshot.args"),p.args)),outputs:r.computed(()=>(console.warn("Change app.outputs to app.snapshot.outputs"),p.outputs)),ui:r.computed(()=>(console.warn("Change app.ui to app.snapshot.ui"),p.ui)),navigationState:r.computed(()=>(console.warn("Change app.navigationState to app.snapshot.navigationState"),p.navigationState))},L=ym({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(C){u(C.args,C.ui)}},{outputs:E,outputErrors:P},n);return r.reactive(Object.assign(L,B,R))}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 o(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(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"]),Cm=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 c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let u=o,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),o}static assert(e){if(!(e instanceof 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 ro=(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=ro;function wm(t){gd=t}function es(){return gd}const ts=t=>{const{data:e,path:n,errorMaps:o,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},bm=[];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===ro?void 0:ro].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 ve;s.status==="dirty"&&e.dirty(),o.push(s.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const s of n){const l=await s.key,c=await s.value;o.push({key:l,value:c})}return gt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return ve;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const ve=Object.freeze({status:"aborted"}),oo=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 En{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 _d=(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:(c,u)=>{var p,f;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??u.defaultError}:typeof u.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=m??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class 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 _d(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 _d(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:Q.custom,...o(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new an({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Bn.create(this,this._def)}nullable(){return rr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this,this._def)}promise(){return lo.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 an({...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 xm=/^c[^\s-]{8,}$/i,km=/^[0-9a-z]+$/,Sm=/^[0-9A-HJKMNP-TV-Z]{26}$/,Em=/^[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,Tm=/^[a-z0-9_-]{21}$/i,Bm=/^[-+]?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)?)??$/,Am=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Nm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oa;const Vm=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Pm=/^(([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})))$/,Dm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vd="((\\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])))",Fm=new RegExp(`^${vd}$`);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 Rm(t){return new RegExp(`^${Cd(t)}$`)}function wd(t){let e=`${vd}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 Mm(t,e){return!!((e==="v4"||!e)&&Vm.test(t)||(e==="v6"||!e)&&Pm.test(t))}class on 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}),ve}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 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}),o.dirty())}else if(l.kind==="email")Am.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(Nm,"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")Em.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")Tm.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")xm.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")km.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")Sm.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"?Fm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{code:Q.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?Rm(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"?Bm.test(e.data)||(s=this._getOrReturnCtx(e,s),re(s,{validation:"duration",code:Q.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?Mm(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"?Dm.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 on({...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 on({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new on({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new on({...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}}on.create=t=>{var e;return new on({checks:[],typeName:ye.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Se(t)})};function Im(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class 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}),ve}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"?Im(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}),ve}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}),ve}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}),ve}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return re(l,{code:Q.invalid_date}),ve}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}),ve}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}),ve}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}),ve}return xt(e.data)}}jo.create=t=>new jo({typeName:ye.ZodNull,...Se(t)});class io extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return xt(e.data)}}io.create=t=>new io({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}),ve}}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}),ve}return xt(e.data)}}os.create=t=>new os({typeName:ye.ZodVoid,...Se(t)});class sn 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}),ve;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}),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((c,u)=>s.type._parseAsync(new En(n,c,n.path,u)))).then(c=>gt.mergeArray(o,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new En(n,c,n.path,u)));return gt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new sn({...this._def,minLength:{value:e,message:de.toString(n)}})}max(e,n){return new sn({...this._def,maxLength:{value:e,message:de.toString(n)}})}length(e,n){return new sn({...this._def,exactLength:{value:e,message:de.toString(n)}})}nonempty(e){return this.min(1,e)}}sn.create=(t,e)=>new sn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...Se(e)});function so(t){if(t instanceof Je){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Bn.create(so(o))}return new Je({...t._def,shape:()=>e})}else return t instanceof sn?new sn({...t._def,type:so(t.element)}):t instanceof Bn?Bn.create(so(t.unwrap())):t instanceof rr?rr.create(so(t.unwrap())):t instanceof Tn?Tn.create(t.items.map(e=>so(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}),ve}const{status:o,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 En(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 En(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,B=await m.value;f.push({key:y,value:B,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,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=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 so(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 Bn;)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 c=l.map(u=>new It(u.ctx.common.issues));return re(n,{code:Q.invalid_union,unionErrors:c}),ve}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new It(p));return re(n,{code:Q.invalid_union,unionErrors:u}),ve}}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 an?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 Bn?[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}),ve;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]}),ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const s=new Map;for(const l of n){const c=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 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),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===ie.array&&o===ie.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let l=0;l<t.length;l++){const c=t[l],u=e[l],p=Ga(c,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,c)=>{if(Ia(l)||Ia(c))return ve;const u=Ga(l.value,c.value);return u.valid?((La(l)||La(c))&&n.dirty(),{status:n.value,value:u.data}):(re(o,{code:Q.invalid_intersection_types}),ve)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Ko.create=(t,e,n)=>new Ko({left:t,right:e,typeName:ye.ZodIntersection,...Se(n)});class Tn 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}),ve;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"}),ve;!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((c,u)=>{const p=this._def.items[u]||this._def.rest;return p?p._parse(new En(o,c,o.path,u)):null}).filter(c=>!!c);return o.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 Tn({...this._def,rest:e})}}Tn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Tn({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}),ve;const s=[],l=this._def.keyType,c=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new En(o,u,o.path,u)),value:c._parse(new En(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:on.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}),ve;const s=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([u,p],f)=>({key:s._parse(new En(o,u,o.path,[f,"key"])),value:l._parse(new En(o,p,o.path,[f,"value"]))}));if(o.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const p of c){const f=await p.key,m=await p.value;if(f.status==="aborted"||m.status==="aborted")return ve;(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 ve;(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}),ve;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 c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return ve;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 En(o,p,o.path,f)));return o.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 ao 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}),ve;function o(u,p){return ts({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,es(),ro].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(),ro].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 lo){const u=this;return xt(async function(...p){const f=new It([]),m=await u._def.args.parseAsync(p,l).catch(E=>{throw f.addIssue(o(p,E)),f}),y=await Reflect.apply(c,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 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(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 ao({...this._def,args:Tn.create(e).rest(Fr.create())})}returns(e){return new ao({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new ao({args:e||Tn.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}),ve}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}),ve}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}),ve}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}),ve}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}),ve}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 lo 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}),ve;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})))}}lo.create=(t,e)=>new lo({type:t,typeName:ye.ZodPromise,...Se(e)});class an 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:c=>{re(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return ve;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?ve:p.status==="dirty"||n.value==="dirty"?oo(p.value):p});{if(n.value==="aborted")return ve;const u=this._def.schema._parseSync({data:c,path:o.path,parent:o});return u.status==="aborted"?ve:u.status==="dirty"||n.value==="dirty"?oo(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?ve:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?ve:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!zo(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>zo(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Me.assertNever(s)}}an.create=(t,e,n)=>new an({schema:t,typeName:ye.ZodEffects,effect:e,...Se(n)}),an.createWithPreprocess=(t,e,n)=>new an({schema:e,effect:{type:"preprocess",transform:t},typeName:ye.ZodEffects,...Se(n)});class Bn extends Be{_parse(e){return this._getType(e)===ie.undefined?xt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Bn.create=(t,e)=>new Bn({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}),ve}return{status:"valid",value:e.data}}}as.create=t=>new as({typeName:ye.ZodNaN,...Se(t)});const Lm=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"?ve:l.status==="dirty"?(n.dirty(),oo(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"?ve: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?io.create().superRefine((o,s)=>{var l,c;if(!t(o)){const u=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):io.create()}const Om={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 Gm=(t,e={message:`Input not instance of ${t.name}`})=>xd(n=>n instanceof t,e),kd=on.create,Sd=er.create,zm=as.create,$m=tr.create,Ed=Wo.create,Zm=Dr.create,Um=rs.create,Wm=Ho.create,Hm=jo.create,jm=io.create,qm=Fr.create,Km=Mn.create,Ym=os.create,Jm=sn.create,Xm=Je.create,Qm=Je.strictCreate,eg=qo.create,tg=is.create,ng=Ko.create,rg=Tn.create,og=Yo.create,ig=ss.create,sg=Rr.create,ag=ao.create,lg=Jo.create,cg=Xo.create,dg=nr.create,ug=Qo.create,pg=lo.create,Td=an.create,hg=Bn.create,fg=rr.create,mg=an.createWithPreprocess,gg=ni.create;var ls=Object.freeze({__proto__:null,defaultErrorMap:ro,setErrorMap:wm,getErrorMap:es,makeIssue:ts,EMPTY_PATH:bm,addIssueToContext:re,ParseStatus:gt,INVALID:ve,DIRTY:oo,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:on,ZodNumber:er,ZodBigInt:tr,ZodBoolean:Wo,ZodDate:Dr,ZodSymbol:rs,ZodUndefined:Ho,ZodNull:jo,ZodAny:io,ZodUnknown:Fr,ZodNever:Mn,ZodVoid:os,ZodArray:sn,ZodObject:Je,ZodUnion:qo,ZodDiscriminatedUnion:is,ZodIntersection:Ko,ZodTuple:Tn,ZodRecord:Yo,ZodMap:ss,ZodSet:Rr,ZodFunction:ao,ZodLazy:Jo,ZodLiteral:Xo,ZodEnum:nr,ZodNativeEnum:Qo,ZodPromise:lo,ZodEffects:an,ZodTransformer:an,ZodOptional:Bn,ZodNullable:rr,ZodDefault:ei,ZodCatch:ti,ZodNaN:as,BRAND:Lm,ZodBranded:za,ZodPipeline:ni,ZodReadonly:ri,custom:xd,Schema:Be,ZodSchema:Be,late:Om,get ZodFirstPartyTypeKind(){return ye},coerce:{string:t=>on.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:jm,array:Jm,bigint:$m,boolean:Ed,date:Zm,discriminatedUnion:tg,effect:Td,enum:dg,function:ag,instanceof:Gm,intersection:ng,lazy:lg,literal:cg,map:ig,nan:zm,nativeEnum:ug,never:Km,null:Hm,nullable:fg,number:Sd,object:Xm,oboolean:()=>Ed().optional(),onumber:()=>Sd().optional(),optional:hg,ostring:()=>kd().optional(),pipeline:gg,preprocess:mg,promise:pg,record:og,set:sg,strictObject:Qm,string:kd,symbol:Um,transformer:Td,tuple:rg,undefined:Wm,union:eg,unknown:qm,void:Ym,NEVER:ve,ZodIssueCode:Q,quotelessJson:Cm,ZodError:It});function yg(t){throw new Error("Unexpected object: "+t)}const _g=-2147483648,Bd=-9007199254740991n,vg=NaN,Cg=NaN,wg=null,bg=null;function Ad(t,e){switch(e){case"Int":return t===_g;case"Long":return t===Number(Bd)||t===Bd;case"Float":return t===vg;case"Double":return t===Cg;case"String":return t===wg;case"Bytes":return t===bg;default:throw Error(`unsupported data type: ${e}`)}}function xg(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:yg(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 kg(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 Sg="1.10.12";function Eg(){return kg({sdkVersion:Sg})}function Tg(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function co(t){return!!t&&typeof t.children<"u"}function or(t){return co(t)?t.groupId:t.colId}function Vd(t,e,n){const o=(c,u)=>{const p=c.children.map(or),f=b._includes(p,or(u)),m=b._last(c.children),y=m&&or(m)!==or(u);return f&&y};if(!co(t))return!0;const s=t,l=n;if(o(s,l))return s.children.push(l),!0;if(s.groupId===e){const c=s.children.map(or);if(!b._includes(c,or(l)))return s.children.push(l),!0}for(let c=s.children.length-1;c>=0&&!Vd(s.children[c],e,n);c--);return!1}function Bg(t){const e=(s,l)=>co(s)&&co(l)&&or(s)===or(l),n=(s,l)=>{if(!co(l))return s;const c=s,u=l;return u.children&&u.groupId&&Vd(c,u.groupId,u.children[0])||u.children.forEach(p=>n(c,p)),c},o=[];for(let s=1;s<=t.length;s++){const l=t[s-1],c=t[s];e(l,c)?t[s]=n(l,c):o.push(l)}return o}var Ag=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(s,l)=>{if(co(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}},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=Bg(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 c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const s=o.getColDef();return o.isPrimary()&&!s.showRowGroup}).map(o=>t(o,o.getColDef()))}};function Ng(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function Vg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function Pg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function Dg(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function Fg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function Rg(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function Mg(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function Ig(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function Lg(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return b._unwrapUserComp(n)}function Og(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var Gg=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}},zg=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 Gg(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()}},$g={selector:"AG-SIDE-BAR-BUTTONS",component:zg},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 Ug=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}},Wg=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 Ug);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 c=this.userComponentFactory.getToolPanelCompDetails(t,e),u=c.newAgStackInstance();if(this.params=c.params,u==null){b._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}u.then(this.setToolPanelComponent.bind(this)),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)}},Hg=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>`,[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,`
|
|
10
|
+
</div>`,[$g]),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),c=o.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(),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 c=o[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 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 Wg),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 c=t===l.getToolPanelId();l.setDisplayed(c)});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 c=this.toolPanelWrappers.find(y=>y.getToolPanelId()===s);if(!c)return;const u=this.gos.addGridCommonParams({...o.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()}},jg={selector:"AG-SIDE-BAR",component:Hg},qg=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return jg}},Wa="32.3.3",Rd=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-core`,beans:[Ag,qg],dependantModules:[Re.EnterpriseCoreModule]}),Kg=b._defineModule({version:Wa,moduleName:`${b.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:Ng,setSideBarVisible:Vg,setSideBarPosition:Pg,openToolPanel:Dg,closeToolPanel:Fg,getOpenedToolPanel:Rg,refreshToolPanel:Mg,isToolPanelShowing:Ig,getToolPanelInstance:Lg,getSideBar:Og},dependantModules:[Rd]}),Ha=b._defineModule({version:Wa,moduleName:b.ModuleNames.SideBarModule,dependantModules:[Rd,Kg]}),Yg={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},Jg=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=Xg,t.first=Qg,t.last=ey,t.min=ty,t.max=ny,t.count=ry,t.avg=oy,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 Yg[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 Xg(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 Qg(t){return t.values.length>0?t.values[0]:null}function ey(t){return t.values.length>0?b._last(t.values):null}function ty(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 ny(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 ry(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 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 oy(t){var c,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=(c=t.rowNode)==null?void 0:c.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 iy=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 c=n[l],u=c.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,c)}if(!o)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={},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),c=t.aggData;return o.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 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,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);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 c=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 c(u)}},sy=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,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 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),c=o.valueGetter||o.field!=null;return l&&!c&&(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}},ay=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=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 B=t.getComponentAt(y);B&&B.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,B=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,B&&y.childrenAfterAggFilter.forEach(E=>u(E,B)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var B;y.childrenAfterAggFilter=((B=y.childrenAfterFilter)==null?void 0:B.filter(E=>{var L;return l({node:E})&&this.filterManager.doesRowPassAggregateFilters({rowNode:E})?(u(E,!0),!0):(L=E.childrenAfterAggFilter)==null?void 0:L.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(`
|
|
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(),c=this.gos.get("rowGroupPanelSuppressSort");return[n&&`${n}${o}`,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(),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()}}),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 B=t.getComponentAt(y);B&&B.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 ly(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}},ly=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 ay(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()}},cy=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)}},dy={selector:"AG-GRID-HEADER-DROP-ZONES",component:cy},uy=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return dy}},py=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:c}=t,u=(y,B=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,B&&y.childrenAfterAggFilter.forEach(E=>u(E,B)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var B;y.childrenAfterAggFilter=((B=y.childrenAfterFilter)==null?void 0:B.filter(E=>{var L;return l({node:E})&&this.filterManager.doesRowPassAggregateFilters({rowNode:E})?(u(E,!0),!0):(L=E.childrenAfterAggFilter)==null?void 0:L.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 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)}},hy=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(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()}},
|
|
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()}},fy=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(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 B=o[y],E=B.allLeafChildren,P=E.length;if(P)for(let R=0;R<P;++R){const L=E[R];(m>=f||p[m]!==L)&&(p[m]=L,s=!0),++m}else(m>=f||p[m]!==B)&&B&&(p[m]=B,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(B=>B.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],B=this.createColDef(l[0],m,y);B.columnGroupShow="open",f.push(B)}),f.sort(u),f}const p=[];return b._iterateObject(e,(f,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,B=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,B,o,s),headerName:f,pivotKeys:B,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(B)})}),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 B=this.columnNameService.getDisplayNameForColumn(y,"header"),E=this.createColDef(y,B,s.pivotKeys);E.pivotTotalColumnIds=f.get(y.getColId()),E.columnGroupShow=n?"open":"closed",E.aggFunc=y.getAggFunc(),m||(s.children.push(E),l.push(E))}),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 B=0;B<e.length;B++){const E=e[B];E.pivotValueColumn===u&&m.push(E.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 B=d[y],E=n(`${s}${this.fieldSeparator}${y}`,y,B,u+1);p.push(E)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const E=this.columnNameService.getDisplayNameForColumn(y,"header")??l,P=this.createColDef(y,E,void 0,!1);return P.colId=s,P.aggFunc=y.getAggFunc(),P.valueGetter=R=>{var L;return(L=R.data)==null?void 0:L[s]},P}return{colId:s,headerName:l,valueGetter:E=>{var P;return(P=E.data)==null?void 0:P[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 B=this.gos.get("pivotRowTotals"),E=this.gos.get("pivotColumnGroupTotals"),P=this.gos.get("suppressExpandablePivotGroups"),R=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),L=B!==this.pivotRowTotalsLastTime||E!==this.pivotColumnGroupTotalsLastTime||P!==this.suppressExpandablePivotGroupsLastTime||R!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=B,this.pivotColumnGroupTotalsLastTime=E,this.suppressExpandablePivotGroupsLastTime=P,this.removePivotHeaderRowWhenSingleValueColumnLastTime=R,this.lastTimeFailed||s||p||y||f||L){const{pivotColumnGroupDefs:C,pivotColumnDefs:V}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=V,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">
|
|
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 my(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,c=s&&l,u=!s&&!l;return c?n-o:u?t.__objectId-e.__objectId:s?1:-1}var gy=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 c;(c=l.childrenAfterGroup)!=null&&c.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=>{my(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,c)=>e({nodeA:l,nodeB:c})),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),c=this.getGroupInfo(o,e).map(s);b._areEqual(l,c)||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,c=>{s.removeFromAllLeafChildren(c,l)})}),o&&s.flush()}removeEmptyGroups(t,e){let n=!0;const o=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=>{o(c)&&(n=!0,this.removeFromParent(c,s),c.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 c;if(!o.group)return;const l={field:o.field,key:o.key,rowGroupColumn:o.rowGroupColumn,leafNode:(c=o.allLeafChildren)==null?void 0:c[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,c)=>{s=this.getOrCreateNextNode(s,l,c,n),o!=null&&o.isRemoveFromAllLeafChildren(s,t)?o==null||o.preventRemoveFromAllLeafChildren(s,t):s.allLeafChildren.push(t)}),s}getOrCreateNextNode(t,e,n,o){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,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 c=l?o(l,l.parent):null;return`${c==null?"":c+"-"}${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}},yy=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,ct=Object.freeze([]),_y=ct.values(),ds=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},vy=class tm{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())??_y}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 tm(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 c=this.popDuplicateRow();c?(this.row=c,c.childrenAfterGroup=l,n>=0&&(c.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,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;o[s]!==m&&(o[s]=m,n=!0),++s}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(o),n||c}reorderChildrenList(e){const n=e.length,o=this.children;e.sort(yy),o.clear();for(let s=0;s<n;++s){const l=e[s].treeNode;o.set(l.key,l)}}updateAllLeafChildren(){var c,u;const{parent:e,row:n,childrenAfterGroup:o}=this;this.leafChildrenChanged=!1;let s=!1;const l=o.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=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 B=o[y],E=B.allLeafChildren,P=E.length;if(P)for(let R=0;R<P;++R){const L=E[R];(m>=f||p[m]!==L)&&(p[m]=L,s=!0),++m}else(m>=f||p[m]!==B)&&B&&(p[m]=B,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,Cy=t=>(t.treeNodeFlags&8)!==0,Gd=t=>(t.treeNodeFlags&16)!==0,zd=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},wy=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},by=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},xy=class extends b.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new vy(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,c={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(c,e,n):this.handleRowData(c,s,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var s,l,c;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((c=o.row)==null?void 0:c.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],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 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 c;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)&&(wy(e),l=!0),l&&t.invalidate(),(c=this.rowsPendingDestruction)==null||c.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,by(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 c=!!((f=o.childrenAfterGroup)!=null&&f.length),u=c||!o.data,p=o.group;p!==u?(ir(o),o.setGroup(u),!u&&!o.expanded&&zd(o,!1)):o.hasChildren()!==c&&(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),Cy(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(B=>B.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)}}},ky=class extends b.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?xy:gy;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_",Sy=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 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 c=s[t].getColDef(),u=this.headerNameComparator.bind(this,c.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===o-1){const f=[];return b._iterateObject(e,m=>{const y=[...n,m],B=this.createColDef(l[0],m,y);B.columnGroupShow="open",f.push(B)}),f.sort(u),f}const p=[];return b._iterateObject(e,(f,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,B=[...n,f];p.push({children:this.recursivelyBuildGroup(t+1,m,B,o,s),headerName:f,pivotKeys:B,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(B)})}),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,c)=>{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 B=this.columnNameService.getDisplayNameForColumn(y,"header"),E=this.createColDef(y,B,s.pivotKeys);E.pivotTotalColumnIds=f.get(y.getColId()),E.columnGroupShow=n?"open":"closed",E.aggFunc=y.getAggFunc(),m||(s.children.push(E),l.push(E))}),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=>{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(c=>c.getAggFunc());if(!s||s.length<1||!this.sameAggFuncs(s))return;const l=o[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,o){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,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 c=0;c<s.length;c++){const u=s[c],p=this.columnNameService.getDisplayNameForColumn(u,"header"),f=this.createColDef(u,p,[]),m=[];for(let B=0;B<e.length;B++){const E=e[B];E.pivotValueColumn===u&&m.push(E.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 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,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 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 B=c[y],E=n(`${s}${this.fieldSeparator}${y}`,y,B,u+1);p.push(E)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const E=this.columnNameService.getDisplayNameForColumn(y,"header")??l,P=this.createColDef(y,E,void 0,!1);return P.colId=s,P.aggFunc=y.getAggFunc(),P.valueGetter=R=>{var L;return(L=R.data)==null?void 0:L[s]},P}return{colId:s,headerName:l,valueGetter:E=>{var P;return(P=E.data)==null?void 0:P[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],c=n(s,s,l,0);o.push(c)}return o}},Ud="Exceeded maximum allowed pivot column count.",Ey=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(),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 B=this.gos.get("pivotRowTotals"),E=this.gos.get("pivotColumnGroupTotals"),P=this.gos.get("suppressExpandablePivotGroups"),R=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),L=B!==this.pivotRowTotalsLastTime||E!==this.pivotColumnGroupTotalsLastTime||P!==this.suppressExpandablePivotGroupsLastTime||R!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=B,this.pivotColumnGroupTotalsLastTime=E,this.suppressExpandablePivotGroupsLastTime=P,this.removePivotHeaderRowWhenSingleValueColumnLastTime=R,this.lastTimeFailed||s||p||y||f||L){const{pivotColumnGroupDefs:C,pivotColumnDefs:V}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=V,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(c=>{let u=this.valueService.getKeyForNode(l,c);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(c)}),n===e.length-1)return s;{const c={};return b._iterateObject(s,(u,p)=>{c[u]=this.bucketChildren(p,e,n+1,o[u])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function Ty(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function By(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function Ay(t){t.aggFuncService&&t.aggFuncService.clear()}function Ny(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function Vy(t){return t.columnModel.isPivotMode()}function Py(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function Dy(t,e){t.funcColsService.setValueColumns(e,"api")}function Fy(t){return t.funcColsService.getValueColumns()}function Ry(t,e){t.funcColsService.removeValueColumns([e],"api")}function My(t,e){t.funcColsService.removeValueColumns(e,"api")}function Iy(t,e){t.funcColsService.addValueColumns([e],"api")}function Ly(t,e){t.funcColsService.addValueColumns(e,"api")}function Oy(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function Gy(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function zy(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function $y(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function Zy(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function Uy(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function Wy(t){return t.funcColsService.getRowGroupColumns()}function Hy(t,e){t.funcColsService.setPivotColumns(e,"api")}function jy(t,e){t.funcColsService.removePivotColumns([e],"api")}function qy(t,e){t.funcColsService.removePivotColumns(e,"api")}function Ky(t,e){t.funcColsService.addPivotColumns([e],"api")}function Yy(t,e){t.funcColsService.addPivotColumns(e,"api")}function Jy(t){return t.funcColsService.getPivotColumns()}function Xy(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function Qy(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var e_=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(c=>{this.showRowGroupColsMap[c.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:[iy,py,ky,Sy,Ey,Jg,sy,e_,uy],userComponents:[{name:"agGroupRowRenderer",classImp:Re.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Re.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Re.GroupCellRendererCtrl}],dependantModules:[Re.EnterpriseCoreModule]}),t_=b._defineModule({version:ii,moduleName:`${b.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:Ty,addAggFuncs:By,clearAggFuncs:Ay,setColumnAggFunc:Ny,isPivotMode:Vy,getPivotResultColumn:Py,setValueColumns:Dy,getValueColumns:Fy,removeValueColumn:Ry,removeValueColumns:My,addValueColumn:Iy,addValueColumns:Ly,setRowGroupColumns:Oy,removeRowGroupColumn:Gy,removeRowGroupColumns:zy,addRowGroupColumn:$y,addRowGroupColumns:Zy,getRowGroupColumns:Wy,moveRowGroupColumn:Uy,setPivotColumns:Hy,removePivotColumn:jy,removePivotColumns:qy,addPivotColumn:Ky,addPivotColumns:Yy,getPivotColumns:Jy,setPivotResultColumns:Xy,getPivotResultColumns:Qy},dependantModules:[Ja]}),Wd=b._defineModule({version:ii,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:hy}],dependantModules:[Ja,b._ColumnFilterModule]}),n_=b._defineModule({version:ii,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:fy}],dependantModules:[Wd,b._FloatingFilterModule]}),r_=b._defineModule({version:ii,moduleName:b.ModuleNames.RowGroupingModule,dependantModules:[Ja,t_,Wd,n_]}),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,o_=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,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)}},
|
|
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)}},i_={selector:"AG-PRIMARY-COLS-HEADER",component:o_},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:c=>{c instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(n)}});l&&(s=l.hideFunc),this.popupService.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:e})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const t=[];for(const e of this.menuItemMap.values()){const n=this.columns.some(s=>e.allowedFunction(s)&&!e.activeFunction(s)),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(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)}},
|
|
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)}},s_=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,c=this.getMoveDiff(e,l);return l-c}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}},a_=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 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"),B=new qd(y,d,u,!0,this.expandGroupsByDefault);p.push(B),n(B),o(d.getChildren(),u+1,B.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">
|
|
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(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 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:c,lockVisible:u}=this.column.getColDef(),p=!!o||!!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")}},l_=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},c_="ag-column-select-list",d_=class extends b.Component{constructor(){super(`<div class="${c_}" 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 s_(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 a_(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=c=>{c.addEventListener("expandedChanged",e);const u=c.removeEventListener.bind(c,"expandedChanged",e);this.destroyColumnItemFuncs.push(u)},o=(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()){o(c.getChildren(),u,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),B=new qd(y,c,u,!0,this.expandGroupsByDefault);p.push(B),n(B),o(c.getChildren(),u+1,B.getChildren())},l=(c,u,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new qd(m,c,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 l_(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 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 o=n.getDisplayName();return o==null||o.toLowerCase().indexOf(this.filterText)!==-1},e=(n,o)=>{let s=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(u=>{const p=e(u,c||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}},u_={selector:"AG-PRIMARY-COLS-LIST",component:d_},p_=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>`,[i_,u_]),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)}},
|
|
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)}},h_=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 p_),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()}},f_=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=[],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);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(c),o.length>0&&this.columnApplyStateService.applyColumnState({state:o},n)}updateColumns(t){const{columns:e,visibleState:n,pivotState:o,eventType:s}=t,l=e.map(c=>{const u=c.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}}},m_="32.3.3",Xd=b._defineModule({version:m_,moduleName:b.ModuleNames.ColumnsToolPanelModule,beans:[f_],userComponents:[{name:"agColumnsToolPanel",classImp:h_},{name:"agMenuItem",classImp:Re.AgMenuItemRenderer}],dependantModules:[Re.EnterpriseCoreModule,r_,Ha]});const g_=`.ag-header {
|
|
44
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 B=typeof y=="function"?y():y;return[m,r.markRaw(B)]}));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 B=r.unref(l),E=bv(()=>B==="integer"?parseInt(y,10):B==="float"?Number(y):y);n("update:modelValue",E),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,B={...y.dataRow,[e.cell.id]:f};m({...y,dataRow:B})})},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??{},B=[],{onSelectedRows:E,onSelectedColumns:P}=y.value,R=n.data.selectedRows.has(m.primaryKey);E&&E.length&&(R?B.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):B.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),P&&P.length&&(B.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),B.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),B.length&&rl(f,B)},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 B=(u.value+m.dy)*o.dataSize/l.value;n("change:offset",B),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((B,E)=>B+E.width+co,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const B=e.columns[e.columns.length-1];B.width=B.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,B=m>y?y:m;e.bodyHeight=B},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(d,(m,y)=>{const B=m.current;(!B||m.scrollTop<B.scrollTop||m.scrollTop+m.bodyHeight>B.bodyHeight+B.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-cu,bodyHeight:m.bodyHeight+cu*2},A_(li(e.currentWindow),n.value.dataSource).then(({rows:E,dataWindow:P})=>{ai(e.currentWindow,P)&&(e.rows=E)}))},{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,R=>n("update:data",R),{deep:!0}),r.watch(o,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Mr(f.value,R=>{s.updateDimensions(R.getBoundingClientRect())})},y=s.tableColumns,B=s.tableRows,{mouseDown:E}=y_(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),tt(window,"resize",()=>r.nextTick(m));const P=R=>{R.preventDefault(),s.updateOffsets(R)};return(R,L)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:L[2]||(L[2]=(...C)=>r.unref(E)&&r.unref(E)(...C))},[r.createElementVNode("div",V_,[r.createVNode(w_),L[3]||(L[3]=r.createTextVNode()),r.createVNode(S_)]),L[7]||(L[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,V)=>(r.openBlock(),r.createBlock(l_,{key:V,col:C,style:r.normalizeStyle(C.style),"onChange:sort":L[0]||(L[0]=q=>R.$emit("change:sort",q))},null,8,["col","style"]))),128))]),_:1})],512),L[8]||(L[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(d.value),onWheel:P},[l.value?(r.openBlock(),r.createElementBlock("div",P_,[r.createElementVNode("div",null,[r.createVNode(n_),L[4]||(L[4]=r.createTextVNode()),L[5]||(L[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),L[6]||(L[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(B),(C,V)=>(r.openBlock(),r.createBlock(c_,{key:V,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,q=>(r.openBlock(),r.createBlock(Xv,{key:q.column.id+":"+V,cell:q,style:r.normalizeStyle(q.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),L[9]||(L[9]=r.createTextVNode()),r.createElementVNode("div",D_,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,V)=>(r.openBlock(),r.createBlock(d_,{key:V,column:C,style:r.normalizeStyle(C.style),"onChange:sort":L[1]||(L[1]=q=>R.$emit("change:sort",q))},null,8,["column","style"]))),128))]),L[10]||(L[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">
|
|
45
|
+
}`;function Qd(){b.ModuleRegistry.registerModules([Qi.ClientSideRowModelModule,rm.InfiniteRowModelModule,ad.ServerSideRowModelModule,om.CsvExportModule,ld.ClipboardModule,cd.RangeSelectionModule,im.RichSelectModule,sm.MenuModule,am.ExcelExportModule,Ha,Xd]);const t=Tg("AGGRID_LICENSE");t?(Re.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const y_=dd.createPart("headerBottomBorder").withCSS(g_),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(y_),tu=Symbol("sdk-vue");function Xa(){return r.inject(tu)}function __(t,e,n={}){let o;Qd();const s=()=>{t.loadBlockState().then(c=>{l.loaded=!0;const u=vm(c,t,n),p=e(u),f=Object.fromEntries(Object.entries(p.routes).map(([m,y])=>{const B=typeof y=="function"?y():y;return[m,r.markRaw(B)]}));o=Object.assign(u,{...p,getRoute(m){return f[m]}})}).catch(c=>{console.error("load initial state error",c),l.error=c})},l=r.reactive({loaded:!1,error:void 0,useApp(){return cm(o,"App is not loaded")},install(c){c.provide(tu,this),s()}});return l}var v_=Object.defineProperty,C_=(t,e,n)=>e in t?v_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,w_=(t,e,n)=>C_(t,e+"",n);function nu(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function b_(t,e,n){const o=Math.min(e,n),s=Math.max(e,n);return t>=o&&t<=s}function x_(t){return new Promise(e=>setTimeout(e,t))}function k_(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 S_(t){if(t&&t.ok)return t.value}async function E_(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const ou=t=>t;function T_(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function B_(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(T_(65,91));return e}function iu(){return B_(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 A_(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 N_(t){return Array.isArray(t)?Object.assign([],t):si(t)?Object.assign({},t):t}function V_(t,e){const n={};for(const o in e)e[o]!==t[o]&&(n[o]=t[o]);return n}function P_(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function D_(t,e,n){return t[e]=n,t}function F_(t,e){return t[e]}function R_(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function M_(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function I_(t,...e){return e.map(n=>t[n])}function L_(t,...e){const n=Object.assign({},t);return e.forEach(o=>delete n[o]),n}function su(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?su(o,s):t[n]=s}),t}const tl=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:P_,deepClone:li,deepEqual:ai,deepPatch:su,getProp:F_,isArray:Qa,isObject:si,isPlainObject:el,map:A_,omit:L_,pick:M_,pickValues:I_,setProp:D_,shallowClone:N_,shallowDiff:V_,shiftProp:R_},Symbol.toStringTag,{value:"Module"}));function O_(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 au(t,e,n){let o;return function(...s){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,t.apply(this,s)},e)}}const G_=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],z_=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],$_=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Z_=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],lu=(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?Z_:$_:e.binary?z_:G_;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=lu(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=lu(Number(t),e.locale),u=n[l];return s+c+" "+u}const U_={class:"context-menu"},W_=["onClick"],H_=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",U_,[(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=>o(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,W_))),128))]))}}),Kt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},j_=Kt(H_,[["__scopeId","data-v-12530966"]]);function rl(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},o=r.h(j_,{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 cu=Symbol(),ps=()=>r.inject(cu),q_=["value"],K_={key:1},Y_=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),c=f=>{var m;let y=(m=f.target)==null?void 0:m.value;const B=r.unref(l),E=k_(()=>B==="integer"?parseInt(y,10):B==="float"?Number(y):y);n("update:modelValue",E),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:c},null,40,q_)):(r.openBlock(),r.createElementBlock("div",K_,r.toDisplayString(f.modelValue),1))],2))}}),J_=["^data-row-index"],X_={key:0,class:"control-cell"},Q_=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,B={...y.dataRow,[e.cell.id]:f};m({...y,dataRow:B})})},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??{},B=[],{onSelectedRows:E,onSelectedColumns:P}=y.value,R=n.data.selectedRows.has(m.primaryKey);E&&E.length&&(R?B.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):B.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),P&&P.length&&(B.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),B.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),B.length&&rl(f,B)},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",X_,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(Y_,{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,J_))}}),ev={},tv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function nv(t,e){return r.openBlock(),r.createElementBlock("svg",tv,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 rv=Kt(ev,[["render",nv]]),ov={class:"tr-head"},iv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",ov,[r.renderSlot(e.$slots,"default")]))}});function sv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function av(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 lv=["^data-col-id"],cv=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 c=[];c.length&&rl(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:sv(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: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:c[0]||(c[0]=r.withModifiers(()=>s(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,lv))}}),dv=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))}}),uv=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 pv(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function hv(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function fv(t,e){let n;function o(l){n={...l}}pv(()=>{n=void 0,e()});const s=hv(t);return tt(window,"mousemove",l=>{n&&s({x:n.x,width:n.width,diff:l.x-n.x})}),{start:o}}const uo=1,mv=10,gv=30,du=60;function uu(){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 pu(t,e={}){const{delayEnter:n=0,delayLeave:o=0}=e,s=r.ref(!1);let l;const c=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",()=>c(!0)),tt(t,"mouseleave",()=>c(!1))),s}function yv(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(),c=o.getAttribute("data-col-id");return ou({colId:c,width:s,x:l,right:l+s})}).slice(0,n.length-1)}function _v(t,e){const n=uu(),o=pu(e,{}),{data:s}=t,l=fv(u=>{Mr(s.resizeTh,p=>{const f=s.columns.find(m=>m.id===p.colId);f&&(f.width=us(u.width+u.diff,gv,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(!o.value){document.body.style.cursor="";return}if(s.resize)return;const u=yv(e).find(p=>Math.abs(n.x-p.right)<mv);u?(document.body.style.cursor="col-resize",s.resizeTh=u):(s.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const vv={key:0,class:"command-menu"},Cv={key:0},wv=["onClick"],bv=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 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)=>o.value?(r.openBlock(),r.createElementBlock("div",vv,[n.value.length?(r.openBlock(),r.createElementBlock("span",Cv,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,wv))),128))])):r.createCommentVNode("",!0)}}),xv={key:0,class:"command-menu"},kv={key:0},Sv=["onClick"],Ev=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 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)=>o.value?(r.openBlock(),r.createElementBlock("div",xv,[n.value.length?(r.openBlock(),r.createElementBlock("span",kv,"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,Sv))),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 Tv=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),c=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 B=(u.value+m.dy)*o.dataSize/l.value;n("change:offset",B),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 Bv(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:o,scrollLeft:s}=e,l=[...e.columns],c=iu();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+uo,y}),f=p.filter(m=>m.frozen);return O_(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===c}))})}function Av(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:c,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:`${c-t.scrollTop}px`,height:`${o.height}px`},primaryKey:l,offset:c,height:p,cells:f,selected:t.selectedRows.has(l)})}))}const Nv=async(t,e)=>{const{scrollTop:n,bodyHeight:o}=t;return await x_(0),E_({rows:e.getRows(n,o),dataWindow:t})};function Vv(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+uo,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)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),u=Bv({data:e,settings:n}),p=Av(e,u),f={data:e,settings:n,tableColumns:u,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((B,E)=>B+E.width+uo,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const B=e.columns[e.columns.length-1];B.width=B.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,B=m>y?y:m;e.bodyHeight=B},updateDimensions(m){this.updateBodyHeight(),f.data.bodyWidth=m.width,f.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,y)=>{const B=m.current;(!B||m.scrollTop<B.scrollTop||m.scrollTop+m.bodyHeight>B.bodyHeight+B.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-du,bodyHeight:m.bodyHeight+du*2},Nv(li(e.currentWindow),n.value.dataSource).then(({rows:E,dataWindow:P})=>{ai(e.currentWindow,P)&&(e.rows=E)}))},{deep:!0,immediate:!0}),r.provide(cu,f),f}const Pv={class:"command-menu__container"},Dv={key:0,class:"table-body__no-data"},Fv={class:"carets"},ol=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,o=t,s=Vv(o),l=r.computed(()=>s.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":s.data.bodyHeight+"px"}));r.watch(s.data,R=>n("update:data",R),{deep:!0}),r.watch(o,()=>m);const u=r.ref(),p=r.ref(),f=r.ref(),m=()=>{Mr(f.value,R=>{s.updateDimensions(R.getBoundingClientRect())})},y=s.tableColumns,B=s.tableRows,{mouseDown:E}=_v(s,u);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),tt(window,"resize",()=>r.nextTick(m));const P=R=>{R.preventDefault(),s.updateOffsets(R)};return(R,L)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:u,class:"data-table",onMousedown:L[2]||(L[2]=(...C)=>r.unref(E)&&r.unref(E)(...C))},[r.createElementVNode("div",Pv,[r.createVNode(bv),L[3]||(L[3]=r.createTextVNode()),r.createVNode(Ev)]),L[7]||(L[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(iv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,V)=>(r.openBlock(),r.createBlock(cv,{key:V,col:C,style:r.normalizeStyle(C.style),"onChange:sort":L[0]||(L[0]=q=>R.$emit("change:sort",q))},null,8,["col","style"]))),128))]),_:1})],512),L[8]||(L[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:f,class:"table-body",style:r.normalizeStyle(c.value),onWheel:P},[l.value?(r.openBlock(),r.createElementBlock("div",Dv,[r.createElementVNode("div",null,[r.createVNode(rv),L[4]||(L[4]=r.createTextVNode()),L[5]||(L[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),L[6]||(L[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(B),(C,V)=>(r.openBlock(),r.createBlock(dv,{key:V,row:C},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C.cells,q=>(r.openBlock(),r.createBlock(Q_,{key:q.column.id+":"+V,cell:q,style:r.normalizeStyle(q.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),L[9]||(L[9]=r.createTextVNode()),r.createElementVNode("div",Fv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(C,V)=>(r.openBlock(),r.createBlock(uv,{key:V,column:C,style:r.normalizeStyle(C.style),"onChange:sort":L[1]||(L[1]=q=>R.$emit("change:sort",q))},null,8,["column","style"]))),128))]),L[10]||(L[10]=r.createTextVNode()),r.createVNode(Tv,{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))}}),hu=new WeakMap;class Rv{constructor(e,n,o){w_(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=o;const s=e.reduce((c,u,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(u,p)+uo,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:nu(s.indices.get(u)),height:this.resolveHeight(c,u)}));hu.set(this,l)}get rows(){return hu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return av(this.rows,o=>{const s=o.offset;return e<s+o.height&&s<n+e})}}class Mv{constructor(e,n,o){this.api=e,this.rowHeight=n,this.resolvePrimaryKey=o}get height(){return this.rowHeight+uo}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,c)=>({dataRow:l,index:o+c,primaryKey:this.resolvePrimaryKey(l,o+c),offset:(o+c)*(this.rowHeight+uo),height:this.rowHeight}))}}function Iv(t){return Object.freeze(t)}function Lv(t){return r.h(ol,{settings:Object.freeze(t)})}function il(t,e){const n=new Rv(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function Ov(t,e){return r.computed(()=>{const n=r.unref(t);return il(n,r.unref(e))})}function Gv(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 zv=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:Mv,Component:ol,factory:Lv,rawDataSettings:il,settings:Iv,useRawData:Ov,useRawDataComponent:Gv},Symbol.toStringTag,{value:"Module"}));function*$v(t,e){for(const n of t)yield e(n)}function Zv(t){const e=[];for(const n of t)e.push(n);return e}function fu(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 mu(t){return new Promise(e=>setTimeout(e,t))}function gu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function yu(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Uv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(yu(65,91));return e}function _u(t){return function(e){return 1-t(1-e)}}function Wv(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 c(u){let p=(u-s)/e;(p>1||l)&&(p=1);const f=o(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function Hv(t){const{getFraction:e,draw:n,timing:o}=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=o(p);n(f),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function Cu(t,e){let n=-1;return(...o)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...o),e)}}function wu(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 jv(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 qv(t){return ll.has(t)||ll.set(t,r.ref(localStorage.getItem(t))),sl(ll.get(t),"...")}function Kv(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function bu(t){const e=qv(t);return r.watch(e,n=>Kv(t,n)),e}const cl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{Zv($v(cl.values(),e=>e(t.matches?"dark":"light")))});const Yv=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",xu=r.ref(Yv),dl=bu("theme");function ku(t){const e=r.computed(()=>dl.value?dl.value:xu.value),n=s=>{xu.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 Jv=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=ku();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))}}),Xv={class:"pl-layout-component pl-block-page"},Qv={key:0,class:"pl-block-page__title"},eC={class:"pl-block-page__title__append"},tC={key:1},nC={class:"pl-block-page__body"},rC={name:"PlBlockPage"},oC=r.defineComponent({...rC,setup(t){const e=r.useSlots();return(n,o)=>(r.openBlock(),r.createElementBlock("div",Xv,[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",Qv,[r.createElementVNode("h1",null,[r.renderSlot(n.$slots,"title")]),o[0]||(o[0]=r.createTextVNode()),r.createElementVNode("div",eC,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",tC)),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",nC,[r.renderSlot(n.$slots,"default")])]))}}),iC={name:"PlContainer"},sC=r.defineComponent({...iC,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))}}),aC={name:"PlRow"},lC=r.defineComponent({...aC,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))}}),cC={class:"pl-layout-component",style:{"flex-grow":"1"}},dC={name:"PlSpacer"},Su=r.defineComponent({...dC,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",cC))}}),uC={name:"PlGrid"},pC=r.defineComponent({...uC,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))}}),hC={key:0,class:"pl-alert__icon"},fC={class:"pl-alert__main"},mC={key:0},gC={class:"pl-alert__main__text"},yC={name:"PlAlert"},_C=r.defineComponent({...yC,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",hC,[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",fC,[n.label?(r.openBlock(),r.createElementBlock("label",mC,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",gC,[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">
|
|
46
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"/>
|
|
47
47
|
</svg>
|
|
48
|
-
`,
|
|
48
|
+
`,CC=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
49
49
|
<rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
|
|
50
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"/>
|
|
51
51
|
</svg>
|
|
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,O=>{if(O){const K=O.getBoundingClientRect();m.optionsHeight=K.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const B=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),E=r.computed(()=>(o.options??[]).findIndex(O=>ai(O.value,l.value))),P=r.computed(()=>ar(o.options??[]).map((O,K)=>({...O,index:K,isSelected:K===E.value,isActive:K===m.activeIndex}))),R=r.computed(()=>o.loading||o.options===void 0),L=r.computed(()=>{var O;return((O=P.value.find(K=>ai(K.value,l.value)))==null?void 0:O.label)??(o.options===void 0?"...":"")});po(d,O=>{const K=O.top+O.height+3;K+m.optionsHeight>O.clientHeight?y.top=O.top-m.optionsHeight-3+"px":y.top=K+"px",y.left=O.left+"px",y.width=O.width+"px",console.log(O.top,y)});const C=O=>{var K;l.value=O,m.open=!1,(K=d==null?void 0:d.value)==null||K.focus()};function V(){s("click")}const q=O=>{var K,W;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(O.code))O.preventDefault();else return;if(O.target===f.value&&O.code==="Enter"){V();return}const{open:S,activeIndex:k}=m;if(!S&&O.target===p.value){O.code==="Enter"&&(m.open=!0);return}O.code==="Escape"&&(m.open=!1,(K=d.value)==null||K.focus());const T=r.unref(P),{length:z}=T;if(!z)return;O.code==="Enter"&&C((W=T.find(G=>G.index===k))==null?void 0:W.value);const Z=T.findIndex(G=>G.index===k)??-1,I=O.code==="ArrowDown"?1:O.code==="ArrowUp"?-1:0,A=Math.abs(Z+I+z)%z;m.activeIndex=P.value[A].index??-1},X=O=>{var K,W;const S=O.relatedTarget;!((K=d.value)!=null&&K.contains(S))&&!((W=u.value)!=null&&W.contains(S))&&(m.open=!1)};return(O,K)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:d,class:r.normalizeClass([{disabled:O.disabled||R.value,loading:R.value},"pl-btn-split d-flex"]),onFocusout:X,onKeydown:q},[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:V,onKeyup:r.withKeys(r.withModifiers(V,["stop"]),["enter"])},r.toDisplayString(L.value),41,AC),K[1]||(K[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:K[0]||(K[0]=W=>m.open=!m.open)},[R.value?(r.openBlock(),r.createBlock(ho,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([B.value,"pl-btn-split__icon"])},null,2))],512),K[2]||(K[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(P.value,(W,S)=>(r.openBlock(),r.createBlock(uo,{key:S,option:W,"is-selected":W.isSelected,"is-hovered":W.isActive,size:"medium",onClick:r.withModifiers(k=>C(W.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,R=>{requestAnimationFrame(()=>{l.tooltipOpen=R})});let d=()=>{};const u=Cu(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[R,L]of fl.entries())R!==o&&L()},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,R=>{R&&f()});const B=r.ref(),E=r.ref(),P=$C(B,r.toRef(s));return fs([B,E],()=>f()),r.onUnmounted(()=>{fl.delete(o)}),(R,L)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(R.element),r.mergeProps(R.$attrs,{ref_key:"rootRef",ref:B,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(R.$slots,"default"),L[1]||(L[1]=r.createTextVNode()),R.$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(P))},[r.createElementVNode("div",{ref_key:"tooltip",ref:E,class:r.normalizeClass(["pl-tooltip",R.position]),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(R.$slots,"tooltip")]),L[0]||(L[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(X){if(u.cached=void 0,o.parse)try{n.value=o.parse(X)}catch(O){u.cached={error:O instanceof Error?O.message:String(O),value:X}}else n.value=X}}),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())},B=Nu(p,o.rules||[]),E=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),P=r.computed(()=>!E.value),R=r.computed(()=>{const X=[];return o.error&&X.push(o.error),u.cached&&X.push(u.cached.error),B.value.isValid||X.push(...B.value.errors),X}),L=r.computed(()=>R.value.length>0),C=r.computed(()=>o.clearable&&P.value&&o.type!=="password"),V=()=>d.value=!d.value,q=()=>{u.cached=void 0};return Ln(s),(X,O)=>(r.openBlock(),r.createElementBlock("div",_w,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:L.value,disabled:X.disabled,dashed:X.dashed,nonEmpty:P.value}])},[X.label?(r.openBlock(),r.createElementBlock("label",Cw,[X.required?(r.openBlock(),r.createElementBlock("i",ww)):r.createCommentVNode("",!0),O[1]||(O[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(X.label),1),O[2]||(O[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(X.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),O[5]||(O[5]=r.createTextVNode()),X.prefix?(r.openBlock(),r.createElementBlock("div",bw,r.toDisplayString(X.prefix),1)):r.createCommentVNode("",!0),O[6]||(O[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":O[0]||(O[0]=K=>p.value=K),disabled:X.disabled,placeholder:X.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:q},null,40,xw),[[r.vModelDynamic,p.value]]),O[7]||(O[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),O[3]||(O[3]=r.createTextVNode()),X.type==="password"?(r.openBlock(),r.createBlock(r.unref(Vu),{key:1,name:m.value,style:{cursor:"pointer"},onClick:V},null,8,["name"])):r.createCommentVNode("",!0),O[4]||(O[4]=r.createTextVNode()),r.renderSlot(X.$slots,"append")]),O[8]||(O[8]=r.createTextVNode()),r.createVNode(lr,{class:"pl-text-field__contour"})],2),O[9]||(O[9]=r.createTextVNode()),L.value?(r.openBlock(),r.createElementBlock("div",Sw,r.toDisplayString(R.value.join(" ")),1)):X.helper?(r.openBlock(),r.createElementBlock("div",Ew,r.toDisplayString(X.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(E){o("update:modelValue",E)}}),p=r.computed(()=>!!s.modelValue),f=Nu(u,s.rules||[]);Ln(l);const m=r.computed(()=>{const E=[];return s.error&&E.push(s.error),E.push(...f.value.errors),E}),y=r.computed(()=>m.value.length>0),B=()=>{if(!s.autogrow)return;const E=d.value;E&&(E.style.height="auto",E.style.height=`${E.scrollHeight}px`)};return r.onMounted(()=>{B()}),(E,P)=>(r.openBlock(),r.createElementBlock("div",Bw,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:E.disabled,dashed:E.dashed,nonEmpty:p.value}])},[E.label?(r.openBlock(),r.createElementBlock("label",Aw,[E.required?(r.openBlock(),r.createElementBlock("i",Nw)):r.createCommentVNode("",!0),P[1]||(P[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(E.label),1),P[2]||(P[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(E.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),P[3]||(P[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:d,"onUpdate:modelValue":P[0]||(P[0]=R=>u.value=R),readonly:E.readonly,rows:E.rows,disabled:E.disabled,placeholder:E.placeholder??"...",spellcheck:"false",onInput:B},null,40,Vw),[[r.vModelText,u.value]]),P[4]||(P[4]=r.createTextVNode()),r.createElementVNode("div",Pw,[r.renderSlot(E.$slots,"append")]),P[5]||(P[5]=r.createTextVNode()),r.createVNode(lr,{class:"ui-text-area__contour"})],2),P[6]||(P[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",Dw,r.toDisplayString(m.value.join(" ")),1)):E.helper?(r.openBlock(),r.createElementBlock("div",Fw,r.toDisplayString(E.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(q.value.findIndex(A=>Pt(A.value,o.modelValue)),A=>A<0?0:A),m=()=>p.activeIndex=f(),y=r.computed(()=>o.options===void 0),B=r.computed(()=>y.value?!0:o.disabled),E=r.computed(()=>(o.options??[]).findIndex(A=>Pt(A.value,o.modelValue))),P=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&E.value===-1)return"The selected value is not one of the options"}}),R=r.computed(()=>ar(o.options??[]).map((A,G)=>({...A,index:G,isSelected:G===E.value,isActive:G===p.activeIndex}))),L=r.computed(()=>{const A=r.unref(R).find(G=>Pt(G.value,o.modelValue));return(A==null?void 0:A.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(L.value):o.placeholder),V=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),q=r.computed(()=>{const A=R.value;return p.search?A.filter(G=>{const J=p.search.toLowerCase();return G.label.toLowerCase().includes(J)||G.description&&G.description.toLowerCase().includes(J)?!0:typeof G.value=="string"?G.value.toLowerCase().includes(J):G.value===p.search}):A}),X=r.computed(()=>B.value?void 0:"0"),O=A=>{var G;n("update:modelValue",A),p.search="",p.open=!1,(G=l==null?void 0:l.value)==null||G.focus()},K=()=>n("update:modelValue",void 0),W=()=>{var A;return(A=u.value)==null?void 0:A.focus()},S=()=>p.open=!p.open,k=()=>p.open=!0,T=A=>{var G,J;const pe=A.relatedTarget;!((G=l.value)!=null&&G.contains(pe))&&!((J=d.value)!=null&&J.contains(pe))&&(p.search="",p.open=!1)},z=()=>{const A=d.value;A&&it(A.querySelector(".hovered-item"),G=>{di(A,G)})},Z=A=>{var G,J;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(A.code))A.preventDefault();else return;const{open:pe,activeIndex:we}=p;if(!pe){A.code==="Enter"&&(p.open=!0);return}A.code==="Escape"&&(p.open=!1,(G=l.value)==null||G.focus());const Ct=r.unref(q),{length:Bt}=Ct;if(!Bt)return;A.code==="Enter"&&O((J=Ct.find(_r=>_r.index===we))==null?void 0:J.value);const ht=Ct.findIndex(_r=>_r.index===we)??-1,vr=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0,Pn=Math.abs(ht+vr+Bt)%Bt;p.activeIndex=q.value[Pn].index??-1};Ln(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,A=>{var G;return A?(G=u.value)==null?void 0:G.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&z()});const I=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(d,A=>{if(A){const G=A.getBoundingClientRect();p.optionsHeight=G.height,window.dispatchEvent(new CustomEvent("adjust"))}}),po(l,A=>{const G=A.top+A.height+3;G+p.optionsHeight>A.clientHeight?I.top=A.top-p.optionsHeight-3+"px":I.top=G+"px",I.left=A.left+"px",I.width=A.width+"px"}),(A,G)=>(r.openBlock(),r.createElementBlock("div",$w,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:X.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:A.error,disabled:B.value}]),onKeydown:Z,onFocusout:T},[r.createElementVNode("div",Uw,[r.createElementVNode("div",Ww,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":G[0]||(G[0]=J=>p.search=J),type:"text",tabindex:"-1",disabled:B.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:k},null,40,Hw),[[r.vModelText,p.search]]),G[4]||(G[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:W},[r.createVNode(_l,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(L.value),1)]),_:1})])),G[5]||(G[5]=r.createTextVNode()),r.createElementVNode("div",jw,[y.value?(r.openBlock(),r.createBlock(r.unref(On),{key:0,name:"loading"})):r.createCommentVNode("",!0),G[1]||(G[1]=r.createTextVNode()),A.clearable&&V.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:1,name:"delete-clear",onClick:r.withModifiers(K,["stop"])})):r.createCommentVNode("",!0),G[2]||(G[2]=r.createTextVNode()),r.renderSlot(A.$slots,"append"),G[3]||(G[3]=r.createTextVNode()),A.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${A.arrowIconLarge}`]]),onClick:r.withModifiers(S,["stop"])},null,2)):A.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${A.arrowIcon}`]]),onClick:r.withModifiers(S,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(S,["stop"])}))])]),G[9]||(G[9]=r.createTextVNode()),A.label?(r.openBlock(),r.createElementBlock("label",qw,[A.required?(r.openBlock(),r.createElementBlock("i",Kw)):r.createCommentVNode("",!0),G[6]||(G[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(A.label),1),G[7]||(G[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),G[10]||(G[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(I),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(q.value,(J,pe)=>(r.openBlock(),r.createBlock(uo,{key:pe,option:J,"is-selected":J.isSelected,"is-hovered":J.isActive,size:A.optionSize,onClick:r.withModifiers(we=>O(J.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),G[8]||(G[8]=r.createTextVNode()),q.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Yw,"Nothing found"))],4)])):r.createCommentVNode("",!0),G[11]||(G[11]=r.createTextVNode()),r.createVNode(lr,{class:"pl-dropdown__contour"})])],42,Zw),G[12]||(G[12]=r.createTextVNode()),P.value?(r.openBlock(),r.createElementBlock("div",Jw,r.toDisplayString(P.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 T=[];return s.isOpen&&T.push("open"),o.disabled&&T.push("disabled"),T.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 T=P();if(T!==-1){const z=ar(o.options)[T];return typeof z.label=="object"?z.label.title:z.label}}return""}),B=r.ref(y.value),E=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(()=>B.value,T=>{y.value!==T?p.value=T:p.value=""}),r.watch(()=>s.isOpen,T=>{var z;T&&l.value&&((z=l.value.querySelector("input"))==null||z.focus(),r.nextTick(()=>W()))}),r.watch(()=>o.modelValue,()=>R(),{immediate:!0});function P(){return o.options.findIndex(T=>Pt(T.value,o.modelValue))}function R(){s.activeOption=ci(f.value.findIndex(T=>Pt(T.value,o.modelValue)),T=>T<0?0:T),B.value=y.value}function L(){p.value=""}function C(){o.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function V(){o.mode==="list"&&(s.isOpen=!1)}function q(T){T&&(n("update:modelValue",T.value),V(),L())}function X(T){return Pt(T.value,o.modelValue)}const O=T=>{var z,Z;const I=T.relatedTarget;!((z=l.value)!=null&&z.contains(I))&&!((Z=d.value)!=null&&Z.contains(I))&&(p.value="",s.isOpen=!1)};function K(T){const{activeOption:z}=s;if(!s.isOpen&&T.code==="Enter"){s.isOpen=!0;return}const{length:Z}=f.value;if(!Z)return;["ArrowDown","ArrowUp","Enter"].includes(T.code)&&T.preventDefault(),T.code==="Enter"&&q(f.value[z]);const I=T.code==="ArrowDown"?1:T.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(z+I+Z)%Z,requestAnimationFrame(W)}function W(){const T=d.value;T&&it(T.querySelector(".hovered-item"),z=>{o.mode==="list"?di(T,z):z.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function S(){n("update:modelValue",void 0)}const k=r.reactive({top:"0px",left:"0px"});return r.watch(d,T=>{if(T){const z=T.getBoundingClientRect();s.optionsHeight=z.height,window.dispatchEvent(new CustomEvent("adjust"))}}),po(l,T=>{const z=T.top+T.height+2;z+s.optionsHeight>T.clientHeight?k.top=T.top-s.optionsHeight-2+"px":k.top=z+"px",k.left=T.left+"px"}),(T,z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:K,onFocusout:O,onClick:C},[r.createElementVNode("div",c0,r.toDisplayString(o==null?void 0:o.prefix),1),z[6]||(z[6]=r.createTextVNode()),r.createVNode(s0,{modelValue:B.value,"onUpdate:modelValue":z[0]||(z[0]=Z=>B.value=Z),placeholder:E.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),z[7]||(z[7]=r.createTextVNode()),r.createElementVNode("div",d0,[r.withDirectives(r.createElementVNode("div",u0,null,512),[[r.vShow,!m.value]]),z[1]||(z[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:S},null,512),[[r.vShow,m.value]])]),z[8]||(z[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(k),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:O},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(Z,I)=>r.renderSlot(T.$slots,"item",{key:I,item:Z,textItem:"text",isSelected:X(Z),isHovered:s.activeOption==I,onClick:r.withModifiers(A=>q(Z),["stop"])},()=>[r.createVNode(uo,{option:Z,"text-item":"text","is-selected":X(Z),"is-hovered":s.activeOption==I,size:"medium",onClick:r.withModifiers(A=>q(Z),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),z[3]||(z[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",p0,z[2]||(z[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(k),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:O},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(Z,I)=>r.renderSlot(T.$slots,"item",{key:I,item:Z,isSelected:X(Z),isHovered:s.activeOption==I,onClick:r.withModifiers(A=>q(Z),["stop"])},()=>[r.createVNode(l0,{option:Z,"is-selected":X(Z),"is-hovered":s.activeOption==I,onClick:r.withModifiers(A=>q(Z),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),z[5]||(z[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",h0,z[4]||(z[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(q.value.findIndex(I=>Pt(I.value,o.modelValue)),I=>I<0?0:I),m=()=>p.activeIndex=f(),y=r.computed(()=>o.options===void 0),B=r.computed(()=>y.value?!0:o.disabled),E=r.computed(()=>(o.options??[]).findIndex(I=>Pt(I.value,o.modelValue))),P=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&E.value===-1)return"The selected value is not one of the options"}}),R=r.computed(()=>ar(o.options??[]).map((I,A)=>({...I,index:A,isSelected:A===E.value,isActive:A===p.activeIndex}))),L=r.computed(()=>{const I=r.unref(R).find(A=>Pt(A.value,o.modelValue));return(I==null?void 0:I.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(L.value):o.placeholder),V=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),q=r.computed(()=>{const I=R.value;return p.search?I.filter(A=>{const G=p.search.toLowerCase();return A.label.toLowerCase().includes(G)||A.description&&A.description.toLowerCase().includes(G)?!0:typeof A.value=="string"?A.value.toLowerCase().includes(G):A.value===p.search}):I}),X=r.computed(()=>B.value?void 0:"0"),O=I=>{var A;n("update:modelValue",I),p.search="",p.open=!1,(A=l==null?void 0:l.value)==null||A.focus()},K=()=>n("update:modelValue",void 0),W=()=>{var I;return(I=u.value)==null?void 0:I.focus()},S=()=>p.open=!p.open,k=()=>p.open=!0,T=I=>{var A;(A=l==null?void 0:l.value)!=null&&A.contains(I.relatedTarget)||(p.search="",p.open=!1)},z=()=>{const I=d.value;I&&it(I.querySelector(".hovered-item"),A=>{di(I,A)})},Z=I=>{var A,G;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(I.code))I.preventDefault();else return;const{open:J,activeIndex:pe}=p;if(!J){I.code==="Enter"&&(p.open=!0);return}I.code==="Escape"&&(p.open=!1,(A=l.value)==null||A.focus());const we=r.unref(q),{length:Ct}=we;if(!Ct)return;I.code==="Enter"&&O((G=we.find(Pn=>Pn.index===pe))==null?void 0:G.value);const Bt=we.findIndex(Pn=>Pn.index===pe)??-1,ht=I.code==="ArrowDown"?1:I.code==="ArrowUp"?-1:0,vr=Math.abs(Bt+ht+Ct)%Ct;p.activeIndex=q.value[vr].index??-1};return Ln(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,I=>{var A;return I?(A=u.value)==null?void 0:A.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&z()}),(I,A)=>(r.openBlock(),r.createElementBlock("div",f0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:X.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:I.error,disabled:B.value}]),onKeydown:Z,onFocusout:T},[r.createElementVNode("div",g0,[r.createElementVNode("div",y0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":A[0]||(A[0]=G=>p.search=G),type:"text",tabindex:"-1",disabled:B.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:k},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:W},[r.createVNode(_l,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(L.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()),I.clearable&&V.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:1,name:"delete-clear",onClick:r.withModifiers(K,["stop"])})):r.createCommentVNode("",!0),A[2]||(A[2]=r.createTextVNode()),r.renderSlot(I.$slots,"append"),A[3]||(A[3]=r.createTextVNode()),I.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${I.arrowIconLarge}`]]),onClick:r.withModifiers(S,["stop"])},null,2)):I.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${I.arrowIcon}`]]),onClick:r.withModifiers(S,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(S,["stop"])}))])]),A[9]||(A[9]=r.createTextVNode()),I.label?(r.openBlock(),r.createElementBlock("label",C0,[I.required?(r.openBlock(),r.createElementBlock("i",w0)):r.createCommentVNode("",!0),A[6]||(A[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(I.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(I.$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(q.value,(G,J)=>(r.openBlock(),r.createBlock(uo,{key:J,option:G,"is-selected":G.isSelected,"is-hovered":G.isActive,size:I.optionSize,onClick:r.withModifiers(pe=>O(G.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),A[8]||(A[8]=r.createTextVNode()),q.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()),P.value?(r.openBlock(),r.createElementBlock("div",x0,r.toDisplayString(P.value),1)):y.value&&I.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",k0,r.toDisplayString(I.loadingOptionsHelper),1)):I.helper?(r.openBlock(),r.createElementBlock("div",S0,r.toDisplayString(I.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 V;C=C.replace(/,/g,""),B(C)?(o("update:modelValue",+C),C.toString()!==((V=n.modelValue)==null?void 0:V.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),B(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 B(C){return C!==void 0?(C=C==null?void 0:C.toString(),!isNaN(+C)&&!isNaN(parseFloat(C))):!1}function E(){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 P(){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 R(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?E():C.code==="ArrowDown"&&P()}const L=C=>{C.detail>1&&C.preventDefault()};return(C,V)=>(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:L,onKeydown:V[1]||(V[1]=q=>R(q))},[r.createElementVNode("div",D0,[r.createVNode(lr,{class:"mi-number-field__contour"}),V[6]||(V[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),V[2]||(V[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":V[0]||(V[0]=q=>p.value=q),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,M0),[[r.vModelText,p.value]])]),V[7]||(V[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:E},V[3]||(V[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),V[5]||(V[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:P},V[4]||(V[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)])]),V[8]||(V[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=S=>n("update:modelValue",S),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),B=r.computed(()=>ar(l.options).filter(S=>vl(m.value,S.value))),E=r.computed(()=>{const S=r.unref(m),k=ar(l.options);return(f.search?k.filter(T=>{const z=f.search.toLowerCase();return T.label.toLowerCase().includes(z)?!0:typeof T.value=="string"?T.value.toLowerCase().includes(z):T.value===f.search}):[...k]).map(T=>({...T,selected:vl(S,T.value)}))}),P=r.computed(()=>l.disabled?void 0:"0"),R=()=>{f.activeOption=ci(E.value.findIndex(S=>Pt(S.value,l.modelValue)),S=>S<0?0:S)},L=S=>{var k;const T=r.unref(m);o(vl(T,S)?T.filter(z=>!Pt(z,S)):[...T,S]),f.search="",(k=d==null?void 0:d.value)==null||k.focus()},C=S=>o(r.unref(m).filter(k=>!Pt(k,S))),V=()=>{var S;return(S=p.value)==null?void 0:S.focus()},q=()=>f.open=!f.open,X=S=>{var k,T;const z=S.relatedTarget;!((k=d.value)!=null&&k.contains(z))&&!((T=u.value)!=null&&T.contains(z))&&(f.search="",f.open=!1)},O=()=>{const S=u.value;S&&it(S.querySelector(".hovered-item"),k=>{di(S,k)})},K=S=>{var k;const{open:T,activeOption:z}=f;if(!T){S.code==="Enter"&&(f.open=!0);return}S.code==="Escape"&&(f.open=!1,(k=d.value)==null||k.focus());const Z=r.unref(E),{length:I}=Z;if(!I)return;["ArrowDown","ArrowUp","Enter"].includes(S.code)&&S.preventDefault(),S.code==="Enter"&&L(Z[z].value);const A=S.code==="ArrowDown"?1:S.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(z+A+I)%I,requestAnimationFrame(O)};Ln(d),r.watch(()=>l.modelValue,()=>R(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&O()});const W=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,S=>{if(S){const k=S.getBoundingClientRect();f.optionsHeight=k.height,window.dispatchEvent(new CustomEvent("adjust"))}}),po(d,S=>{const k=S.top+S.height+5;k+f.optionsHeight>S.clientHeight?W.top=S.top-f.optionsHeight-5+"px":W.top=k+"px",W.left=S.left+"px",W.width=S.width+"px"}),(S,k)=>(r.openBlock(),r.createElementBlock("div",z0,[r.createElementVNode("div",{ref_key:"rootRef",ref:d,tabindex:P.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:S.error,disabled:S.disabled}]),onKeydown:K,onFocusout:X},[r.createElementVNode("div",Z0,[r.createElementVNode("div",U0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":k[0]||(k[0]=T=>f.search=T),type:"text",tabindex:"-1",disabled:S.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:k[1]||(k[1]=T=>f.open=!0)},null,40,W0),[[r.vModelText,f.search]]),k[3]||(k[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:V},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(B.value,(T,z)=>(r.openBlock(),r.createBlock(r.unref(Cl),{key:z,closeable:"",small:"",onClick:k[2]||(k[2]=r.withModifiers(Z=>f.open=!0,["stop"])),onClose:Z=>C(T.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(T.label||T.value),1)]),_:2},1032,["onClose"]))),128))])),k[4]||(k[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(q,["stop"])}),k[5]||(k[5]=r.createTextVNode()),r.createElementVNode("div",H0,[r.renderSlot(S.$slots,"append")])]),k[10]||(k[10]=r.createTextVNode()),S.label?(r.openBlock(),r.createElementBlock("label",j0,[S.required?(r.openBlock(),r.createElementBlock("i",q0)):r.createCommentVNode("",!0),k[6]||(k[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(S.label),1),k[7]||(k[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(S.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),k[11]||(k[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(W),tabindex:"-1",onFocusout:X},[r.createElementVNode("div",K0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(B.value,(T,z)=>(r.openBlock(),r.createBlock(r.unref(Cl),{key:z,closeable:"",small:"",onClose:Z=>C(T.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(T.label||T.value),1)]),_:2},1032,["onClose"]))),128))]),k[8]||(k[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,(T,z)=>(r.openBlock(),r.createBlock(uo,{key:z,option:T,"text-item":"text","is-selected":T.selected,"is-hovered":f.activeOption==z,size:"medium","use-checkbox":"",onClick:r.withModifiers(Z=>L(T.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),k[9]||(k[9]=r.createTextVNode()),E.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Y0,"Nothing found"))],36)])):r.createCommentVNode("",!0),k[12]||(k[12]=r.createTextVNode()),r.createVNode(lr,{class:"pl-multi-dropdown__contour"})])],42,$0),k[13]||(k[13]=r.createTextVNode()),S.error?(r.openBlock(),r.createElementBlock("div",J0,r.toDisplayString(S.error),1)):S.helper?(r.openBlock(),r.createElementBlock("div",X0,r.toDisplayString(S.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=P=>{if(P&&P.ok===!1)return P.errors.join(`
|
|
53
|
-
`)},n=t,o=Ab(n),s=r.ref(!0),l=r.ref(),d=r.ref(),u=r.computed(()=>{var P;return((P=o.value)==null?void 0:P.error)??n.error??e(n.output)}),p=r.computed(()=>{var P;return((P=o.value)==null?void 0:P.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)},B=()=>{Mr(l.value,P=>{s.value&&P.scrollTo(P.scrollLeft,P.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{B()})},{immediate:!0});const E=P=>{const R=P.target;s.value=R.scrollTop+20>=R.scrollHeight-R.offsetHeight};return(P,R)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:d,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[P.label?(r.openBlock(),r.createElementBlock("label",Nb,r.toDisplayString(P.label),1)):r.createCommentVNode("",!0),R[1]||(R[1]=r.createTextVNode()),r.createVNode(lr,{class:"pl-log-view__contour"}),R[2]||(R[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"]),R[0]||(R[0]=r.createTextVNode())]),_:1})]),R[3]||(R[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:E},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(W=>!W.name.startsWith("."))),u=r.computed(()=>{var W;return{modelValue:o.modelValue,dirPath:l.dirPath,storageHandle:(W=l.storageEntry)==null?void 0:W.handle}}),p=(W,S)=>{window.platforma&&l.currentLoadingPath!==S&&(l.error="",l.items=[],l.lastSelected=void 0,l.currentLoadingPath=S,window.platforma.lsDriver.listFiles(W,S).then(k=>{S===l.dirPath&&(l.items=nu(k).entries.map(T=>({path:T.fullPath,name:T.name,isDir:T.type==="dir",canBeSelected:T.type==="file"&&(!o.extensions||o.extensions.some(z=>T.fullPath.endsWith(z))),handle:T.type==="file"?T.handle:void 0,selected:!1})).sort((T,z)=>T.isDir&&!z.isDir?-1:!T.isDir&&z.isDir?1:T.name.localeCompare(z.name)).map((T,z)=>({id:z,...T})),l.lastSelected=void 0)}).catch(k=>l.error=String(k)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:W,dirPath:S,modelValue:k}=u.value;W&&k&&p(W,S)},m=su(W=>{l.dirPath=W??""},1e3),y=r.computed(()=>$b(l.dirPath)),B=r.computed(()=>l.items.filter(W=>W.canBeSelected&&W.selected&&!W.isDir)),E=r.computed(()=>B.value.length>0),P=()=>{n("update:modelValue",!1)},R=()=>{var W;E.value&&(W=l.storageEntry)!=null&&W.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:B.value.map(S=>S.handle)}),P())},L=W=>{l.dirPath=W,l.storageEntry&&f()},C=(W,S)=>{const{shiftKey:k,metaKey:T}=W,{lastSelected:z}=l;if(W.preventDefault(),S.canBeSelected){if(o.multi||l.items.forEach(Z=>Z.selected=!1),S.selected=!0,!o.multi)return;!T&&!k&&l.items.forEach(Z=>{Z.id!==S.id&&(Z.selected=!1)}),k&&z!==void 0&&l.items.forEach(Z=>{Cv(Z.id,z,S.id)&&(Z.selected=!0)}),S.selected&&(l.lastSelected=S.id)}},V=W=>{W&&!o.multi||l.items.filter(S=>S.canBeSelected).forEach(S=>{S.selected=W})},q=()=>V(!0),X=()=>V(!1),O=()=>{if(l.error="",l.lastSelected=void 0,X(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(W=>{l.storageOptions=W.map(S=>({text:S.name,value:S})),o.autoSelectStorage&&Mr(W.find(S=>S.name==="local"||S.name.startsWith("local_disk_")&&S.initialFullPath.length>4),S=>{l.storageEntry=S,l.dirPath=S.initialFullPath})}).catch(W=>l.error=String(W))};r.watch(r.toRef(l,"storageEntry"),W=>{l.dirPath=(W==null?void 0:W.initialFullPath)??""}),r.watch([()=>l.dirPath,()=>l.storageEntry],()=>{f()}),r.watch(()=>o.modelValue,W=>{W?O():Object.assign(l,s())},{immediate:!0}),tt(document,"keydown",W=>{o.modelValue&&W.target===document.body&&(W.metaKey&&W.code==="KeyA"&&(W.preventDefault(),q()),W.metaKey&&W.shiftKey&&W.code==="Period"&&(W.preventDefault(),l.showHiddenItems=!l.showHiddenItems),W.code==="Enter"&&R())}),r.onUpdated(O);const K={mounted:W=>{if(W.clientWidth<W.scrollWidth){const S=W.innerText;W.innerText=S.substring(0,57)+"..."+S.substring(S.length-10)}}};return(W,S)=>(r.openBlock(),r.createBlock(r.unref(bl),{"no-content-gutters":!0,"close-on-outside-click":W.closeOnOutsideClick,class:"split","model-value":W.modelValue,width:"688px",height:"720px","onUpdate:modelValue":P,onClick:r.withModifiers(X,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(W.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(ul),{style:{"min-width":"160px"},disabled:!E.value,onClick:r.withModifiers(R,["stop"])},{default:r.withCtx(()=>S[14]||(S[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),S[16]||(S[16]=r.createTextVNode()),r.createVNode(r.unref(hl),{"justify-center":!1,onClick:r.withModifiers(P,["stop"])},{default:r.withCtx(()=>S[15]||(S[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[S[17]||(S[17]=r.createTextVNode()),r.createElementVNode("div",Zb,[r.createElementVNode("div",Ub,[r.createVNode(r.unref(ui),{modelValue:l.storageEntry,"onUpdate:modelValue":S[0]||(S[0]=k=>l.storageEntry=k),label:"Select storage",options:l.storageOptions},null,8,["modelValue","options"]),S[1]||(S[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"])]),S[13]||(S[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,(k,T)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:T},[r.createElementVNode("div",{title:k.path,onClick:z=>L(k.path)},r.toDisplayString(k.name),9,qb),S[2]||(S[2]=r.createTextVNode()),k.index!==y.value.length-1?(r.openBlock(),r.createElementBlock("i",Kb)):r.createCommentVNode("",!0)],64))),128))]),S[3]||(S[3]=r.createTextVNode()),r.createElementVNode("div",Yb,[r.createElementVNode("span",Jb,"Selected: "+r.toDisplayString(B.value.length),1)])]),S[12]||(S[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",Xb,S[4]||(S[4]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):l.storageEntry?l.error?(r.openBlock(),r.createElementBlock("div",ex,[S[6]||(S[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),S[7]||(S[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,k=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:k.id},[k.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:T=>L(k.path)},[S[8]||(S[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),S[9]||(S[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:k.name},[r.createTextVNode(r.toDisplayString(k.name),1)],8,ox)),[[K]])],8,rx)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:k.canBeSelected,selected:k.selected}),onClick:r.withModifiers(T=>C(T,k),["stop"])},[S[10]||(S[10]=r.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),S[11]||(S[11]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:k.name},[r.createTextVNode(r.toDisplayString(k.name),1)],8,sx)),[[K]])],10,ix))],64))),128))])):(r.openBlock(),r.createElementBlock("div",Qb,S[5]||(S[5]=[r.createElementVNode("div",{class:"ls-empty__cat"},null,-1),r.createTextVNode(),r.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),S[18]||(S[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(B=>{throw f.addIssue(o(p,B)),f}),y=await Reflect.apply(d,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(B=>{throw f.addIssue(s(y,B)),f})})}else{const u=this;return 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:V}=l.progress??{};return!C||!C.bytesTotal?"":C.bytesProcessed&&!V?nl(C.bytesProcessed,{})+" / "+nl(C.bytesTotal,{}):nl(C.bytesTotal,{})}),B=r.computed(()=>{var C;const{progress:V}=l;return V?{width:V.done?"100%":Math.round((((C=V.status)==null?void 0:C.progress)??0)*100)+"%"}:{}}),E=()=>{n.fileDialogOpen=!0},P=C=>{C.files.length&&s("update:modelValue",C.files[0])},R=()=>s("update:modelValue",void 0),L=r.ref();return l.cellStyle||Ln(L),(C,V)=>(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:L,class:r.normalizeClass(["pl-file-input",{dashed:C.dashed,error:f.value}]),tabindex:"0",onKeyup:r.withKeys(E,["enter"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(B.value)},null,4),V[3]||(V[3]=r.createTextVNode()),!C.cellStyle&&C.label?(r.openBlock(),r.createElementBlock("label",ck,[C.required?(r.openBlock(),r.createElementBlock("i",dk)):r.createCommentVNode("",!0),V[1]||(V[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(C.label),1),V[2]||(V[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),V[4]||(V[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"})),V[5]||(V[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":C.placeholder??"Choose file",class:"pl-file-input__filename",onClick:r.withModifiers(E,["stop"])},r.toDisplayString(d.value),9,uk),V[6]||(V[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",pk,r.toDisplayString(y.value),1)):r.createCommentVNode("",!0),V[7]||(V[7]=r.createTextVNode()),C.modelValue?(r.openBlock(),r.createBlock(r.unref(On),{key:6,name:"close",onClick:r.withModifiers(R,["stop"])})):r.createCommentVNode("",!0),V[8]||(V[8]=r.createTextVNode()),r.createVNode(lr,{class:"pl-file-input__contour"})],34),V[9]||(V[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),V[10]||(V[10]=r.createTextVNode()),r.createVNode(r.unref(Ou),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":V[0]||(V[0]=q=>n.fileDialogOpen=q),extensions:C.extensions,title:C.fileDialogTitle,"close-on-outside-click":C.fileDialogCloseOnOutsideClick,"onImport:files":P},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 O=s.modelValue;return Number.isFinite(O)?O<s.min?`Min value: ${s.min}`:O>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),m=r.computed(()=>s),y=Al(m),B=r.computed(()=>(u.value-s.min)/d.value),E=r.computed(()=>({right:Math.ceil((1-B.value)*100)+"%"})),P=r.computed(()=>({right:`calc(${Math.ceil((1-B.value)*100)}%) `})),R=r.ref(),L=r.ref();r.watch(()=>s.modelValue,O=>{p.value=O});function C(O){const K=vt(O,s.min,s.max);return Math.round((K+Number.EPSILON)*(1/s.step))/(1/s.step)}sr(L,O=>{var K;it((K=r.unref(R))==null?void 0:K.getBoundingClientRect(),W=>{const{dx:S}=O;l.deltaValue=S/W.width*d.value,p.value=C(vt((s.modelValue??0)+l.deltaValue,s.min,s.max)),O.stop&&(o("update:modelValue",C(u.value)),l.deltaValue=0)})});function V(O){o("update:modelValue",C(O))}function q(O){V(+O.target.value)}function X(O){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(O.code)&&O.preventDefault();const K=O.code==="ArrowUp"||O.code==="ArrowRight"?s.step*1:O.code==="ArrowDown"||O.code==="ArrowLeft"?s.step*-1:0;V(s.modelValue+K)}return(O,K)=>(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,[O.label?(r.openBlock(),r.createElementBlock("label",bk,[r.createElementVNode("span",null,r.toDisplayString(O.label),1),K[1]||(K[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(O.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),K[2]||(K[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",xk,r.toDisplayString(p.value)+r.toDisplayString(O.measure),1)):r.createCommentVNode("",!0)]),K[6]||(K[6]=r.createTextVNode()),r.createElementVNode("div",kk,[r.createElementVNode("div",Sk,[r.createElementVNode("div",{ref_key:"barRef",ref:R,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(E.value)},null,4)],512)]),K[5]||(K[5]=r.createTextVNode()),r.createElementVNode("div",Ek,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(W,S)=>(r.openBlock(),r.createElementBlock("div",{key:S,style:r.normalizeStyle({right:`${W}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),K[4]||(K[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:L,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(P.value),onKeydown:X},K[3]||(K[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),K[7]||(K[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:K[0]||(K[0]=W=>q(W))},null,40,Bk)):r.createCommentVNode("",!0)])],2),K[8]||(K[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,B=p>e?e:0,E=y>e?m-e-B:m;return`linear-gradient(
|
|
52
|
+
`,wC=["innerHTML"],bC={class:"dropdown-list-item__title-container"},xC={class:"dropdown-list-item__title text-s"},kC={key:0,class:"dropdown-list-item__description text-description"},SC={key:1,class:"dropdown-list-item__icon flex-self-start"},po=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?CC:vC);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(o.value),innerHTML:s.value},null,10,wC)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",bC,[r.createElementVNode("div",xC,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",kC,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",SC)):r.createCommentVNode("",!0)],2))}});function ho(t,e){const n=al(()=>{if(t.value){const{scrollTop:o,scrollLeft:s,scrollHeight:l,scrollWidth:c,clientHeight:u,clientWidth:p}=document.documentElement,f=t.value.getBoundingClientRect();e({scrollTop:o,scrollLeft:s,scrollHeight:l,scrollWidth:c,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 EC=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))}}),TC="_icon_1ugxm_2",BC={icon:TC},AC={$style:BC},Ir=Kt(EC,[["__cssModules",AC]]),NC=["onKeyup"],VC=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"),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,O=>{if(O){const K=O.getBoundingClientRect();m.optionsHeight=K.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const B=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),E=r.computed(()=>(o.options??[]).findIndex(O=>ai(O.value,l.value))),P=r.computed(()=>ar(o.options??[]).map((O,K)=>({...O,index:K,isSelected:K===E.value,isActive:K===m.activeIndex}))),R=r.computed(()=>o.loading||o.options===void 0),L=r.computed(()=>{var O;return((O=P.value.find(K=>ai(K.value,l.value)))==null?void 0:O.label)??(o.options===void 0?"...":"")});ho(c,O=>{const K=O.top+O.height+3;K+m.optionsHeight>O.clientHeight?y.top=O.top-m.optionsHeight-3+"px":y.top=K+"px",y.left=O.left+"px",y.width=O.width+"px",console.log(O.top,y)});const C=O=>{var K;l.value=O,m.open=!1,(K=c==null?void 0:c.value)==null||K.focus()};function V(){s("click")}const q=O=>{var K,W;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(O.code))O.preventDefault();else return;if(O.target===f.value&&O.code==="Enter"){V();return}const{open:S,activeIndex:k}=m;if(!S&&O.target===p.value){O.code==="Enter"&&(m.open=!0);return}O.code==="Escape"&&(m.open=!1,(K=c.value)==null||K.focus());const T=r.unref(P),{length:z}=T;if(!z)return;O.code==="Enter"&&C((W=T.find(G=>G.index===k))==null?void 0:W.value);const Z=T.findIndex(G=>G.index===k)??-1,I=O.code==="ArrowDown"?1:O.code==="ArrowUp"?-1:0,A=Math.abs(Z+I+z)%z;m.activeIndex=P.value[A].index??-1},X=O=>{var K,W;const S=O.relatedTarget;!((K=c.value)!=null&&K.contains(S))&&!((W=u.value)!=null&&W.contains(S))&&(m.open=!1)};return(O,K)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass([{disabled:O.disabled||R.value,loading:R.value},"pl-btn-split d-flex"]),onFocusout:X,onKeydown:q},[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:V,onKeyup:r.withKeys(r.withModifiers(V,["stop"]),["enter"])},r.toDisplayString(L.value),41,NC),K[1]||(K[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:K[0]||(K[0]=W=>m.open=!m.open)},[R.value?(r.openBlock(),r.createBlock(Ir,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([B.value,"pl-btn-split__icon"])},null,2))],512),K[2]||(K[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(P.value,(W,S)=>(r.openBlock(),r.createBlock(po,{key:S,option:W,"is-selected":W.isSelected,"is-hovered":W.isActive,size:"medium",onClick:r.withModifiers(k=>C(W.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function Eu(t){function e(n){const o=n.currentTarget,s=document.createElement("span"),l=Math.max(o.clientWidth,o.clientHeight),c=l/2;s.style.width=s.style.height=`${l}px`,s.style.left=`${n.clientX-o.offsetLeft-c}px`,s.style.top=`${n.clientY-o.offsetTop-c}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 PC={key:0},DC={inheritAttrs:!1},hs=r.defineComponent({...DC,__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 Eu(n),(l,c)=>(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",PC,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(Ir),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(Ir),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),FC={name:"PlBtnPrimary"},ul=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-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),RC={name:"PlBtnAccent"},MC=r.defineComponent({...RC,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))}}),IC={name:"PlBtnDanger"},LC=r.defineComponent({...IC,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))}}),OC={name:"PlBtnSecondary"},pl=r.defineComponent({...OC,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))}}),GC={key:0},zC={name:"PlBtnGhost"},hl=r.defineComponent({...zC,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 Eu(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:o.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",GC,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),u[0]||(u[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(Ir),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(Ir),{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))}}),$C=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 ZC(t,e){const n=r.ref();return ho(t,o=>{n.value=o}),r.computed(()=>{const o=r.unref(n),s=r.unref(e),l=s.position??"top",c=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-c}px;`:l==="top"?`left: ${p}px; top: ${o.offsetY-c}px;`:l==="right"?`left: ${o.offsetX+o.width+c}px; top: ${u}px;`:l==="left"?`right: ${o.scrollWidth-o.x+c}px; top: ${u}px;`:""})}function ci(t,e){return e(t)}function it(t,e){if(t!=null)return e(t)}function UC(t){return Array.isArray(t)?t:[t]}function WC(t,e,...n){n.forEach(o=>{t[o]=e[o]})}function fs(t,e){tt(document,"click",n=>{document.contains(n.target)&&(UC(t).map(o=>o.value).filter(o=>!!o).some(o=>o==null?void 0:o.contains(n.target))||e())})}const HC={},jC={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qC(t,e){return r.openBlock(),r.createElementBlock("svg",jC,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 KC=Kt(HC,[["render",qC]]),fl=new Map,YC={name:"PlTooltip"},kt=r.defineComponent({...YC,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,R=>{requestAnimationFrame(()=>{l.tooltipOpen=R})});let c=()=>{};const u=wu(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(let[R,L]of fl.entries())R!==o&&L()},f=()=>{l.open=!1,n("tooltip:close")},m=async()=>{s.hide||(u(),l.over=!0,c(),await mu(100),l.over&&p())},y=()=>{l.over=!1,c=gu(()=>{l.over||f()},s.closeDelay)};r.watch(()=>s.hide,R=>{R&&f()});const B=r.ref(),E=r.ref(),P=ZC(B,r.toRef(s));return fs([B,E],()=>f()),r.onUnmounted(()=>{fl.delete(o)}),(R,L)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(R.element),r.mergeProps(R.$attrs,{ref_key:"rootRef",ref:B,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(R.$slots,"default"),L[1]||(L[1]=r.createTextVNode()),R.$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(P))},[r.createElementVNode("div",{ref_key:"tooltip",ref:E,class:r.normalizeClass(["pl-tooltip",R.position]),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(R.$slots,"tooltip")]),L[0]||(L[0]=r.createTextVNode()),r.createVNode(KC)],34)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),JC={},XC={class:"inner-border"};function QC(t,e,n,o,s,l){return r.openBlock(),r.createElementBlock("div",XC,[r.renderSlot(t.$slots,"default")])}const ew=Kt(JC,[["render",QC]]),tw={key:0},nw=["tabindex","onKeydown","onClick"],rw={key:1,class:"pl-btn-group__helper"},ow={key:2,class:"pl-btn-group__error"},iw={name:"PlBtnGroup"},sw=r.defineComponent({...iw,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},compact:{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,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,compact:u.compact}])},[u.label?(r.openBlock(),r.createElementBlock("label",tw,[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(ew,{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,nw))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),u.helper?(r.openBlock(),r.createElementBlock("div",rw,r.toDisplayString(u.helper),1)):u.error?(r.openBlock(),r.createElementBlock("div",ow,r.toDisplayString(u.error),1)):r.createCommentVNode("",!0)],2))}}),aw={inheritAttrs:!1},lw={class:"double-contour"};function cw(t,e,n,o,s,l){return r.openBlock(),r.createElementBlock("div",lw,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const lr=Kt(aw,[["render",cw]]);function Tu(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 Bu(t,e){ml.set(t,e),gl.unobserve(t),gl.observe(t)}function Au(t){gl.unobserve(t),ml.delete(t)}const dw=8,Nu=4;function Ln(t,e="label"){const n=new Set;Tu(()=>{it(t==null?void 0:t.value,o=>{const s=o.querySelector(e);s&&(n.add(s),Bu(s,()=>{const l=fu(()=>s.getBoundingClientRect().width+ci(dw,c=>Number.isNaN(c)?Nu:c+Nu));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=>Au(o))})}function uw(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 Vu(t,e){return r.computed(()=>uw(t.value,e))}const pw=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))}}),hw="_icon_1ugxm_2",fw={icon:hw},mw={$style:fw},ms=Kt(pw,[["__cssModules",mw]]),gw=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))}}),yw="_icon_1ugxm_2",_w={icon:yw},vw={$style:_w},Pu=Kt(gw,[["__cssModules",vw]]),Cw={class:"pl-text-field__envelope"},ww={key:0,ref:"label"},bw={key:0,class:"required-icon"},xw={key:1,class:"pl-text-field__prefix"},kw=["disabled","placeholder","type"],Sw={class:"pl-text-field__append"},Ew={key:0,class:"pl-text-field__error"},Tw={key:1,class:"pl-text-field__helper"},Bw={name:"PlTextField"},Lr=r.defineComponent({...Bw,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(),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(X){if(u.cached=void 0,o.parse)try{n.value=o.parse(X)}catch(O){u.cached={error:O instanceof Error?O.message:String(O),value:X}}else n.value=X}}),f=r.computed(()=>o.type&&o.type==="password"?c.value?"text":o.type:"text"),m=r.computed(()=>c.value?"view-show":"view-hide"),y=()=>{o.clearable&&(u.cached=void 0,n.value=o.clearable===!0?"":o.clearable())},B=Vu(p,o.rules||[]),E=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),P=r.computed(()=>!E.value),R=r.computed(()=>{const X=[];return o.error&&X.push(o.error),u.cached&&X.push(u.cached.error),B.value.isValid||X.push(...B.value.errors),X}),L=r.computed(()=>R.value.length>0),C=r.computed(()=>o.clearable&&P.value&&o.type!=="password"),V=()=>c.value=!c.value,q=()=>{u.cached=void 0};return Ln(s),(X,O)=>(r.openBlock(),r.createElementBlock("div",Cw,[r.createElementVNode("div",{ref_key:"rootRef",ref:s,class:r.normalizeClass(["pl-text-field",{error:L.value,disabled:X.disabled,dashed:X.dashed,nonEmpty:P.value}])},[X.label?(r.openBlock(),r.createElementBlock("label",ww,[X.required?(r.openBlock(),r.createElementBlock("i",bw)):r.createCommentVNode("",!0),O[1]||(O[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(X.label),1),O[2]||(O[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(X.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),O[5]||(O[5]=r.createTextVNode()),X.prefix?(r.openBlock(),r.createElementBlock("div",xw,r.toDisplayString(X.prefix),1)):r.createCommentVNode("",!0),O[6]||(O[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":O[0]||(O[0]=K=>p.value=K),disabled:X.disabled,placeholder:X.placeholder||"...",type:f.value,spellcheck:"false",onFocusout:q},null,40,kw),[[r.vModelDynamic,p.value]]),O[7]||(O[7]=r.createTextVNode()),r.createElementVNode("div",Sw,[C.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),O[3]||(O[3]=r.createTextVNode()),X.type==="password"?(r.openBlock(),r.createBlock(r.unref(Pu),{key:1,name:m.value,style:{cursor:"pointer"},onClick:V},null,8,["name"])):r.createCommentVNode("",!0),O[4]||(O[4]=r.createTextVNode()),r.renderSlot(X.$slots,"append")]),O[8]||(O[8]=r.createTextVNode()),r.createVNode(lr,{class:"pl-text-field__contour"})],2),O[9]||(O[9]=r.createTextVNode()),L.value?(r.openBlock(),r.createElementBlock("div",Ew,r.toDisplayString(R.value.join(" ")),1)):X.helper?(r.openBlock(),r.createElementBlock("div",Tw,r.toDisplayString(X.helper),1)):r.createCommentVNode("",!0)]))}}),Aw={class:"ui-text-area__envelope"},Nw={key:0,ref:"label"},Vw={key:0,class:"required-icon"},Pw=["readonly","rows","disabled","placeholder"],Dw={class:"ui-text-area__append"},Fw={key:0,class:"ui-text-area__error"},Rw={key:1,class:"ui-text-area__helper"},Mw={name:"PlTextArea"},Iw=r.defineComponent({...Mw,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(),c=r.ref(),u=r.computed({get(){return s.modelValue??""},set(E){o("update:modelValue",E)}}),p=r.computed(()=>!!s.modelValue),f=Vu(u,s.rules||[]);Ln(l);const m=r.computed(()=>{const E=[];return s.error&&E.push(s.error),E.push(...f.value.errors),E}),y=r.computed(()=>m.value.length>0),B=()=>{if(!s.autogrow)return;const E=c.value;E&&(E.style.height="auto",E.style.height=`${E.scrollHeight}px`)};return r.onMounted(()=>{B()}),(E,P)=>(r.openBlock(),r.createElementBlock("div",Aw,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:E.disabled,dashed:E.dashed,nonEmpty:p.value}])},[E.label?(r.openBlock(),r.createElementBlock("label",Nw,[E.required?(r.openBlock(),r.createElementBlock("i",Vw)):r.createCommentVNode("",!0),P[1]||(P[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(E.label),1),P[2]||(P[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(E.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),P[3]||(P[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":P[0]||(P[0]=R=>u.value=R),readonly:E.readonly,rows:E.rows,disabled:E.disabled,placeholder:E.placeholder??"...",spellcheck:"false",onInput:B},null,40,Pw),[[r.vModelText,u.value]]),P[4]||(P[4]=r.createTextVNode()),r.createElementVNode("div",Dw,[r.renderSlot(E.$slots,"append")]),P[5]||(P[5]=r.createTextVNode()),r.createVNode(lr,{class:"ui-text-area__contour"})],2),P[6]||(P[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",Fw,r.toDisplayString(m.value.join(" ")),1)):E.helper?(r.openBlock(),r.createElementBlock("div",Rw,r.toDisplayString(E.helper),1)):r.createCommentVNode("",!0)]))}});function Du(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 Fu(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,c=e.offsetTop,u=Fu(t,e);if(u==="visible")return;const p=f=>{const m=u==="floor"?c-(s-l):c;t.scrollTop=o+f*(m-o)};Du(t,e)||vu({duration:n.duration||100,timing:_u(f=>f),draw:p})}function yl(t,e,n,o){return t.addEventListener(e,n,o),function(){t.removeEventListener(e,n)}}function Lw(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 Ru(t){return t!==null&&typeof t=="object"}function Pt(t,e){return Ru(t)&&Ru(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Pt(t[n],e[n])):t===e}function _l(t,e){return t.some(n=>Pt(n,e))}const vl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),o=r.ref(!1),s=r.computed(()=>o.value&&e.value?"ui-lt-animate":""),l=Cu(m=>o.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=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))}}),Ow=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))}}),Gw="_icon_1ugxm_2",zw={icon:Gw},$w={$style:zw},On=Kt(Ow,[["__cssModules",$w]]),Zw={class:"pl-dropdown__envelope"},Uw=["tabindex"],Ww={class:"pl-dropdown__container"},Hw={class:"pl-dropdown__field"},jw=["disabled","placeholder"],qw={class:"pl-dropdown__controls"},Kw={key:0},Yw={key:0,class:"required-icon"},Jw={key:0,class:"nothing-found"},Xw={key:0,class:"pl-dropdown__error"},Qw={key:1,class:"pl-dropdown__helper"},e0={key:2,class:"pl-dropdown__helper"},t0={name:"PlDropdown"},ui=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},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(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),f=()=>ci(q.value.findIndex(A=>Pt(A.value,o.modelValue)),A=>A<0?0:A),m=()=>p.activeIndex=f(),y=r.computed(()=>o.options===void 0),B=r.computed(()=>y.value?!0:o.disabled),E=r.computed(()=>(o.options??[]).findIndex(A=>Pt(A.value,o.modelValue))),P=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&E.value===-1)return"The selected value is not one of the options"}}),R=r.computed(()=>ar(o.options??[]).map((A,G)=>({...A,index:G,isSelected:G===E.value,isActive:G===p.activeIndex}))),L=r.computed(()=>{const A=r.unref(R).find(G=>Pt(G.value,o.modelValue));return(A==null?void 0:A.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(L.value):o.placeholder),V=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),q=r.computed(()=>{const A=R.value;return p.search?A.filter(G=>{const J=p.search.toLowerCase();return G.label.toLowerCase().includes(J)||G.description&&G.description.toLowerCase().includes(J)?!0:typeof G.value=="string"?G.value.toLowerCase().includes(J):G.value===p.search}):A}),X=r.computed(()=>B.value?void 0:"0"),O=A=>{var G;n("update:modelValue",A),p.search="",p.open=!1,(G=l==null?void 0:l.value)==null||G.focus()},K=()=>n("update:modelValue",void 0),W=()=>{var A;return(A=u.value)==null?void 0:A.focus()},S=()=>p.open=!p.open,k=()=>p.open=!0,T=A=>{var G,J;const pe=A.relatedTarget;!((G=l.value)!=null&&G.contains(pe))&&!((J=c.value)!=null&&J.contains(pe))&&(p.search="",p.open=!1)},z=()=>{const A=c.value;A&&it(A.querySelector(".hovered-item"),G=>{di(A,G)})},Z=A=>{var G,J;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(A.code))A.preventDefault();else return;const{open:pe,activeIndex:we}=p;if(!pe){A.code==="Enter"&&(p.open=!0);return}A.code==="Escape"&&(p.open=!1,(G=l.value)==null||G.focus());const Ct=r.unref(q),{length:Bt}=Ct;if(!Bt)return;A.code==="Enter"&&O((J=Ct.find(vr=>vr.index===we))==null?void 0:J.value);const ht=Ct.findIndex(vr=>vr.index===we)??-1,_r=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0,Pn=Math.abs(ht+_r+Bt)%Bt;p.activeIndex=q.value[Pn].index??-1};Ln(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,A=>{var G;return A?(G=u.value)==null?void 0:G.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&z()});const I=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(c,A=>{if(A){const G=A.getBoundingClientRect();p.optionsHeight=G.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ho(l,A=>{const G=A.top+A.height+3;G+p.optionsHeight>A.clientHeight?I.top=A.top-p.optionsHeight-3+"px":I.top=G+"px",I.left=A.left+"px",I.width=A.width+"px"}),(A,G)=>(r.openBlock(),r.createElementBlock("div",Zw,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:X.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:A.error,disabled:B.value}]),onKeydown:Z,onFocusout:T},[r.createElementVNode("div",Ww,[r.createElementVNode("div",Hw,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":G[0]||(G[0]=J=>p.search=J),type:"text",tabindex:"-1",disabled:B.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:k},null,40,jw),[[r.vModelText,p.search]]),G[4]||(G[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:W},[r.createVNode(vl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(L.value),1)]),_:1})])),G[5]||(G[5]=r.createTextVNode()),r.createElementVNode("div",qw,[y.value?(r.openBlock(),r.createBlock(r.unref(On),{key:0,name:"loading"})):r.createCommentVNode("",!0),G[1]||(G[1]=r.createTextVNode()),A.clearable&&V.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:1,name:"delete-clear",onClick:r.withModifiers(K,["stop"])})):r.createCommentVNode("",!0),G[2]||(G[2]=r.createTextVNode()),r.renderSlot(A.$slots,"append"),G[3]||(G[3]=r.createTextVNode()),A.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${A.arrowIconLarge}`]]),onClick:r.withModifiers(S,["stop"])},null,2)):A.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${A.arrowIcon}`]]),onClick:r.withModifiers(S,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(S,["stop"])}))])]),G[9]||(G[9]=r.createTextVNode()),A.label?(r.openBlock(),r.createElementBlock("label",Kw,[A.required?(r.openBlock(),r.createElementBlock("i",Yw)):r.createCommentVNode("",!0),G[6]||(G[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(A.label),1),G[7]||(G[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),G[10]||(G[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(I),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(q.value,(J,pe)=>(r.openBlock(),r.createBlock(po,{key:pe,option:J,"is-selected":J.isSelected,"is-hovered":J.isActive,size:A.optionSize,onClick:r.withModifiers(we=>O(J.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),G[8]||(G[8]=r.createTextVNode()),q.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Jw,"Nothing found"))],4)])):r.createCommentVNode("",!0),G[11]||(G[11]=r.createTextVNode()),r.createVNode(lr,{class:"pl-dropdown__contour"})])],42,Uw),G[12]||(G[12]=r.createTextVNode()),P.value?(r.openBlock(),r.createElementBlock("div",Xw,r.toDisplayString(P.value),1)):y.value&&A.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",Qw,r.toDisplayString(A.loadingOptionsHelper),1)):A.helper?(r.openBlock(),r.createElementBlock("div",e0,r.toDisplayString(A.helper),1)):r.createCommentVNode("",!0)]))}}),n0={name:"PlDropdownRef"},r0=r.defineComponent({...n0,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]=c=>s.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function o0(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 i0={class:"resizable-input"},s0=["placeholder","value","disabled"],a0=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 c(u){const p=u.target.value;o("update:modelValue",p)}return(u,p)=>(r.openBlock(),r.createElementBlock("div",i0,[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,s0)]))}}),l0={class:"dropdown-tab-item__title text-caps13"},c0=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",l0,r.toDisplayString(n.value),1)],2))}}),d0={class:"pl-line-dropdown__prefix"},u0={class:"pl-line-dropdown__icon-wrapper"},p0={class:"pl-line-dropdown__icon"},h0={key:0,class:"pl-line-dropdown__no-item"},f0={key:0,class:"pl-line-dropdown__no-item"},Mu=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(),c=r.ref(),u=r.computed(()=>{const T=[];return s.isOpen&&T.push("open"),o.disabled&&T.push("disabled"),T.join(" ")}),p=r.ref(""),f=o0(r.toRef(o,"options"),p),m=r.computed(()=>!!(o.clearable&&s.isOpen&&o.modelValue&&y.value)),y=r.computed(()=>{if(o.modelValue){const T=P();if(T!==-1){const z=ar(o.options)[T];return typeof z.label=="object"?z.label.title:z.label}}return""}),B=r.ref(y.value),E=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(()=>B.value,T=>{y.value!==T?p.value=T:p.value=""}),r.watch(()=>s.isOpen,T=>{var z;T&&l.value&&((z=l.value.querySelector("input"))==null||z.focus(),r.nextTick(()=>W()))}),r.watch(()=>o.modelValue,()=>R(),{immediate:!0});function P(){return o.options.findIndex(T=>Pt(T.value,o.modelValue))}function R(){s.activeOption=ci(f.value.findIndex(T=>Pt(T.value,o.modelValue)),T=>T<0?0:T),B.value=y.value}function L(){p.value=""}function C(){o.disabled?s.isOpen=!1:r.nextTick(()=>{s.isOpen=!s.isOpen})}function V(){o.mode==="list"&&(s.isOpen=!1)}function q(T){T&&(n("update:modelValue",T.value),V(),L())}function X(T){return Pt(T.value,o.modelValue)}const O=T=>{var z,Z;const I=T.relatedTarget;!((z=l.value)!=null&&z.contains(I))&&!((Z=c.value)!=null&&Z.contains(I))&&(p.value="",s.isOpen=!1)};function K(T){const{activeOption:z}=s;if(!s.isOpen&&T.code==="Enter"){s.isOpen=!0;return}const{length:Z}=f.value;if(!Z)return;["ArrowDown","ArrowUp","Enter"].includes(T.code)&&T.preventDefault(),T.code==="Enter"&&q(f.value[z]);const I=T.code==="ArrowDown"?1:T.code==="ArrowUp"?-1:0;s.activeOption=Math.abs(z+I+Z)%Z,requestAnimationFrame(W)}function W(){const T=c.value;T&&it(T.querySelector(".hovered-item"),z=>{o.mode==="list"?di(T,z):z.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function S(){n("update:modelValue",void 0)}const k=r.reactive({top:"0px",left:"0px"});return r.watch(c,T=>{if(T){const z=T.getBoundingClientRect();s.optionsHeight=z.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ho(l,T=>{const z=T.top+T.height+2;z+s.optionsHeight>T.clientHeight?k.top=T.top-s.optionsHeight-2+"px":k.top=z+"px",k.left=T.left+"px"}),(T,z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([u.value,"pl-line-dropdown uc-pointer"]),onKeydown:K,onFocusout:O,onClick:C},[r.createElementVNode("div",d0,r.toDisplayString(o==null?void 0:o.prefix),1),z[6]||(z[6]=r.createTextVNode()),r.createVNode(a0,{modelValue:B.value,"onUpdate:modelValue":z[0]||(z[0]=Z=>B.value=Z),placeholder:E.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),z[7]||(z[7]=r.createTextVNode()),r.createElementVNode("div",u0,[r.withDirectives(r.createElementVNode("div",p0,null,512),[[r.vShow,!m.value]]),z[1]||(z[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:S},null,512),[[r.vShow,m.value]])]),z[8]||(z[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:c,style:r.normalizeStyle(k),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:O},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(Z,I)=>r.renderSlot(T.$slots,"item",{key:I,item:Z,textItem:"text",isSelected:X(Z),isHovered:s.activeOption==I,onClick:r.withModifiers(A=>q(Z),["stop"])},()=>[r.createVNode(po,{option:Z,"text-item":"text","is-selected":X(Z),"is-hovered":s.activeOption==I,size:"medium",onClick:r.withModifiers(A=>q(Z),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),z[3]||(z[3]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",h0,z[2]||(z[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:c,style:r.normalizeStyle(k),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:O},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f),(Z,I)=>r.renderSlot(T.$slots,"item",{key:I,item:Z,isSelected:X(Z),isHovered:s.activeOption==I,onClick:r.withModifiers(A=>q(Z),["stop"])},()=>[r.createVNode(c0,{option:Z,"is-selected":X(Z),"is-hovered":s.activeOption==I,onClick:r.withModifiers(A=>q(Z),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),z[5]||(z[5]=r.createTextVNode()),r.unref(f).length===0?(r.openBlock(),r.createElementBlock("div",f0,z[4]||(z[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))}}),m0={class:"ui-dropdown__envelope"},g0=["tabindex"],y0={class:"ui-dropdown__container"},_0={class:"ui-dropdown__field"},v0=["disabled","placeholder"],C0={class:"ui-dropdown__controls"},w0={key:0},b0={key:0,class:"required-icon"},x0={key:0,class:"nothing-found"},k0={key:0,class:"ui-dropdown__error"},S0={key:1,class:"ui-dropdown__helper"},E0={key:2,class:"ui-dropdown__helper"},T0={name:"PlDropdown"},B0=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},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(),c=r.ref(),u=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),f=()=>ci(q.value.findIndex(I=>Pt(I.value,o.modelValue)),I=>I<0?0:I),m=()=>p.activeIndex=f(),y=r.computed(()=>o.options===void 0),B=r.computed(()=>y.value?!0:o.disabled),E=r.computed(()=>(o.options??[]).findIndex(I=>Pt(I.value,o.modelValue))),P=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&E.value===-1)return"The selected value is not one of the options"}}),R=r.computed(()=>ar(o.options??[]).map((I,A)=>({...I,index:A,isSelected:A===E.value,isActive:A===p.activeIndex}))),L=r.computed(()=>{const I=r.unref(R).find(A=>Pt(A.value,o.modelValue));return(I==null?void 0:I.label)||o.modelValue}),C=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(L.value):o.placeholder),V=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),q=r.computed(()=>{const I=R.value;return p.search?I.filter(A=>{const G=p.search.toLowerCase();return A.label.toLowerCase().includes(G)||A.description&&A.description.toLowerCase().includes(G)?!0:typeof A.value=="string"?A.value.toLowerCase().includes(G):A.value===p.search}):I}),X=r.computed(()=>B.value?void 0:"0"),O=I=>{var A;n("update:modelValue",I),p.search="",p.open=!1,(A=l==null?void 0:l.value)==null||A.focus()},K=()=>n("update:modelValue",void 0),W=()=>{var I;return(I=u.value)==null?void 0:I.focus()},S=()=>p.open=!p.open,k=()=>p.open=!0,T=I=>{var A;(A=l==null?void 0:l.value)!=null&&A.contains(I.relatedTarget)||(p.search="",p.open=!1)},z=()=>{const I=c.value;I&&it(I.querySelector(".hovered-item"),A=>{di(I,A)})},Z=I=>{var A,G;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(I.code))I.preventDefault();else return;const{open:J,activeIndex:pe}=p;if(!J){I.code==="Enter"&&(p.open=!0);return}I.code==="Escape"&&(p.open=!1,(A=l.value)==null||A.focus());const we=r.unref(q),{length:Ct}=we;if(!Ct)return;I.code==="Enter"&&O((G=we.find(Pn=>Pn.index===pe))==null?void 0:G.value);const Bt=we.findIndex(Pn=>Pn.index===pe)??-1,ht=I.code==="ArrowDown"?1:I.code==="ArrowUp"?-1:0,_r=Math.abs(Bt+ht+Ct)%Ct;p.activeIndex=q.value[_r].index??-1};return Ln(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,I=>{var A;return I?(A=u.value)==null?void 0:A.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&z()}),(I,A)=>(r.openBlock(),r.createElementBlock("div",m0,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:X.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:I.error,disabled:B.value}]),onKeydown:Z,onFocusout:T},[r.createElementVNode("div",y0,[r.createElementVNode("div",_0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:u,"onUpdate:modelValue":A[0]||(A[0]=G=>p.search=G),type:"text",tabindex:"-1",disabled:B.value,placeholder:C.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:k},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:W},[r.createVNode(vl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(L.value),1)]),_:1})])),A[5]||(A[5]=r.createTextVNode()),r.createElementVNode("div",C0,[y.value?(r.openBlock(),r.createBlock(r.unref(On),{key:0,name:"loading"})):r.createCommentVNode("",!0),A[1]||(A[1]=r.createTextVNode()),I.clearable&&V.value?(r.openBlock(),r.createBlock(r.unref(ms),{key:1,name:"delete-clear",onClick:r.withModifiers(K,["stop"])})):r.createCommentVNode("",!0),A[2]||(A[2]=r.createTextVNode()),r.renderSlot(I.$slots,"append"),A[3]||(A[3]=r.createTextVNode()),I.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${I.arrowIconLarge}`]]),onClick:r.withModifiers(S,["stop"])},null,2)):I.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${I.arrowIcon}`]]),onClick:r.withModifiers(S,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(S,["stop"])}))])]),A[9]||(A[9]=r.createTextVNode()),I.label?(r.openBlock(),r.createElementBlock("label",w0,[I.required?(r.openBlock(),r.createElementBlock("i",b0)):r.createCommentVNode("",!0),A[6]||(A[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(I.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(I.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),A[10]||(A[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createElementBlock("div",{key:1,ref_key:"list",ref:c,class:"ui-dropdown__options"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(q.value,(G,J)=>(r.openBlock(),r.createBlock(po,{key:J,option:G,"is-selected":G.isSelected,"is-hovered":G.isActive,size:I.optionSize,onClick:r.withModifiers(pe=>O(G.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),A[8]||(A[8]=r.createTextVNode()),q.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",x0,"Nothing found"))],512)):r.createCommentVNode("",!0),A[11]||(A[11]=r.createTextVNode()),r.createVNode(lr,{class:"ui-dropdown__contour"})])],42,g0),A[12]||(A[12]=r.createTextVNode()),P.value?(r.openBlock(),r.createElementBlock("div",k0,r.toDisplayString(P.value),1)):y.value&&I.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",S0,r.toDisplayString(I.loadingOptionsHelper),1)):I.helper?(r.openBlock(),r.createElementBlock("div",E0,r.toDisplayString(I.helper),1)):r.createCommentVNode("",!0)]))}}),A0={key:0,class:"ui-progress-bar"},N0={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},V0={class:"ui-progress-bar__message flex-grow-1"},P0={class:"ui-progress-bar__percent"},D0=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",A0,[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",N0,[r.createElementVNode("div",V0,r.toDisplayString(n.value),1),s[0]||(s[0]=r.createTextVNode()),r.createElementVNode("div",P0,r.toDisplayString(o.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),F0={class:"mi-number-field__main-wrapper d-flex"},R0={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},M0={key:0,class:"text-description"},I0=["disabled","placeholder"],L0={class:"mi-number-field__icons d-flex-column"},O0={key:0,class:"mi-number-field__hint text-description"},G0=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(),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 V;C=C.replace(/,/g,""),B(C)?(o("update:modelValue",+C),C.toString()!==((V=n.modelValue)==null?void 0:V.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),B(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 B(C){return C!==void 0?(C=C==null?void 0:C.toString(),!isNaN(+C)&&!isNaN(parseFloat(C))):!1}function E(){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 P(){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 R(C){["ArrowDown","ArrowUp"].includes(C.code)&&C.preventDefault(),C.code==="ArrowUp"?E():C.code==="ArrowDown"&&P()}const L=C=>{C.detail>1&&C.preventDefault()};return(C,V)=>(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:L,onKeydown:V[1]||(V[1]=q=>R(q))},[r.createElementVNode("div",F0,[r.createVNode(lr,{class:"mi-number-field__contour"}),V[6]||(V[6]=r.createTextVNode()),r.createElementVNode("div",R0,[C.label?(r.openBlock(),r.createElementBlock("label",M0,[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),V[2]||(V[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":V[0]||(V[0]=q=>p.value=q),disabled:C.disabled,placeholder:C.placeholder,class:"text-s flex-grow"},null,8,I0),[[r.vModelText,p.value]])]),V[7]||(V[7]=r.createTextVNode()),r.createElementVNode("div",L0,[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:E},V[3]||(V[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),V[5]||(V[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:P},V[4]||(V[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)])]),V[8]||(V[8]=r.createTextVNode()),f.value.trim()?(r.openBlock(),r.createElementBlock("div",O0,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],34))}}),z0={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",z0,[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))}}),$0={class:"pl-multi-dropdown__envelope"},Z0=["tabindex"],U0={class:"pl-multi-dropdown__container"},W0={class:"pl-multi-dropdown__field"},H0=["disabled","placeholder"],j0={class:"pl-multi-dropdown__append"},q0={key:0},K0={key:0,class:"required-icon"},Y0={class:"pl-multi-dropdown__open-chips-container"},J0={key:0,class:"nothing-found"},X0={key:0,class:"pl-multi-dropdown__error"},Q0={key:1,class:"pl-multi-dropdown__helper"},eb={name:"PlDropdownMulti"},tb=r.defineComponent({...eb,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=S=>n("update:modelValue",S),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),B=r.computed(()=>ar(l.options).filter(S=>_l(m.value,S.value))),E=r.computed(()=>{const S=r.unref(m),k=ar(l.options);return(f.search?k.filter(T=>{const z=f.search.toLowerCase();return T.label.toLowerCase().includes(z)?!0:typeof T.value=="string"?T.value.toLowerCase().includes(z):T.value===f.search}):[...k]).map(T=>({...T,selected:_l(S,T.value)}))}),P=r.computed(()=>l.disabled?void 0:"0"),R=()=>{f.activeOption=ci(E.value.findIndex(S=>Pt(S.value,l.modelValue)),S=>S<0?0:S)},L=S=>{var k;const T=r.unref(m);o(_l(T,S)?T.filter(z=>!Pt(z,S)):[...T,S]),f.search="",(k=c==null?void 0:c.value)==null||k.focus()},C=S=>o(r.unref(m).filter(k=>!Pt(k,S))),V=()=>{var S;return(S=p.value)==null?void 0:S.focus()},q=()=>f.open=!f.open,X=S=>{var k,T;const z=S.relatedTarget;!((k=c.value)!=null&&k.contains(z))&&!((T=u.value)!=null&&T.contains(z))&&(f.search="",f.open=!1)},O=()=>{const S=u.value;S&&it(S.querySelector(".hovered-item"),k=>{di(S,k)})},K=S=>{var k;const{open:T,activeOption:z}=f;if(!T){S.code==="Enter"&&(f.open=!0);return}S.code==="Escape"&&(f.open=!1,(k=c.value)==null||k.focus());const Z=r.unref(E),{length:I}=Z;if(!I)return;["ArrowDown","ArrowUp","Enter"].includes(S.code)&&S.preventDefault(),S.code==="Enter"&&L(Z[z].value);const A=S.code==="ArrowDown"?1:S.code==="ArrowUp"?-1:0;f.activeOption=Math.abs(z+A+I)%I,requestAnimationFrame(O)};Ln(c),r.watch(()=>l.modelValue,()=>R(),{immediate:!0}),r.watchPostEffect(()=>{f.search,f.open&&O()});const W=r.reactive({top:"0px",left:"0px",width:"0px"});return r.watch(u,S=>{if(S){const k=S.getBoundingClientRect();f.optionsHeight=k.height,window.dispatchEvent(new CustomEvent("adjust"))}}),ho(c,S=>{const k=S.top+S.height+5;k+f.optionsHeight>S.clientHeight?W.top=S.top-f.optionsHeight-5+"px":W.top=k+"px",W.left=S.left+"px",W.width=S.width+"px"}),(S,k)=>(r.openBlock(),r.createElementBlock("div",$0,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:P.value,class:r.normalizeClass(["pl-multi-dropdown",{open:f.open,error:S.error,disabled:S.disabled}]),onKeydown:K,onFocusout:X},[r.createElementVNode("div",U0,[r.createElementVNode("div",W0,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:p,"onUpdate:modelValue":k[0]||(k[0]=T=>f.search=T),type:"text",tabindex:"-1",disabled:S.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:k[1]||(k[1]=T=>f.open=!0)},null,40,H0),[[r.vModelText,f.search]]),k[3]||(k[3]=r.createTextVNode()),f.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:V},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(B.value,(T,z)=>(r.openBlock(),r.createBlock(r.unref(Cl),{key:z,closeable:"",small:"",onClick:k[2]||(k[2]=r.withModifiers(Z=>f.open=!0,["stop"])),onClose:Z=>C(T.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(T.label||T.value),1)]),_:2},1032,["onClose"]))),128))])),k[4]||(k[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(q,["stop"])}),k[5]||(k[5]=r.createTextVNode()),r.createElementVNode("div",j0,[r.renderSlot(S.$slots,"append")])]),k[10]||(k[10]=r.createTextVNode()),S.label?(r.openBlock(),r.createElementBlock("label",q0,[S.required?(r.openBlock(),r.createElementBlock("i",K0)):r.createCommentVNode("",!0),k[6]||(k[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(S.label),1),k[7]||(k[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(S.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),k[11]||(k[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(W),tabindex:"-1",onFocusout:X},[r.createElementVNode("div",Y0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(B.value,(T,z)=>(r.openBlock(),r.createBlock(r.unref(Cl),{key:z,closeable:"",small:"",onClose:Z=>C(T.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(T.label||T.value),1)]),_:2},1032,["onClose"]))),128))]),k[8]||(k[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,(T,z)=>(r.openBlock(),r.createBlock(po,{key:z,option:T,"text-item":"text","is-selected":T.selected,"is-hovered":f.activeOption==z,size:"medium","use-checkbox":"",onClick:r.withModifiers(Z=>L(T.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),k[9]||(k[9]=r.createTextVNode()),E.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",J0,"Nothing found"))],36)])):r.createCommentVNode("",!0),k[12]||(k[12]=r.createTextVNode()),r.createVNode(lr,{class:"pl-multi-dropdown__contour"})])],42,Z0),k[13]||(k[13]=r.createTextVNode()),S.error?(r.openBlock(),r.createElementBlock("div",X0,r.toDisplayString(S.error),1)):S.helper?(r.openBlock(),r.createElementBlock("div",Q0,r.toDisplayString(S.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))}}),nb={name:"PlCheckbox"},Iu=r.defineComponent({...nb,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))}}),rb={key:0},ob=["onClick"],ib={name:"PlCheckboxGroup"},sb=r.defineComponent({...ib,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,s=c=>o.modelValue.includes(c),l=c=>{const u=o.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",rb,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(wl,{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,ob)]))),128))],2))}}),ab="_component_tupwt_1",lb={component:ab},cb={};function db(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 ub={$style:lb},pb=Kt(cb,[["render",db],["__cssModules",ub]]),hb={key:1,class:"pl-dialog-modal__title"},fb={inheritAttrs:!1},bl=r.defineComponent({...fb,__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(),c=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(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(pb,{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",hb,[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})]))}}),mb=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}))}}),gb={key:0,class:"pl-slide-modal__title"},yb={class:"pl-slide-modal__content"},_b={key:1,class:"pl-slide-modal__actions"},vb={name:"PlSlideModal",inheritAttrs:!1},Cb=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(),c=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(mb,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=>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",gb,[r.renderSlot(u.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",yb,[r.renderSlot(u.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",_b,[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)]))}}),wb={key:0,class:"label"},bb={name:"PlToggleSwitch"},gs=r.defineComponent({...bb,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",wb,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function Lu(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function xb(t){return r.unref(t)}const kb=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function Sb(t,e,n={}){const{immediate:o=!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)},xb(e))}return o&&(s.value=!0,kb&&p()),Lu(u),{isPending:r.readonly(s),start:p,stop:u}}function Eb(t,e,n){return r.watch(t,(o,s,l)=>{o&&e(o,s,l)},{...n,once:!1})}function Tb(t,e,n){const{start:o}=Sb(l,e,{immediate:!1}),s=r.ref(!1);async function l(){s.value&&(await t(),o())}function c(){s.value||(s.value=!0,l())}function u(){s.value=!1}return n!=null&&n.immediate&&c(),Lu(u),{isActive:s,pause:u,resume:c}}const Bb="[==PROGRESS==]";function Ab(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nb(t){const e=r.ref(),n=r.reactive({errorCount:0});async function o(){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??Bb,m=new TextDecoder().decode(p.data).replace(new RegExp(`${Ab(f)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const s=Tb(()=>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 Eb(()=>{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 Vb={key:0},Pb={class:"pl-log-view__copy"},Db={key:1,class:"pl-log-view__error"},Fb={name:"PlLogView"},Ou=r.defineComponent({...Fb,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=P=>{if(P&&P.ok===!1)return P.errors.join(`
|
|
53
|
+
`)},n=t,o=Nb(n),s=r.ref(!0),l=r.ref(),c=r.ref(),u=r.computed(()=>{var P;return((P=o.value)==null?void 0:P.error)??n.error??e(n.output)}),p=r.computed(()=>{var P;return((P=o.value)==null?void 0:P.lines)??n.value??S_(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)},B=()=>{Mr(l.value,P=>{s.value&&P.scrollTo(P.scrollLeft,P.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{B()})},{immediate:!0});const E=P=>{const R=P.target;s.value=R.scrollTop+20>=R.scrollHeight-R.offsetHeight};return(P,R)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":u.value}])},[P.label?(r.openBlock(),r.createElementBlock("label",Vb,r.toDisplayString(P.label),1)):r.createCommentVNode("",!0),R[1]||(R[1]=r.createTextVNode()),r.createVNode(lr,{class:"pl-log-view__contour"}),R[2]||(R[2]=r.createTextVNode()),r.createElementVNode("div",Pb,[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"]),R[0]||(R[0]=r.createTextVNode())]),_:1})]),R[3]||(R[3]=r.createTextVNode()),u.value?(r.openBlock(),r.createElementBlock("div",Db,r.toDisplayString(u.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:E},r.toDisplayString(p.value),545))],2))}}),Rb="_component_1ukal_1",Mb="_tab_1ukal_14",Ib="_disabled_1ukal_27",Lb="_active_1ukal_56",Ob="_topLine_1ukal_69",fo={component:Rb,tab:Mb,disabled:Ib,active:Lb,topLine:Ob},Gb=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"]))}}),zb={name:"PlTabs"},$b=r.defineComponent({...zb,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,(c,u)=>(r.openBlock(),r.createBlock(Gb,{key:u,tabindex:s.modelValue===c.value||s.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(fo).active]:s.modelValue===c.value,[r.unref(fo).disabled]:c.disabled},r.unref(fo).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??s.maxTabWidth}),onKeydown:r.withKeys(p=>o(c.value),["enter"]),onClick:p=>o(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))}}),Zb=r.defineComponent({__name:"PlSectionSeparator",props:{compact:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-section-separator",{[e.$style.compact]:e.compact}])},[r.createElementVNode("div",{class:r.normalizeClass(e.$style.content)},[r.renderSlot(e.$slots,"default")],2)],2))}}),Ub="_compact_rhd5u_16",Wb="_content_rhd5u_20",Hb={compact:Ub,content:Wb},jb={$style:Hb},Gu=Kt(Zb,[["__cssModules",jb]]),qb=r.defineComponent({__name:"PlAccordion",props:r.mergeModels({multiple:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t;return r.provide("pl-accordion-model",e),r.provide("pl-accordion-props",r.toRef(n)),(o,s)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.renderSlot(o.$slots,"header"),s[0]||(s[0]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],64))}}),Kb=r.defineComponent({__name:"ExpandTransition",setup(t){const e=o=>{o.style.setProperty("--component-height",o.scrollHeight+"px"),o.classList.add("expand-collapse-fix")},n=o=>{o.style.removeProperty("--component-height"),o.classList.remove("expand-collapse-fix")};return(o,s)=>(r.openBlock(),r.createBlock(r.Transition,{name:"expand-collapse",onEnter:e,onLeave:e,onAfterEnter:n,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),Yb=r.defineComponent({__name:"PlAccordionSection",props:r.mergeModels({label:{},compact:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.inject("pl-accordion-model"),n=r.inject("pl-accordion-props"),o=r.useModel(t,"modelValue"),s=iu(),l=r.computed(()=>!n||n.value.multiple),c=r.computed({get(){return l.value?o.value:e?e.value===s:o.value},set(u){l.value?o.value=u:e&&(e.value=e.value===s?"":s)}});return(u,p)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(Gu),{class:r.normalizeClass(u.$style.separator),compact:u.compact,onClick:p[0]||(p[0]=f=>c.value=!c.value)},{default:r.withCtx(()=>[r.createVNode(r.unref(Ir),{name:"chevron-right",class:r.normalizeClass([{[u.$style.down]:c.value},u.$style.chevron])},null,8,["class"]),r.createTextVNode(" "+r.toDisplayString(u.label),1)]),_:1},8,["class","compact"]),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Kb,null,{default:r.withCtx(()=>[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(u.$style.content)},[r.renderSlot(u.$slots,"default")],2)):r.createCommentVNode("",!0)]),_:3})],64))}}),Jb="_content_jmjfk_2",Xb="_separator_jmjfk_14",Qb="_chevron_jmjfk_19",ex="_down_jmjfk_23",tx={content:Jb,separator:Xb,chevron:Qb,down:ex},nx={$style:tx},rx=Kt(Yb,[["__cssModules",nx]]);function ox(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 ix={class:"file-dialog"},sx={class:"file-dialog__search"},ax={class:"ls-container"},lx={class:"ls-head"},cx={class:"ls-head__breadcrumbs"},dx=["title","onClick"],ux={key:0,class:"icon-16 icon-chevron-right"},px={class:"d-flex ml-auto align-center gap-12"},hx={class:"ls-head__selected"},fx={key:0,class:"ls-loader"},mx={key:1,class:"ls-empty"},gx={key:2,class:"ls-error"},yx={class:"ls-error__message"},_x={key:3,class:"ls-body"},vx=["onClick"],Cx=["title"],wx=["onClick"],bx=["title"],zu=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()),c=r.computed(()=>l.showHiddenItems?l.items:l.items.filter(W=>!W.name.startsWith("."))),u=r.computed(()=>{var W;return{modelValue:o.modelValue,dirPath:l.dirPath,storageHandle:(W=l.storageEntry)==null?void 0:W.handle}}),p=(W,S)=>{window.platforma&&l.currentLoadingPath!==S&&(l.error="",l.items=[],l.lastSelected=void 0,l.currentLoadingPath=S,window.platforma.lsDriver.listFiles(W,S).then(k=>{S===l.dirPath&&(l.items=nu(k).entries.map(T=>({path:T.fullPath,name:T.name,isDir:T.type==="dir",canBeSelected:T.type==="file"&&(!o.extensions||o.extensions.some(z=>T.fullPath.endsWith(z))),handle:T.type==="file"?T.handle:void 0,selected:!1})).sort((T,z)=>T.isDir&&!z.isDir?-1:!T.isDir&&z.isDir?1:T.name.localeCompare(z.name)).map((T,z)=>({id:z,...T})),l.lastSelected=void 0)}).catch(k=>l.error=String(k)).finally(()=>{l.currentLoadingPath=void 0}))},f=()=>{const{storageHandle:W,dirPath:S,modelValue:k}=u.value;W&&k&&p(W,S)},m=au(W=>{l.dirPath=W??""},1e3),y=r.computed(()=>ox(l.dirPath)),B=r.computed(()=>l.items.filter(W=>W.canBeSelected&&W.selected&&!W.isDir)),E=r.computed(()=>B.value.length>0),P=()=>{n("update:modelValue",!1)},R=()=>{var W;E.value&&(W=l.storageEntry)!=null&&W.handle&&(n("import:files",{storageHandle:l.storageEntry.handle,files:B.value.map(S=>S.handle)}),P())},L=W=>{l.dirPath=W,l.storageEntry&&f()},C=(W,S)=>{const{shiftKey:k,metaKey:T}=W,{lastSelected:z}=l;if(W.preventDefault(),S.canBeSelected){if(o.multi||l.items.forEach(Z=>Z.selected=!1),S.selected=!0,!o.multi)return;!T&&!k&&l.items.forEach(Z=>{Z.id!==S.id&&(Z.selected=!1)}),k&&z!==void 0&&l.items.forEach(Z=>{b_(Z.id,z,S.id)&&(Z.selected=!0)}),S.selected&&(l.lastSelected=S.id)}},V=W=>{W&&!o.multi||l.items.filter(S=>S.canBeSelected).forEach(S=>{S.selected=W})},q=()=>V(!0),X=()=>V(!1),O=()=>{if(l.error="",l.lastSelected=void 0,X(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(W=>{l.storageOptions=W.map(S=>({text:S.name,value:S})),o.autoSelectStorage&&Mr(W.find(S=>S.name==="local"||S.name.startsWith("local_disk_")&&S.initialFullPath.length>4),S=>{l.storageEntry=S,l.dirPath=S.initialFullPath})}).catch(W=>l.error=String(W))};r.watch(r.toRef(l,"storageEntry"),W=>{l.dirPath=(W==null?void 0:W.initialFullPath)??""}),r.watch([()=>l.dirPath,()=>l.storageEntry],()=>{f()}),r.watch(()=>o.modelValue,W=>{W?O():Object.assign(l,s())},{immediate:!0}),tt(document,"keydown",W=>{o.modelValue&&W.target===document.body&&(W.metaKey&&W.code==="KeyA"&&(W.preventDefault(),q()),W.metaKey&&W.shiftKey&&W.code==="Period"&&(W.preventDefault(),l.showHiddenItems=!l.showHiddenItems),W.code==="Enter"&&R())}),r.onUpdated(O);const K={mounted:W=>{if(W.clientWidth<W.scrollWidth){const S=W.innerText;W.innerText=S.substring(0,57)+"..."+S.substring(S.length-10)}}};return(W,S)=>(r.openBlock(),r.createBlock(r.unref(bl),{"no-content-gutters":!0,"close-on-outside-click":W.closeOnOutsideClick,class:"split","model-value":W.modelValue,width:"688px",height:"720px","onUpdate:modelValue":P,onClick:r.withModifiers(X,["stop"])},{title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(W.title??"Select files"),1)]),actions:r.withCtx(()=>[r.createVNode(r.unref(ul),{style:{"min-width":"160px"},disabled:!E.value,onClick:r.withModifiers(R,["stop"])},{default:r.withCtx(()=>S[14]||(S[14]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),S[16]||(S[16]=r.createTextVNode()),r.createVNode(r.unref(hl),{"justify-center":!1,onClick:r.withModifiers(P,["stop"])},{default:r.withCtx(()=>S[15]||(S[15]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[S[17]||(S[17]=r.createTextVNode()),r.createElementVNode("div",ix,[r.createElementVNode("div",sx,[r.createVNode(r.unref(ui),{modelValue:l.storageEntry,"onUpdate:modelValue":S[0]||(S[0]=k=>l.storageEntry=k),label:"Select storage",options:l.storageOptions},null,8,["modelValue","options"]),S[1]||(S[1]=r.createTextVNode()),r.createVNode(r.unref(Lr),{"model-value":l.dirPath,label:"Enter path","onUpdate:modelValue":r.unref(m)},null,8,["model-value","onUpdate:modelValue"])]),S[13]||(S[13]=r.createTextVNode()),r.createElementVNode("div",ax,[r.createElementVNode("div",lx,[r.createElementVNode("div",cx,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(k,T)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:T},[r.createElementVNode("div",{title:k.path,onClick:z=>L(k.path)},r.toDisplayString(k.name),9,dx),S[2]||(S[2]=r.createTextVNode()),k.index!==y.value.length-1?(r.openBlock(),r.createElementBlock("i",ux)):r.createCommentVNode("",!0)],64))),128))]),S[3]||(S[3]=r.createTextVNode()),r.createElementVNode("div",px,[r.createElementVNode("span",hx,"Selected: "+r.toDisplayString(B.value.length),1)])]),S[12]||(S[12]=r.createTextVNode()),l.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",fx,S[4]||(S[4]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):l.storageEntry?l.error?(r.openBlock(),r.createElementBlock("div",gx,[S[6]||(S[6]=r.createElementVNode("div",{class:"ls-error__cat"},null,-1)),S[7]||(S[7]=r.createTextVNode()),r.createElementVNode("div",yx,r.toDisplayString(l.error),1)])):(r.openBlock(),r.createElementBlock("div",_x,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,k=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:k.id},[k.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:"isDir",onClick:T=>L(k.path)},[S[8]||(S[8]=r.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),S[9]||(S[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:k.name},[r.createTextVNode(r.toDisplayString(k.name),1)],8,Cx)),[[K]])],8,vx)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({canBeSelected:k.canBeSelected,selected:k.selected}),onClick:r.withModifiers(T=>C(T,k),["stop"])},[S[10]||(S[10]=r.createElementVNode("i",{class:"mask-16 mask-box isFile"},null,-1)),S[11]||(S[11]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:k.name},[r.createTextVNode(r.toDisplayString(k.name),1)],8,bx)),[[K]])],10,wx))],64))),128))])):(r.openBlock(),r.createElementBlock("div",mx,S[5]||(S[5]=[r.createElementVNode("div",{class:"ls-empty__cat"},null,-1),r.createTextVNode(),r.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])]),S[18]||(S[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 o(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(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"]),xx=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 c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let u=o,p=0;for(;p<c.path.length;){const f=c.path[p];p===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],p++}}};return s(this),o}static assert(e){if(!(e instanceof 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 $u=mo;function kx(t){$u=t}function ys(){return $u}const _s=t=>{const{data:e,path:n,errorMaps:o,issueData:s}=t,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let u="";const p=o.filter(f=>!!f).slice().reverse();for(const f of p)u=f(c,{data:e,defaultError:u}).message;return{...s,path:l,message:u}},Sx=[];function oe(t,e){const n=ys(),o=_s({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,c=await s.value;o.push({key:l,value:c})}return yt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return Ce;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const Ce=Object.freeze({status:"aborted"}),vs=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 Uu=(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,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??o)!==null&&u!==void 0?u:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(p=f??n)!==null&&p!==void 0?p:c.defaultError}},description:s}}class Ae{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return cr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new yt,ctx:{common:e.parent.common,data:e.data,parsedType:cr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(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 Uu(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 Uu(o,l)}refine(e,n){const o=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=e(s),u=()=>l.addIssue({code:ee.custom,...o(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(e,n){return this._refinement((o,s)=>e(o)?!0:(s.addIssue(typeof n=="function"?n(o,s):n),!1))}_refinement(e){return new dn({schema:this,typeName:_e.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 cn.create(this,this._def)}promise(){return vo.create(this,this._def)}or(e){return vi.create([this,e],this._def)}and(e){return Ci.create(this,e,this._def)}transform(e){return new dn({...Ee(this._def),schema:this,typeName:_e.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:_e.ZodDefault})}brand(){return new Bl({typeName:_e.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:_e.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 Ex=/^c[^\s-]{8,}$/i,Tx=/^[0-9a-z]+$/,Bx=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ax=/^[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,Nx=/^[a-z0-9_-]{21}$/i,Vx=/^[-+]?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)?)??$/,Px=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let El;const Fx=/^(?:(?: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])$/,Rx=/^(([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})))$/,Mx=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wu="((\\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])))",Ix=new RegExp(`^${Wu}$`);function Hu(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 Lx(t){return new RegExp(`^${Hu(t)}$`)}function ju(t){let e=`${Wu}T${Hu(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 Ox(t,e){return!!((e==="v4"||!e)&&Fx.test(t)||(e==="v6"||!e)&&Rx.test(t))}class ln 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,c=e.data.length<s.value;(l||c)&&(o=this._getOrReturnCtx(e,o),l?oe(o,{code:ee.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&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")Px.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(Dx,"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")Ax.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")Nx.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")Ex.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")Tx.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")Bx.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"?ju(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"?Ix.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{code:ee.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Lx(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"?Vx.test(e.data)||(o=this._getOrReturnCtx(e,o),oe(o,{validation:"duration",code:ee.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Ox(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"?Mx.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 ln({...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 ln({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ln({...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}}ln.create=t=>{var e;return new ln({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function Gx(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,s=n>o?n:o,l=parseInt(t.toFixed(s).replace(".","")),c=parseInt(e.toFixed(s).replace(".",""));return l%c/Math.pow(10,s)}class 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"?Gx(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:_e.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:_e.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:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});class Or extends Ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==se.date){const s=this._getOrReturnCtx(e);return 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 Or({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ue.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Or.create=t=>new Or({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.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:_e.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:_e.ZodUndefined,...Ee(t)});class _i 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)}}_i.create=t=>new _i({typeName:_e.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:_e.ZodAny,...Ee(t)});class Gr extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return St(e.data)}}Gr.create=t=>new Gr({typeName:_e.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:_e.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:_e.ZodVoid,...Ee(t)});class cn 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 c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(oe(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}),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((c,u)=>s.type._parseAsync(new An(n,c,n.path,u)))).then(c=>yt.mergeArray(o,c));const l=[...n.data].map((c,u)=>s.type._parseSync(new An(n,c,n.path,u)));return yt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new cn({...this._def,minLength:{value:e,message:ue.toString(n)}})}max(e,n){return new cn({...this._def,maxLength:{value:e,message:ue.toString(n)}})}length(e,n){return new cn({...this._def,exactLength:{value:e,message:ue.toString(n)}})}nonempty(e){return this.min(1,e)}}cn.create=(t,e)=>new cn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.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 cn?new cn({...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(),c=[];if(!(this._def.catchall instanceof Gn&&this._def.unknownKeys==="strip"))for(const p in o.data)l.includes(p)||c.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 c)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(p==="strict")c.length>0&&(oe(o,{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=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,c,u;const p=(c=(l=(s=this._def).errorMap)===null||l===void 0?void 0:l.call(s,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(u=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:_e.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 qu(Ie.objectKeys(this.shape))}}Xe.create=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strip",catchall:Gn.create(),typeName:_e.ZodObject,...Ee(e)}),Xe.strictCreate=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strict",catchall:Gn.create(),typeName:_e.ZodObject,...Ee(e)}),Xe.lazycreate=(t,e)=>new Xe({shape:t,unknownKeys:"strip",catchall:Gn.create(),typeName:_e.ZodObject,...Ee(e)});class vi 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 c=l.map(u=>new Lt(u.ctx.common.issues));return oe(n,{code:ee.invalid_union,unionErrors:c}),Ce}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const p of o){const f={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const u=c.map(p=>new Lt(p));return oe(n,{code:ee.invalid_union,unionErrors:u}),Ce}}get options(){return this._def.options}}vi.create=(t,e)=>new vi({options:t,typeName:_e.ZodUnion,...Ee(e)});const pr=t=>t instanceof bi?pr(t.schema):t instanceof dn?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 _i?[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 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:_e.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),c={...t,...e};for(const u of l){const p=Tl(t[u],e[u]);if(!p.valid)return{valid:!1};c[u]=p.data}return{valid:!0,data:c}}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 c=t[l],u=e[l],p=Tl(c,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,c)=>{if(kl(l)||kl(c))return Ce;const u=Tl(l.value,c.value);return u.valid?((Sl(l)||Sl(c))&&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,c])=>s(l,c)):s(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Ci.create=(t,e,n)=>new Ci({left:t,right:e,typeName:_e.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,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new An(o,l,o.path,c)):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:_e.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,c=this._def.valueType;for(const u in o.data)s.push({key:l._parse(new An(o,u,o.path,u)),value:c._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:_e.ZodRecord,...Ee(o)}):new wi({keyType:ln.create(),valueType:e,typeName:_e.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,c=[...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 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:_e.ZodMap,...Ee(n)});class zr 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 c(p){const f=new Set;for(const m of p){if(m.status==="aborted")return Ce;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...o.data.values()].map((p,f)=>l._parse(new An(o,p,o.path,f)));return o.common.async?Promise.all(u).then(p=>c(p)):c(u)}min(e,n){return new zr({...this._def,minSize:{value:e,message:ue.toString(n)}})}max(e,n){return new zr({...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)}}zr.create=(t,e)=>new zr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Ee(e)});class _o 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 _s({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 _s({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},c=n.data;if(this._def.returns instanceof vo){const u=this;return St(async function(...p){const f=new Lt([]),m=await u._def.args.parseAsync(p,l).catch(B=>{throw f.addIssue(o(p,B)),f}),y=await Reflect.apply(c,this,m);return await u._def.returns._def.type.parseAsync(y,l).catch(B=>{throw f.addIssue(s(y,B)),f})})}else{const u=this;return 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(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 _o({...this._def,args:Nn.create(e).rest(Gr.create())})}returns(e){return new _o({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new _o({args:e||Nn.create([]).rest(Gr.create()),returns:n||Gr.create(),typeName:_e.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:_e.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:_e.ZodLiteral,...Ee(e)});function qu(t,e){return new hr({values:t,typeName:_e.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=qu;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:_e.ZodNativeEnum,...Ee(e)});class vo 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})))}}vo.create=(t,e)=>new vo({type:t,typeName:_e.ZodPromise,...Ee(e)});class dn extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),s=this._def.effect||null,l={addIssue:c=>{oe(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return Ce;const p=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return p.status==="aborted"?Ce:p.status==="dirty"||n.value==="dirty"?vs(p.value):p});{if(n.value==="aborted")return Ce;const u=this._def.schema._parseSync({data:c,path:o.path,parent:o});return u.status==="aborted"?Ce:u.status==="dirty"||n.value==="dirty"?vs(u.value):u}}if(s.type==="refinement"){const c=u=>{const p=s.refinement(u,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?Ce:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!pi(c))return c;const u=s.transform(c.value,l);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>pi(c)?Promise.resolve(s.transform(c.value,l)).then(u=>({status:n.value,value:u})):c);Ie.assertNever(s)}}dn.create=(t,e,n)=>new dn({schema:t,typeName:_e.ZodEffects,effect:e,...Ee(n)}),dn.createWithPreprocess=(t,e,n)=>new dn({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.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:_e.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:_e.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:_e.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:_e.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:_e.ZodNaN,...Ee(t)});const zx=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(),vs(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:_e.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:_e.ZodReadonly,...Ee(e)});function Ku(t,e={},n){return t?go.create().superRefine((o,s)=>{var l,c;if(!t(o)){const u=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=u.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:p})}}):go.create()}const $x={object:Xe.lazycreate};var _e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_e||(_e={}));const Zx=(t,e={message:`Input not instance of ${t.name}`})=>Ku(n=>n instanceof t,e),Yu=ln.create,Ju=dr.create,Ux=Ss.create,Wx=ur.create,Xu=gi.create,Hx=Or.create,jx=ws.create,qx=yi.create,Kx=_i.create,Yx=go.create,Jx=Gr.create,Xx=Gn.create,Qx=bs.create,ek=cn.create,tk=Xe.create,nk=Xe.strictCreate,rk=vi.create,ok=xs.create,ik=Ci.create,sk=Nn.create,ak=wi.create,lk=ks.create,ck=zr.create,dk=_o.create,uk=bi.create,pk=xi.create,hk=hr.create,fk=ki.create,mk=vo.create,Qu=dn.create,gk=Vn.create,yk=fr.create,_k=dn.createWithPreprocess,vk=Ti.create;var Es=Object.freeze({__proto__:null,defaultErrorMap:mo,setErrorMap:kx,getErrorMap:ys,makeIssue:_s,EMPTY_PATH:Sx,addIssueToContext:oe,ParseStatus:yt,INVALID:Ce,DIRTY:vs,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:ju,ZodString:ln,ZodNumber:dr,ZodBigInt:ur,ZodBoolean:gi,ZodDate:Or,ZodSymbol:ws,ZodUndefined:yi,ZodNull:_i,ZodAny:go,ZodUnknown:Gr,ZodNever:Gn,ZodVoid:bs,ZodArray:cn,ZodObject:Xe,ZodUnion:vi,ZodDiscriminatedUnion:xs,ZodIntersection:Ci,ZodTuple:Nn,ZodRecord:wi,ZodMap:ks,ZodSet:zr,ZodFunction:_o,ZodLazy:bi,ZodLiteral:xi,ZodEnum:hr,ZodNativeEnum:ki,ZodPromise:vo,ZodEffects:dn,ZodTransformer:dn,ZodOptional:Vn,ZodNullable:fr,ZodDefault:Si,ZodCatch:Ei,ZodNaN:Ss,BRAND:zx,ZodBranded:Bl,ZodPipeline:Ti,ZodReadonly:Bi,custom:Ku,Schema:Ae,ZodSchema:Ae,late:$x,get ZodFirstPartyTypeKind(){return _e},coerce:{string:t=>ln.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=>Or.create({...t,coerce:!0})},any:Yx,array:ek,bigint:Wx,boolean:Xu,date:Hx,discriminatedUnion:ok,effect:Qu,enum:hk,function:dk,instanceof:Zx,intersection:ik,lazy:uk,literal:pk,map:lk,nan:Ux,nativeEnum:fk,never:Xx,null:Kx,nullable:yk,number:Ju,object:tk,oboolean:()=>Xu().optional(),onumber:()=>Ju().optional(),optional:gk,ostring:()=>Yu().optional(),pipeline:vk,preprocess:_k,promise:mk,record:ak,set:ck,strictObject:nk,string:Yu,symbol:jx,transformer:Qu,tuple:sk,undefined:qx,union:rk,unknown:Jx,void:Qx,NEVER:Ce,ZodIssueCode:ee,quotelessJson:xx,ZodError:Lt});function Ck(t){throw new Error("Unexpected object: "+t)}const ep="upload://upload/",tp="index://index/";function wk(t){return t.startsWith(ep)}function bk(t){return t.startsWith(tp)}function xk(t){if(bk(t)){const e=t.slice(tp.length);return JSON.parse(decodeURIComponent(e)).path}else if(wk(t)){const e=t.slice(ep.length);return JSON.parse(decodeURIComponent(e)).localPath}Ck(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 kk(t){return t.replace(/^.*[\\/]/,"")}const Sk={key:0,ref:"label"},Ek={key:0,class:"required-icon"},Tk=["data-placeholder"],Bk={key:5,class:"pl-file-input__stats"},Ak={key:0,class:"pl-file-input__error"},Nk={key:1,class:"upl-file-input__helper"},np=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,c=r.computed(()=>{if(l.modelValue)try{const C=xk(l.modelValue).trim();return l.showFilenameOnly?kk(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:V}=l.progress??{};return!C||!C.bytesTotal?"":C.bytesProcessed&&!V?nl(C.bytesProcessed,{})+" / "+nl(C.bytesTotal,{}):nl(C.bytesTotal,{})}),B=r.computed(()=>{var C;const{progress:V}=l;return V?{width:V.done?"100%":Math.round((((C=V.status)==null?void 0:C.progress)??0)*100)+"%"}:{}}),E=()=>{n.fileDialogOpen=!0},P=C=>{C.files.length&&s("update:modelValue",C.files[0])},R=()=>s("update:modelValue",void 0),L=r.ref();return l.cellStyle||Ln(L),(C,V)=>(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:L,class:r.normalizeClass(["pl-file-input",{dashed:C.dashed,error:f.value}]),tabindex:"0",onKeyup:r.withKeys(E,["enter"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(B.value)},null,4),V[3]||(V[3]=r.createTextVNode()),!C.cellStyle&&C.label?(r.openBlock(),r.createElementBlock("label",Sk,[C.required?(r.openBlock(),r.createElementBlock("i",Ek)):r.createCommentVNode("",!0),V[1]||(V[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(C.label),1),V[2]||(V[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),V[4]||(V[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"})),V[5]||(V[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":C.placeholder??"Choose file",class:"pl-file-input__filename",onClick:r.withModifiers(E,["stop"])},r.toDisplayString(c.value),9,Tk),V[6]||(V[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",Bk,r.toDisplayString(y.value),1)):r.createCommentVNode("",!0),V[7]||(V[7]=r.createTextVNode()),C.modelValue?(r.openBlock(),r.createBlock(r.unref(On),{key:6,name:"close",onClick:r.withModifiers(R,["stop"])})):r.createCommentVNode("",!0),V[8]||(V[8]=r.createTextVNode()),r.createVNode(lr,{class:"pl-file-input__contour"})],34),V[9]||(V[9]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",Ak,r.toDisplayString(m.value),1)):C.helper?(r.openBlock(),r.createElementBlock("div",Nk,r.toDisplayString(C.helper),1)):r.createCommentVNode("",!0)],2),V[10]||(V[10]=r.createTextVNode()),r.createVNode(r.unref(zu),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":V[0]||(V[0]=q=>n.fileDialogOpen=q),extensions:C.extensions,title:C.fileDialogTitle,"close-on-outside-click":C.fileDialogCloseOnOutsideClick,"onImport:files":P},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),Vk={class:"pl-notification-alert__wrapper d-flex"},Pk={class:"pl-notification-alert__content flex-grow-1"},Dk={key:0,class:"pl-notification-alert__close"},Fk={key:0,class:"pl-notification-alert__actions d-flex"},rp=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",Vk,[r.createElementVNode("div",Pk,[r.renderSlot(s.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),s.closable?(r.openBlock(),r.createElementBlock("div",Dk,[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",Fk,[r.renderSlot(s.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),Rk=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 _t(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 c=(1-(_t(l,n,o)-n)/(o-n))*100;e.push(c)}return e}),Mk={class:"ui-slider__wrapper"},Ik={class:"ui-slider__label-section"},Lk={key:0,class:"text-s"},Ok={key:1,class:"ui-slider__value-static text-s"},Gk={class:"ui-slider__base"},zk={class:"ui-slider__container"},$k={class:"ui-slider__container ui-slider__container-thumb"},Zk={class:"ui-slider__input-wrapper d-flex"},Uk=["value"],Wk={key:0,class:"ui-slider__error"},op=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}),c=r.computed(()=>s.max-s.min),u=r.computed(()=>_t((s.modelValue??0)+l.deltaValue,s.min,s.max)),p=r.ref(s.modelValue),f=r.computed(()=>{const O=s.modelValue;return Number.isFinite(O)?O<s.min?`Min value: ${s.min}`:O>s.max?`Max value: ${s.max}`:s.error:"Not a number"}),m=r.computed(()=>s),y=Al(m),B=r.computed(()=>(u.value-s.min)/c.value),E=r.computed(()=>({right:Math.ceil((1-B.value)*100)+"%"})),P=r.computed(()=>({right:`calc(${Math.ceil((1-B.value)*100)}%) `})),R=r.ref(),L=r.ref();r.watch(()=>s.modelValue,O=>{p.value=O});function C(O){const K=_t(O,s.min,s.max);return Math.round((K+Number.EPSILON)*(1/s.step))/(1/s.step)}sr(L,O=>{var K;it((K=r.unref(R))==null?void 0:K.getBoundingClientRect(),W=>{const{dx:S}=O;l.deltaValue=S/W.width*c.value,p.value=C(_t((s.modelValue??0)+l.deltaValue,s.min,s.max)),O.stop&&(o("update:modelValue",C(u.value)),l.deltaValue=0)})});function V(O){o("update:modelValue",C(O))}function q(O){V(+O.target.value)}function X(O){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(O.code)&&O.preventDefault();const K=O.code==="ArrowUp"||O.code==="ArrowRight"?s.step*1:O.code==="ArrowDown"||O.code==="ArrowLeft"?s.step*-1:0;V(s.modelValue+K)}return(O,K)=>(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",Mk,[r.createElementVNode("div",Ik,[O.label?(r.openBlock(),r.createElementBlock("label",Lk,[r.createElementVNode("span",null,r.toDisplayString(O.label),1),K[1]||(K[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(O.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),K[2]||(K[2]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",Ok,r.toDisplayString(p.value)+r.toDisplayString(O.measure),1)):r.createCommentVNode("",!0)]),K[6]||(K[6]=r.createTextVNode()),r.createElementVNode("div",Gk,[r.createElementVNode("div",zk,[r.createElementVNode("div",{ref_key:"barRef",ref:R,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(E.value)},null,4)],512)]),K[5]||(K[5]=r.createTextVNode()),r.createElementVNode("div",$k,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(W,S)=>(r.openBlock(),r.createElementBlock("div",{key:S,style:r.normalizeStyle({right:`${W}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),K[4]||(K[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:L,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(P.value),onKeydown:X},K[3]||(K[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),K[7]||(K[7]=r.createTextVNode()),r.createElementVNode("div",Zk,[s.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:K[0]||(K[0]=W=>q(W))},null,40,Uk)):r.createCommentVNode("",!0)])],2),K[8]||(K[8]=r.createTextVNode()),f.value?(r.openBlock(),r.createElementBlock("div",Wk,r.toDisplayString(f.value),1)):r.createCommentVNode("",!0)],2))}});function Hk(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,B=p>e?e:0,E=y>e?m-e-B:m;return`linear-gradient(
|
|
54
54
|
to bottom,
|
|
55
55
|
transparent,
|
|
56
56
|
black ${B}px,
|
|
@@ -62,17 +62,17 @@
|
|
|
62
62
|
black ${B}px,
|
|
63
63
|
black ${E}px,
|
|
64
64
|
transparent 100%
|
|
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 E;return[...((E=t.value)==null?void 0:E.children)??[]]}},o=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function d(E){const P=e.handle?this.querySelector(e.handle):null;P&&!P.contains(E.target)||(this.classList.remove(mr.animate),this.classList.add(mr.item),n.item={el:this,y:E.y,dy:0,orderChanged:!1})}function u(E){const P=n.options();return P.slice(0,P.indexOf(E))}function p(E){const P=n.options();return P.slice(P.indexOf(E)+1)}function f(E,P){const R=n.options().filter(C=>C!==P),L=R.indexOf(E);return R.splice(L,0,P),R}function m(E,P){const R=n.options().filter(C=>C!==P),L=R.indexOf(E);return R.splice(L+1,0,P),R}function y(E,P){E.dy=P-E.y,E.el.style.setProperty("transform",`translateY(${E.dy}px)`)}function B(E){var P;if(!n.item)return;const{el:R}=n.item;if(!R.isConnected){n.item=void 0;return}const L=E.map(K=>Ai(K)),C=Ai(R);(P=t.value)==null||P.replaceChildren(...E);const V=Ai(R),q=E.map(K=>Ai(K)),X=[];for(let K=0;K<q.length;K++){const W=E[K];if(W===n.item.el)continue;const S=q[K],k=L[K]-S;W.style.transform=`translateY(${k}px)`,X.push(W)}const O=V-C;n.item.y=n.item.y+O,n.item.dy=n.item.dy-O,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),X.forEach(K=>K.classList.remove(mr.animate)),requestAnimationFrame(function(){X.forEach(K=>{K.classList.add(mr.animate),K.style.transform="",K.addEventListener("transitionend",()=>{K.classList.remove(mr.animate)})})})}tt(window,"mousemove",E=>{if(!n.item)return;const{el:P}=n.item;y(n.item,E.y);const R=Ai(n.item.el),L=Vk(n.item.el),C=u(P),V=p(P);C.forEach(q=>{const X=op(q);R+s<X&&B(f(q,P))}),V.forEach(q=>{const X=op(q);L-s>X&&B(m(q,P))})}),tt(window,"mouseup",()=>{if(!n.item)return;const{el:E,orderChanged:P}=n.item;E.classList.add(mr.animate),E.style.removeProperty("transform"),E.addEventListener("transitionend",()=>{E.classList.remove(mr.animate,mr.item)}),setTimeout(()=>{if(!P)return;const R=n.options().map(C=>Number(C.getAttribute("data-index"))),L=t.value;if(L){for(const C of n.options())L.removeChild(C);o.value.forEach(C=>{L.appendChild(C)})}e.onChange(R)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((E,P)=>{E.removeEventListener("mousedown",d),E.addEventListener("mousedown",d),E.setAttribute("data-index",String(P))})})}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),B=Al(y),E=r.computed(()=>vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),P=r.computed(()=>vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),R=r.computed(()=>vt((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),L=r.computed(()=>{const G=s.modelValue;if(!(Array.isArray(G)&&G.length===3&&G.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(()=>(E.value-s.min)/m.value),V=r.computed(()=>(P.value-s.min)/m.value),q=r.computed(()=>(R.value-s.min)/m.value),X=r.computed(()=>T()),O=r.computed(()=>({right:X.value[0]+"%",left:100-X.value[2]+"%"})),K=r.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),W=r.computed(()=>({right:Math.ceil((1-V.value)*100)+"%"})),S=r.computed(()=>({right:Math.ceil((1-q.value)*100)+"%"}));sr(u,G=>{var J;it((J=r.unref(d))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=G;l.deltaValue1=we/pe.width*m.value,u.value&&k(u.value,s.modelValue[0],l.deltaValue1),G.stop&&(Z([z(E.value),z(P.value),z(R.value)]),l.deltaValue1=0)})}),sr(p,G=>{var J;it((J=r.unref(d))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=G;l.deltaValue2=we/pe.width*m.value,p.value&&k(p.value,s.modelValue[1],l.deltaValue2),G.stop&&(Z([z(E.value),z(P.value),z(R.value)]),l.deltaValue2=0)})}),sr(f,G=>{var J;it((J=r.unref(d))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=G;l.deltaValue3=we/pe.width*m.value,f.value&&k(f.value,s.modelValue[2],l.deltaValue3),G.stop&&(Z([z(E.value),z(P.value),z(R.value)]),l.deltaValue3=0)})});function k(G,J,pe){const we=z(vt((J??0)+pe,s.min,s.max));G.dataset.percent=`${we}${s.measure}`,I()}function T(){const G=Math.ceil((1-C.value)*100),J=Math.ceil((1-V.value)*100),pe=Math.ceil((1-q.value)*100);return[G,J,pe].sort((we,Ct)=>we-Ct)}function z(G){const J=vt(G,s.min,s.max);return Math.round((J+Number.EPSILON)*(1/s.step))/(1/s.step)}function Z(G){o("update:modelValue",G)}function I(){const G=Number(K.value.right.substring(0,K.value.right.length-1)),J=Number(W.value.right.substring(0,W.value.right.length-1)),pe=Number(S.value.right.substring(0,S.value.right.length-1)),we=[{r:G,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 A(G,J){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(G.code)&&G.preventDefault();const pe=G.code==="ArrowUp"||G.code==="ArrowRight"?s.step*1:G.code==="ArrowDown"||G.code==="ArrowLeft"?s.step*-1:0,we=[...s.modelValue];we[J]=vt(we[J]+pe,s.min,s.max),Z(we),I()}return r.onMounted(()=>{I()}),(G,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",Ik,[r.createElementVNode("div",Lk,[G.label?(r.openBlock(),r.createElementBlock("label",Ok,[r.createElementVNode("span",null,r.toDisplayString(G.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(G.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),J[11]||(J[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(O.value)},null,4)],512)]),J[10]||(J[10]=r.createTextVNode()),r.createElementVNode("div",$k,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(B),(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(K.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:J[0]||(J[0]=pe=>A(pe,0))},J[4]||(J[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Zk),J[8]||(J[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(W.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:J[1]||(J[1]=pe=>A(pe,1))},J[5]||(J[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Uk),J[9]||(J[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(S.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:J[2]||(J[2]=pe=>A(pe,2))},J[6]||(J[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,Wk)])])]),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()),L.value?(r.openBlock(),r.createElementBlock("div",Hk,r.toDisplayString(L.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 B=y.target.value;/^[0-9]{0,2}$/.test(B)?m?s.left=+B:s.right=+B:m?s.left=+B.slice(0,B.length-1):s.right=+B.slice(0,B.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]=B=>u.value.left=B),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=B=>l.value=!0),onFocusout:y[2]||(y[2]=B=>l.value=!1),onInput:y[3]||(y[3]=B=>f(!0,B))},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]=B=>u.value.right=B),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=B=>l.value=!0),onFocusout:y[6]||(y[6]=B=>l.value=!1),onInput:y[7]||(y[7]=B=>f(!1,B))},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]),B=r.computed(()=>s),E=Al(B),P=r.computed(()=>[m.value,y.value].sort((I,A)=>I-A).join("-")),R=r.computed(()=>s.max-s.min),L=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)),V=r.computed(()=>{const I=s.modelValue;return Array.isArray(I)&&I.length===2&&I.every(A=>Number.isFinite(A))?s.error:"Expected model [number, number]"}),q=r.computed(()=>(L.value-s.min)/R.value),X=r.computed(()=>(C.value-s.min)/R.value),O=r.computed(()=>k()),K=r.computed(()=>({right:O.value[0]+"%",left:100-O.value[1]+"%"})),W=r.computed(()=>({right:Math.ceil((1-q.value)*100)+"%"})),S=r.computed(()=>({right:Math.ceil((1-X.value)*100)+"%"}));r.watch(()=>s.modelValue,I=>{f.value=I,m.value=+I[0],y.value=+I[1]},{immediate:!0}),sr(u,I=>{var A;it((A=r.unref(d))==null?void 0:A.getBoundingClientRect(),G=>{const{dx:J}=I;l.deltaValue1=J/G.width*R.value,m.value=T(vt((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,y.value].sort((pe,we)=>pe-we),I.stop&&(z([T(L.value),T(C.value)]),l.deltaValue1=0)})}),sr(p,I=>{var A;it((A=r.unref(d))==null?void 0:A.getBoundingClientRect(),G=>{const{dx:J}=I;l.deltaValue2=J/G.width*R.value,y.value=T(vt((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,y.value].sort((pe,we)=>pe-we),I.stop&&(z([T(L.value),T(C.value)]),l.deltaValue2=0)})});function k(){const I=Math.ceil((1-q.value)*100),A=Math.ceil((1-X.value)*100);return[I,A].sort((G,J)=>G-J)}function T(I){const A=vt(I,s.min,s.max);return Math.round((A+Number.EPSILON)*(1/s.step))/(1/s.step)}function z(I){o("update:modelValue",I)}function Z(I,A){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(I.code)&&I.preventDefault();const G=I.code==="ArrowUp"||I.code==="ArrowRight"?s.step*1:I.code==="ArrowDown"||I.code==="ArrowLeft"?s.step*-1:0,J=[...s.modelValue];J[A]=vt(J[A]+G,s.min,s.max),z(J)}return(I,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,[I.label?(r.openBlock(),r.createElementBlock("label",Xk,[r.createElementVNode("span",null,r.toDisplayString(I.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(I.$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(P.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(K.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(E),(G,J)=>(r.openBlock(),r.createElementBlock("div",{key:J,style:r.normalizeStyle({right:`${G}%`}),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(W.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:A[0]||(A[0]=G=>Z(G,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(S.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:A[1]||(A[1]=G=>Z(G,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]=G=>f.value=G),class:"ui-focused-border",onChange:z},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),A[12]||(A[12]=r.createTextVNode()),V.value?(r.openBlock(),r.createElementBlock("div",oS,r.toDisplayString(V.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 B=(y.clientY-f.clientY)/l.value;n("update:scrollTop",o.scrollTop+B),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 B=(y.clientX-f.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+B),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:{}};/**
|
|
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 c=al(l);r.onMounted(l),tt(window,"scroll",c,!0),tt(window,"resize",c,!0)}function ip(t,e){Tu(()=>{it(r.unref(t),n=>{Bu(n,()=>e(n))})}),r.onUnmounted(()=>{it(r.unref(t),n=>{Au(n)})})}const mr={item:"sortable__item",animate:"sortable__animate"},Ai=t=>t.getBoundingClientRect().y,sp=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},jk=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function qk(t,e){const n={item:void 0,options(){var E;return[...((E=t.value)==null?void 0:E.children)??[]]}},o=r.computed(()=>n.options()),s=e.shakeBuffer??10,l=e.reorderDelay??100;function c(E){const P=e.handle?this.querySelector(e.handle):null;P&&!P.contains(E.target)||(this.classList.remove(mr.animate),this.classList.add(mr.item),n.item={el:this,y:E.y,dy:0,orderChanged:!1})}function u(E){const P=n.options();return P.slice(0,P.indexOf(E))}function p(E){const P=n.options();return P.slice(P.indexOf(E)+1)}function f(E,P){const R=n.options().filter(C=>C!==P),L=R.indexOf(E);return R.splice(L,0,P),R}function m(E,P){const R=n.options().filter(C=>C!==P),L=R.indexOf(E);return R.splice(L+1,0,P),R}function y(E,P){E.dy=P-E.y,E.el.style.setProperty("transform",`translateY(${E.dy}px)`)}function B(E){var P;if(!n.item)return;const{el:R}=n.item;if(!R.isConnected){n.item=void 0;return}const L=E.map(K=>Ai(K)),C=Ai(R);(P=t.value)==null||P.replaceChildren(...E);const V=Ai(R),q=E.map(K=>Ai(K)),X=[];for(let K=0;K<q.length;K++){const W=E[K];if(W===n.item.el)continue;const S=q[K],k=L[K]-S;W.style.transform=`translateY(${k}px)`,X.push(W)}const O=V-C;n.item.y=n.item.y+O,n.item.dy=n.item.dy-O,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),X.forEach(K=>K.classList.remove(mr.animate)),requestAnimationFrame(function(){X.forEach(K=>{K.classList.add(mr.animate),K.style.transform="",K.addEventListener("transitionend",()=>{K.classList.remove(mr.animate)})})})}tt(window,"mousemove",E=>{if(!n.item)return;const{el:P}=n.item;y(n.item,E.y);const R=Ai(n.item.el),L=jk(n.item.el),C=u(P),V=p(P);C.forEach(q=>{const X=sp(q);R+s<X&&B(f(q,P))}),V.forEach(q=>{const X=sp(q);L-s>X&&B(m(q,P))})}),tt(window,"mouseup",()=>{if(!n.item)return;const{el:E,orderChanged:P}=n.item;E.classList.add(mr.animate),E.style.removeProperty("transform"),E.addEventListener("transitionend",()=>{E.classList.remove(mr.animate,mr.item)}),setTimeout(()=>{if(!P)return;const R=n.options().map(C=>Number(C.getAttribute("data-index"))),L=t.value;if(L){for(const C of n.options())L.removeChild(C);o.value.forEach(C=>{L.appendChild(C)})}e.onChange(R)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((E,P)=>{E.removeEventListener("mousedown",c),E.addEventListener("mousedown",c),E.setAttribute("data-index",String(P))})})}function Kk(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function Yk(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 Jk(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 au(()=>{const s=n();this.run(...s).catch(console.error)},o)}});return e.run=e.run.bind(e),e}function Xk(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 o(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",o)}function l(){var c;(c=r.unref(t))==null||c.removeEventListener("mousedown",o)}r.onMounted(s),r.onUnmounted(l)}const Qk={class:"ui-slider__wrapper"},eS={class:"ui-slider__label-section"},tS={key:0,class:"text-s"},nS={class:"ui-slider__base"},rS={class:"ui-slider__container"},oS={class:"ui-slider__container ui-slider__container-thumb"},iS=["data-percent"],sS=["data-percent"],aS=["data-percent"],lS={key:0,class:"ui-slider__error"},cS=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}),c=r.ref(),u=r.ref(),p=r.ref(),f=r.ref(),m=r.computed(()=>s.max-s.min),y=r.computed(()=>s),B=Al(y),E=r.computed(()=>_t((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),P=r.computed(()=>_t((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),R=r.computed(()=>_t((s.modelValue[2]??0)+l.deltaValue3,s.min,s.max)),L=r.computed(()=>{const G=s.modelValue;if(!(Array.isArray(G)&&G.length===3&&G.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(()=>(E.value-s.min)/m.value),V=r.computed(()=>(P.value-s.min)/m.value),q=r.computed(()=>(R.value-s.min)/m.value),X=r.computed(()=>T()),O=r.computed(()=>({right:X.value[0]+"%",left:100-X.value[2]+"%"})),K=r.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),W=r.computed(()=>({right:Math.ceil((1-V.value)*100)+"%"})),S=r.computed(()=>({right:Math.ceil((1-q.value)*100)+"%"}));sr(u,G=>{var J;it((J=r.unref(c))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=G;l.deltaValue1=we/pe.width*m.value,u.value&&k(u.value,s.modelValue[0],l.deltaValue1),G.stop&&(Z([z(E.value),z(P.value),z(R.value)]),l.deltaValue1=0)})}),sr(p,G=>{var J;it((J=r.unref(c))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=G;l.deltaValue2=we/pe.width*m.value,p.value&&k(p.value,s.modelValue[1],l.deltaValue2),G.stop&&(Z([z(E.value),z(P.value),z(R.value)]),l.deltaValue2=0)})}),sr(f,G=>{var J;it((J=r.unref(c))==null?void 0:J.getBoundingClientRect(),pe=>{const{dx:we}=G;l.deltaValue3=we/pe.width*m.value,f.value&&k(f.value,s.modelValue[2],l.deltaValue3),G.stop&&(Z([z(E.value),z(P.value),z(R.value)]),l.deltaValue3=0)})});function k(G,J,pe){const we=z(_t((J??0)+pe,s.min,s.max));G.dataset.percent=`${we}${s.measure}`,I()}function T(){const G=Math.ceil((1-C.value)*100),J=Math.ceil((1-V.value)*100),pe=Math.ceil((1-q.value)*100);return[G,J,pe].sort((we,Ct)=>we-Ct)}function z(G){const J=_t(G,s.min,s.max);return Math.round((J+Number.EPSILON)*(1/s.step))/(1/s.step)}function Z(G){o("update:modelValue",G)}function I(){const G=Number(K.value.right.substring(0,K.value.right.length-1)),J=Number(W.value.right.substring(0,W.value.right.length-1)),pe=Number(S.value.right.substring(0,S.value.right.length-1)),we=[{r:G,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 A(G,J){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(G.code)&&G.preventDefault();const pe=G.code==="ArrowUp"||G.code==="ArrowRight"?s.step*1:G.code==="ArrowDown"||G.code==="ArrowLeft"?s.step*-1:0,we=[...s.modelValue];we[J]=_t(we[J]+pe,s.min,s.max),Z(we),I()}return r.onMounted(()=>{I()}),(G,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",Qk,[r.createElementVNode("div",eS,[G.label?(r.openBlock(),r.createElementBlock("label",tS,[r.createElementVNode("span",null,r.toDisplayString(G.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(G.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),J[11]||(J[11]=r.createTextVNode()),r.createElementVNode("div",nS,[r.createElementVNode("div",rS,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(O.value)},null,4)],512)]),J[10]||(J[10]=r.createTextVNode()),r.createElementVNode("div",oS,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(B),(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(K.value),"data-percent":s.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:J[0]||(J[0]=pe=>A(pe,0))},J[4]||(J[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,iS),J[8]||(J[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(W.value),"data-percent":s.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:J[1]||(J[1]=pe=>A(pe,1))},J[5]||(J[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,sS),J[9]||(J[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:f,style:r.normalizeStyle(S.value),"data-percent":s.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:J[2]||(J[2]=pe=>A(pe,2))},J[6]||(J[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,aS)])])]),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()),L.value?(r.openBlock(),r.createElementBlock("div",lS,r.toDisplayString(L.value),1)):r.createCommentVNode("",!0)],2))}}),dS={class:"ui-input-range__separator"},uS=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),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(){o("update:modelValue",[+s.left,+s.right]),o("change",[+s.left,+s.right])}function f(m,y){const B=y.target.value;/^[0-9]{0,2}$/.test(B)?m?s.left=+B:s.right=+B:m?s.left=+B.slice(0,B.length-1):s.right=+B.slice(0,B.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]=B=>u.value.left=B),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=B=>l.value=!0),onFocusout:y[2]||(y[2]=B=>l.value=!1),onInput:y[3]||(y[3]=B=>f(!0,B))},null,544),[[r.vModelText,u.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",dS,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=B=>u.value.right=B),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=B=>l.value=!0),onFocusout:y[6]||(y[6]=B=>l.value=!1),onInput:y[7]||(y[7]=B=>f(!1,B))},null,544),[[r.vModelText,u.value.right]])],16))}}),pS={class:"ui-slider__wrapper"},hS={class:"ui-slider__label-section"},fS={key:0,class:"text-s"},mS={key:1,class:"ui-slider__value-static text-s"},gS={class:"ui-slider__base"},yS={class:"ui-slider__container"},_S={class:"ui-slider__container ui-slider__container-thumb"},vS={class:"ui-slider__input-wrapper d-flex"},CS={key:0,class:"ui-slider__error"},wS=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}),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]),B=r.computed(()=>s),E=Al(B),P=r.computed(()=>[m.value,y.value].sort((I,A)=>I-A).join("-")),R=r.computed(()=>s.max-s.min),L=r.computed(()=>_t((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),C=r.computed(()=>_t((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),V=r.computed(()=>{const I=s.modelValue;return Array.isArray(I)&&I.length===2&&I.every(A=>Number.isFinite(A))?s.error:"Expected model [number, number]"}),q=r.computed(()=>(L.value-s.min)/R.value),X=r.computed(()=>(C.value-s.min)/R.value),O=r.computed(()=>k()),K=r.computed(()=>({right:O.value[0]+"%",left:100-O.value[1]+"%"})),W=r.computed(()=>({right:Math.ceil((1-q.value)*100)+"%"})),S=r.computed(()=>({right:Math.ceil((1-X.value)*100)+"%"}));r.watch(()=>s.modelValue,I=>{f.value=I,m.value=+I[0],y.value=+I[1]},{immediate:!0}),sr(u,I=>{var A;it((A=r.unref(c))==null?void 0:A.getBoundingClientRect(),G=>{const{dx:J}=I;l.deltaValue1=J/G.width*R.value,m.value=T(_t((s.modelValue[0]??0)+l.deltaValue1,s.min,s.max)),f.value=[m.value,y.value].sort((pe,we)=>pe-we),I.stop&&(z([T(L.value),T(C.value)]),l.deltaValue1=0)})}),sr(p,I=>{var A;it((A=r.unref(c))==null?void 0:A.getBoundingClientRect(),G=>{const{dx:J}=I;l.deltaValue2=J/G.width*R.value,y.value=T(_t((s.modelValue[1]??0)+l.deltaValue2,s.min,s.max)),f.value=[m.value,y.value].sort((pe,we)=>pe-we),I.stop&&(z([T(L.value),T(C.value)]),l.deltaValue2=0)})});function k(){const I=Math.ceil((1-q.value)*100),A=Math.ceil((1-X.value)*100);return[I,A].sort((G,J)=>G-J)}function T(I){const A=_t(I,s.min,s.max);return Math.round((A+Number.EPSILON)*(1/s.step))/(1/s.step)}function z(I){o("update:modelValue",I)}function Z(I,A){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(I.code)&&I.preventDefault();const G=I.code==="ArrowUp"||I.code==="ArrowRight"?s.step*1:I.code==="ArrowDown"||I.code==="ArrowLeft"?s.step*-1:0,J=[...s.modelValue];J[A]=_t(J[A]+G,s.min,s.max),z(J)}return(I,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",pS,[r.createElementVNode("div",hS,[I.label?(r.openBlock(),r.createElementBlock("label",fS,[r.createElementVNode("span",null,r.toDisplayString(I.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(I.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),A[4]||(A[4]=r.createTextVNode()),s.mode==="text"?(r.openBlock(),r.createElementBlock("div",mS,r.toDisplayString(P.value),1)):r.createCommentVNode("",!0)]),A[10]||(A[10]=r.createTextVNode()),r.createElementVNode("div",gS,[r.createElementVNode("div",yS,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(K.value)},null,4)],512)]),A[9]||(A[9]=r.createTextVNode()),r.createElementVNode("div",_S,[s.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(E),(G,J)=>(r.openBlock(),r.createElementBlock("div",{key:J,style:r.normalizeStyle({right:`${G}%`}),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(W.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:A[0]||(A[0]=G=>Z(G,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(S.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:A[1]||(A[1]=G=>Z(G,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",vS,[s.mode==="input"?(r.openBlock(),r.createBlock(uS,{key:0,modelValue:f.value,"onUpdate:modelValue":A[2]||(A[2]=G=>f.value=G),class:"ui-focused-border",onChange:z},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),A[12]||(A[12]=r.createTextVNode()),V.value?(r.openBlock(),r.createElementBlock("div",CS,r.toDisplayString(V.value),1)):r.createCommentVNode("",!0)],2))}}),bS=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)),c=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 B=(y.clientY-f.clientY)/l.value;n("update:scrollTop",o.scrollTop+B),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)}}),xS=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)),c=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 B=(y.clientX-f.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+B),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)}}),kS={class:"ui-scrollable"},SS=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){WC(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 c(u){it(r.unref(e),p=>{p.scrollLeft=u,o(p)})}return ip(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",kS,[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(bS,{"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(xS,{"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"])]))}}),ES="add.svg",TS="box.svg",BS="calendar.svg",AS="checkmark.svg",NS="clipboard.svg",VS="close.svg",PS="copy.svg",DS="download.svg",FS="duplicate.svg",RS="edit.svg",MS="error.svg",IS="filter.svg",LS="help.svg",OS="info.svg",GS="link.svg",zS="loading.svg",$S="lock.svg",ZS="maximize.svg",US="minimize.svg",WS="minus.svg",HS="more.svg",jS="open.svg",qS="pause.svg",KS="play.svg",YS="renew.svg",JS="restart.svg",XS="reverse.svg",QS="settings.svg",e1="sort.svg",t1="stop.svg",n1="success.svg",r1="time.svg",o1="tune.svg",i1="warning.svg",s1="zip.svg",a1={add:ES,"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:TS,calendar:BS,"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:AS,"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:NS,close:VS,copy:PS,"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:FS,edit:RS,error:MS,export:"export.svg","filter-on":"filter-on.svg",filter:IS,"help-outline":"help-outline.svg",help:LS,"info-outline":"info-outline.svg",info:OS,"jump-link":"jump-link.svg",link:GS,loading:zS,lock:$S,maximize:ZS,minimize:US,minus:WS,more:HS,open:jS,"paper-clip":"paper-clip.svg",pause:qS,play:KS,renew:YS,restart:JS,reverse:XS,settings:QS,sort:e1,stop:t1,success:n1,time:r1,tune:o1,warning:i1,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:s1},l1="add.svg",c1="annotate.svg",d1="annotation.svg",u1="area.svg",p1="axes.svg",h1="bar.svg",f1="bindot.svg",m1="box.svg",g1="boxplot.svg",y1="bubble.svg",_1="calendar.svg",v1="canvas.svg",C1="checkbox.svg",w1="checkmark.svg",b1="clipboard.svg",x1="close.svg",k1="cluster.svg",S1="code.svg",E1="color.svg",T1="columns.svg",B1="container.svg",A1="cookie.svg",N1="copy.svg",V1="cpu.svg",P1="debug.svg",D1="dna.svg",F1="download.svg",R1="duplicate.svg",M1="edit.svg",I1="error.svg",L1="filter.svg",O1="generate.svg",G1="graph.svg",z1="heatmap.svg",$1="help.svg",Z1="info.svg",U1="jitter.svg",W1="lasso.svg",H1="layers.svg",j1="learn.svg",q1="legend.svg",K1="line.svg",Y1="link.svg",J1="loading.svg",X1="lock.svg",Q1="maximize.svg",eE="menu.svg",tE="minimize.svg",nE="minus.svg",rE="more.svg",oE="pause.svg",iE="pin.svg",sE="play.svg",aE="product.svg",lE="publications.svg",cE="renew.svg",dE="restart.svg",uE="reverse.svg",pE="search.svg",hE="server.svg",fE="settings.svg",mE="sina.svg",gE="skatterplot.svg",yE="slice.svg",_E="sort.svg",vE="statistics.svg",CE="stop.svg",wE="success.svg",bE="table.svg",xE="template.svg",kE="terminal.svg",SE="time.svg",EE="tune.svg",TE="venn.svg",BE="violin.svg",AE="warning.svg",NE="wetlab.svg",VE="zip.svg",PE={"add-layer":"add-layer.svg",add:l1,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:c1,annotation:d1,area:u1,"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:p1,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:h1,bindot:f1,box:m1,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:g1,bubble:y1,calendar:_1,canvas:v1,"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:C1,checkmark:w1,"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:b1,close:x1,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:k1,code:S1,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:E1,columns:T1,"connected-points":"connected-points.svg",container:B1,cookie:A1,copy:N1,cpu:V1,"data-dimentions":"data-dimentions.svg",debug:P1,"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:F1,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:R1,edit:M1,"error-bar":"error-bar.svg",error:I1,"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:L1,"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:O1,graph:G1,heatmap:z1,"help-outline":"help-outline.svg",help:$1,"info-outline":"info-outline.svg",info:Z1,jitter:U1,"jump-link":"jump-link.svg",lasso:W1,layers:H1,learn:j1,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:q1,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:K1,"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:Y1,loading:J1,lock:X1,maximize:Q1,menu:eE,minimize:tE,minus:nE,more:rE,"paper-clip":"paper-clip.svg",pause:oE,pin:iE,play:sE,"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:aE,publications:lE,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:cE,restart:dE,reverse:uE,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:pE,"server-on":"server-on.svg",server:hE,settings:fE,sina:mE,skatterplot:gE,slice:yE,"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:_E,statistics:vE,stop:CE,"strip-plot":"strip-plot.svg",success:wE,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:bE,template:xE,terminal:kE,"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:SE,tune:EE,venn:TE,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:BE,warning:AE,wetlab:NE,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:VE,"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 FE=["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"],RE=["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"],ME={allCssVariables:DE(),icons16:a1,icons24:PE},IE={class:"block__not-found"},LE=r.defineComponent({__name:"NotFound",setup(t){const n=Xa().useApp(),o=()=>{n.updateNavigationState(s=>{s.href="/"})};return(s,l)=>(r.openBlock(),r.createElementBlock("div",IE,[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},OE={},GE={class:"block__loader-page"};function zE(t,e){return r.openBlock(),r.createElementBlock("div",GE,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const $E=Ts(OE,[["render",zE]]),ZE={class:"pl-app-notification-alert"},UE={class:"pl-app-notification-alert__content"},WE={class:"pl-app-notification-alert__title"},HE=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(c=>!!c[1]));function l(){n.value=!0}return r.watch(()=>e.errors,c=>{o.value=Object.values(c).some(u=>!!u)},{immediate:!0,deep:!0}),(c,u)=>(r.openBlock(),r.createElementBlock("div",ZE,[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",UE,[(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",WE,r.toDisplayString(p[0]),1),r.createVNode(r.unref(Ou),{value:(f=p[1])==null?void 0:f.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(rp),{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(Su))]),default:r.withCtx(()=>[u[4]||(u[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),jE={class:"block block__layout"},qE={key:0},KE=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),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",jE,[r.unref(e).error?(r.openBlock(),r.createElementBlock("div",qE,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(LE,{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(HE),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var Bs={exports:{}};/**
|
|
66
66
|
* @license
|
|
67
67
|
* Lodash <https://lodash.com/>
|
|
68
68
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
69
69
|
* Released under MIT license <https://lodash.com/license>
|
|
70
70
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
71
71
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
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,B=2,E=4,P=1,R=2,L=1,C=2,V=4,q=8,X=16,O=32,K=64,W=128,S=256,k=512,T=30,z="...",Z=800,I=16,A=1,G=2,J=3,pe=1/0,we=9007199254740991,Ct=17976931348623157e292,Bt=NaN,ht=4294967295,vr=ht-1,Pn=ht>>>1,_r=[["ary",W],["bind",L],["bindKey",C],["curry",q],["curryRight",X],["flip",k],["partial",O],["partialRight",K],["rearg",S]],$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 D=Hr&&Hr.require&&Hr.require("util").types;return D||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(D,U,$){switch($.length){case 0:return D.call(U);case 1:return D.call(U,$[0]);case 2:return D.call(U,$[0],$[1]);case 3:return D.call(U,$[0],$[1],$[2])}return D.apply(U,$)}function wB(D,U,$,ae){for(var xe=-1,ze=D==null?0:D.length;++xe<ze;){var at=D[xe];U(ae,at,$(at),D)}return ae}function Yt(D,U){for(var $=-1,ae=D==null?0:D.length;++$<ae&&U(D[$],$,D)!==!1;);return D}function bB(D,U){for(var $=D==null?0:D.length;$--&&U(D[$],$,D)!==!1;);return D}function Xp(D,U){for(var $=-1,ae=D==null?0:D.length;++$<ae;)if(!U(D[$],$,D))return!1;return!0}function wr(D,U){for(var $=-1,ae=D==null?0:D.length,xe=0,ze=[];++$<ae;){var at=D[$];U(at,$,D)&&(ze[xe++]=at)}return ze}function Os(D,U){var $=D==null?0:D.length;return!!$&&To(D,U,0)>-1}function Ql(D,U,$){for(var ae=-1,xe=D==null?0:D.length;++ae<xe;)if($(U,D[ae]))return!0;return!1}function Ye(D,U){for(var $=-1,ae=D==null?0:D.length,xe=Array(ae);++$<ae;)xe[$]=U(D[$],$,D);return xe}function br(D,U){for(var $=-1,ae=U.length,xe=D.length;++$<ae;)D[xe+$]=U[$];return D}function ec(D,U,$,ae){var xe=-1,ze=D==null?0:D.length;for(ae&&ze&&($=D[++xe]);++xe<ze;)$=U($,D[xe],xe,D);return $}function xB(D,U,$,ae){var xe=D==null?0:D.length;for(ae&&xe&&($=D[--xe]);xe--;)$=U($,D[xe],xe,D);return $}function tc(D,U){for(var $=-1,ae=D==null?0:D.length;++$<ae;)if(U(D[$],$,D))return!0;return!1}var kB=nc("length");function SB(D){return D.split("")}function EB(D){return D.match(FT)||[]}function Qp(D,U,$){var ae;return $(D,function(xe,ze,at){if(U(xe,ze,at))return ae=ze,!1}),ae}function Gs(D,U,$,ae){for(var xe=D.length,ze=$+(ae?1:-1);ae?ze--:++ze<xe;)if(U(D[ze],ze,D))return ze;return-1}function To(D,U,$){return U===U?LB(D,U,$):Gs(D,eh,$)}function TB(D,U,$,ae){for(var xe=$-1,ze=D.length;++xe<ze;)if(ae(D[xe],U))return xe;return-1}function eh(D){return D!==D}function th(D,U){var $=D==null?0:D.length;return $?oc(D,U)/$:Bt}function nc(D){return function(U){return U==null?n:U[D]}}function rc(D){return function(U){return D==null?n:D[U]}}function nh(D,U,$,ae,xe){return xe(D,function(ze,at,We){$=ae?(ae=!1,ze):U($,ze,at,We)}),$}function BB(D,U){var $=D.length;for(D.sort(U);$--;)D[$]=D[$].value;return D}function oc(D,U){for(var $,ae=-1,xe=D.length;++ae<xe;){var ze=U(D[ae]);ze!==n&&($=$===n?ze:$+ze)}return $}function ic(D,U){for(var $=-1,ae=Array(D);++$<D;)ae[$]=U($);return ae}function AB(D,U){return Ye(U,function($){return[$,D[$]]})}function rh(D){return D&&D.slice(0,ah(D)+1).replace(Wl,"")}function Ut(D){return function(U){return D(U)}}function sc(D,U){return Ye(U,function($){return D[$]})}function Ii(D,U){return D.has(U)}function oh(D,U){for(var $=-1,ae=D.length;++$<ae&&To(U,D[$],0)>-1;);return $}function ih(D,U){for(var $=D.length;$--&&To(U,D[$],0)>-1;);return $}function NB(D,U){for(var $=D.length,ae=0;$--;)D[$]===U&&++ae;return ae}var VB=rc(fB),PB=rc(mB);function DB(D){return"\\"+yB[D]}function FB(D,U){return D==null?n:D[U]}function Bo(D){return dB.test(D)}function RB(D){return uB.test(D)}function MB(D){for(var U,$=[];!(U=D.next()).done;)$.push(U.value);return $}function ac(D){var U=-1,$=Array(D.size);return D.forEach(function(ae,xe){$[++U]=[xe,ae]}),$}function sh(D,U){return function($){return D(U($))}}function xr(D,U){for(var $=-1,ae=D.length,xe=0,ze=[];++$<ae;){var at=D[$];(at===U||at===m)&&(D[$]=m,ze[xe++]=$)}return ze}function zs(D){var U=-1,$=Array(D.size);return D.forEach(function(ae){$[++U]=ae}),$}function IB(D){var U=-1,$=Array(D.size);return D.forEach(function(ae){$[++U]=[ae,ae]}),$}function LB(D,U,$){for(var ae=$-1,xe=D.length;++ae<xe;)if(D[ae]===U)return ae;return-1}function OB(D,U,$){for(var ae=$+1;ae--;)if(D[ae]===U)return ae;return ae}function Ao(D){return Bo(D)?zB(D):kB(D)}function Cn(D){return Bo(D)?$B(D):SB(D)}function ah(D){for(var U=D.length;U--&&NT.test(D.charAt(U)););return U}var GB=rc(gB);function zB(D){for(var U=Yl.lastIndex=0;Yl.test(D);)++U;return U}function $B(D){return D.match(Yl)||[]}function ZB(D){return D.match(cB)||[]}var UB=function D(U){U=U==null?ft:No.defaults(ft.Object(),U,No.pick(ft,pB));var $=U.Array,ae=U.Date,xe=U.Error,ze=U.Function,at=U.Math,We=U.Object,lc=U.RegExp,WB=U.String,Jt=U.TypeError,$s=$.prototype,HB=ze.prototype,Vo=We.prototype,Zs=U["__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?U.Buffer:n,kr=U.Symbol,js=U.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=U.clearTimeout!==ft.clearTimeout&&U.clearTimeout,XB=ae&&ae.now!==ft.Date.now&&ae.now,QB=U.setTimeout!==ft.setTimeout&&U.setTimeout,Js=at.ceil,Xs=at.floor,cc=We.getOwnPropertySymbols,eA=Hs?Hs.isBuffer:n,hh=U.isFinite,tA=$s.join,nA=sh(We.keys,We),lt=at.max,wt=at.min,rA=ae.now,oA=U.parseInt,fh=at.random,iA=$s.reverse,dc=Xr(U,"DataView"),Oi=Xr(U,"Map"),uc=Xr(U,"Promise"),Po=Xr(U,"Set"),Gi=Xr(U,"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,N=_.end,F=N-x,H=h?N:x-1,j=this.__iteratees__,Y=j.length,ne=0,ce=wt(F,this.__takeCount__);if(!c||!h&&g==F&&ce==F)return Oh(i,this.__actions__);var me=[];e:for(;F--&&ne<ce;){H+=a;for(var Ne=-1,ge=i[H];++Ne<Y;){var Pe=j[Ne],Fe=Pe.iteratee,jt=Pe.type,Vt=Fe(ge);if(jt==G)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||_,N=x?ic(i.length,WB):[],F=N.length;for(var H in i)(a||Ue.call(i,H))&&!(x&&(H=="length"||g&&(H=="offset"||H=="parent")||_&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||Kn(H,F)))&&N.push(H);return N}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,N=a&y,F=a&B,H=a&E;if(c&&(x=g?c(i,h,g,_):c(i)),x!==n)return x;if(!Qe(i))return i;var j=ke(i);if(j){if(x=TN(i),!N)return Dt(i,x)}else{var Y=bt(i),ne=Y==Fs||Y==Cp;if(Ar(i))return $h(i,N);if(Y==Zn||Y==$n||ne&&!g){if(x=F||ne?{}:lf(i),!N)return F?gN(i,OA(x,i)):mN(i,vh(x,i))}else{if(!He[Y])return g?i:{};x=BN(i,Y,N)}}_||(_=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=H?F?Dc:Pc:F?Rt:pt,Ne=j?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,N=i.length,F=[],H=a.length;if(!N)return F;c&&(a=Ye(a,Ut(c))),h?(_=Ql,x=!1):a.length>=s&&(_=Ii,x=!1,a=new Kr(a));e:for(;++g<N;){var j=i[g],Y=c==null?j:c(j);if(j=h||j!==0?j:0,x&&Y===Y){for(var ne=H;ne--;)if(a[ne]===Y)continue e;F.push(j)}else _(a,Y,h)||F.push(j)}return F}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&&(N===n?x===x&&!Ht(x):c(x,N)))var N=x,F=_}return F}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 N=i[_];a>0&&c(N)?a>1?mt(N,a-1,c,h,g):br(g,N):h||(g[g.length]=N)}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=_,N=$(_),F=1/0,H=[];x--;){var j=i[x];x&&a&&(j=Ye(j,Ut(a))),F=wt(j.length,F),N[x]=!c&&(a||g>=120&&j.length>=120)?new Kr(x&&j):n}j=i[0];var Y=-1,ne=N[0];e:for(;++Y<g&&H.length<F;){var ce=j[Y],me=a?a(ce):ce;if(ce=c||ce!==0?ce:0,!(ne?Ii(ne,me):h(H,me,c))){for(x=_;--x;){var Ne=N[x];if(!(Ne?Ii(Ne,me):h(i[x],me,c)))continue e}ne&&ne.push(me),H.push(ce)}}return H}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),N=ke(a),F=x?Wr:bt(i),H=N?Wr:bt(a);F=F==$n?Zn:F,H=H==$n?Zn:H;var j=F==Zn,Y=H==Zn,ne=F==H;if(ne&&Ar(i)){if(!Ar(a))return!1;x=!0,j=!1}if(ne&&!j)return _||(_=new wn),x||Lo(i)?of(i,a,c,h,g,_):bN(i,a,F,c,h,g,_);if(!(c&P)){var ce=j&&Ue.call(i,"__wrapped__"),me=Y&&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 N=c[g];if(x&&N[2]?N[1]!==i[N[0]]:!(N[0]in i))return!1}for(;++g<_;){N=c[g];var F=N[0],H=i[F],j=N[1];if(x&&N[2]){if(H===n&&!(F in i))return!1}else{var Y=new wn;if(h)var ne=h(H,j,F,i,a,Y);if(!(ne===n?Hi(j,H,P|R,h,Y):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,P|R)}}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 N=h?h(Oc(i,x),_,x+"",i,a,g):n;N===n&&(N=_),pc(i,x,N)}},Rt)}function tN(i,a,c,h,g,_,x){var N=Oc(i,c),F=Oc(a,c),H=x.get(F);if(H){pc(i,c,H);return}var j=_?_(N,F,c+"",i,a,x):n,Y=j===n;if(Y){var ne=ke(F),ce=!ne&&Ar(F),me=!ne&&!ce&&Lo(F);j=F,ne||ce||me?ke(N)?j=N:nt(N)?j=Dt(N):ce?(Y=!1,j=$h(F,!0)):me?(Y=!1,j=Zh(F,!0)):j=[]:Ji(F)||eo(F)?(j=N,eo(N)?j=Gf(N):(!Qe(N)||Yn(N))&&(j=lf(F))):Y=!1}Y&&(x.set(F,j),g(j,F,h,_,x),x.delete(F)),pc(i,c,j)}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,N){var F=Ye(a,function(H){return H(_)});return{criteria:F,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],N=Jr(i,x);c(N,x)&&ji(_,Tr(x,i),N)}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,N=i;for(i===a&&(a=Dt(a)),c&&(N=Ye(i,Ut(c)));++_<x;)for(var F=0,H=a[_],j=c?c(H):H;(F=g(N,j,F,h))>-1;)N!==i&&Ks.call(N,F,1),Ks.call(i,F,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,N=i;N!=null&&++g<_;){var F=Rn(a[g]),H=c;if(F==="__proto__"||F==="constructor"||F==="prototype")return i;if(g!=x){var j=N[F];H=h?h(j,F,N):n,H===n&&(H=Qe(j)?j:Kn(a[g+1])?[]:{})}Zi(N,F,H),N=N[F]}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,N=a===null,F=Ht(a),H=a===n;g<_;){var j=Xs((g+_)/2),Y=c(i[j]),ne=Y!==n,ce=Y===null,me=Y===Y,Ne=Ht(Y);if(x)var ge=h||me;else H?ge=me&&(h||ne):N?ge=me&&ne&&(h||!ce):F?ge=me&&ne&&!ce&&(h||!Ne):ce||Ne?ge=!1:ge=h?Y<=a:Y<a;ge?g=j+1:_=j}return wt(_,vr)}function Mh(i,a){for(var c=-1,h=i.length,g=0,_=[];++c<h;){var x=i[c],N=a?a(x):x;if(!c||!bn(N,F)){var F=N;_[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,N=[],F=N;if(c)x=!1,g=Ql;else if(_>=s){var H=a?null:CN(i);if(H)return zs(H);x=!1,g=Ii,F=new Kr}else F=a?[]:N;e:for(;++h<_;){var j=i[h],Y=a?a(j):j;if(j=c||j!==0?j:0,x&&Y===Y){for(var ne=F.length;ne--;)if(F[ne]===Y)continue e;a&&F.push(Y),N.push(j)}else g(F,Y,c)||(F!==N&&F.push(Y),N.push(j))}return N}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],N=-1;++N<h;)N!=g&&(_[g]=Ui(_[g]||x,i[N],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 N=h<_?a[h]:n;c(x,i[h],N)}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,N=a===null,F=a===a,H=Ht(a);if(!N&&!H&&!_&&i>a||_&&x&&F&&!N&&!H||h&&x&&F||!c&&F||!g)return 1;if(!h&&!_&&!H&&i<a||H&&c&&g&&!h&&!_||N&&c&&g||!x&&g||!F)return-1}return 0}function fN(i,a,c){for(var h=-1,g=i.criteria,_=a.criteria,x=g.length,N=c.length;++h<x;){var F=Uh(g[h],_[h]);if(F){if(h>=N)return F;var H=c[h];return F*(H=="desc"?-1:1)}}return i.index-a.index}function Wh(i,a,c,h){for(var g=-1,_=i.length,x=c.length,N=-1,F=a.length,H=lt(_-x,0),j=$(F+H),Y=!h;++N<F;)j[N]=a[N];for(;++g<x;)(Y||g<_)&&(j[c[g]]=i[g]);for(;H--;)j[N++]=i[g++];return j}function Hh(i,a,c,h){for(var g=-1,_=i.length,x=-1,N=c.length,F=-1,H=a.length,j=lt(_-N,0),Y=$(j+H),ne=!h;++g<j;)Y[g]=i[g];for(var ce=g;++F<H;)Y[ce+F]=a[F];for(;++x<N;)(ne||g<_)&&(Y[ce+c[x]]=i[g++]);return Y}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 N=a[_],F=h?h(c[N],i[N],N,c,i):n;F===n&&(F=i[N]),g?Hn(c,N,F):Zi(c,N,F)}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 N=c[h];N&&i(a,N,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),N=x.length;N--;){var F=x[i?N:++g];if(c(_[F],F,_)===!1)break}return a}}function yN(i,a,c){var h=a&L,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=$(_),N=_,F=Io(g);N--;)x[N]=arguments[N];var H=_<3&&x[0]!==F&&x[_-1]!==F?[]:xr(x,F);if(_-=H.length,_<c)return ef(i,a,ca,g.placeholder,n,x,H,n,n,c-_);var j=this&&this!==ft&&this instanceof g?h:i;return Zt(j,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(N){return _(g[N],N,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 N=ha(_),F=N=="wrapper"?Fc(_):n;F&&Lc(F[0])&&F[1]==(W|q|O|S)&&!F[4].length&&F[9]==1?x=x[ha(F[0])].apply(x,F[3]):x=_.length==1&&Lc(_)?x[N]():x.thru(_)}return function(){var H=arguments,j=H[0];if(x&&H.length==1&&ke(j))return x.plant(j).value();for(var Y=0,ne=c?a[Y].apply(this,H):j;++Y<c;)ne=a[Y].call(this,ne);return ne}})}function ca(i,a,c,h,g,_,x,N,F,H){var j=a&W,Y=a&L,ne=a&C,ce=a&(q|X),me=a&k,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<H){var rt=xr(Fe,Vt);return ef(i,a,ca,ge.placeholder,c,Fe,rt,N,F,H-Pe)}var xn=Y?c:this,Xn=ne?xn[i]:i;return Pe=Fe.length,N?Fe=LN(Fe,N):me&&Pe>1&&Fe.reverse(),j&&F<Pe&&(Fe.length=F),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&L,_=qi(i);function x(){for(var N=-1,F=arguments.length,H=-1,j=h.length,Y=$(j+F),ne=this&&this!==ft&&this instanceof x?_:i;++H<j;)Y[H]=h[H];for(;F--;)Y[H++]=arguments[++N];return Zt(ne,g?c:this,Y)}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,N,F,H){var j=a&q,Y=j?x:n,ne=j?n:x,ce=j?_:n,me=j?n:_;a|=j?O:K,a&=~(j?K:O),a&V||(a&=~(L|C));var Ne=[i,a,g,ce,Y,me,ne,N,F,H],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,N){var F=a&C;if(!F&&typeof i!="function")throw new Jt(d);var H=h?h.length:0;if(H||(a&=~(O|K),h=g=n),x=x===n?x:lt(Te(x),0),N=N===n?N:Te(N),H-=g?g.length:0,a&K){var j=h,Y=g;h=g=n}var ne=F?n:Fc(i),ce=[i,a,c,h,g,j,Y,_,x,N];if(ne&&RN(ce,ne),i=ce[0],a=ce[1],c=ce[2],h=ce[3],g=ce[4],N=ce[9]=ce[9]===n?F?0:i.length:lt(ce[9]-H,0),!N&&a&(q|X)&&(a&=~(q|X)),!a||a==L)var me=yN(i,a,c);else a==q||a==X?me=vN(i,a,N):(a==O||a==(L|O))&&!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&P,N=i.length,F=a.length;if(N!=F&&!(x&&F>N))return!1;var H=_.get(i),j=_.get(a);if(H&&j)return H==a&&j==i;var Y=-1,ne=!0,ce=c&R?new Kr:n;for(_.set(i,a),_.set(a,i);++Y<N;){var me=i[Y],Ne=a[Y];if(h)var ge=x?h(Ne,me,Y,a,i,_):h(me,Ne,Y,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 N=ac;case _n:var F=h&P;if(N||(N=zs),i.size!=a.size&&!F)return!1;var H=x.get(i);if(H)return H==a;h|=R,x.set(i,a);var j=of(N(i),N(a),h,g,_,x);return x.delete(i),j;case Rs:if($i)return $i.call(i)==$i.call(a)}return!1}function xN(i,a,c,h,g,_){var x=c&P,N=Pc(i),F=N.length,H=Pc(a),j=H.length;if(F!=j&&!x)return!1;for(var Y=F;Y--;){var ne=N[Y];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;++Y<F;){ne=N[Y];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,`{
|
|
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.",c="Expected a function",u="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",y=1,B=2,E=4,P=1,R=2,L=1,C=2,V=4,q=8,X=16,O=32,K=64,W=128,S=256,k=512,T=30,z="...",Z=800,I=16,A=1,G=2,J=3,pe=1/0,we=9007199254740991,Ct=17976931348623157e292,Bt=NaN,ht=4294967295,_r=ht-1,Pn=ht>>>1,vr=[["ary",W],["bind",L],["bindKey",C],["curry",q],["curryRight",X],["flip",k],["partial",O],["partialRight",K],["rearg",S]],$n="[object Arguments]",Hr="[object Array]",Ps="[object AsyncFunction]",Ge="[object Boolean]",Cr="[object Date]",NT="[object DOMException]",Ds="[object Error]",Fs="[object Function]",bp="[object GeneratorFunction]",vn="[object Map]",Pi="[object Number]",VT="[object Null]",Zn="[object Object]",xp="[object Promise]",PT="[object Proxy]",Di="[object RegExp]",Cn="[object Set]",Fi="[object String]",Rs="[object Symbol]",DT="[object Undefined]",Ri="[object WeakMap]",FT="[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]",RT=/\b__p \+= '';/g,MT=/\b(__p \+=) '' \+/g,IT=/(__e\(.*?\)|\b__t\)) \+\n'';/g,kp=/&(?:amp|lt|gt|quot|#39);/g,Sp=/[&<>"']/g,LT=RegExp(kp.source),OT=RegExp(Sp.source),GT=/<%-([\s\S]+?)%>/g,zT=/<%([\s\S]+?)%>/g,Ep=/<%=([\s\S]+?)%>/g,$T=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ZT=/^\w*$/,UT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ul=/[\\^$.*+?()[\]{}|]/g,WT=RegExp(Ul.source),Wl=/^\s+/,HT=/\s/,jT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,qT=/\{\n\/\* \[wrapped with (.+)\] \*/,KT=/,? & /,YT=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,JT=/[()=,{}\[\]\/\s]/,XT=/\\(\\)?/g,QT=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Tp=/\w*$/,eB=/^[-+]0x[0-9a-f]+$/i,tB=/^0b[01]+$/i,nB=/^\[object .+?Constructor\]$/,rB=/^0o[0-7]+$/i,oB=/^(?:0|[1-9]\d*)$/,iB=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ms=/($^)/,sB=/['\n\r\u2028\u2029\\]/g,Is="\\ud800-\\udfff",aB="\\u0300-\\u036f",lB="\\ufe20-\\ufe2f",cB="\\u20d0-\\u20ff",Bp=aB+lB+cB,Ap="\\u2700-\\u27bf",Np="a-z\\xdf-\\xf6\\xf8-\\xff",dB="\\xac\\xb1\\xd7\\xf7",uB="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",pB="\\u2000-\\u206f",hB=" \\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",Vp="A-Z\\xc0-\\xd6\\xd8-\\xde",Pp="\\ufe0e\\ufe0f",Dp=dB+uB+pB+hB,Hl="['’]",fB="["+Is+"]",Fp="["+Dp+"]",Ls="["+Bp+"]",Rp="\\d+",mB="["+Ap+"]",Mp="["+Np+"]",Ip="[^"+Is+Dp+Rp+Ap+Np+Vp+"]",jl="\\ud83c[\\udffb-\\udfff]",gB="(?:"+Ls+"|"+jl+")",Lp="[^"+Is+"]",ql="(?:\\ud83c[\\udde6-\\uddff]){2}",Kl="[\\ud800-\\udbff][\\udc00-\\udfff]",Eo="["+Vp+"]",Op="\\u200d",Gp="(?:"+Mp+"|"+Ip+")",yB="(?:"+Eo+"|"+Ip+")",zp="(?:"+Hl+"(?:d|ll|m|re|s|t|ve))?",$p="(?:"+Hl+"(?:D|LL|M|RE|S|T|VE))?",Zp=gB+"?",Up="["+Pp+"]?",_B="(?:"+Op+"(?:"+[Lp,ql,Kl].join("|")+")"+Up+Zp+")*",vB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",CB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Wp=Up+Zp+_B,wB="(?:"+[mB,ql,Kl].join("|")+")"+Wp,bB="(?:"+[Lp+Ls+"?",Ls,ql,Kl,fB].join("|")+")",xB=RegExp(Hl,"g"),kB=RegExp(Ls,"g"),Yl=RegExp(jl+"(?="+jl+")|"+bB+Wp,"g"),SB=RegExp([Eo+"?"+Mp+"+"+zp+"(?="+[Fp,Eo,"$"].join("|")+")",yB+"+"+$p+"(?="+[Fp,Eo+Gp,"$"].join("|")+")",Eo+"?"+Gp+"+"+zp,Eo+"+"+$p,CB,vB,Rp,wB].join("|"),"g"),EB=RegExp("["+Op+Is+Bp+Pp+"]"),TB=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,BB=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],AB=-1,qe={};qe[Rl]=qe[Ml]=qe[Il]=qe[Ll]=qe[Ol]=qe[Gl]=qe[zl]=qe[$l]=qe[Zl]=!0,qe[$n]=qe[Hr]=qe[Mi]=qe[Ge]=qe[So]=qe[Cr]=qe[Ds]=qe[Fs]=qe[vn]=qe[Pi]=qe[Zn]=qe[Di]=qe[Cn]=qe[Fi]=qe[Ri]=!1;var He={};He[$n]=He[Hr]=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[Cn]=He[Fi]=He[Rs]=He[Gl]=He[zl]=He[$l]=He[Zl]=!0,He[Ds]=He[Fs]=He[Ri]=!1;var NB={À:"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"},VB={"&":"&","<":"<",">":">",'"':""","'":"'"},PB={"&":"&","<":"<",">":">",""":'"',"'":"'"},DB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},FB=parseFloat,RB=parseInt,Hp=typeof Go=="object"&&Go&&Go.Object===Object&&Go,MB=typeof self=="object"&&self&&self.Object===Object&&self,ft=Hp||MB||Function("return this")(),Jl=e&&!e.nodeType&&e,jr=Jl&&!0&&t&&!t.nodeType&&t,jp=jr&&jr.exports===Jl,Xl=jp&&Hp.process,Yt=function(){try{var D=jr&&jr.require&&jr.require("util").types;return D||Xl&&Xl.binding&&Xl.binding("util")}catch{}}(),qp=Yt&&Yt.isArrayBuffer,Kp=Yt&&Yt.isDate,Yp=Yt&&Yt.isMap,Jp=Yt&&Yt.isRegExp,Xp=Yt&&Yt.isSet,Qp=Yt&&Yt.isTypedArray;function Zt(D,U,$){switch($.length){case 0:return D.call(U);case 1:return D.call(U,$[0]);case 2:return D.call(U,$[0],$[1]);case 3:return D.call(U,$[0],$[1],$[2])}return D.apply(U,$)}function IB(D,U,$,ae){for(var xe=-1,ze=D==null?0:D.length;++xe<ze;){var at=D[xe];U(ae,at,$(at),D)}return ae}function Jt(D,U){for(var $=-1,ae=D==null?0:D.length;++$<ae&&U(D[$],$,D)!==!1;);return D}function LB(D,U){for(var $=D==null?0:D.length;$--&&U(D[$],$,D)!==!1;);return D}function eh(D,U){for(var $=-1,ae=D==null?0:D.length;++$<ae;)if(!U(D[$],$,D))return!1;return!0}function wr(D,U){for(var $=-1,ae=D==null?0:D.length,xe=0,ze=[];++$<ae;){var at=D[$];U(at,$,D)&&(ze[xe++]=at)}return ze}function Os(D,U){var $=D==null?0:D.length;return!!$&&To(D,U,0)>-1}function Ql(D,U,$){for(var ae=-1,xe=D==null?0:D.length;++ae<xe;)if($(U,D[ae]))return!0;return!1}function Ye(D,U){for(var $=-1,ae=D==null?0:D.length,xe=Array(ae);++$<ae;)xe[$]=U(D[$],$,D);return xe}function br(D,U){for(var $=-1,ae=U.length,xe=D.length;++$<ae;)D[xe+$]=U[$];return D}function ec(D,U,$,ae){var xe=-1,ze=D==null?0:D.length;for(ae&&ze&&($=D[++xe]);++xe<ze;)$=U($,D[xe],xe,D);return $}function OB(D,U,$,ae){var xe=D==null?0:D.length;for(ae&&xe&&($=D[--xe]);xe--;)$=U($,D[xe],xe,D);return $}function tc(D,U){for(var $=-1,ae=D==null?0:D.length;++$<ae;)if(U(D[$],$,D))return!0;return!1}var GB=nc("length");function zB(D){return D.split("")}function $B(D){return D.match(YT)||[]}function th(D,U,$){var ae;return $(D,function(xe,ze,at){if(U(xe,ze,at))return ae=ze,!1}),ae}function Gs(D,U,$,ae){for(var xe=D.length,ze=$+(ae?1:-1);ae?ze--:++ze<xe;)if(U(D[ze],ze,D))return ze;return-1}function To(D,U,$){return U===U?eA(D,U,$):Gs(D,nh,$)}function ZB(D,U,$,ae){for(var xe=$-1,ze=D.length;++xe<ze;)if(ae(D[xe],U))return xe;return-1}function nh(D){return D!==D}function rh(D,U){var $=D==null?0:D.length;return $?oc(D,U)/$:Bt}function nc(D){return function(U){return U==null?n:U[D]}}function rc(D){return function(U){return D==null?n:D[U]}}function oh(D,U,$,ae,xe){return xe(D,function(ze,at,We){$=ae?(ae=!1,ze):U($,ze,at,We)}),$}function UB(D,U){var $=D.length;for(D.sort(U);$--;)D[$]=D[$].value;return D}function oc(D,U){for(var $,ae=-1,xe=D.length;++ae<xe;){var ze=U(D[ae]);ze!==n&&($=$===n?ze:$+ze)}return $}function ic(D,U){for(var $=-1,ae=Array(D);++$<D;)ae[$]=U($);return ae}function WB(D,U){return Ye(U,function($){return[$,D[$]]})}function ih(D){return D&&D.slice(0,ch(D)+1).replace(Wl,"")}function Ut(D){return function(U){return D(U)}}function sc(D,U){return Ye(U,function($){return D[$]})}function Ii(D,U){return D.has(U)}function sh(D,U){for(var $=-1,ae=D.length;++$<ae&&To(U,D[$],0)>-1;);return $}function ah(D,U){for(var $=D.length;$--&&To(U,D[$],0)>-1;);return $}function HB(D,U){for(var $=D.length,ae=0;$--;)D[$]===U&&++ae;return ae}var jB=rc(NB),qB=rc(VB);function KB(D){return"\\"+DB[D]}function YB(D,U){return D==null?n:D[U]}function Bo(D){return EB.test(D)}function JB(D){return TB.test(D)}function XB(D){for(var U,$=[];!(U=D.next()).done;)$.push(U.value);return $}function ac(D){var U=-1,$=Array(D.size);return D.forEach(function(ae,xe){$[++U]=[xe,ae]}),$}function lh(D,U){return function($){return D(U($))}}function xr(D,U){for(var $=-1,ae=D.length,xe=0,ze=[];++$<ae;){var at=D[$];(at===U||at===m)&&(D[$]=m,ze[xe++]=$)}return ze}function zs(D){var U=-1,$=Array(D.size);return D.forEach(function(ae){$[++U]=ae}),$}function QB(D){var U=-1,$=Array(D.size);return D.forEach(function(ae){$[++U]=[ae,ae]}),$}function eA(D,U,$){for(var ae=$-1,xe=D.length;++ae<xe;)if(D[ae]===U)return ae;return-1}function tA(D,U,$){for(var ae=$+1;ae--;)if(D[ae]===U)return ae;return ae}function Ao(D){return Bo(D)?rA(D):GB(D)}function wn(D){return Bo(D)?oA(D):zB(D)}function ch(D){for(var U=D.length;U--&&HT.test(D.charAt(U)););return U}var nA=rc(PB);function rA(D){for(var U=Yl.lastIndex=0;Yl.test(D);)++U;return U}function oA(D){return D.match(Yl)||[]}function iA(D){return D.match(SB)||[]}var sA=function D(U){U=U==null?ft:No.defaults(ft.Object(),U,No.pick(ft,BB));var $=U.Array,ae=U.Date,xe=U.Error,ze=U.Function,at=U.Math,We=U.Object,lc=U.RegExp,aA=U.String,Xt=U.TypeError,$s=$.prototype,lA=ze.prototype,Vo=We.prototype,Zs=U["__core-js_shared__"],Us=lA.toString,Ue=Vo.hasOwnProperty,cA=0,dh=function(){var i=/[^.]+$/.exec(Zs&&Zs.keys&&Zs.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Ws=Vo.toString,dA=Us.call(We),uA=ft._,pA=lc("^"+Us.call(Ue).replace(Ul,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hs=jp?U.Buffer:n,kr=U.Symbol,js=U.Uint8Array,uh=Hs?Hs.allocUnsafe:n,qs=lh(We.getPrototypeOf,We),ph=We.create,hh=Vo.propertyIsEnumerable,Ks=$s.splice,fh=kr?kr.isConcatSpreadable:n,Li=kr?kr.iterator:n,qr=kr?kr.toStringTag:n,Ys=function(){try{var i=Qr(We,"defineProperty");return i({},"",{}),i}catch{}}(),hA=U.clearTimeout!==ft.clearTimeout&&U.clearTimeout,fA=ae&&ae.now!==ft.Date.now&&ae.now,mA=U.setTimeout!==ft.setTimeout&&U.setTimeout,Js=at.ceil,Xs=at.floor,cc=We.getOwnPropertySymbols,gA=Hs?Hs.isBuffer:n,mh=U.isFinite,yA=$s.join,_A=lh(We.keys,We),lt=at.max,wt=at.min,vA=ae.now,CA=U.parseInt,gh=at.random,wA=$s.reverse,dc=Qr(U,"DataView"),Oi=Qr(U,"Map"),uc=Qr(U,"Promise"),Po=Qr(U,"Set"),Gi=Qr(U,"WeakMap"),zi=Qr(We,"create"),Qs=Gi&&new Gi,Do={},bA=eo(dc),xA=eo(Oi),kA=eo(uc),SA=eo(Po),EA=eo(Gi),ea=kr?kr.prototype:n,$i=ea?ea.valueOf:n,yh=ea?ea.toString:n;function _(i){if(et(i)&&!ke(i)&&!(i instanceof De)){if(i instanceof Qt)return i;if(Ue.call(i,"__wrapped__"))return vf(i)}return new Qt(i)}var Fo=function(){function i(){}return function(a){if(!Qe(a))return{};if(ph)return ph(a);i.prototype=a;var d=new i;return i.prototype=n,d}}();function ta(){}function Qt(i,a){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}_.templateSettings={escape:GT,evaluate:zT,interpolate:Ep,variable:"",imports:{_}},_.prototype=ta.prototype,_.prototype.constructor=_,Qt.prototype=Fo(ta.prototype),Qt.prototype.constructor=Qt;function De(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ht,this.__views__=[]}function TA(){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 BA(){if(this.__filtered__){var i=new De(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function AA(){var i=this.__wrapped__.value(),a=this.__dir__,d=ke(i),h=a<0,g=d?i.length:0,v=zN(0,g,this.__views__),x=v.start,N=v.end,F=N-x,H=h?N:x-1,j=this.__iteratees__,Y=j.length,ne=0,ce=wt(F,this.__takeCount__);if(!d||!h&&g==F&&ce==F)return zh(i,this.__actions__);var me=[];e:for(;F--&&ne<ce;){H+=a;for(var Ne=-1,ge=i[H];++Ne<Y;){var Pe=j[Ne],Fe=Pe.iteratee,jt=Pe.type,Vt=Fe(ge);if(jt==G)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 Kr(i){var a=-1,d=i==null?0:i.length;for(this.clear();++a<d;){var h=i[a];this.set(h[0],h[1])}}function NA(){this.__data__=zi?zi(null):{},this.size=0}function VA(i){var a=this.has(i)&&delete this.__data__[i];return this.size-=a?1:0,a}function PA(i){var a=this.__data__;if(zi){var d=a[i];return d===p?n:d}return Ue.call(a,i)?a[i]:n}function DA(i){var a=this.__data__;return zi?a[i]!==n:Ue.call(a,i)}function FA(i,a){var d=this.__data__;return this.size+=this.has(i)?0:1,d[i]=zi&&a===n?p:a,this}Kr.prototype.clear=NA,Kr.prototype.delete=VA,Kr.prototype.get=PA,Kr.prototype.has=DA,Kr.prototype.set=FA;function Un(i){var a=-1,d=i==null?0:i.length;for(this.clear();++a<d;){var h=i[a];this.set(h[0],h[1])}}function RA(){this.__data__=[],this.size=0}function MA(i){var a=this.__data__,d=na(a,i);if(d<0)return!1;var h=a.length-1;return d==h?a.pop():Ks.call(a,d,1),--this.size,!0}function IA(i){var a=this.__data__,d=na(a,i);return d<0?n:a[d][1]}function LA(i){return na(this.__data__,i)>-1}function OA(i,a){var d=this.__data__,h=na(d,i);return h<0?(++this.size,d.push([i,a])):d[h][1]=a,this}Un.prototype.clear=RA,Un.prototype.delete=MA,Un.prototype.get=IA,Un.prototype.has=LA,Un.prototype.set=OA;function Wn(i){var a=-1,d=i==null?0:i.length;for(this.clear();++a<d;){var h=i[a];this.set(h[0],h[1])}}function GA(){this.size=0,this.__data__={hash:new Kr,map:new(Oi||Un),string:new Kr}}function zA(i){var a=fa(this,i).delete(i);return this.size-=a?1:0,a}function $A(i){return fa(this,i).get(i)}function ZA(i){return fa(this,i).has(i)}function UA(i,a){var d=fa(this,i),h=d.size;return d.set(i,a),this.size+=d.size==h?0:1,this}Wn.prototype.clear=GA,Wn.prototype.delete=zA,Wn.prototype.get=$A,Wn.prototype.has=ZA,Wn.prototype.set=UA;function Yr(i){var a=-1,d=i==null?0:i.length;for(this.__data__=new Wn;++a<d;)this.add(i[a])}function WA(i){return this.__data__.set(i,p),this}function HA(i){return this.__data__.has(i)}Yr.prototype.add=Yr.prototype.push=WA,Yr.prototype.has=HA;function bn(i){var a=this.__data__=new Un(i);this.size=a.size}function jA(){this.__data__=new Un,this.size=0}function qA(i){var a=this.__data__,d=a.delete(i);return this.size=a.size,d}function KA(i){return this.__data__.get(i)}function YA(i){return this.__data__.has(i)}function JA(i,a){var d=this.__data__;if(d instanceof Un){var h=d.__data__;if(!Oi||h.length<s-1)return h.push([i,a]),this.size=++d.size,this;d=this.__data__=new Wn(h)}return d.set(i,a),this.size=d.size,this}bn.prototype.clear=jA,bn.prototype.delete=qA,bn.prototype.get=KA,bn.prototype.has=YA,bn.prototype.set=JA;function _h(i,a){var d=ke(i),h=!d&&to(i),g=!d&&!h&&Ar(i),v=!d&&!h&&!g&&Lo(i),x=d||h||g||v,N=x?ic(i.length,aA):[],F=N.length;for(var H in i)(a||Ue.call(i,H))&&!(x&&(H=="length"||g&&(H=="offset"||H=="parent")||v&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||Kn(H,F)))&&N.push(H);return N}function vh(i){var a=i.length;return a?i[bc(0,a-1)]:n}function XA(i,a){return ma(Dt(i),Jr(a,0,i.length))}function QA(i){return ma(Dt(i))}function pc(i,a,d){(d!==n&&!xn(i[a],d)||d===n&&!(a in i))&&Hn(i,a,d)}function Zi(i,a,d){var h=i[a];(!(Ue.call(i,a)&&xn(h,d))||d===n&&!(a in i))&&Hn(i,a,d)}function na(i,a){for(var d=i.length;d--;)if(xn(i[d][0],a))return d;return-1}function eN(i,a,d,h){return Sr(i,function(g,v,x){a(h,g,d(g),x)}),h}function Ch(i,a){return i&&Fn(a,pt(a),i)}function tN(i,a){return i&&Fn(a,Rt(a),i)}function Hn(i,a,d){a=="__proto__"&&Ys?Ys(i,a,{configurable:!0,enumerable:!0,value:d,writable:!0}):i[a]=d}function hc(i,a){for(var d=-1,h=a.length,g=$(h),v=i==null;++d<h;)g[d]=v?n:jc(i,a[d]);return g}function Jr(i,a,d){return i===i&&(d!==n&&(i=i<=d?i:d),a!==n&&(i=i>=a?i:a)),i}function en(i,a,d,h,g,v){var x,N=a&y,F=a&B,H=a&E;if(d&&(x=g?d(i,h,g,v):d(i)),x!==n)return x;if(!Qe(i))return i;var j=ke(i);if(j){if(x=ZN(i),!N)return Dt(i,x)}else{var Y=bt(i),ne=Y==Fs||Y==bp;if(Ar(i))return Uh(i,N);if(Y==Zn||Y==$n||ne&&!g){if(x=F||ne?{}:df(i),!N)return F?PN(i,tN(x,i)):VN(i,Ch(x,i))}else{if(!He[Y])return g?i:{};x=UN(i,Y,N)}}v||(v=new bn);var ce=v.get(i);if(ce)return ce;v.set(i,x),Of(i)?i.forEach(function(ge){x.add(en(ge,a,d,ge,i,v))}):If(i)&&i.forEach(function(ge,Pe){x.set(Pe,en(ge,a,d,Pe,i,v))});var me=H?F?Dc:Pc:F?Rt:pt,Ne=j?n:me(i);return Jt(Ne||i,function(ge,Pe){Ne&&(Pe=ge,ge=i[Pe]),Zi(x,Pe,en(ge,a,d,Pe,i,v))}),x}function nN(i){var a=pt(i);return function(d){return wh(d,i,a)}}function wh(i,a,d){var h=d.length;if(i==null)return!h;for(i=We(i);h--;){var g=d[h],v=a[g],x=i[g];if(x===n&&!(g in i)||!v(x))return!1}return!0}function bh(i,a,d){if(typeof i!="function")throw new Xt(c);return Yi(function(){i.apply(n,d)},a)}function Ui(i,a,d,h){var g=-1,v=Os,x=!0,N=i.length,F=[],H=a.length;if(!N)return F;d&&(a=Ye(a,Ut(d))),h?(v=Ql,x=!1):a.length>=s&&(v=Ii,x=!1,a=new Yr(a));e:for(;++g<N;){var j=i[g],Y=d==null?j:d(j);if(j=h||j!==0?j:0,x&&Y===Y){for(var ne=H;ne--;)if(a[ne]===Y)continue e;F.push(j)}else v(a,Y,h)||F.push(j)}return F}var Sr=Kh(Dn),xh=Kh(mc,!0);function rN(i,a){var d=!0;return Sr(i,function(h,g,v){return d=!!a(h,g,v),d}),d}function ra(i,a,d){for(var h=-1,g=i.length;++h<g;){var v=i[h],x=a(v);if(x!=null&&(N===n?x===x&&!Ht(x):d(x,N)))var N=x,F=v}return F}function oN(i,a,d,h){var g=i.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:zf(h);d<h;)i[d++]=a;return i}function kh(i,a){var d=[];return Sr(i,function(h,g,v){a(h,g,v)&&d.push(h)}),d}function mt(i,a,d,h,g){var v=-1,x=i.length;for(d||(d=HN),g||(g=[]);++v<x;){var N=i[v];a>0&&d(N)?a>1?mt(N,a-1,d,h,g):br(g,N):h||(g[g.length]=N)}return g}var fc=Yh(),Sh=Yh(!0);function Dn(i,a){return i&&fc(i,a,pt)}function mc(i,a){return i&&Sh(i,a,pt)}function oa(i,a){return wr(a,function(d){return Yn(i[d])})}function Xr(i,a){a=Tr(a,i);for(var d=0,h=a.length;i!=null&&d<h;)i=i[Rn(a[d++])];return d&&d==h?i:n}function Eh(i,a,d){var h=a(i);return ke(i)?h:br(h,d(i))}function At(i){return i==null?i===n?DT:VT:qr&&qr in We(i)?GN(i):QN(i)}function gc(i,a){return i>a}function iN(i,a){return i!=null&&Ue.call(i,a)}function sN(i,a){return i!=null&&a in We(i)}function aN(i,a,d){return i>=wt(a,d)&&i<lt(a,d)}function yc(i,a,d){for(var h=d?Ql:Os,g=i[0].length,v=i.length,x=v,N=$(v),F=1/0,H=[];x--;){var j=i[x];x&&a&&(j=Ye(j,Ut(a))),F=wt(j.length,F),N[x]=!d&&(a||g>=120&&j.length>=120)?new Yr(x&&j):n}j=i[0];var Y=-1,ne=N[0];e:for(;++Y<g&&H.length<F;){var ce=j[Y],me=a?a(ce):ce;if(ce=d||ce!==0?ce:0,!(ne?Ii(ne,me):h(H,me,d))){for(x=v;--x;){var Ne=N[x];if(!(Ne?Ii(Ne,me):h(i[x],me,d)))continue e}ne&&ne.push(me),H.push(ce)}}return H}function lN(i,a,d,h){return Dn(i,function(g,v,x){a(h,d(g),v,x)}),h}function Wi(i,a,d){a=Tr(a,i),i=ff(i,a);var h=i==null?i:i[Rn(nn(a))];return h==null?n:Zt(h,i,d)}function Th(i){return et(i)&&At(i)==$n}function cN(i){return et(i)&&At(i)==Mi}function dN(i){return et(i)&&At(i)==Cr}function Hi(i,a,d,h,g){return i===a?!0:i==null||a==null||!et(i)&&!et(a)?i!==i&&a!==a:uN(i,a,d,h,Hi,g)}function uN(i,a,d,h,g,v){var x=ke(i),N=ke(a),F=x?Hr:bt(i),H=N?Hr:bt(a);F=F==$n?Zn:F,H=H==$n?Zn:H;var j=F==Zn,Y=H==Zn,ne=F==H;if(ne&&Ar(i)){if(!Ar(a))return!1;x=!0,j=!1}if(ne&&!j)return v||(v=new bn),x||Lo(i)?af(i,a,d,h,g,v):LN(i,a,F,d,h,g,v);if(!(d&P)){var ce=j&&Ue.call(i,"__wrapped__"),me=Y&&Ue.call(a,"__wrapped__");if(ce||me){var Ne=ce?i.value():i,ge=me?a.value():a;return v||(v=new bn),g(Ne,ge,d,h,v)}}return ne?(v||(v=new bn),ON(i,a,d,h,g,v)):!1}function pN(i){return et(i)&&bt(i)==vn}function _c(i,a,d,h){var g=d.length,v=g,x=!h;if(i==null)return!v;for(i=We(i);g--;){var N=d[g];if(x&&N[2]?N[1]!==i[N[0]]:!(N[0]in i))return!1}for(;++g<v;){N=d[g];var F=N[0],H=i[F],j=N[1];if(x&&N[2]){if(H===n&&!(F in i))return!1}else{var Y=new bn;if(h)var ne=h(H,j,F,i,a,Y);if(!(ne===n?Hi(j,H,P|R,h,Y):ne))return!1}}return!0}function Bh(i){if(!Qe(i)||qN(i))return!1;var a=Yn(i)?pA:nB;return a.test(eo(i))}function hN(i){return et(i)&&At(i)==Di}function fN(i){return et(i)&&bt(i)==Cn}function mN(i){return et(i)&&wa(i.length)&&!!qe[At(i)]}function Ah(i){return typeof i=="function"?i:i==null?Mt:typeof i=="object"?ke(i)?Ph(i[0],i[1]):Vh(i):Xf(i)}function vc(i){if(!Ki(i))return _A(i);var a=[];for(var d in We(i))Ue.call(i,d)&&d!="constructor"&&a.push(d);return a}function gN(i){if(!Qe(i))return XN(i);var a=Ki(i),d=[];for(var h in i)h=="constructor"&&(a||!Ue.call(i,h))||d.push(h);return d}function Cc(i,a){return i<a}function Nh(i,a){var d=-1,h=Ft(i)?$(i.length):[];return Sr(i,function(g,v,x){h[++d]=a(g,v,x)}),h}function Vh(i){var a=Rc(i);return a.length==1&&a[0][2]?pf(a[0][0],a[0][1]):function(d){return d===i||_c(d,i,a)}}function Ph(i,a){return Ic(i)&&uf(a)?pf(Rn(i),a):function(d){var h=jc(d,i);return h===n&&h===a?qc(d,i):Hi(a,h,P|R)}}function ia(i,a,d,h,g){i!==a&&fc(a,function(v,x){if(g||(g=new bn),Qe(v))yN(i,a,x,d,ia,h,g);else{var N=h?h(Oc(i,x),v,x+"",i,a,g):n;N===n&&(N=v),pc(i,x,N)}},Rt)}function yN(i,a,d,h,g,v,x){var N=Oc(i,d),F=Oc(a,d),H=x.get(F);if(H){pc(i,d,H);return}var j=v?v(N,F,d+"",i,a,x):n,Y=j===n;if(Y){var ne=ke(F),ce=!ne&&Ar(F),me=!ne&&!ce&&Lo(F);j=F,ne||ce||me?ke(N)?j=N:nt(N)?j=Dt(N):ce?(Y=!1,j=Uh(F,!0)):me?(Y=!1,j=Wh(F,!0)):j=[]:Ji(F)||to(F)?(j=N,to(N)?j=$f(N):(!Qe(N)||Yn(N))&&(j=df(F))):Y=!1}Y&&(x.set(F,j),g(j,F,h,v,x),x.delete(F)),pc(i,d,j)}function Dh(i,a){var d=i.length;if(d)return a+=a<0?d:0,Kn(a,d)?i[a]:n}function Fh(i,a,d){a.length?a=Ye(a,function(v){return ke(v)?function(x){return Xr(x,v.length===1?v[0]:v)}:v}):a=[Mt];var h=-1;a=Ye(a,Ut(he()));var g=Nh(i,function(v,x,N){var F=Ye(a,function(H){return H(v)});return{criteria:F,index:++h,value:v}});return UB(g,function(v,x){return NN(v,x,d)})}function _N(i,a){return Rh(i,a,function(d,h){return qc(i,h)})}function Rh(i,a,d){for(var h=-1,g=a.length,v={};++h<g;){var x=a[h],N=Xr(i,x);d(N,x)&&ji(v,Tr(x,i),N)}return v}function vN(i){return function(a){return Xr(a,i)}}function wc(i,a,d,h){var g=h?ZB:To,v=-1,x=a.length,N=i;for(i===a&&(a=Dt(a)),d&&(N=Ye(i,Ut(d)));++v<x;)for(var F=0,H=a[v],j=d?d(H):H;(F=g(N,j,F,h))>-1;)N!==i&&Ks.call(N,F,1),Ks.call(i,F,1);return i}function Mh(i,a){for(var d=i?a.length:0,h=d-1;d--;){var g=a[d];if(d==h||g!==v){var v=g;Kn(g)?Ks.call(i,g,1):Sc(i,g)}}return i}function bc(i,a){return i+Xs(gh()*(a-i+1))}function CN(i,a,d,h){for(var g=-1,v=lt(Js((a-i)/(d||1)),0),x=$(v);v--;)x[h?v:++g]=i,i+=d;return x}function xc(i,a){var d="";if(!i||a<1||a>we)return d;do a%2&&(d+=i),a=Xs(a/2),a&&(i+=i);while(a);return d}function Ve(i,a){return Gc(hf(i,a,Mt),i+"")}function wN(i){return vh(Oo(i))}function bN(i,a){var d=Oo(i);return ma(d,Jr(a,0,d.length))}function ji(i,a,d,h){if(!Qe(i))return i;a=Tr(a,i);for(var g=-1,v=a.length,x=v-1,N=i;N!=null&&++g<v;){var F=Rn(a[g]),H=d;if(F==="__proto__"||F==="constructor"||F==="prototype")return i;if(g!=x){var j=N[F];H=h?h(j,F,N):n,H===n&&(H=Qe(j)?j:Kn(a[g+1])?[]:{})}Zi(N,F,H),N=N[F]}return i}var Ih=Qs?function(i,a){return Qs.set(i,a),i}:Mt,xN=Ys?function(i,a){return Ys(i,"toString",{configurable:!0,enumerable:!1,value:Yc(a),writable:!0})}:Mt;function kN(i){return ma(Oo(i))}function tn(i,a,d){var h=-1,g=i.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 v=$(g);++h<g;)v[h]=i[h+a];return v}function SN(i,a){var d;return Sr(i,function(h,g,v){return d=a(h,g,v),!d}),!!d}function sa(i,a,d){var h=0,g=i==null?h:i.length;if(typeof a=="number"&&a===a&&g<=Pn){for(;h<g;){var v=h+g>>>1,x=i[v];x!==null&&!Ht(x)&&(d?x<=a:x<a)?h=v+1:g=v}return g}return kc(i,a,Mt,d)}function kc(i,a,d,h){var g=0,v=i==null?0:i.length;if(v===0)return 0;a=d(a);for(var x=a!==a,N=a===null,F=Ht(a),H=a===n;g<v;){var j=Xs((g+v)/2),Y=d(i[j]),ne=Y!==n,ce=Y===null,me=Y===Y,Ne=Ht(Y);if(x)var ge=h||me;else H?ge=me&&(h||ne):N?ge=me&&ne&&(h||!ce):F?ge=me&&ne&&!ce&&(h||!Ne):ce||Ne?ge=!1:ge=h?Y<=a:Y<a;ge?g=j+1:v=j}return wt(v,_r)}function Lh(i,a){for(var d=-1,h=i.length,g=0,v=[];++d<h;){var x=i[d],N=a?a(x):x;if(!d||!xn(N,F)){var F=N;v[g++]=x===0?0:x}}return v}function Oh(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 yh?yh.call(i):"";var a=i+"";return a=="0"&&1/i==-pe?"-0":a}function Er(i,a,d){var h=-1,g=Os,v=i.length,x=!0,N=[],F=N;if(d)x=!1,g=Ql;else if(v>=s){var H=a?null:MN(i);if(H)return zs(H);x=!1,g=Ii,F=new Yr}else F=a?[]:N;e:for(;++h<v;){var j=i[h],Y=a?a(j):j;if(j=d||j!==0?j:0,x&&Y===Y){for(var ne=F.length;ne--;)if(F[ne]===Y)continue e;a&&F.push(Y),N.push(j)}else g(F,Y,d)||(F!==N&&F.push(Y),N.push(j))}return N}function Sc(i,a){return a=Tr(a,i),i=ff(i,a),i==null||delete i[Rn(nn(a))]}function Gh(i,a,d,h){return ji(i,a,d(Xr(i,a)),h)}function aa(i,a,d,h){for(var g=i.length,v=h?g:-1;(h?v--:++v<g)&&a(i[v],v,i););return d?tn(i,h?0:v,h?v+1:g):tn(i,h?v+1:0,h?g:v)}function zh(i,a){var d=i;return d instanceof De&&(d=d.value()),ec(a,function(h,g){return g.func.apply(g.thisArg,br([h],g.args))},d)}function Ec(i,a,d){var h=i.length;if(h<2)return h?Er(i[0]):[];for(var g=-1,v=$(h);++g<h;)for(var x=i[g],N=-1;++N<h;)N!=g&&(v[g]=Ui(v[g]||x,i[N],a,d));return Er(mt(v,1),a,d)}function $h(i,a,d){for(var h=-1,g=i.length,v=a.length,x={};++h<g;){var N=h<v?a[h]:n;d(x,i[h],N)}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]:_f(Ze(i))}var EN=Ve;function Br(i,a,d){var h=i.length;return d=d===n?h:d,!a&&d>=h?i:tn(i,a,d)}var Zh=hA||function(i){return ft.clearTimeout(i)};function Uh(i,a){if(a)return i.slice();var d=i.length,h=uh?uh(d):new i.constructor(d);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 TN(i,a){var d=a?Ac(i.buffer):i.buffer;return new i.constructor(d,i.byteOffset,i.byteLength)}function BN(i){var a=new i.constructor(i.source,Tp.exec(i));return a.lastIndex=i.lastIndex,a}function AN(i){return $i?We($i.call(i)):{}}function Wh(i,a){var d=a?Ac(i.buffer):i.buffer;return new i.constructor(d,i.byteOffset,i.length)}function Hh(i,a){if(i!==a){var d=i!==n,h=i===null,g=i===i,v=Ht(i),x=a!==n,N=a===null,F=a===a,H=Ht(a);if(!N&&!H&&!v&&i>a||v&&x&&F&&!N&&!H||h&&x&&F||!d&&F||!g)return 1;if(!h&&!v&&!H&&i<a||H&&d&&g&&!h&&!v||N&&d&&g||!x&&g||!F)return-1}return 0}function NN(i,a,d){for(var h=-1,g=i.criteria,v=a.criteria,x=g.length,N=d.length;++h<x;){var F=Hh(g[h],v[h]);if(F){if(h>=N)return F;var H=d[h];return F*(H=="desc"?-1:1)}}return i.index-a.index}function jh(i,a,d,h){for(var g=-1,v=i.length,x=d.length,N=-1,F=a.length,H=lt(v-x,0),j=$(F+H),Y=!h;++N<F;)j[N]=a[N];for(;++g<x;)(Y||g<v)&&(j[d[g]]=i[g]);for(;H--;)j[N++]=i[g++];return j}function qh(i,a,d,h){for(var g=-1,v=i.length,x=-1,N=d.length,F=-1,H=a.length,j=lt(v-N,0),Y=$(j+H),ne=!h;++g<j;)Y[g]=i[g];for(var ce=g;++F<H;)Y[ce+F]=a[F];for(;++x<N;)(ne||g<v)&&(Y[ce+d[x]]=i[g++]);return Y}function Dt(i,a){var d=-1,h=i.length;for(a||(a=$(h));++d<h;)a[d]=i[d];return a}function Fn(i,a,d,h){var g=!d;d||(d={});for(var v=-1,x=a.length;++v<x;){var N=a[v],F=h?h(d[N],i[N],N,d,i):n;F===n&&(F=i[N]),g?Hn(d,N,F):Zi(d,N,F)}return d}function VN(i,a){return Fn(i,Mc(i),a)}function PN(i,a){return Fn(i,lf(i),a)}function la(i,a){return function(d,h){var g=ke(d)?IB:eN,v=a?a():{};return g(d,i,he(h,2),v)}}function Ro(i){return Ve(function(a,d){var h=-1,g=d.length,v=g>1?d[g-1]:n,x=g>2?d[2]:n;for(v=i.length>3&&typeof v=="function"?(g--,v):n,x&&Nt(d[0],d[1],x)&&(v=g<3?n:v,g=1),a=We(a);++h<g;){var N=d[h];N&&i(a,N,h,v)}return a})}function Kh(i,a){return function(d,h){if(d==null)return d;if(!Ft(d))return i(d,h);for(var g=d.length,v=a?g:-1,x=We(d);(a?v--:++v<g)&&h(x[v],v,x)!==!1;);return d}}function Yh(i){return function(a,d,h){for(var g=-1,v=We(a),x=h(a),N=x.length;N--;){var F=x[i?N:++g];if(d(v[F],F,v)===!1)break}return a}}function DN(i,a,d){var h=a&L,g=qi(i);function v(){var x=this&&this!==ft&&this instanceof v?g:i;return x.apply(h?d:this,arguments)}return v}function Jh(i){return function(a){a=Ze(a);var d=Bo(a)?wn(a):n,h=d?d[0]:a.charAt(0),g=d?Br(d,1).join(""):a.slice(1);return h[i]()+g}}function Mo(i){return function(a){return ec(Yf(Kf(a).replace(xB,"")),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 d=Fo(i.prototype),h=i.apply(d,a);return Qe(h)?h:d}}function FN(i,a,d){var h=qi(i);function g(){for(var v=arguments.length,x=$(v),N=v,F=Io(g);N--;)x[N]=arguments[N];var H=v<3&&x[0]!==F&&x[v-1]!==F?[]:xr(x,F);if(v-=H.length,v<d)return nf(i,a,ca,g.placeholder,n,x,H,n,n,d-v);var j=this&&this!==ft&&this instanceof g?h:i;return Zt(j,this,x)}return g}function Xh(i){return function(a,d,h){var g=We(a);if(!Ft(a)){var v=he(d,3);a=pt(a),d=function(N){return v(g[N],N,g)}}var x=i(a,d,h);return x>-1?g[v?a[x]:x]:n}}function Qh(i){return qn(function(a){var d=a.length,h=d,g=Qt.prototype.thru;for(i&&a.reverse();h--;){var v=a[h];if(typeof v!="function")throw new Xt(c);if(g&&!x&&ha(v)=="wrapper")var x=new Qt([],!0)}for(h=x?h:d;++h<d;){v=a[h];var N=ha(v),F=N=="wrapper"?Fc(v):n;F&&Lc(F[0])&&F[1]==(W|q|O|S)&&!F[4].length&&F[9]==1?x=x[ha(F[0])].apply(x,F[3]):x=v.length==1&&Lc(v)?x[N]():x.thru(v)}return function(){var H=arguments,j=H[0];if(x&&H.length==1&&ke(j))return x.plant(j).value();for(var Y=0,ne=d?a[Y].apply(this,H):j;++Y<d;)ne=a[Y].call(this,ne);return ne}})}function ca(i,a,d,h,g,v,x,N,F,H){var j=a&W,Y=a&L,ne=a&C,ce=a&(q|X),me=a&k,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=HB(Fe,Vt);if(h&&(Fe=jh(Fe,h,g,ce)),v&&(Fe=qh(Fe,v,x,ce)),Pe-=qt,ce&&Pe<H){var rt=xr(Fe,Vt);return nf(i,a,ca,ge.placeholder,d,Fe,rt,N,F,H-Pe)}var kn=Y?d:this,Xn=ne?kn[i]:i;return Pe=Fe.length,N?Fe=eV(Fe,N):me&&Pe>1&&Fe.reverse(),j&&F<Pe&&(Fe.length=F),this&&this!==ft&&this instanceof ge&&(Xn=Ne||qi(Xn)),Xn.apply(kn,Fe)}return ge}function ef(i,a){return function(d,h){return lN(d,i,a(h),{})}}function da(i,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=Oh(d),h=Oh(h)),g=i(d,h)}return g}}function Nc(i){return qn(function(a){return a=Ye(a,Ut(he())),Ve(function(d){var h=this;return i(a,function(g){return Zt(g,h,d)})})})}function ua(i,a){a=a===n?" ":Wt(a);var d=a.length;if(d<2)return d?xc(a,i):a;var h=xc(a,Js(i/Ao(a)));return Bo(a)?Br(wn(h),0,i).join(""):h.slice(0,i)}function RN(i,a,d,h){var g=a&L,v=qi(i);function x(){for(var N=-1,F=arguments.length,H=-1,j=h.length,Y=$(j+F),ne=this&&this!==ft&&this instanceof x?v:i;++H<j;)Y[H]=h[H];for(;F--;)Y[H++]=arguments[++N];return Zt(ne,g?d:this,Y)}return x}function tf(i){return function(a,d,h){return h&&typeof h!="number"&&Nt(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),CN(a,d,h,i)}}function pa(i){return function(a,d){return typeof a=="string"&&typeof d=="string"||(a=rn(a),d=rn(d)),i(a,d)}}function nf(i,a,d,h,g,v,x,N,F,H){var j=a&q,Y=j?x:n,ne=j?n:x,ce=j?v:n,me=j?n:v;a|=j?O:K,a&=~(j?K:O),a&V||(a&=~(L|C));var Ne=[i,a,g,ce,Y,me,ne,N,F,H],ge=d.apply(n,Ne);return Lc(i)&&mf(ge,Ne),ge.placeholder=h,gf(ge,i,a)}function Vc(i){var a=at[i];return function(d,h){if(d=rn(d),h=h==null?0:wt(Te(h),292),h&&mh(d)){var g=(Ze(d)+"e").split("e"),v=a(g[0]+"e"+(+g[1]+h));return g=(Ze(v)+"e").split("e"),+(g[0]+"e"+(+g[1]-h))}return a(d)}}var MN=Po&&1/zs(new Po([,-0]))[1]==pe?function(i){return new Po(i)}:Qc;function rf(i){return function(a){var d=bt(a);return d==vn?ac(a):d==Cn?QB(a):WB(a,i(a))}}function jn(i,a,d,h,g,v,x,N){var F=a&C;if(!F&&typeof i!="function")throw new Xt(c);var H=h?h.length:0;if(H||(a&=~(O|K),h=g=n),x=x===n?x:lt(Te(x),0),N=N===n?N:Te(N),H-=g?g.length:0,a&K){var j=h,Y=g;h=g=n}var ne=F?n:Fc(i),ce=[i,a,d,h,g,j,Y,v,x,N];if(ne&&JN(ce,ne),i=ce[0],a=ce[1],d=ce[2],h=ce[3],g=ce[4],N=ce[9]=ce[9]===n?F?0:i.length:lt(ce[9]-H,0),!N&&a&(q|X)&&(a&=~(q|X)),!a||a==L)var me=DN(i,a,d);else a==q||a==X?me=FN(i,a,N):(a==O||a==(L|O))&&!g.length?me=RN(i,a,d,h):me=ca.apply(n,ce);var Ne=ne?Ih:mf;return gf(Ne(me,ce),i,a)}function of(i,a,d,h){return i===n||xn(i,Vo[d])&&!Ue.call(h,d)?a:i}function sf(i,a,d,h,g,v){return Qe(i)&&Qe(a)&&(v.set(a,i),ia(i,a,n,sf,v),v.delete(a)),i}function IN(i){return Ji(i)?n:i}function af(i,a,d,h,g,v){var x=d&P,N=i.length,F=a.length;if(N!=F&&!(x&&F>N))return!1;var H=v.get(i),j=v.get(a);if(H&&j)return H==a&&j==i;var Y=-1,ne=!0,ce=d&R?new Yr:n;for(v.set(i,a),v.set(a,i);++Y<N;){var me=i[Y],Ne=a[Y];if(h)var ge=x?h(Ne,me,Y,a,i,v):h(me,Ne,Y,i,a,v);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,d,h,v)))return ce.push(Fe)})){ne=!1;break}}else if(!(me===Ne||g(me,Ne,d,h,v))){ne=!1;break}}return v.delete(i),v.delete(a),ne}function LN(i,a,d,h,g,v,x){switch(d){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||!v(new js(i),new js(a)));case Ge:case Cr:case Pi:return xn(+i,+a);case Ds:return i.name==a.name&&i.message==a.message;case Di:case Fi:return i==a+"";case vn:var N=ac;case Cn:var F=h&P;if(N||(N=zs),i.size!=a.size&&!F)return!1;var H=x.get(i);if(H)return H==a;h|=R,x.set(i,a);var j=af(N(i),N(a),h,g,v,x);return x.delete(i),j;case Rs:if($i)return $i.call(i)==$i.call(a)}return!1}function ON(i,a,d,h,g,v){var x=d&P,N=Pc(i),F=N.length,H=Pc(a),j=H.length;if(F!=j&&!x)return!1;for(var Y=F;Y--;){var ne=N[Y];if(!(x?ne in a:Ue.call(a,ne)))return!1}var ce=v.get(i),me=v.get(a);if(ce&&me)return ce==a&&me==i;var Ne=!0;v.set(i,a),v.set(a,i);for(var ge=x;++Y<F;){ne=N[Y];var Pe=i[ne],Fe=a[ne];if(h)var jt=x?h(Fe,Pe,ne,a,i,v):h(Pe,Fe,ne,i,a,v);if(!(jt===n?Pe===Fe||g(Pe,Fe,d,h,v):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 v.delete(i),v.delete(a),Ne}function qn(i){return Gc(hf(i,n,bf),i+"")}function Pc(i){return Eh(i,pt,Mc)}function Dc(i){return Eh(i,Rt,lf)}var Fc=Qs?function(i){return Qs.get(i)}:Qc;function ha(i){for(var a=i.name+"",d=Do[a],h=Ue.call(Do,a)?d.length:0;h--;){var g=d[h],v=g.func;if(v==null||v==i)return g.name}return a}function Io(i){var a=Ue.call(_,"placeholder")?_:i;return a.placeholder}function he(){var i=_.iteratee||Jc;return i=i===Jc?Ah:i,arguments.length?i(arguments[0],arguments[1]):i}function fa(i,a){var d=i.__data__;return jN(a)?d[typeof a=="string"?"string":"hash"]:d.map}function Rc(i){for(var a=pt(i),d=a.length;d--;){var h=a[d],g=i[h];a[d]=[h,g,uf(g)]}return a}function Qr(i,a){var d=YB(i,a);return Bh(d)?d:n}function GN(i){var a=Ue.call(i,qr),d=i[qr];try{i[qr]=n;var h=!0}catch{}var g=Ws.call(i);return h&&(a?i[qr]=d:delete i[qr]),g}var Mc=cc?function(i){return i==null?[]:(i=We(i),wr(cc(i),function(a){return hh.call(i,a)}))}:ed,lf=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())!=xp||Po&&bt(new Po)!=Cn||Gi&&bt(new Gi)!=Ri)&&(bt=function(i){var a=At(i),d=a==Zn?i.constructor:n,h=d?eo(d):"";if(h)switch(h){case bA:return So;case xA:return vn;case kA:return xp;case SA:return Cn;case EA:return Ri}return a});function zN(i,a,d){for(var h=-1,g=d.length;++h<g;){var v=d[h],x=v.size;switch(v.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 $N(i){var a=i.match(qT);return a?a[1].split(KT):[]}function cf(i,a,d){a=Tr(a,i);for(var h=-1,g=a.length,v=!1;++h<g;){var x=Rn(a[h]);if(!(v=i!=null&&d(i,x)))break;i=i[x]}return v||++h!=g?v:(g=i==null?0:i.length,!!g&&wa(g)&&Kn(x,g)&&(ke(i)||to(i)))}function ZN(i){var a=i.length,d=new i.constructor(a);return a&&typeof i[0]=="string"&&Ue.call(i,"index")&&(d.index=i.index,d.input=i.input),d}function df(i){return typeof i.constructor=="function"&&!Ki(i)?Fo(qs(i)):{}}function UN(i,a,d){var h=i.constructor;switch(a){case Mi:return Ac(i);case Ge:case Cr:return new h(+i);case So:return TN(i,d);case Rl:case Ml:case Il:case Ll:case Ol:case Gl:case zl:case $l:case Zl:return Wh(i,d);case vn:return new h;case Pi:case Fi:return new h(i);case Di:return BN(i);case Cn:return new h;case Rs:return AN(i)}}function WN(i,a){var d=a.length;if(!d)return i;var h=d-1;return a[h]=(d>1?"& ":"")+a[h],a=a.join(d>2?", ":" "),i.replace(jT,`{
|
|
73
73
|
/* [wrapped with `+a+`] */
|
|
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<(L|C|W),x=h==W&&c==q||h==W&&c==S&&i[7].length<=a[8]||h==(W|S)&&a[7].length<=a[8]&&c==q;if(!(_||x))return i;h&L&&(i[2]=a[2],g|=c&L?0:V);var N=a[3];if(N){var F=i[3];i[3]=F?Wh(F,N,a[4]):N,i[4]=F?xr(i[3],m):a[4]}return N=a[5],N&&(F=i[5],i[5]=F?Hh(F,N,a[6]):N,i[6]=F?xr(i[5],m):a[6]),N=a[7],N&&(i[7]=N),h&W&&(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 N=$(a+1);++g<a;)N[g]=h[g];return N[a]=c(x),Zt(i,this,N)}}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=I-(h-c);if(c=h,g>0){if(++a>=Z)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,W,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=L;if(c.length){var g=xr(c,Io(Zc));h|=O}return jn(i,h,a,c,g)}),Af=Ve(function(i,a,c){var h=L|C;if(c.length){var g=xr(c,Io(Af));h|=O}return jn(a,h,i,c,g)});function Nf(i,a,c){a=c?n:a;var h=jn(i,q,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,X,n,n,n,n,n,a);return h.placeholder=Vf.placeholder,h}function Pf(i,a,c){var h,g,_,x,N,F,H=0,j=!1,Y=!1,ne=!0;if(typeof i!="function")throw new Jt(d);a=nn(a)||0,Qe(c)&&(j=!!c.leading,Y="maxWait"in c,_=Y?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,H=rt,x=i.apply(Xn,xn),x}function me(rt){return H=rt,N=Yi(Pe,a),j?ce(rt):x}function Ne(rt){var xn=rt-F,Xn=rt-H,Jf=a-xn;return Y?wt(Jf,_-Xn):Jf}function ge(rt){var xn=rt-F,Xn=rt-H;return F===n||xn>=a||xn<0||Y&&Xn>=_}function Pe(){var rt=va();if(ge(rt))return Fe(rt);N=Yi(Pe,Ne(rt))}function Fe(rt){return N=n,ne&&h?ce(rt):(h=g=n,x)}function jt(){N!==n&&zh(N),H=0,h=F=g=N=n}function Vt(){return N===n?x:Fe(va())}function qt(){var rt=va(),xn=ge(rt);if(h=arguments,g=this,F=rt,xn){if(N===n)return me(F);if(Y)return zh(N),N=Yi(Pe,a),ce(F)}return N===n&&(N=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,k)}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,O,n,a,c)}),Df=Ve(function(i,a){var c=xr(a,Io(Df));return jn(i,K,n,a,c)}),SP=qn(function(i,a){return jn(i,S,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,E)}function DP(i,a){return a=typeof a=="function"?a:n,Qt(i,E,a)}function FP(i){return Qt(i,y|E)}function RP(i,a){return a=typeof a=="function"?a:n,Qt(i,y|E,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(_),N=-1,F=x.length;++N<F;){var H=x[N],j=i[H];(j===n||bn(j,Vo[H])&&!Ue.call(i,H))&&(i[H]=_[H])}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|B|E,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,N,F){return a(c,x,N,F)}),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,_),N,F,H=0,j=a.interpolate||Ms,Y="__p += '",ne=lc((a.escape||Ms).source+"|"+j.source+"|"+(j===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),Y+=i.slice(H,qt).replace(
|
|
74
|
+
`)}function HN(i){return ke(i)||to(i)||!!(fh&&i&&i[fh])}function Kn(i,a){var d=typeof i;return a=a??we,!!a&&(d=="number"||d!="symbol"&&oB.test(i))&&i>-1&&i%1==0&&i<a}function Nt(i,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)?xn(d[a],i):!1}function Ic(i,a){if(ke(i))return!1;var d=typeof i;return d=="number"||d=="symbol"||d=="boolean"||i==null||Ht(i)?!0:ZT.test(i)||!$T.test(i)||a!=null&&i in We(a)}function jN(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),d=_[a];if(typeof d!="function"||!(a in De.prototype))return!1;if(i===d)return!0;var h=Fc(d);return!!h&&i===h[0]}function qN(i){return!!dh&&dh in i}var KN=Zs?Yn:td;function Ki(i){var a=i&&i.constructor,d=typeof a=="function"&&a.prototype||Vo;return i===d}function uf(i){return i===i&&!Qe(i)}function pf(i,a){return function(d){return d==null?!1:d[i]===a&&(a!==n||i in We(d))}}function YN(i){var a=va(i,function(h){return d.size===f&&d.clear(),h}),d=a.cache;return a}function JN(i,a){var d=i[1],h=a[1],g=d|h,v=g<(L|C|W),x=h==W&&d==q||h==W&&d==S&&i[7].length<=a[8]||h==(W|S)&&a[7].length<=a[8]&&d==q;if(!(v||x))return i;h&L&&(i[2]=a[2],g|=d&L?0:V);var N=a[3];if(N){var F=i[3];i[3]=F?jh(F,N,a[4]):N,i[4]=F?xr(i[3],m):a[4]}return N=a[5],N&&(F=i[5],i[5]=F?qh(F,N,a[6]):N,i[6]=F?xr(i[5],m):a[6]),N=a[7],N&&(i[7]=N),h&W&&(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 XN(i){var a=[];if(i!=null)for(var d in We(i))a.push(d);return a}function QN(i){return Ws.call(i)}function hf(i,a,d){return a=lt(a===n?i.length-1:a,0),function(){for(var h=arguments,g=-1,v=lt(h.length-a,0),x=$(v);++g<v;)x[g]=h[a+g];g=-1;for(var N=$(a+1);++g<a;)N[g]=h[g];return N[a]=d(x),Zt(i,this,N)}}function ff(i,a){return a.length<2?i:Xr(i,tn(a,0,-1))}function eV(i,a){for(var d=i.length,h=wt(a.length,d),g=Dt(i);h--;){var v=a[h];i[h]=Kn(v,d)?g[v]:n}return i}function Oc(i,a){if(!(a==="constructor"&&typeof i[a]=="function")&&a!="__proto__")return i[a]}var mf=yf(Ih),Yi=mA||function(i,a){return ft.setTimeout(i,a)},Gc=yf(xN);function gf(i,a,d){var h=a+"";return Gc(i,WN(h,tV($N(h),d)))}function yf(i){var a=0,d=0;return function(){var h=vA(),g=I-(h-d);if(d=h,g>0){if(++a>=Z)return arguments[0]}else a=0;return i.apply(n,arguments)}}function ma(i,a){var d=-1,h=i.length,g=h-1;for(a=a===n?h:a;++d<a;){var v=bc(d,g),x=i[v];i[v]=i[d],i[d]=x}return i.length=a,i}var _f=YN(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(UT,function(d,h,g,v){a.push(g?v.replace(XT,"$1"):h||d)}),a});function Rn(i){if(typeof i=="string"||Ht(i))return i;var a=i+"";return a=="0"&&1/i==-pe?"-0":a}function eo(i){if(i!=null){try{return Us.call(i)}catch{}try{return i+""}catch{}}return""}function tV(i,a){return Jt(vr,function(d){var h="_."+d[0];a&d[1]&&!Os(i,h)&&i.push(h)}),i.sort()}function vf(i){if(i instanceof De)return i.clone();var a=new Qt(i.__wrapped__,i.__chain__);return a.__actions__=Dt(i.__actions__),a.__index__=i.__index__,a.__values__=i.__values__,a}function nV(i,a,d){(d?Nt(i,a,d):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,v=0,x=$(Js(h/a));g<h;)x[v++]=tn(i,g,g+=a);return x}function rV(i){for(var a=-1,d=i==null?0:i.length,h=0,g=[];++a<d;){var v=i[a];v&&(g[h++]=v)}return g}function oV(){var i=arguments.length;if(!i)return[];for(var a=$(i-1),d=arguments[0],h=i;h--;)a[h-1]=arguments[h];return br(ke(d)?Dt(d):[d],mt(a,1))}var iV=Ve(function(i,a){return nt(i)?Ui(i,mt(a,1,nt,!0)):[]}),sV=Ve(function(i,a){var d=nn(a);return nt(d)&&(d=n),nt(i)?Ui(i,mt(a,1,nt,!0),he(d,2)):[]}),aV=Ve(function(i,a){var d=nn(a);return nt(d)&&(d=n),nt(i)?Ui(i,mt(a,1,nt,!0),n,d):[]});function lV(i,a,d){var h=i==null?0:i.length;return h?(a=d||a===n?1:Te(a),tn(i,a<0?0:a,h)):[]}function cV(i,a,d){var h=i==null?0:i.length;return h?(a=d||a===n?1:Te(a),a=h-a,tn(i,0,a<0?0:a)):[]}function dV(i,a){return i&&i.length?aa(i,he(a,3),!0,!0):[]}function uV(i,a){return i&&i.length?aa(i,he(a,3),!0):[]}function pV(i,a,d,h){var g=i==null?0:i.length;return g?(d&&typeof d!="number"&&Nt(i,a,d)&&(d=0,h=g),oN(i,a,d,h)):[]}function Cf(i,a,d){var h=i==null?0:i.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=lt(h+g,0)),Gs(i,he(a,3),g)}function wf(i,a,d){var h=i==null?0:i.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(i,he(a,3),g,!0)}function bf(i){var a=i==null?0:i.length;return a?mt(i,1):[]}function hV(i){var a=i==null?0:i.length;return a?mt(i,pe):[]}function fV(i,a){var d=i==null?0:i.length;return d?(a=a===n?1:Te(a),mt(i,a)):[]}function mV(i){for(var a=-1,d=i==null?0:i.length,h={};++a<d;){var g=i[a];h[g[0]]=g[1]}return h}function xf(i){return i&&i.length?i[0]:n}function gV(i,a,d){var h=i==null?0:i.length;if(!h)return-1;var g=d==null?0:Te(d);return g<0&&(g=lt(h+g,0)),To(i,a,g)}function yV(i){var a=i==null?0:i.length;return a?tn(i,0,-1):[]}var _V=Ve(function(i){var a=Ye(i,Tc);return a.length&&a[0]===i[0]?yc(a):[]}),vV=Ve(function(i){var a=nn(i),d=Ye(i,Tc);return a===nn(d)?a=n:d.pop(),d.length&&d[0]===i[0]?yc(d,he(a,2)):[]}),CV=Ve(function(i){var a=nn(i),d=Ye(i,Tc);return a=typeof a=="function"?a:n,a&&d.pop(),d.length&&d[0]===i[0]?yc(d,n,a):[]});function wV(i,a){return i==null?"":yA.call(i,a)}function nn(i){var a=i==null?0:i.length;return a?i[a-1]:n}function bV(i,a,d){var h=i==null?0:i.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?tA(i,a,g):Gs(i,nh,g,!0)}function xV(i,a){return i&&i.length?Dh(i,Te(a)):n}var kV=Ve(kf);function kf(i,a){return i&&i.length&&a&&a.length?wc(i,a):i}function SV(i,a,d){return i&&i.length&&a&&a.length?wc(i,a,he(d,2)):i}function EV(i,a,d){return i&&i.length&&a&&a.length?wc(i,a,n,d):i}var TV=qn(function(i,a){var d=i==null?0:i.length,h=hc(i,a);return Mh(i,Ye(a,function(g){return Kn(g,d)?+g:g}).sort(Hh)),h});function BV(i,a){var d=[];if(!(i&&i.length))return d;var h=-1,g=[],v=i.length;for(a=he(a,3);++h<v;){var x=i[h];a(x,h,i)&&(d.push(x),g.push(h))}return Mh(i,g),d}function zc(i){return i==null?i:wA.call(i)}function AV(i,a,d){var h=i==null?0:i.length;return h?(d&&typeof d!="number"&&Nt(i,a,d)?(a=0,d=h):(a=a==null?0:Te(a),d=d===n?h:Te(d)),tn(i,a,d)):[]}function NV(i,a){return sa(i,a)}function VV(i,a,d){return kc(i,a,he(d,2))}function PV(i,a){var d=i==null?0:i.length;if(d){var h=sa(i,a);if(h<d&&xn(i[h],a))return h}return-1}function DV(i,a){return sa(i,a,!0)}function FV(i,a,d){return kc(i,a,he(d,2),!0)}function RV(i,a){var d=i==null?0:i.length;if(d){var h=sa(i,a,!0)-1;if(xn(i[h],a))return h}return-1}function MV(i){return i&&i.length?Lh(i):[]}function IV(i,a){return i&&i.length?Lh(i,he(a,2)):[]}function LV(i){var a=i==null?0:i.length;return a?tn(i,1,a):[]}function OV(i,a,d){return i&&i.length?(a=d||a===n?1:Te(a),tn(i,0,a<0?0:a)):[]}function GV(i,a,d){var h=i==null?0:i.length;return h?(a=d||a===n?1:Te(a),a=h-a,tn(i,a<0?0:a,h)):[]}function zV(i,a){return i&&i.length?aa(i,he(a,3),!1,!0):[]}function $V(i,a){return i&&i.length?aa(i,he(a,3)):[]}var ZV=Ve(function(i){return Er(mt(i,1,nt,!0))}),UV=Ve(function(i){var a=nn(i);return nt(a)&&(a=n),Er(mt(i,1,nt,!0),he(a,2))}),WV=Ve(function(i){var a=nn(i);return a=typeof a=="function"?a:n,Er(mt(i,1,nt,!0),n,a)});function HV(i){return i&&i.length?Er(i):[]}function jV(i,a){return i&&i.length?Er(i,he(a,2)):[]}function qV(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(d){if(nt(d))return a=lt(d.length,a),!0}),ic(a,function(d){return Ye(i,nc(d))})}function Sf(i,a){if(!(i&&i.length))return[];var d=$c(i);return a==null?d:Ye(d,function(h){return Zt(a,n,h)})}var KV=Ve(function(i,a){return nt(i)?Ui(i,a):[]}),YV=Ve(function(i){return Ec(wr(i,nt))}),JV=Ve(function(i){var a=nn(i);return nt(a)&&(a=n),Ec(wr(i,nt),he(a,2))}),XV=Ve(function(i){var a=nn(i);return a=typeof a=="function"?a:n,Ec(wr(i,nt),n,a)}),QV=Ve($c);function eP(i,a){return $h(i||[],a||[],Zi)}function tP(i,a){return $h(i||[],a||[],ji)}var nP=Ve(function(i){var a=i.length,d=a>1?i[a-1]:n;return d=typeof d=="function"?(i.pop(),d):n,Sf(i,d)});function Ef(i){var a=_(i);return a.__chain__=!0,a}function rP(i,a){return a(i),i}function ga(i,a){return a(i)}var oP=qn(function(i){var a=i.length,d=a?i[0]:0,h=this.__wrapped__,g=function(v){return hc(v,i)};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 Qt(h,this.__chain__).thru(function(v){return a&&!v.length&&v.push(n),v}))});function iP(){return Ef(this)}function sP(){return new Qt(this.value(),this.__chain__)}function aP(){this.__values__===n&&(this.__values__=Gf(this.value()));var i=this.__index__>=this.__values__.length,a=i?n:this.__values__[this.__index__++];return{done:i,value:a}}function lP(){return this}function cP(i){for(var a,d=this;d instanceof ta;){var h=vf(d);h.__index__=0,h.__values__=n,a?g.__wrapped__=h:a=h;var g=h;d=d.__wrapped__}return g.__wrapped__=i,a}function dP(){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 Qt(a,this.__chain__)}return this.thru(zc)}function uP(){return zh(this.__wrapped__,this.__actions__)}var pP=la(function(i,a,d){Ue.call(i,d)?++i[d]:Hn(i,d,1)});function hP(i,a,d){var h=ke(i)?eh:rN;return d&&Nt(i,a,d)&&(a=n),h(i,he(a,3))}function fP(i,a){var d=ke(i)?wr:kh;return d(i,he(a,3))}var mP=Xh(Cf),gP=Xh(wf);function yP(i,a){return mt(ya(i,a),1)}function _P(i,a){return mt(ya(i,a),pe)}function vP(i,a,d){return d=d===n?1:Te(d),mt(ya(i,a),d)}function Tf(i,a){var d=ke(i)?Jt:Sr;return d(i,he(a,3))}function Bf(i,a){var d=ke(i)?LB:xh;return d(i,he(a,3))}var CP=la(function(i,a,d){Ue.call(i,d)?i[d].push(a):Hn(i,d,[a])});function wP(i,a,d,h){i=Ft(i)?i:Oo(i),d=d&&!h?Te(d):0;var g=i.length;return d<0&&(d=lt(g+d,0)),ba(i)?d<=g&&i.indexOf(a,d)>-1:!!g&&To(i,a,d)>-1}var bP=Ve(function(i,a,d){var h=-1,g=typeof a=="function",v=Ft(i)?$(i.length):[];return Sr(i,function(x){v[++h]=g?Zt(a,x,d):Wi(x,a,d)}),v}),xP=la(function(i,a,d){Hn(i,d,a)});function ya(i,a){var d=ke(i)?Ye:Nh;return d(i,he(a,3))}function kP(i,a,d,h){return i==null?[]:(ke(a)||(a=a==null?[]:[a]),d=h?n:d,ke(d)||(d=d==null?[]:[d]),Fh(i,a,d))}var SP=la(function(i,a,d){i[d?0:1].push(a)},function(){return[[],[]]});function EP(i,a,d){var h=ke(i)?ec:oh,g=arguments.length<3;return h(i,he(a,4),d,g,Sr)}function TP(i,a,d){var h=ke(i)?OB:oh,g=arguments.length<3;return h(i,he(a,4),d,g,xh)}function BP(i,a){var d=ke(i)?wr:kh;return d(i,Ca(he(a,3)))}function AP(i){var a=ke(i)?vh:wN;return a(i)}function NP(i,a,d){(d?Nt(i,a,d):a===n)?a=1:a=Te(a);var h=ke(i)?XA:bN;return h(i,a)}function VP(i){var a=ke(i)?QA:kN;return a(i)}function PP(i){if(i==null)return 0;if(Ft(i))return ba(i)?Ao(i):i.length;var a=bt(i);return a==vn||a==Cn?i.size:vc(i).length}function DP(i,a,d){var h=ke(i)?tc:SN;return d&&Nt(i,a,d)&&(a=n),h(i,he(a,3))}var FP=Ve(function(i,a){if(i==null)return[];var d=a.length;return d>1&&Nt(i,a[0],a[1])?a=[]:d>2&&Nt(a[0],a[1],a[2])&&(a=[a[0]]),Fh(i,mt(a,1),[])}),_a=fA||function(){return ft.Date.now()};function RP(i,a){if(typeof a!="function")throw new Xt(c);return i=Te(i),function(){if(--i<1)return a.apply(this,arguments)}}function Af(i,a,d){return a=d?n:a,a=i&&a==null?i.length:a,jn(i,W,n,n,n,n,a)}function Nf(i,a){var d;if(typeof a!="function")throw new Xt(c);return i=Te(i),function(){return--i>0&&(d=a.apply(this,arguments)),i<=1&&(a=n),d}}var Zc=Ve(function(i,a,d){var h=L;if(d.length){var g=xr(d,Io(Zc));h|=O}return jn(i,h,a,d,g)}),Vf=Ve(function(i,a,d){var h=L|C;if(d.length){var g=xr(d,Io(Vf));h|=O}return jn(a,h,i,d,g)});function Pf(i,a,d){a=d?n:a;var h=jn(i,q,n,n,n,n,n,a);return h.placeholder=Pf.placeholder,h}function Df(i,a,d){a=d?n:a;var h=jn(i,X,n,n,n,n,n,a);return h.placeholder=Df.placeholder,h}function Ff(i,a,d){var h,g,v,x,N,F,H=0,j=!1,Y=!1,ne=!0;if(typeof i!="function")throw new Xt(c);a=rn(a)||0,Qe(d)&&(j=!!d.leading,Y="maxWait"in d,v=Y?lt(rn(d.maxWait)||0,a):v,ne="trailing"in d?!!d.trailing:ne);function ce(rt){var kn=h,Xn=g;return h=g=n,H=rt,x=i.apply(Xn,kn),x}function me(rt){return H=rt,N=Yi(Pe,a),j?ce(rt):x}function Ne(rt){var kn=rt-F,Xn=rt-H,Qf=a-kn;return Y?wt(Qf,v-Xn):Qf}function ge(rt){var kn=rt-F,Xn=rt-H;return F===n||kn>=a||kn<0||Y&&Xn>=v}function Pe(){var rt=_a();if(ge(rt))return Fe(rt);N=Yi(Pe,Ne(rt))}function Fe(rt){return N=n,ne&&h?ce(rt):(h=g=n,x)}function jt(){N!==n&&Zh(N),H=0,h=F=g=N=n}function Vt(){return N===n?x:Fe(_a())}function qt(){var rt=_a(),kn=ge(rt);if(h=arguments,g=this,F=rt,kn){if(N===n)return me(F);if(Y)return Zh(N),N=Yi(Pe,a),ce(F)}return N===n&&(N=Yi(Pe,a)),x}return qt.cancel=jt,qt.flush=Vt,qt}var MP=Ve(function(i,a){return bh(i,1,a)}),IP=Ve(function(i,a,d){return bh(i,rn(a)||0,d)});function LP(i){return jn(i,k)}function va(i,a){if(typeof i!="function"||a!=null&&typeof a!="function")throw new Xt(c);var d=function(){var h=arguments,g=a?a.apply(this,h):h[0],v=d.cache;if(v.has(g))return v.get(g);var x=i.apply(this,h);return d.cache=v.set(g,x)||v,x};return d.cache=new(va.Cache||Wn),d}va.Cache=Wn;function Ca(i){if(typeof i!="function")throw new Xt(c);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 OP(i){return Nf(2,i)}var GP=EN(function(i,a){a=a.length==1&&ke(a[0])?Ye(a[0],Ut(he())):Ye(mt(a,1),Ut(he()));var d=a.length;return Ve(function(h){for(var g=-1,v=wt(h.length,d);++g<v;)h[g]=a[g].call(this,h[g]);return Zt(i,this,h)})}),Uc=Ve(function(i,a){var d=xr(a,Io(Uc));return jn(i,O,n,a,d)}),Rf=Ve(function(i,a){var d=xr(a,Io(Rf));return jn(i,K,n,a,d)}),zP=qn(function(i,a){return jn(i,S,n,n,n,a)});function $P(i,a){if(typeof i!="function")throw new Xt(c);return a=a===n?a:Te(a),Ve(i,a)}function ZP(i,a){if(typeof i!="function")throw new Xt(c);return a=a==null?0:lt(Te(a),0),Ve(function(d){var h=d[a],g=Br(d,0,a);return h&&br(g,h),Zt(i,this,g)})}function UP(i,a,d){var h=!0,g=!0;if(typeof i!="function")throw new Xt(c);return Qe(d)&&(h="leading"in d?!!d.leading:h,g="trailing"in d?!!d.trailing:g),Ff(i,a,{leading:h,maxWait:a,trailing:g})}function WP(i){return Af(i,1)}function HP(i,a){return Uc(Bc(a),i)}function jP(){if(!arguments.length)return[];var i=arguments[0];return ke(i)?i:[i]}function qP(i){return en(i,E)}function KP(i,a){return a=typeof a=="function"?a:n,en(i,E,a)}function YP(i){return en(i,y|E)}function JP(i,a){return a=typeof a=="function"?a:n,en(i,y|E,a)}function XP(i,a){return a==null||wh(i,a,pt(a))}function xn(i,a){return i===a||i!==i&&a!==a}var QP=pa(gc),eD=pa(function(i,a){return i>=a}),to=Th(function(){return arguments}())?Th:function(i){return et(i)&&Ue.call(i,"callee")&&!hh.call(i,"callee")},ke=$.isArray,tD=qp?Ut(qp):cN;function Ft(i){return i!=null&&wa(i.length)&&!Yn(i)}function nt(i){return et(i)&&Ft(i)}function nD(i){return i===!0||i===!1||et(i)&&At(i)==Ge}var Ar=gA||td,rD=Kp?Ut(Kp):dN;function oD(i){return et(i)&&i.nodeType===1&&!Ji(i)}function iD(i){if(i==null)return!0;if(Ft(i)&&(ke(i)||typeof i=="string"||typeof i.splice=="function"||Ar(i)||Lo(i)||to(i)))return!i.length;var a=bt(i);if(a==vn||a==Cn)return!i.size;if(Ki(i))return!vc(i).length;for(var d in i)if(Ue.call(i,d))return!1;return!0}function sD(i,a){return Hi(i,a)}function aD(i,a,d){d=typeof d=="function"?d:n;var h=d?d(i,a):n;return h===n?Hi(i,a,n,d):!!h}function Wc(i){if(!et(i))return!1;var a=At(i);return a==Ds||a==NT||typeof i.message=="string"&&typeof i.name=="string"&&!Ji(i)}function lD(i){return typeof i=="number"&&mh(i)}function Yn(i){if(!Qe(i))return!1;var a=At(i);return a==Fs||a==bp||a==Ps||a==PT}function Mf(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 If=Yp?Ut(Yp):pN;function cD(i,a){return i===a||_c(i,a,Rc(a))}function dD(i,a,d){return d=typeof d=="function"?d:n,_c(i,a,Rc(a),d)}function uD(i){return Lf(i)&&i!=+i}function pD(i){if(KN(i))throw new xe(l);return Bh(i)}function hD(i){return i===null}function fD(i){return i==null}function Lf(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 d=Ue.call(a,"constructor")&&a.constructor;return typeof d=="function"&&d instanceof d&&Us.call(d)==dA}var Hc=Jp?Ut(Jp):hN;function mD(i){return Mf(i)&&i>=-we&&i<=we}var Of=Xp?Ut(Xp):fN;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=Qp?Ut(Qp):mN;function gD(i){return i===n}function yD(i){return et(i)&&bt(i)==Ri}function _D(i){return et(i)&&At(i)==FT}var vD=pa(Cc),CD=pa(function(i,a){return i<=a});function Gf(i){if(!i)return[];if(Ft(i))return ba(i)?wn(i):Dt(i);if(Li&&i[Li])return XB(i[Li]());var a=bt(i),d=a==vn?ac:a==Cn?zs:Oo;return d(i)}function Jn(i){if(!i)return i===0?i:0;if(i=rn(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),d=a%1;return a===a?d?a-d:a:0}function zf(i){return i?Jr(Te(i),0,ht):0}function rn(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=ih(i);var d=tB.test(i);return d||rB.test(i)?RB(i.slice(2),d?2:8):eB.test(i)?Bt:+i}function $f(i){return Fn(i,Rt(i))}function wD(i){return i?Jr(Te(i),-we,we):i===0?i:0}function Ze(i){return i==null?"":Wt(i)}var bD=Ro(function(i,a){if(Ki(a)||Ft(a)){Fn(a,pt(a),i);return}for(var d in a)Ue.call(a,d)&&Zi(i,d,a[d])}),Zf=Ro(function(i,a){Fn(a,Rt(a),i)}),xa=Ro(function(i,a,d,h){Fn(a,Rt(a),i,h)}),xD=Ro(function(i,a,d,h){Fn(a,pt(a),i,h)}),kD=qn(hc);function SD(i,a){var d=Fo(i);return a==null?d:Ch(d,a)}var ED=Ve(function(i,a){i=We(i);var d=-1,h=a.length,g=h>2?a[2]:n;for(g&&Nt(a[0],a[1],g)&&(h=1);++d<h;)for(var v=a[d],x=Rt(v),N=-1,F=x.length;++N<F;){var H=x[N],j=i[H];(j===n||xn(j,Vo[H])&&!Ue.call(i,H))&&(i[H]=v[H])}return i}),TD=Ve(function(i){return i.push(n,sf),Zt(Uf,n,i)});function BD(i,a){return th(i,he(a,3),Dn)}function AD(i,a){return th(i,he(a,3),mc)}function ND(i,a){return i==null?i:fc(i,he(a,3),Rt)}function VD(i,a){return i==null?i:Sh(i,he(a,3),Rt)}function PD(i,a){return i&&Dn(i,he(a,3))}function DD(i,a){return i&&mc(i,he(a,3))}function FD(i){return i==null?[]:oa(i,pt(i))}function RD(i){return i==null?[]:oa(i,Rt(i))}function jc(i,a,d){var h=i==null?n:Xr(i,a);return h===n?d:h}function MD(i,a){return i!=null&&cf(i,a,iN)}function qc(i,a){return i!=null&&cf(i,a,sN)}var ID=ef(function(i,a,d){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),i[a]=d},Yc(Mt)),LD=ef(function(i,a,d){a!=null&&typeof a.toString!="function"&&(a=Ws.call(a)),Ue.call(i,a)?i[a].push(d):i[a]=[d]},he),OD=Ve(Wi);function pt(i){return Ft(i)?_h(i):vc(i)}function Rt(i){return Ft(i)?_h(i,!0):gN(i)}function GD(i,a){var d={};return a=he(a,3),Dn(i,function(h,g,v){Hn(d,a(h,g,v),h)}),d}function zD(i,a){var d={};return a=he(a,3),Dn(i,function(h,g,v){Hn(d,g,a(h,g,v))}),d}var $D=Ro(function(i,a,d){ia(i,a,d)}),Uf=Ro(function(i,a,d,h){ia(i,a,d,h)}),ZD=qn(function(i,a){var d={};if(i==null)return d;var h=!1;a=Ye(a,function(v){return v=Tr(v,i),h||(h=v.length>1),v}),Fn(i,Dc(i),d),h&&(d=en(d,y|B|E,IN));for(var g=a.length;g--;)Sc(d,a[g]);return d});function UD(i,a){return Wf(i,Ca(he(a)))}var WD=qn(function(i,a){return i==null?{}:_N(i,a)});function Wf(i,a){if(i==null)return{};var d=Ye(Dc(i),function(h){return[h]});return a=he(a),Rh(i,d,function(h,g){return a(h,g[0])})}function HD(i,a,d){a=Tr(a,i);var h=-1,g=a.length;for(g||(g=1,i=n);++h<g;){var v=i==null?n:i[Rn(a[h])];v===n&&(h=g,v=d),i=Yn(v)?v.call(i):v}return i}function jD(i,a,d){return i==null?i:ji(i,a,d)}function qD(i,a,d,h){return h=typeof h=="function"?h:n,i==null?i:ji(i,a,d,h)}var Hf=rf(pt),jf=rf(Rt);function KD(i,a,d){var h=ke(i),g=h||Ar(i)||Lo(i);if(a=he(a,4),d==null){var v=i&&i.constructor;g?d=h?new v:[]:Qe(i)?d=Yn(v)?Fo(qs(i)):{}:d={}}return(g?Jt:Dn)(i,function(x,N,F){return a(d,x,N,F)}),d}function YD(i,a){return i==null?!0:Sc(i,a)}function JD(i,a,d){return i==null?i:Gh(i,a,Bc(d))}function XD(i,a,d,h){return h=typeof h=="function"?h:n,i==null?i:Gh(i,a,Bc(d),h)}function Oo(i){return i==null?[]:sc(i,pt(i))}function QD(i){return i==null?[]:sc(i,Rt(i))}function eF(i,a,d){return d===n&&(d=a,a=n),d!==n&&(d=rn(d),d=d===d?d:0),a!==n&&(a=rn(a),a=a===a?a:0),Jr(rn(i),a,d)}function tF(i,a,d){return a=Jn(a),d===n?(d=a,a=0):d=Jn(d),i=rn(i),aN(i,a,d)}function nF(i,a,d){if(d&&typeof d!="boolean"&&Nt(i,a,d)&&(a=d=n),d===n&&(typeof a=="boolean"?(d=a,a=n):typeof i=="boolean"&&(d=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(d||i%1||a%1){var g=gh();return wt(i+g*(a-i+FB("1e-"+((g+"").length-1))),a)}return bc(i,a)}var rF=Mo(function(i,a,d){return a=a.toLowerCase(),i+(d?qf(a):a)});function qf(i){return Kc(Ze(i).toLowerCase())}function Kf(i){return i=Ze(i),i&&i.replace(iB,jB).replace(kB,"")}function oF(i,a,d){i=Ze(i),a=Wt(a);var h=i.length;d=d===n?h:Jr(Te(d),0,h);var g=d;return d-=a.length,d>=0&&i.slice(d,g)==a}function iF(i){return i=Ze(i),i&&OT.test(i)?i.replace(Sp,qB):i}function sF(i){return i=Ze(i),i&&WT.test(i)?i.replace(Ul,"\\$&"):i}var aF=Mo(function(i,a,d){return i+(d?"-":"")+a.toLowerCase()}),lF=Mo(function(i,a,d){return i+(d?" ":"")+a.toLowerCase()}),cF=Jh("toLowerCase");function dF(i,a,d){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),d)+i+ua(Js(g),d)}function uF(i,a,d){i=Ze(i),a=Te(a);var h=a?Ao(i):0;return a&&h<a?i+ua(a-h,d):i}function pF(i,a,d){i=Ze(i),a=Te(a);var h=a?Ao(i):0;return a&&h<a?ua(a-h,d)+i:i}function hF(i,a,d){return d||a==null?a=0:a&&(a=+a),CA(Ze(i).replace(Wl,""),a||0)}function fF(i,a,d){return(d?Nt(i,a,d):a===n)?a=1:a=Te(a),xc(Ze(i),a)}function mF(){var i=arguments,a=Ze(i[0]);return i.length<3?a:a.replace(i[1],i[2])}var gF=Mo(function(i,a,d){return i+(d?"_":"")+a.toLowerCase()});function yF(i,a,d){return d&&typeof d!="number"&&Nt(i,a,d)&&(a=d=n),d=d===n?ht:d>>>0,d?(i=Ze(i),i&&(typeof a=="string"||a!=null&&!Hc(a))&&(a=Wt(a),!a&&Bo(i))?Br(wn(i),0,d):i.split(a,d)):[]}var _F=Mo(function(i,a,d){return i+(d?" ":"")+Kc(a)});function vF(i,a,d){return i=Ze(i),d=d==null?0:Jr(Te(d),0,i.length),a=Wt(a),i.slice(d,d+a.length)==a}function CF(i,a,d){var h=_.templateSettings;d&&Nt(i,a,d)&&(a=n),i=Ze(i),a=xa({},a,h,of);var g=xa({},a.imports,h.imports,of),v=pt(g),x=sc(g,v),N,F,H=0,j=a.interpolate||Ms,Y="__p += '",ne=lc((a.escape||Ms).source+"|"+j.source+"|"+(j===Ep?QT:Ms).source+"|"+(a.evaluate||Ms).source+"|$","g"),ce="//# sourceURL="+(Ue.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++AB+"]")+`
|
|
75
|
+
`;i.replace(ne,function(ge,Pe,Fe,jt,Vt,qt){return Fe||(Fe=jt),Y+=i.slice(H,qt).replace(sB,KB),Pe&&(N=!0,Y+=`' +
|
|
76
76
|
__e(`+Pe+`) +
|
|
77
77
|
'`),Vt&&(F=!0,Y+=`';
|
|
78
78
|
`+Vt+`;
|
|
@@ -82,10 +82,10 @@ __p += '`),Fe&&(Y+=`' +
|
|
|
82
82
|
`;var me=Ue.call(a,"variable")&&a.variable;if(!me)Y=`with (obj) {
|
|
83
83
|
`+Y+`
|
|
84
84
|
}
|
|
85
|
-
`;else if(
|
|
85
|
+
`;else if(JT.test(me))throw new xe(u);Y=(F?Y.replace(RT,""):Y).replace(MT,"$1").replace(IT,"$1;"),Y="function("+(me||"obj")+`) {
|
|
86
86
|
`+(me?"":`obj || (obj = {});
|
|
87
87
|
`)+"var __t, __p = ''"+(N?", __e = _.escape":"")+(F?`, __j = Array.prototype.join;
|
|
88
88
|
function print() { __p += __j.call(arguments, '') }
|
|
89
89
|
`:`;
|
|
90
90
|
`)+Y+`return __p
|
|
91
|
-
}`;var Ne=Kf(function(){return ze(_,ce+"return "+Y).apply(n,x)});if(Ne.source=Y,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=T,h=z;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 N=c-Ao(h);if(N<1)return h;var F=x?Br(x,0,N).join(""):i.slice(0,N);if(g===n)return F+h;if(x&&(N+=F.length-N),Hc(g)){if(i.slice(N).search(g)){var H,j=F;for(g.global||(g=lc(g.source,Ze(Sp.exec(g))+"g")),g.lastIndex=0;H=g.exec(j);)var Y=H.index;F=F.slice(0,Y===n?N:Y)}}else if(i.indexOf(Wt(g),N)!=N){var ne=F.lastIndexOf(g);ne>-1&&(F=F.slice(0,ne))}return F+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(N){var F=a[N];i[N]=F,x&&(i.prototype[N]=function(){var H=this.__chain__;if(_||H){var j=i(this.__wrapped__),Y=j.__actions__=Dt(this.__actions__);return Y.push({func:F,args:arguments,thisArg:i}),j.__chain__=H,j}return F.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=D,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==J;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__,N=h?[1]:arguments,F=x instanceof De,H=N[0],j=F||ke(x),Y=function(Pe){var Fe=g.apply(v,br([Pe],N));return h&&ne?Fe[0]:Fe};j&&c&&typeof H=="function"&&H.length!=1&&(F=j=!1);var ne=this.__chain__,ce=!!this.__actions__.length,me=_&&!ne,Ne=F&&!ce;if(!_&&j){x=Ne?x:new De(this);var ge=i.apply(x,N);return ge.__actions__.push({func:ga,args:[Y],thisArg:n}),new Xt(ge,ne)}return me&&Ne?i.apply(this,N):(ge=this.thru(Y),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 B=o[u].data.filter(E=>E!==null);return Array.from(new Set(B))})();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 B=f[y],E=B+"@"+y;n.push({colId:E,field:ap(o.length,y),headerName:B,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 R=0;R<e.length;++R){if(R===n||R===o)continue;const L=t[R].toString();m[L]=e[R].data[f]}let y;const B=to(Object.values(m))??"";d.has(B)?y=d.get(B):(d.set(B,m),y=m,y.id=u.toString(),u++);const E=s.indexOf(e[n].data[f]);if(E===-1)throw Error("index not found");const P=ap(e.length,E);y[P]=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 B=0;B<y.length;++B){const E=Oe.findIndex(s,P=>Oe.isEqual(P,y[B]));E===-1||u[E]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(d[E]=[[m,B]],u[E]=l[m].columnId):d[E].push([m,B]))}}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,B]of d[m]){const E=await t.getUniqueValues(e,{columnId:l[y].columnId,...!u[m]&&{axis:Oe.cloneDeep(s[m])},filters:[],limit:p});if(E.overflow){u.splice(m,1),d.splice(m,1),s.splice(m,1);continue e}const P=E.values.type;for(const R of E.values.data)if(!(Ad(R,P)||R===null)&&(f[m].add(dp(R,P)),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 B=[...f[y]].map(P=>({value:P,text:P.toString()})),E=B[0].value;return{axis:Oe.cloneDeep(m),...u[y]&&{column:u[y]},options:B,defaultValue:E}})}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(),B=e[m].data[d],E=e[m].type;wg(e[m].absent,d)?f[y]=void 0:Ad(B,E)||B===null?f[y]=null:f[y]=dp(B,E)}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,V=>Oe.isEqual(V.axis,s[C].id)||Oe.isEqual(V.column,s[C].id))).sort((C,V)=>{var O,K;if(s[C].type!==s[V].type)return s[C].type==="axis"?-1:1;const q=(O=s[C].spec.annotations)==null?void 0:O["pl7.app/table/orderPriority"],X=(K=s[V].spec.annotations)==null?void 0:K["pl7.app/table/orderPriority"];return q===void 0?X===void 0?0:1:X===void 0?-1:Number(X)-Number(q)}),u=Oe.cloneDeep(d),p=GE(s,d);for(let C=d.length-1;C>=0;--C){const V=d[C];if(!KE(s[V]))continue;const q=$a(s[V].spec.axesSpec)[0],X=Oe.findIndex(d,O=>Oe.isEqual(s[O].id,q));if(X!==-1){d[X]=V;for(const O of p)O.axisIdx===V&&(O.axisIdx=X);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 B=[...d],E=new Map;for(let C=0;C<l;++C)E.set(C,-1);for(let C=0;C<B.length;++C){const V=B[C];E.has(V)&&E.set(V,C)}for(const[C,V]of E)V===-1&&(E.set(C,B.length),B.push(C));const P=[];for(let C=0;C<l;++C){const V=E.get(C);if(V===void 0||V===-1)throw new Error("assertion exception");P.push(V)}let R;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(R&&!Oe.isEqual(R.request.sortModel,C.request.sortModel)){R=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}R=C;let V=0,q=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(V=Math.min(m,C.request.endRow)-C.request.startRow,V>0)){const X=await t.getData(e,B,{offset:C.request.startRow,length:V});q=qE(u,X,P,C.request.startRow)}C.success({rowData:q,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(V){C.api.setGridOption("loading",!0),C.fail(),console.trace(V)}}}}}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(S,k)=>{if(S.sourceType!=="pframe"||!S.pFrame||!S.join||k&&k.sourceType==="pframe"&&Oe.isEqual(S.pFrame,k.pFrame)&&Oe.isEqual(S.join,k.join))return;const T=window.platforma;if(!T)throw Error("platforma not set");const z=T.pFrameDriver;if(!z)throw Error("platforma.pFrameDriver not set");const Z=await HE(z,S.pFrame,S.join),I=n.value;I.pTableParams||(I.pTableParams={sorting:[],filters:[]}),I.pTableParams.join=Z,n.value=I});const d=pp(()=>s.value.sourceType,async S=>{var T;const k=s.value.sourceType;switch(k){case"pframe":{const z=window.platforma;if(!z)throw Error("platforma not set");const Z=z.pFrameDriver;if(!Z)throw Error("platforma.pFrameDriver not set");if(!s.value.pFrame)return[];const I=s.value.pFrame,A=(T=n.value.pTableParams)==null?void 0:T.join;return A?await jE(Z,I,s.value.sheetAxes,A):[]}case"ptable":return s.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${k}`)}});function u(S){if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return(S==null?void 0:S.sortModel.map(k=>{const{spec:T,...z}=lp(k.colId);return{column:z,ascending:k.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const p=r.computed({get:()=>{const S=n.value;return{columnOrder:S.gridState.columnOrder,sort:S.gridState.sort,columnVisibility:S.gridState.columnVisibility}},set:S=>{const k=n.value,T=E.value.rowModelType==="clientSide"?void 0:u(S.sort);k.gridState={...k.gridState,...S},(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(k.pTableParams||(k.pTableParams={sorting:[],filters:[]}),k.pTableParams.sorting=T),n.value=k}}),f=S=>to(S);function m(S){var k;if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return((k=d.value)==null?void 0:k.map(T=>({type:"bySingleColumn",column:T.column?{type:"column",id:T.column}:{type:"axis",id:T.axis},predicate:{operator:"Equal",reference:S[f(T.axis)]}})))??[]}const y=r.computed({get:()=>n.value.gridState.sheets??{},set:S=>{const k=m(S),T=n.value;T.gridState.sheets=S,(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(T.pTableParams||(T.pTableParams={sorting:[],filters:[]}),T.pTableParams.filters=k),n.value=T}});r.watch(()=>[s.value,d.value],(S,k)=>{const[T,z]=S;if(!z)return;if(k){const[I,A]=k;if((T.sourceType==="ptable"||T.sourceType==="pframe")&&T.sourceType===(I==null?void 0:I.sourceType)&&Oe.isEqual(z,A))return}if(T.sourceType!=="ptable"&&T.sourceType!=="pframe"){y.value={};return}const Z=y.value;for(const I of z){const A=f(I.axis);Z[A]||(Z[A]=I.defaultValue??I.options[0].value)}y.value=Z},{immediate:!0});const B=r.shallowRef(),E=r.ref({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:p.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:S=>{S.api.autoSizeAllColumns()},onRowDoubleClicked:S=>{S.data&&l("onRowDoubleClicked",S.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:S=>S.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent: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"}}),P=S=>{const k=S.api;B.value=new Proxy(k,{get(T,z,Z){switch(z){case"setGridOption":return(I,A)=>{const G=E.value;G[I]=A,E.value=G,k.updateGridOptions(G)};case"updateGridOptions":return I=>{E.value={...E.value,...I},k.updateGridOptions(I)};default:return Reflect.get(T,z,Z)}}})},R=S=>({columnOrder:S.columnOrder,sort:S.sort,columnVisibility:S.columnVisibility??(S.columnOrder?{hiddenColIds:[]}:void 0)}),L=S=>{E.value.initialState=p.value=R(S.state),S.api.autoSizeAllColumns()},C=()=>{E.value.initialState=p.value=R(B.value.getState()),B.value=void 0},V=r.ref(0);r.watch(()=>[B.value,p.value],(S,k)=>{if(Oe.isEqual(S,k))return;const[T,z]=S;if(!T)return;const Z=R(T.getState());Oe.isEqual(z,Z)||(E.value.initialState=z,++V.value)}),r.watch(()=>E.value,(S,k)=>{var T;if(k&&(S.rowModelType!=k.rowModelType&&++V.value,!Oe.isEqual(S.columnDefs,k.columnDefs)&&S.columnDefs)){const z=A=>!("children"in A),Z=(T=S.columnDefs)==null?void 0:T.filter(z),I=Z==null?void 0:Z.map(A=>A.colId).filter(A=>A!==void 0).map(A=>lp(A));l("columnsChanged",I??[])}});const q=(S,k)=>{var z;const T=y.value;T[S]!==k&&(T[S]=k,y.value=T,(z=B.value)==null||z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},X=window.platforma;if(!X)throw Error("platforma not set");const O=X.pFrameDriver;if(!O)throw Error("platforma.pFrameDriver not set");const K=X.blobDriver;if(!K)throw Error("platforma.blobDriver not set");let W;return r.watch(()=>[B.value,s.value,d.value],async S=>{var I,A;const[k,T,z]=S;if(!k||Oe.isEqual(T,W))return;W=T;const Z=T.sourceType;switch(Z){case"pframe":case"ptable":{const G=T.pTable;if(!G||!z)return k.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const J=(A=(I=p.value)==null?void 0:I.columnVisibility)==null?void 0:A.hiddenColIds,pe=await YE(O,G,z,J);return k.updateGridOptions({loading:pe.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...pe})}case"xsv":{const G=T.xsvFile;if(!(G!=null&&G.ok)||!G.value)return k.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const J=await LE(K,G.value);return k.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...J})}default:throw Error(`unsupported source type: ${Z}`)}}),(S,k)=>(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,(T,z)=>(r.openBlock(),r.createBlock(r.unref(Ru),{key:z,"model-value":y.value[f(T.axis)],options:T.options,"onUpdate:modelValue":Z=>q(f(T.axis),Z)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0)]),_:1}),(r.openBlock(),r.createBlock(r.unref(sm.AgGridVue),{key:V.value,theme:r.unref(eu),class:"ap-ag-data-table-grid","grid-options":E.value,onGridReady:P,onStateUpdated:L,onGridPreDestroyed:C},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-4c628516"]]),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=k=>to(k.id),u=r.computed(()=>o.value.filter(k=>{const T=k.type;switch(T){case"axis":return k.spec.type!=="Bytes";case"column":return k.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${T}`)}}).map(k=>({column:k,id:d(k)}))),p=r.computed(()=>{const k=s.value??[],T={};for(const{column:z,id:Z}of u.value){const I=Oe.find(k,A=>Oe.isEqual(A.column.id,z.id));I!==void 0&&(T[Z]=I.allowedFilterTypes)}return T}),f=r.computed(()=>{const k=l.value??[],T={};for(const{column:z,id:Z}of u.value){const I=Oe.find(k,A=>Oe.isEqual(A.column.id,z.id));I!==void 0&&(T[Z]=I.default)}return T}),m=k=>k!==void 0?k:f.value,y=r.reactive({state:m(e.value.state)});r.watch(()=>e.value,k=>{Oe.isEqual(y.state,k.state)||(y.state=m(k.state))}),r.watch(()=>u.value,k=>{if(y.state!==void 0&&k.length===0)return;const T=y.state??{},z={};for(const{id:Z}of k)T[Z]!==void 0&&(z[Z]=T[Z]);y.state=z},{immediate:!0});const B=k=>{switch(k){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: ${k}`)}},E=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],P=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"],R=r.computed(()=>{const k=p.value,T={};for(const{column:z,id:Z}of u.value){let A=(z.type==="column"?z.spec.valueType:z.spec.type)==="String"?P:E;const G=k[Z];G!==void 0&&(A=A.filter(J=>G.includes(J))),T[Z]=A.map(J=>({value:J,text:B(J)}))}return T}),L=r.computed(()=>Oe.some(Object.values(R.value),k=>k.length>0)),C=k=>{const T=k.type;switch(T){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return k.reference;case"number_between":return k.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return k.reference;default:throw Error(`unsupported filter type: ${T}`)}},V=(k,T)=>{switch(k){case"isNotNA":case"isNA":return{type:k};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:k,reference:typeof T=="number"?T:0};case"number_between":return{type:k,lowerBound:typeof T=="number"?T: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:k,reference:typeof T=="string"?T:""};case"string_containsFuzzyMatch":return{type:k,reference:typeof T=="string"?T:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${k}`)}},q=(k,T)=>{const z=y.state[k];y.state[k]=V(T,C(z))},X=(k,T)=>{T?y.state[k]=f.value[k]??V(R.value[k][0].value):delete y.state[k]},O=k=>{const T=Oe.uniq(k);return T.sort(),T.map(z=>({value:z,text:z}))},K=k=>{const T=Number(k);if(!Number.isFinite(T))throw Error("Model value is not a number.");return T},W=k=>{const T=k.type;switch(T){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":case"string_equals":return{operator:"Equal",reference:k.reference};case"number_notEquals":case"string_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:k.reference}};case"number_greaterThan":return{operator:"Greater",reference:k.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:k.reference};case"number_lessThan":return{operator:"Less",reference:k.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:k.reference};case"number_between":return{operator:"And",operands:[{operator:k.includeLowerBound?"GreaterOrEqual":"Greater",reference:k.lowerBound},{operator:k.includeUpperBound?"LessOrEqual":"Less",reference:k.upperBound}]};case"string_contains":return{operator:"StringContains",substring:k.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:"StringContains",substring:k.reference}};case"string_matches":return{operator:"Matches",regex:k.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:k.reference}};case"string_containsFuzzyMatch":return{operator:"StringContainsFuzzy",reference:k.reference,maxEdits:k.maxEdits,substitutionsOnly:k.substitutionsOnly,wildcard:k.wildcard};default:throw Error(`unsupported filter type: ${T}`)}},S=k=>u.value.map(({column:T,id:z})=>{if(!(z in k))return;const Z=W(k[z]),{spec:I,...A}=T;return{type:"bySingleColumn",column:A,predicate:Z}}).filter(T=>T!==void 0);return r.watch(()=>y,k=>{Oe.isEqual(k.state,e.value.state)||(e.value={state:Oe.cloneDeep(k.state),filters:S(k.state)})},{immediate:!0,deep:!0}),(k,T)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,({column:z,id:Z},I)=>{var A,G,J,pe,we,Ct,Bt,ht,vr,Pn,_r,$n,Wr,Ps;return r.openBlock(),r.createElementBlock("div",{key:Z},[R.value[Z].length>0?(r.openBlock(),r.createElementBlock("form",eT,[r.createVNode(r.unref(Mu),{"model-value":!!y.state[Z],"onUpdate:modelValue":Ge=>X(Z,Ge)},{default:r.withCtx(()=>{var Ge,Cr;return[r.createTextVNode(r.toDisplayString(((Cr=(Ge=z.spec.annotations)==null?void 0:Ge["pl7.app/label"])==null?void 0:Cr.trim())??"Unlabeled "+z.type+" "+I.toString()),1)]}),_:2},1032,["model-value","onUpdate:modelValue"]),r.createElementVNode("div",{class:r.normalizeClass(["controls d-flex gap-10 flex-column",{open:!!y.state[Z]}])},[y.state[Z]?(r.openBlock(),r.createBlock(r.unref(ui),{key:0,"model-value":y.state[Z].type,options:R.value[Z],label:"Predicate","onUpdate:modelValue":Ge=>q(Z,Ge)},null,8,["model-value","options","onUpdate:modelValue"])):r.createCommentVNode("",!0),((A=y.state[Z])==null?void 0:A.type)==="number_equals"||((G=y.state[Z])==null?void 0:G.type)==="number_notEquals"||((J=y.state[Z])==null?void 0:J.type)==="number_lessThan"||((pe=y.state[Z])==null?void 0:pe.type)==="number_lessThanOrEqualTo"||((we=y.state[Z])==null?void 0:we.type)==="number_greaterThan"||((Ct=y.state[Z])==null?void 0:Ct.type)==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(Ir),{key:1,modelValue:y.state[Z].reference,"onUpdate:modelValue":Ge=>y.state[Z].reference=Ge,parse:K,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Bt=y.state[Z])==null?void 0:Bt.type)==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createVNode(r.unref(Ir),{modelValue:y.state[Z].lowerBound,"onUpdate:modelValue":Ge=>y.state[Z].lowerBound=Ge,parse:K,label:"Lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[Z].includeLowerBound,"onUpdate:modelValue":Ge=>y.state[Z].includeLowerBound=Ge,label:"Include lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(Ir),{modelValue:y.state[Z].upperBound,"onUpdate:modelValue":Ge=>y.state[Z].upperBound=Ge,parse:K,label:"Upper bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[Z].includeUpperBound,"onUpdate:modelValue":Ge=>y.state[Z].includeUpperBound=Ge,label:"Include upper bound"},null,8,["modelValue","onUpdate:modelValue"])],64)):r.createCommentVNode("",!0),((ht=y.state[Z])==null?void 0:ht.type)==="string_equals"||((vr=y.state[Z])==null?void 0:vr.type)==="string_notEquals"||((Pn=y.state[Z])==null?void 0:Pn.type)==="string_contains"||((_r=y.state[Z])==null?void 0:_r.type)==="string_doesNotContain"||(($n=y.state[Z])==null?void 0:$n.type)==="string_matches"||((Wr=y.state[Z])==null?void 0:Wr.type)==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(Ir),{key:3,modelValue:y.state[Z].reference,"onUpdate:modelValue":Ge=>y.state[Z].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Ps=y.state[Z])==null?void 0:Ps.type)==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(Ir),{modelValue:y.state[Z].reference,"onUpdate:modelValue":Ge=>y.state[Z].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(np),{modelValue:y.state[Z].maxEdits,"onUpdate:modelValue":Ge=>y.state[Z].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[Z].substitutionsOnly,"onUpdate:modelValue":Ge=>y.state[Z].substitutionsOnly=Ge,label:"Substitutions only"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(ui),{modelValue:y.state[Z].wildcard,"onUpdate:modelValue":Ge=>y.state[Z].wildcard=Ge,options:O(y.state[Z].reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","onUpdate:modelValue","options"])],64)):r.createCommentVNode("",!0)],2)])):r.createCommentVNode("",!0)])}),128)),L.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",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:B,maxSize:E=0,maxEntrySize:P=0,sizeCalculation:R,fetchMethod:L,memoMethod:C,noDeleteOnFetchRejection:V,noDeleteOnStaleGet:q,allowStaleOnFetchRejection:X,allowStaleOnFetchAbort:O,ignoreFetchAbort:K}=e;if(n!==0&&!gr(n))throw new TypeError("max option must be a nonnegative integer");const W=n?gp(n):Array;if(!W)throw new Error("invalid max value: "+n);if(fe(this,dn,n),fe(this,Ot,E),this.maxEntrySize=P||w(this,Ot),this.sizeCalculation=R,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),L!==void 0&&typeof L!="function")throw new TypeError("fetchMethod must be a function if specified");if(fe(this,bo,L),fe(this,yr,!!L),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 W(n)),fe(this,Gt,new W(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=!!B,this.noDeleteOnFetchRejection=!!V,this.allowStaleOnFetchRejection=!!X,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!K,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=!!q,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 S="LRU_CACHE_UNBOUNDED";uT(S)&&(hp.add(S),fp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",S,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 B,E,P,R,L;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:V}=C;V!==void 0&&!d&&(w(this,yn)&&((B=w(this,un))==null||B.call(this,V,e,"set")),w(this,Tt)&&((E=w(this,ut))==null||E.push([V,e,"set"])))}else d||(w(this,yn)&&((P=w(this,un))==null||P.call(this,C,e,"set")),w(this,Tt)&&((R=w(this,ut))==null||R.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 V=C&&le(this,te,Ke).call(this,C)?C.__staleWhileFetching:C;V!==void 0&&(p.oldValue=V)}}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 V;for(;V=C==null?void 0:C.shift();)(L=w(this,pn))==null||L.call(this,...V)}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:B=this.allowStaleOnFetchRejection,ignoreFetchAbort:E=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,context:R,forceRefresh:L=!1,status:C,signal:V}=n;if(!w(this,yr))return C&&(C.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const q={allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:d,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:B,allowStaleOnFetchAbort:P,ignoreFetchAbort:E,status:C,signal:V};let X=w(this,ot).get(e);if(X===void 0){C&&(C.fetch="miss");const O=le(this,te,Ea).call(this,e,X,q,R);return O.__returned=O}else{const O=w(this,be)[X];if(le(this,te,Ke).call(this,O)){const T=o&&O.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",T&&(C.returnedStale=!0)),T?O.__staleWhileFetching:O.__returned=O}const K=w(this,$t).call(this,X);if(!L&&!K)return C&&(C.fetch="hit"),le(this,te,Xi).call(this,X),s&&w(this,$r).call(this,X),C&&w(this,zn).call(this,C,X),O;const W=le(this,te,Ea).call(this,e,X,q,R),k=W.__staleWhileFetching!==void 0&&o;return C&&(C.fetch=K?"stale":"refresh",k&&K&&(C.returnedStale=!0)),k?W.__staleWhileFetching:W.__returned=W}}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=(R,L=!1)=>{const{aborted:C}=d.signal,V=o.ignoreFetchAbort&&R!==void 0;if(o.status&&(C&&!L?(o.status.fetchAborted=!0,o.status.fetchError=d.signal.reason,V&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),C&&!V&&!L)return y(d.signal.reason);const q=E;return w(this,be)[n]===E&&(R===void 0?q.__staleWhileFetching?w(this,be)[n]=q.__staleWhileFetching:le(this,te,Pr).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,R,p.options))),R},m=R=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=R),y(R)),y=R=>{const{aborted:L}=d.signal,C=L&&o.allowStaleOnFetchAbort,V=C||o.allowStaleOnFetchRejection,q=V||o.noDeleteOnFetchRejection,X=E;if(w(this,be)[n]===E&&(!q||X.__staleWhileFetching===void 0?le(this,te,Pr).call(this,e,"fetch"):C||(w(this,be)[n]=X.__staleWhileFetching)),V)return o.status&&X.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),X.__staleWhileFetching;if(X.__returned===X)throw R},B=(R,L)=>{var V;const C=(V=w(this,bo))==null?void 0:V.call(this,e,l,p);C&&C instanceof Promise&&C.then(q=>R(q===void 0?void 0:q),L),d.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(R(void 0),o.allowStaleOnFetchAbort&&(R=q=>f(q,!0)))})};o.status&&(o.status.fetchDispatched=!0);const E=new Promise(B).then(f,m),P=Object.assign(E,{__abortController:d,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,P,{...p.options,status:void 0}),n=w(this,ot).get(e)):w(this,be)[n]=P,P},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;M.AgGridTheme=eu,M.BlockLayout=DE,M.ContextProvider=_k,M.DataTable=G_,M.DemoData=CE,M.DropdownListItem=uo,M.LongText=_l,M.MultiError=Aa,M.PlAgCellFile=aT,M.PlAgDataTable=QE,M.PlAgOverlayLoading=ip,M.PlAgOverlayNoRows=sp,M.PlAlert=yC,M.PlBlockPage=rC,M.PlBtnAccent=RC,M.PlBtnDanger=IC,M.PlBtnGhost=hl,M.PlBtnGroup=iw,M.PlBtnLink=zC,M.PlBtnPrimary=ul,M.PlBtnSecondary=pl,M.PlBtnSplit=NC,M.PlCheckbox=Mu,M.PlCheckboxGroup=ib,M.PlChip=Cl,M.PlContainer=iC,M.PlDialogModal=bl,M.PlDropdown=ui,M.PlDropdownLegacy=T0,M.PlDropdownLine=Ru,M.PlDropdownMulti=eb,M.PlDropdownRef=n0,M.PlFileDialog=Ou,M.PlFileInput=ep,M.PlGrid=uC,M.PlIcon16=ms,M.PlIcon24=Vu,M.PlLogView=Lu,M.PlMaskIcon16=ho,M.PlMaskIcon24=On,M.PlNotificationAlert=tp,M.PlNumberField=O0,M.PlProgressBar=P0,M.PlRow=aC,M.PlSlideModal=_b,M.PlSpacer=ku,M.PlTableFilters=nT,M.PlTabs=zb,M.PlTextArea=Mw,M.PlTextField=Ir,M.PlToggleSwitch=gs,M.PlTooltip=kt,M.ReactiveFileContent=Dl,M.Scrollable=cS,M.Slider=np,M.SliderRange=iS,M.SliderRangeTriple=jk,M.ThemeSwitcher=Y_,M.UnresolvedError=Ba,M.ValueOrErrorsComponent=iT,M.activateAgGrid=Qd,M.animate=vu,M.animateInfinite=W_,M.call=hu,M.computedResult=dT,M.createModel=Ra,M.debounce=_u,M.defineApp=gv,M.defineStore=cT,M.delay=fu,M.detectOutside=Iw,M.ensureError=Pa,M.eventListener=yl,M.formatZodError=Fa,M.getElementScrollPosition=Du,M.identity=Va,M.isDefined=fm,M.isElementVisible=Pu,M.isJsonEqual=Na,M.isZodError=Da,M.listToOptions=H_,M.makeEaseInOut=U_,M.makeEaseOut=yu,M.maskIcons16=vE,M.maskIcons24=_E,M.normalizeListOptions=ar,M.notEmpty=sl,M.randomInt=gu,M.randomString=Z_,M.requestTick=al,M.scrollIntoView=di,M.showContextMenu=rl,M.throttle=Cu,M.timeout=mu,M.unwrapOptionalResult=hm,M.unwrapValueOrErrors=fd,M.useClickOutside=fs,M.useDraggable=Mk,M.useEventListener=tt,M.useFormState=Fk,M.useHover=uu,M.useInterval=Dk,M.useLabelNotch=Ln,M.useLocalStorage=wu,M.useMouse=du,M.useMouseCapture=sr,M.usePosition=po,M.useQuery=Rk,M.useResizeObserver=rp,M.useScroll=Nk,M.useSdkPlugin=Xa,M.useSortable=Pk,M.useTheme=xu,M.useWatchFetch=pp,M.wrapOptionalResult=md,M.wrapValueOrErrors=pm,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
91
|
+
}`;var Ne=Jf(function(){return ze(v,ce+"return "+Y).apply(n,x)});if(Ne.source=Y,Wc(Ne))throw Ne;return Ne}function wF(i){return Ze(i).toLowerCase()}function bF(i){return Ze(i).toUpperCase()}function xF(i,a,d){if(i=Ze(i),i&&(d||a===n))return ih(i);if(!i||!(a=Wt(a)))return i;var h=wn(i),g=wn(a),v=sh(h,g),x=ah(h,g)+1;return Br(h,v,x).join("")}function kF(i,a,d){if(i=Ze(i),i&&(d||a===n))return i.slice(0,ch(i)+1);if(!i||!(a=Wt(a)))return i;var h=wn(i),g=ah(h,wn(a))+1;return Br(h,0,g).join("")}function SF(i,a,d){if(i=Ze(i),i&&(d||a===n))return i.replace(Wl,"");if(!i||!(a=Wt(a)))return i;var h=wn(i),g=sh(h,wn(a));return Br(h,g).join("")}function EF(i,a){var d=T,h=z;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}i=Ze(i);var v=i.length;if(Bo(i)){var x=wn(i);v=x.length}if(d>=v)return i;var N=d-Ao(h);if(N<1)return h;var F=x?Br(x,0,N).join(""):i.slice(0,N);if(g===n)return F+h;if(x&&(N+=F.length-N),Hc(g)){if(i.slice(N).search(g)){var H,j=F;for(g.global||(g=lc(g.source,Ze(Tp.exec(g))+"g")),g.lastIndex=0;H=g.exec(j);)var Y=H.index;F=F.slice(0,Y===n?N:Y)}}else if(i.indexOf(Wt(g),N)!=N){var ne=F.lastIndexOf(g);ne>-1&&(F=F.slice(0,ne))}return F+h}function TF(i){return i=Ze(i),i&<.test(i)?i.replace(kp,nA):i}var BF=Mo(function(i,a,d){return i+(d?" ":"")+a.toUpperCase()}),Kc=Jh("toUpperCase");function Yf(i,a,d){return i=Ze(i),a=d?n:a,a===n?JB(i)?iA(i):$B(i):i.match(a)||[]}var Jf=Ve(function(i,a){try{return Zt(i,n,a)}catch(d){return Wc(d)?d:new xe(d)}}),AF=qn(function(i,a){return Jt(a,function(d){d=Rn(d),Hn(i,d,Zc(i[d],i))}),i});function NF(i){var a=i==null?0:i.length,d=he();return i=a?Ye(i,function(h){if(typeof h[1]!="function")throw new Xt(c);return[d(h[0]),h[1]]}):[],Ve(function(h){for(var g=-1;++g<a;){var v=i[g];if(Zt(v[0],this,h))return Zt(v[1],this,h)}})}function VF(i){return nN(en(i,y))}function Yc(i){return function(){return i}}function PF(i,a){return i==null||i!==i?a:i}var DF=Qh(),FF=Qh(!0);function Mt(i){return i}function Jc(i){return Ah(typeof i=="function"?i:en(i,y))}function RF(i){return Vh(en(i,y))}function MF(i,a){return Ph(i,en(a,y))}var IF=Ve(function(i,a){return function(d){return Wi(d,i,a)}}),LF=Ve(function(i,a){return function(d){return Wi(i,d,a)}});function Xc(i,a,d){var h=pt(a),g=oa(a,h);d==null&&!(Qe(a)&&(g.length||!h.length))&&(d=a,a=i,i=this,g=oa(a,pt(a)));var v=!(Qe(d)&&"chain"in d)||!!d.chain,x=Yn(i);return Jt(g,function(N){var F=a[N];i[N]=F,x&&(i.prototype[N]=function(){var H=this.__chain__;if(v||H){var j=i(this.__wrapped__),Y=j.__actions__=Dt(this.__actions__);return Y.push({func:F,args:arguments,thisArg:i}),j.__chain__=H,j}return F.apply(i,br([this.value()],arguments))})}),i}function OF(){return ft._===this&&(ft._=uA),this}function Qc(){}function GF(i){return i=Te(i),Ve(function(a){return Dh(a,i)})}var zF=Nc(Ye),$F=Nc(eh),ZF=Nc(tc);function Xf(i){return Ic(i)?nc(Rn(i)):vN(i)}function UF(i){return function(a){return i==null?n:Xr(i,a)}}var WF=tf(),HF=tf(!0);function ed(){return[]}function td(){return!1}function jF(){return{}}function qF(){return""}function KF(){return!0}function YF(i,a){if(i=Te(i),i<1||i>we)return[];var d=ht,h=wt(i,ht);a=he(a),i-=ht;for(var g=ic(h,a);++d<i;)a(d);return g}function JF(i){return ke(i)?Ye(i,Rn):Ht(i)?[i]:Dt(_f(Ze(i)))}function XF(i){var a=++cA;return Ze(i)+a}var QF=da(function(i,a){return i+a},0),eR=Vc("ceil"),tR=da(function(i,a){return i/a},1),nR=Vc("floor");function rR(i){return i&&i.length?ra(i,Mt,gc):n}function oR(i,a){return i&&i.length?ra(i,he(a,2),gc):n}function iR(i){return rh(i,Mt)}function sR(i,a){return rh(i,he(a,2))}function aR(i){return i&&i.length?ra(i,Mt,Cc):n}function lR(i,a){return i&&i.length?ra(i,he(a,2),Cc):n}var cR=da(function(i,a){return i*a},1),dR=Vc("round"),uR=da(function(i,a){return i-a},0);function pR(i){return i&&i.length?oc(i,Mt):0}function hR(i,a){return i&&i.length?oc(i,he(a,2)):0}return _.after=RP,_.ary=Af,_.assign=bD,_.assignIn=Zf,_.assignInWith=xa,_.assignWith=xD,_.at=kD,_.before=Nf,_.bind=Zc,_.bindAll=AF,_.bindKey=Vf,_.castArray=jP,_.chain=Ef,_.chunk=nV,_.compact=rV,_.concat=oV,_.cond=NF,_.conforms=VF,_.constant=Yc,_.countBy=pP,_.create=SD,_.curry=Pf,_.curryRight=Df,_.debounce=Ff,_.defaults=ED,_.defaultsDeep=TD,_.defer=MP,_.delay=IP,_.difference=iV,_.differenceBy=sV,_.differenceWith=aV,_.drop=lV,_.dropRight=cV,_.dropRightWhile=dV,_.dropWhile=uV,_.fill=pV,_.filter=fP,_.flatMap=yP,_.flatMapDeep=_P,_.flatMapDepth=vP,_.flatten=bf,_.flattenDeep=hV,_.flattenDepth=fV,_.flip=LP,_.flow=DF,_.flowRight=FF,_.fromPairs=mV,_.functions=FD,_.functionsIn=RD,_.groupBy=CP,_.initial=yV,_.intersection=_V,_.intersectionBy=vV,_.intersectionWith=CV,_.invert=ID,_.invertBy=LD,_.invokeMap=bP,_.iteratee=Jc,_.keyBy=xP,_.keys=pt,_.keysIn=Rt,_.map=ya,_.mapKeys=GD,_.mapValues=zD,_.matches=RF,_.matchesProperty=MF,_.memoize=va,_.merge=$D,_.mergeWith=Uf,_.method=IF,_.methodOf=LF,_.mixin=Xc,_.negate=Ca,_.nthArg=GF,_.omit=ZD,_.omitBy=UD,_.once=OP,_.orderBy=kP,_.over=zF,_.overArgs=GP,_.overEvery=$F,_.overSome=ZF,_.partial=Uc,_.partialRight=Rf,_.partition=SP,_.pick=WD,_.pickBy=Wf,_.property=Xf,_.propertyOf=UF,_.pull=kV,_.pullAll=kf,_.pullAllBy=SV,_.pullAllWith=EV,_.pullAt=TV,_.range=WF,_.rangeRight=HF,_.rearg=zP,_.reject=BP,_.remove=BV,_.rest=$P,_.reverse=zc,_.sampleSize=NP,_.set=jD,_.setWith=qD,_.shuffle=VP,_.slice=AV,_.sortBy=FP,_.sortedUniq=MV,_.sortedUniqBy=IV,_.split=yF,_.spread=ZP,_.tail=LV,_.take=OV,_.takeRight=GV,_.takeRightWhile=zV,_.takeWhile=$V,_.tap=rP,_.throttle=UP,_.thru=ga,_.toArray=Gf,_.toPairs=Hf,_.toPairsIn=jf,_.toPath=JF,_.toPlainObject=$f,_.transform=KD,_.unary=WP,_.union=ZV,_.unionBy=UV,_.unionWith=WV,_.uniq=HV,_.uniqBy=jV,_.uniqWith=qV,_.unset=YD,_.unzip=$c,_.unzipWith=Sf,_.update=JD,_.updateWith=XD,_.values=Oo,_.valuesIn=QD,_.without=KV,_.words=Yf,_.wrap=HP,_.xor=YV,_.xorBy=JV,_.xorWith=XV,_.zip=QV,_.zipObject=eP,_.zipObjectDeep=tP,_.zipWith=nP,_.entries=Hf,_.entriesIn=jf,_.extend=Zf,_.extendWith=xa,Xc(_,_),_.add=QF,_.attempt=Jf,_.camelCase=rF,_.capitalize=qf,_.ceil=eR,_.clamp=eF,_.clone=qP,_.cloneDeep=YP,_.cloneDeepWith=JP,_.cloneWith=KP,_.conformsTo=XP,_.deburr=Kf,_.defaultTo=PF,_.divide=tR,_.endsWith=oF,_.eq=xn,_.escape=iF,_.escapeRegExp=sF,_.every=hP,_.find=mP,_.findIndex=Cf,_.findKey=BD,_.findLast=gP,_.findLastIndex=wf,_.findLastKey=AD,_.floor=nR,_.forEach=Tf,_.forEachRight=Bf,_.forIn=ND,_.forInRight=VD,_.forOwn=PD,_.forOwnRight=DD,_.get=jc,_.gt=QP,_.gte=eD,_.has=MD,_.hasIn=qc,_.head=xf,_.identity=Mt,_.includes=wP,_.indexOf=gV,_.inRange=tF,_.invoke=OD,_.isArguments=to,_.isArray=ke,_.isArrayBuffer=tD,_.isArrayLike=Ft,_.isArrayLikeObject=nt,_.isBoolean=nD,_.isBuffer=Ar,_.isDate=rD,_.isElement=oD,_.isEmpty=iD,_.isEqual=sD,_.isEqualWith=aD,_.isError=Wc,_.isFinite=lD,_.isFunction=Yn,_.isInteger=Mf,_.isLength=wa,_.isMap=If,_.isMatch=cD,_.isMatchWith=dD,_.isNaN=uD,_.isNative=pD,_.isNil=fD,_.isNull=hD,_.isNumber=Lf,_.isObject=Qe,_.isObjectLike=et,_.isPlainObject=Ji,_.isRegExp=Hc,_.isSafeInteger=mD,_.isSet=Of,_.isString=ba,_.isSymbol=Ht,_.isTypedArray=Lo,_.isUndefined=gD,_.isWeakMap=yD,_.isWeakSet=_D,_.join=wV,_.kebabCase=aF,_.last=nn,_.lastIndexOf=bV,_.lowerCase=lF,_.lowerFirst=cF,_.lt=vD,_.lte=CD,_.max=rR,_.maxBy=oR,_.mean=iR,_.meanBy=sR,_.min=aR,_.minBy=lR,_.stubArray=ed,_.stubFalse=td,_.stubObject=jF,_.stubString=qF,_.stubTrue=KF,_.multiply=cR,_.nth=xV,_.noConflict=OF,_.noop=Qc,_.now=_a,_.pad=dF,_.padEnd=uF,_.padStart=pF,_.parseInt=hF,_.random=nF,_.reduce=EP,_.reduceRight=TP,_.repeat=fF,_.replace=mF,_.result=HD,_.round=dR,_.runInContext=D,_.sample=AP,_.size=PP,_.snakeCase=gF,_.some=DP,_.sortedIndex=NV,_.sortedIndexBy=VV,_.sortedIndexOf=PV,_.sortedLastIndex=DV,_.sortedLastIndexBy=FV,_.sortedLastIndexOf=RV,_.startCase=_F,_.startsWith=vF,_.subtract=uR,_.sum=pR,_.sumBy=hR,_.template=CF,_.times=YF,_.toFinite=Jn,_.toInteger=Te,_.toLength=zf,_.toLower=wF,_.toNumber=rn,_.toSafeInteger=wD,_.toString=Ze,_.toUpper=bF,_.trim=xF,_.trimEnd=kF,_.trimStart=SF,_.truncate=EF,_.unescape=TF,_.uniqueId=XF,_.upperCase=BF,_.upperFirst=Kc,_.each=Tf,_.eachRight=Bf,_.first=xf,Xc(_,function(){var i={};return Dn(_,function(a,d){Ue.call(_.prototype,d)||(i[d]=a)}),i}(),{chain:!1}),_.VERSION=o,Jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){_[i].placeholder=_}),Jt(["drop","take"],function(i,a){De.prototype[i]=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:i+(h.__dir__<0?"Right":"")}),h},De.prototype[i+"Right"]=function(d){return this.reverse()[i](d).reverse()}}),Jt(["filter","map","takeWhile"],function(i,a){var d=a+1,h=d==A||d==J;De.prototype[i]=function(g){var v=this.clone();return v.__iteratees__.push({iteratee:he(g,3),type:d}),v.__filtered__=v.__filtered__||h,v}}),Jt(["head","last"],function(i,a){var d="take"+(a?"Right":"");De.prototype[i]=function(){return this[d](1).value()[0]}}),Jt(["initial","tail"],function(i,a){var d="drop"+(a?"":"Right");De.prototype[i]=function(){return this.__filtered__?new De(this):this[d](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(d){return Wi(d,i,a)})}),De.prototype.reject=function(i){return this.filter(Ca(he(i)))},De.prototype.slice=function(i,a){i=Te(i);var d=this;return d.__filtered__&&(i>0||a<0)?new De(d):(i<0?d=d.takeRight(-i):i&&(d=d.drop(i)),a!==n&&(a=Te(a),d=a<0?d.dropRight(-a):d.take(a-i)),d)},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 d=/^(?:filter|find|map|reject)|While$/.test(a),h=/^(?:head|last)$/.test(a),g=_[h?"take"+(a=="last"?"Right":""):a],v=h||/^find/.test(a);g&&(_.prototype[a]=function(){var x=this.__wrapped__,N=h?[1]:arguments,F=x instanceof De,H=N[0],j=F||ke(x),Y=function(Pe){var Fe=g.apply(_,br([Pe],N));return h&&ne?Fe[0]:Fe};j&&d&&typeof H=="function"&&H.length!=1&&(F=j=!1);var ne=this.__chain__,ce=!!this.__actions__.length,me=v&&!ne,Ne=F&&!ce;if(!v&&j){x=Ne?x:new De(this);var ge=i.apply(x,N);return ge.__actions__.push({func:ga,args:[Y],thisArg:n}),new Qt(ge,ne)}return me&&Ne?i.apply(this,N):(ge=this.thru(Y),me?h?ge.value()[0]:ge.value():ge)})}),Jt(["pop","push","shift","sort","splice","unshift"],function(i){var a=$s[i],d=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",h=/^(?:pop|shift)$/.test(i);_.prototype[i]=function(){var g=arguments;if(h&&!this.__chain__){var v=this.value();return a.apply(ke(v)?v:[],g)}return this[d](function(x){return a.apply(ke(x)?x:[],g)})}}),Dn(De.prototype,function(i,a){var d=_[a];if(d){var h=d.name+"";Ue.call(Do,h)||(Do[h]=[]),Do[h].push({name:a,func:d})}}),Do[ca(n,C).name]=[{name:"wrapper",func:n}],De.prototype.clone=TA,De.prototype.reverse=BA,De.prototype.value=AA,_.prototype.at=oP,_.prototype.chain=iP,_.prototype.commit=sP,_.prototype.next=aP,_.prototype.plant=cP,_.prototype.reverse=dP,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=uP,_.prototype.first=_.prototype.head,Li&&(_.prototype[Li]=lP),_},No=sA();jr?((jr.exports=No)._=No,Jl._=No):ft._=No}).call(Go)}(Bs,Bs.exports);var Oe=Bs.exports;const YE={class:"grid-overlay-container"},ap=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",YE,[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))]))}}),JE={},XE={class:"grid-overlay-container"};function QE(t,e){return r.openBlock(),r.createElementBlock("div",XE,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const lp=Ts(JE,[["render",QE]]);async function eT(t,e){throw Error("not implemented")}function tT(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function nT(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const s=tT(t[o].spec);for(const l of s){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=Nd(l),u=t.findIndex(p=>Oe.isEqual(p.id,c));if(u===-1)throw console.error("axis not found",o,c,t),Error("axis not found");n.push({columnIdx:o,axisIdx:u})}}return n}const cp=(t,e)=>(t+e).toString();function rT(t,e,n,o,s,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let u=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===c.axisIdx&&(u=y),l[y]===c.columnIdx&&(p=y);const f=(()=>{const B=o[u].data.filter(E=>E!==null);return Array.from(new Set(B))})();f.sort(),p>u?(n.splice(p,1),n.splice(u,1)):(n.splice(u,1),n.splice(p,1));const m=oT(s,o,u,p,f,e.rows);for(let y=0;y<f.length;++y){const B=f[y],E=B+"@"+y;n.push({colId:E,field:cp(o.length,y),headerName:B,valueFormatter:up})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function oT(t,e,n,o,s,l){const c=new Map;let u=0;for(let f=0;f<l;f++){const m={};for(let R=0;R<e.length;++R){if(R===n||R===o)continue;const L=t[R].toString();m[L]=e[R].data[f]}let y;const B=no(Object.values(m))??"";c.has(B)?y=c.get(B):(c.set(B,m),y=m,y.id=u.toString(),u++);const E=s.indexOf(e[n].data[f]);if(E===-1)throw Error("index not found");const P=cp(e.length,E);y[P]=e[o].data[f]}return Array.from(c.values())}function iT(t){return no(t)}function dp(t){return JSON.parse(t)}const up=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function sT(t,e,n){var s,l,c;const o=iT(e);return{colId:o,field:t.toString(),headerName:((l=(s=e.spec.annotations)==null?void 0:s["pl7.app/label"])==null?void 0:l.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(o))??((c=e.spec.annotations)==null?void 0:c["pl7.app/table/visibility"])==="optional",valueFormatter:up,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 pp(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 hp(t){const e=[];return cs(t,n=>(e.push(n),n)),e}async function aT(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 lT(t,e,n){const o=hp(n),l=(await aT(t,e,o)).filter(c=>!Oe.find(o,u=>c.columnId===u.columnId));return l.length===0?n:{type:"outer",primary:n,secondary:l.map(c=>({type:"column",column:c}))}}async function cT(t,e,n,o){const s=n.filter(m=>m.type!=="Bytes"),l=hp(o),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 B=0;B<y.length;++B){const E=Oe.findIndex(s,P=>Oe.isEqual(P,y[B]));E===-1||u[E]||(y.length===1&&l[m].spec.name==="pl7.app/label"?(c[E]=[[m,B]],u[E]=l[m].columnId):c[E].push([m,B]))}}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,B]of c[m]){const E=await t.getUniqueValues(e,{columnId:l[y].columnId,...!u[m]&&{axis:Oe.cloneDeep(s[m])},filters:[],limit:p});if(E.overflow){u.splice(m,1),c.splice(m,1),s.splice(m,1);continue e}const P=E.values.type;for(const R of E.values.data)if(!(Ad(R,P)||R===null)&&(f[m].add(pp(R,P)),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 B=[...f[y]].map(P=>({value:P,text:P.toString()})),E=B[0].value;return{axis:Oe.cloneDeep(m),...u[y]&&{column:u[y]},options:B,defaultValue:E}})}function dT(t,e,n,o){const s=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const u=[],p=(o++).toString();for(const m of n)u.push(e[m].data[c]);const f={key:u,id:p};for(let m=0;m<s;++m){const y=t[m].toString(),B=e[m].data[c],E=e[m].type;xg(e[m].absent,c)?f[y]=void 0:Ad(B,E)||B===null?f[y]=null:f[y]=pp(B,E)}l.push(f)}return l}const uT=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function pT(t,e,n,o){const s=await t.getSpec(e);let l=s.findIndex(C=>C.type==="column");l===-1&&(l=s.length);const c=[...s.keys()].filter(C=>!Oe.find(n,V=>Oe.isEqual(V.axis,s[C].id)||Oe.isEqual(V.column,s[C].id))).sort((C,V)=>{var O,K;if(s[C].type!==s[V].type)return s[C].type==="axis"?-1:1;const q=(O=s[C].spec.annotations)==null?void 0:O["pl7.app/table/orderPriority"],X=(K=s[V].spec.annotations)==null?void 0:K["pl7.app/table/orderPriority"];return q===void 0?X===void 0?0:1:X===void 0?-1:Number(X)-Number(q)}),u=Oe.cloneDeep(c),p=nT(s,c);for(let C=c.length-1;C>=0;--C){const V=c[C];if(!uT(s[V]))continue;const q=$a(s[V].spec.axesSpec)[0],X=Oe.findIndex(c,O=>Oe.isEqual(s[O].id,q));if(X!==-1){c[X]=V;for(const O of p)O.axisIdx===V&&(O.axisIdx=X);c.splice(C,1),u.splice(C,1)}}const f=await t.getShape(e),m=f.rows,y=u.map(C=>sT(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 rT(p,f,y,await t.getData(e,c),u,c);const B=[...c],E=new Map;for(let C=0;C<l;++C)E.set(C,-1);for(let C=0;C<B.length;++C){const V=B[C];E.has(V)&&E.set(V,C)}for(const[C,V]of E)V===-1&&(E.set(C,B.length),B.push(C));const P=[];for(let C=0;C<l;++C){const V=E.get(C);if(V===void 0||V===-1)throw new Error("assertion exception");P.push(V)}let R;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(R&&!Oe.isEqual(R.request.sortModel,C.request.sortModel)){R=void 0,C.api.setGridOption("loading",!0),C.success({rowData:[],rowCount:0});return}R=C;let V=0,q=[];if(m>0&&C.request.startRow!==void 0&&C.request.endRow!==void 0&&(V=Math.min(m,C.request.endRow)-C.request.startRow,V>0)){const X=await t.getData(e,B,{offset:C.request.startRow,length:V});q=dT(u,X,P,C.request.startRow)}C.success({rowData:q,rowCount:m}),C.api.autoSizeAllColumns(),C.api.setGridOption("loading",!1)}catch(V){C.api.setGridOption("loading",!0),C.fail(),console.trace(V)}}}}}const hT={class:"ap-ag-data-table-container"},fT={key:0,class:"ap-ag-data-table-sheets"},mT=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(S,k)=>{if(S.sourceType!=="pframe"||!S.pFrame||!S.join||k&&k.sourceType==="pframe"&&Oe.isEqual(S.pFrame,k.pFrame)&&Oe.isEqual(S.join,k.join))return;const T=window.platforma;if(!T)throw Error("platforma not set");const z=T.pFrameDriver;if(!z)throw Error("platforma.pFrameDriver not set");const Z=await lT(z,S.pFrame,S.join),I=n.value;I.pTableParams||(I.pTableParams={sorting:[],filters:[]}),I.pTableParams.join=Z,n.value=I});const c=fp(()=>s.value.sourceType,async S=>{var T;const k=s.value.sourceType;switch(k){case"pframe":{const z=window.platforma;if(!z)throw Error("platforma not set");const Z=z.pFrameDriver;if(!Z)throw Error("platforma.pFrameDriver not set");if(!s.value.pFrame)return[];const I=s.value.pFrame,A=(T=n.value.pTableParams)==null?void 0:T.join;return A?await cT(Z,I,s.value.sheetAxes,A):[]}case"ptable":return s.value.sheets??[];case"xsv":return[];default:throw Error(`unsupported source type: ${k}`)}});function u(S){if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return(S==null?void 0:S.sortModel.map(k=>{const{spec:T,...z}=dp(k.colId);return{column:z,ascending:k.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const p=r.computed({get:()=>{const S=n.value;return{columnOrder:S.gridState.columnOrder,sort:S.gridState.sort,columnVisibility:S.gridState.columnVisibility}},set:S=>{const k=n.value,T=E.value.rowModelType==="clientSide"?void 0:u(S.sort);k.gridState={...k.gridState,...S},(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(k.pTableParams||(k.pTableParams={sorting:[],filters:[]}),k.pTableParams.sorting=T),n.value=k}}),f=S=>no(S);function m(S){var k;if(!(s.value.sourceType!=="ptable"&&s.value.sourceType!=="pframe"))return((k=c.value)==null?void 0:k.map(T=>({type:"bySingleColumn",column:T.column?{type:"column",id:T.column}:{type:"axis",id:T.axis},predicate:{operator:"Equal",reference:S[f(T.axis)]}})))??[]}const y=r.computed({get:()=>n.value.gridState.sheets??{},set:S=>{const k=m(S),T=n.value;T.gridState.sheets=S,(s.value.sourceType==="ptable"||s.value.sourceType==="pframe")&&(T.pTableParams||(T.pTableParams={sorting:[],filters:[]}),T.pTableParams.filters=k),n.value=T}});r.watch(()=>[s.value,c.value],(S,k)=>{const[T,z]=S;if(!z)return;if(k){const[I,A]=k;if((T.sourceType==="ptable"||T.sourceType==="pframe")&&T.sourceType===(I==null?void 0:I.sourceType)&&Oe.isEqual(z,A))return}if(T.sourceType!=="ptable"&&T.sourceType!=="pframe"){y.value={};return}const Z=y.value;for(const I of z){const A=f(I.axis);Z[A]||(Z[A]=I.defaultValue??I.options[0].value)}y.value=Z},{immediate:!0});const B=r.shallowRef(),E=r.ref({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:p.value,autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:S=>{S.api.autoSizeAllColumns()},onRowDoubleClicked:S=>{S.data&&l("onRowDoubleClicked",S.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,cacheBlockSize:100,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:S=>S.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:ap,noRowsOverlayComponent:lp,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"}}),P=S=>{const k=S.api;B.value=new Proxy(k,{get(T,z,Z){switch(z){case"setGridOption":return(I,A)=>{const G=E.value;G[I]=A,E.value=G,k.updateGridOptions(G)};case"updateGridOptions":return I=>{E.value={...E.value,...I},k.updateGridOptions(I)};default:return Reflect.get(T,z,Z)}}})},R=S=>({columnOrder:S.columnOrder,sort:S.sort,columnVisibility:S.columnVisibility??(S.columnOrder?{hiddenColIds:[]}:void 0)}),L=S=>{E.value.initialState=p.value=R(S.state),S.api.autoSizeAllColumns()},C=()=>{E.value.initialState=p.value=R(B.value.getState()),B.value=void 0},V=r.ref(0);r.watch(()=>[B.value,p.value],(S,k)=>{if(Oe.isEqual(S,k))return;const[T,z]=S;if(!T)return;const Z=R(T.getState());Oe.isEqual(z,Z)||(E.value.initialState=z,++V.value)}),r.watch(()=>E.value,(S,k)=>{var T;if(k&&(S.rowModelType!=k.rowModelType&&++V.value,!Oe.isEqual(S.columnDefs,k.columnDefs)&&S.columnDefs)){const z=A=>!("children"in A),Z=(T=S.columnDefs)==null?void 0:T.filter(z),I=Z==null?void 0:Z.map(A=>A.colId).filter(A=>A!==void 0).map(A=>dp(A));l("columnsChanged",I??[])}});const q=(S,k)=>{var z;const T=y.value;T[S]!==k&&(T[S]=k,y.value=T,(z=B.value)==null||z.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}}))},X=window.platforma;if(!X)throw Error("platforma not set");const O=X.pFrameDriver;if(!O)throw Error("platforma.pFrameDriver not set");const K=X.blobDriver;if(!K)throw Error("platforma.blobDriver not set");let W;return r.watch(()=>[B.value,s.value,c.value],async S=>{var I,A;const[k,T,z]=S;if(!k||Oe.isEqual(T,W))return;W=T;const Z=T.sourceType;switch(Z){case"pframe":case"ptable":{const G=T.pTable;if(!G||!z)return k.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const J=(A=(I=p.value)==null?void 0:I.columnVisibility)==null?void 0:A.hiddenColIds,pe=await pT(O,G,z,J);return k.updateGridOptions({loading:pe.rowModelType!=="clientSide",loadingOverlayComponentParams:{notReady:!1},...pe})}case"xsv":{const G=T.xsvFile;if(!(G!=null&&G.ok)||!G.value)return k.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[]});const J=await eT(K,G.value);return k.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...J})}default:throw Error(`unsupported source type: ${Z}`)}}),(S,k)=>(r.openBlock(),r.createElementBlock("div",hT,[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",fT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(c).value,(T,z)=>(r.openBlock(),r.createBlock(r.unref(Mu),{key:z,"model-value":y.value[f(T.axis)],options:T.options,"onUpdate:modelValue":Z=>q(f(T.axis),Z)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):r.createCommentVNode("",!0)]),_:1}),(r.openBlock(),r.createBlock(r.unref(lm.AgGridVue),{key:V.value,theme:r.unref(eu),class:"ap-ag-data-table-grid","grid-options":E.value,onGridReady:P,onStateUpdated:L,onGridPreDestroyed:C},null,8,["theme","grid-options"]))]))}}),[["__scopeId","data-v-4c628516"]]),gT={key:0,class:"d-flex gap-10 flex-column"},yT={key:0},_T=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),c=k=>no(k.id),u=r.computed(()=>o.value.filter(k=>{const T=k.type;switch(T){case"axis":return k.spec.type!=="Bytes";case"column":return k.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${T}`)}}).map(k=>({column:k,id:c(k)}))),p=r.computed(()=>{const k=s.value??[],T={};for(const{column:z,id:Z}of u.value){const I=Oe.find(k,A=>Oe.isEqual(A.column.id,z.id));I!==void 0&&(T[Z]=I.allowedFilterTypes)}return T}),f=r.computed(()=>{const k=l.value??[],T={};for(const{column:z,id:Z}of u.value){const I=Oe.find(k,A=>Oe.isEqual(A.column.id,z.id));I!==void 0&&(T[Z]=I.default)}return T}),m=k=>k!==void 0?k:f.value,y=r.reactive({state:m(e.value.state)});r.watch(()=>e.value,k=>{Oe.isEqual(y.state,k.state)||(y.state=m(k.state))}),r.watch(()=>u.value,k=>{if(y.state!==void 0&&k.length===0)return;const T=y.state??{},z={};for(const{id:Z}of k)T[Z]!==void 0&&(z[Z]=T[Z]);y.state=z},{immediate:!0});const B=k=>{switch(k){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: ${k}`)}},E=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],P=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"],R=r.computed(()=>{const k=p.value,T={};for(const{column:z,id:Z}of u.value){let A=(z.type==="column"?z.spec.valueType:z.spec.type)==="String"?P:E;const G=k[Z];G!==void 0&&(A=A.filter(J=>G.includes(J))),T[Z]=A.map(J=>({value:J,text:B(J)}))}return T}),L=r.computed(()=>Oe.some(Object.values(R.value),k=>k.length>0)),C=k=>{const T=k.type;switch(T){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return k.reference;case"number_between":return k.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return k.reference;default:throw Error(`unsupported filter type: ${T}`)}},V=(k,T)=>{switch(k){case"isNotNA":case"isNA":return{type:k};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:k,reference:typeof T=="number"?T:0};case"number_between":return{type:k,lowerBound:typeof T=="number"?T: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:k,reference:typeof T=="string"?T:""};case"string_containsFuzzyMatch":return{type:k,reference:typeof T=="string"?T:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${k}`)}},q=(k,T)=>{const z=y.state[k];y.state[k]=V(T,C(z))},X=(k,T)=>{T?y.state[k]=f.value[k]??V(R.value[k][0].value):delete y.state[k]},O=k=>{const T=Oe.uniq(k);return T.sort(),T.map(z=>({value:z,text:z}))},K=k=>{const T=Number(k);if(!Number.isFinite(T))throw Error("Model value is not a number.");return T},W=k=>{const T=k.type;switch(T){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":case"string_equals":return{operator:"Equal",reference:k.reference};case"number_notEquals":case"string_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:k.reference}};case"number_greaterThan":return{operator:"Greater",reference:k.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:k.reference};case"number_lessThan":return{operator:"Less",reference:k.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:k.reference};case"number_between":return{operator:"And",operands:[{operator:k.includeLowerBound?"GreaterOrEqual":"Greater",reference:k.lowerBound},{operator:k.includeUpperBound?"LessOrEqual":"Less",reference:k.upperBound}]};case"string_contains":return{operator:"StringContains",substring:k.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:"StringContains",substring:k.reference}};case"string_matches":return{operator:"Matches",regex:k.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:k.reference}};case"string_containsFuzzyMatch":return{operator:"StringContainsFuzzy",reference:k.reference,maxEdits:k.maxEdits,substitutionsOnly:k.substitutionsOnly,wildcard:k.wildcard};default:throw Error(`unsupported filter type: ${T}`)}},S=k=>u.value.map(({column:T,id:z})=>{if(!(z in k))return;const Z=W(k[z]),{spec:I,...A}=T;return{type:"bySingleColumn",column:A,predicate:Z}}).filter(T=>T!==void 0);return r.watch(()=>y,k=>{Oe.isEqual(k.state,e.value.state)||(e.value={state:Oe.cloneDeep(k.state),filters:S(k.state)})},{immediate:!0,deep:!0}),(k,T)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,({column:z,id:Z},I)=>{var A,G,J,pe,we,Ct,Bt,ht,_r,Pn,vr,$n,Hr,Ps;return r.openBlock(),r.createElementBlock("div",{key:Z},[R.value[Z].length>0?(r.openBlock(),r.createElementBlock("form",gT,[r.createVNode(r.unref(Iu),{"model-value":!!y.state[Z],"onUpdate:modelValue":Ge=>X(Z,Ge)},{default:r.withCtx(()=>{var Ge,Cr;return[r.createTextVNode(r.toDisplayString(((Cr=(Ge=z.spec.annotations)==null?void 0:Ge["pl7.app/label"])==null?void 0:Cr.trim())??"Unlabeled "+z.type+" "+I.toString()),1)]}),_:2},1032,["model-value","onUpdate:modelValue"]),r.createElementVNode("div",{class:r.normalizeClass(["controls d-flex gap-10 flex-column",{open:!!y.state[Z]}])},[y.state[Z]?(r.openBlock(),r.createBlock(r.unref(ui),{key:0,"model-value":y.state[Z].type,options:R.value[Z],label:"Predicate","onUpdate:modelValue":Ge=>q(Z,Ge)},null,8,["model-value","options","onUpdate:modelValue"])):r.createCommentVNode("",!0),((A=y.state[Z])==null?void 0:A.type)==="number_equals"||((G=y.state[Z])==null?void 0:G.type)==="number_notEquals"||((J=y.state[Z])==null?void 0:J.type)==="number_lessThan"||((pe=y.state[Z])==null?void 0:pe.type)==="number_lessThanOrEqualTo"||((we=y.state[Z])==null?void 0:we.type)==="number_greaterThan"||((Ct=y.state[Z])==null?void 0:Ct.type)==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(Lr),{key:1,modelValue:y.state[Z].reference,"onUpdate:modelValue":Ge=>y.state[Z].reference=Ge,parse:K,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Bt=y.state[Z])==null?void 0:Bt.type)==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createVNode(r.unref(Lr),{modelValue:y.state[Z].lowerBound,"onUpdate:modelValue":Ge=>y.state[Z].lowerBound=Ge,parse:K,label:"Lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[Z].includeLowerBound,"onUpdate:modelValue":Ge=>y.state[Z].includeLowerBound=Ge,label:"Include lower bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(Lr),{modelValue:y.state[Z].upperBound,"onUpdate:modelValue":Ge=>y.state[Z].upperBound=Ge,parse:K,label:"Upper bound"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(gs),{modelValue:y.state[Z].includeUpperBound,"onUpdate:modelValue":Ge=>y.state[Z].includeUpperBound=Ge,label:"Include upper bound"},null,8,["modelValue","onUpdate:modelValue"])],64)):r.createCommentVNode("",!0),((ht=y.state[Z])==null?void 0:ht.type)==="string_equals"||((_r=y.state[Z])==null?void 0:_r.type)==="string_notEquals"||((Pn=y.state[Z])==null?void 0:Pn.type)==="string_contains"||((vr=y.state[Z])==null?void 0:vr.type)==="string_doesNotContain"||(($n=y.state[Z])==null?void 0:$n.type)==="string_matches"||((Hr=y.state[Z])==null?void 0:Hr.type)==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(Lr),{key:3,modelValue:y.state[Z].reference,"onUpdate:modelValue":Ge=>y.state[Z].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"])):r.createCommentVNode("",!0),((Ps=y.state[Z])==null?void 0:Ps.type)==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(Lr),{modelValue:y.state[Z].reference,"onUpdate:modelValue":Ge=>y.state[Z].reference=Ge,label:"Reference value"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(op),{modelValue:y.state[Z].maxEdits,"onUpdate:modelValue":Ge=>y.state[Z].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[Z].substitutionsOnly,"onUpdate:modelValue":Ge=>y.state[Z].substitutionsOnly=Ge,label:"Substitutions only"},null,8,["modelValue","onUpdate:modelValue"]),r.createVNode(r.unref(ui),{modelValue:y.state[Z].wildcard,"onUpdate:modelValue":Ge=>y.state[Z].wildcard=Ge,options:O(y.state[Z].reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","onUpdate:modelValue","options"])],64)):r.createCommentVNode("",!0)],2)])):r.createCommentVNode("",!0)])}),128)),L.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",yT,"No filters applicable"))],64))}}),[["__scopeId","data-v-b30bf5ef"]]),vT={key:1,class:"alert-error"},CT={key:2},wT=r.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(t){const e=t,n=r.computed(()=>e.valueOrError&&e.valueOrError.ok?e.valueOrError.value:void 0),o=r.computed(()=>e.valueOrError&&!e.valueOrError.ok?e.valueOrError.errors:void 0),s=r.computed(()=>n.value===void 0&&o.value===void 0);return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[n.value!==void 0?r.renderSlot(l.$slots,"default",r.normalizeProps(r.mergeProps({key:0},{value:n.value}))):r.createCommentVNode("",!0),o.value?(r.openBlock(),r.createElementBlock("div",vT,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),s.value?(r.openBlock(),r.createElementBlock("div",CT,"Unresolved")):r.createCommentVNode("",!0)]))}}),bT={style:{height:"100%"}},xT=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function s(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(c,u)=>(r.openBlock(),r.createElementBlock("div",bT,[r.createVNode(r.unref(np),{"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 kT(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 ST(t){const e=Symbol();return()=>(As.has(e)||As.set(e,kT(e,t)),As.get(e))}function ET(t){return r.computed(()=>{try{return md(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function fp(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=um(e);return r.watch(t,async c=>{s.error=void 0,o.value++,l(c).then(u=>{u.ok&&(s.value=u.value)}).catch(u=>{s.value=void 0,s.error=u}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),s}const Co=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,mp=new Set,Nl=typeof process=="object"&&process?process:{},gp=(t,e,n,o)=>{typeof Nl.emitWarning=="function"?Nl.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let Ns=globalThis.AbortController,yp=globalThis.AbortSignal;if(typeof Ns>"u"){yp=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 yp);e()}abort(o){var s,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const c of this.signal._onabort)c(o);(l=(s=this.signal).onabort)==null||l.call(s,o)}}};let t=((vp=Nl.env)==null?void 0:vp.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,gp("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 TT=t=>!mp.has(t),gr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),_p=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 $r=class $r{constructor(e,n){$e(this,"heap");$e(this,"length");if(!w($r,wo))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=_p(e);if(!n)return[];fe($r,wo,!0);const o=new $r(e,n);return fe($r,wo,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};wo=new WeakMap,Le($r,wo,!1);let Vl=$r;const Fl=class Fl{constructor(e){Le(this,te);Le(this,un);Le(this,Ot);Le(this,pn);Le(this,hn);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,fn);Le(this,ot);Le(this,je);Le(this,be);Le(this,Et);Le(this,Gt);Le(this,vt);Le(this,dt);Le(this,mn);Le(this,ut);Le(this,gn);Le(this,yn);Le(this,zt);Le(this,_n);Le(this,yr);Le(this,Tt);Le(this,Zr,()=>{});Le(this,zn,()=>{});Le(this,Ni,()=>{});Le(this,$t,()=>!1);Le(this,Ur,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,Cp,"LRUCache");const{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:u,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:B,maxSize:E=0,maxEntrySize:P=0,sizeCalculation:R,fetchMethod:L,memoMethod:C,noDeleteOnFetchRejection:V,noDeleteOnStaleGet:q,allowStaleOnFetchRejection:X,allowStaleOnFetchAbort:O,ignoreFetchAbort:K}=e;if(n!==0&&!gr(n))throw new TypeError("max option must be a nonnegative integer");const W=n?_p(n):Array;if(!W)throw new Error("invalid max value: "+n);if(fe(this,un,n),fe(this,Ot,E),this.maxEntrySize=P||w(this,Ot),this.sizeCalculation=R,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),L!==void 0&&typeof L!="function")throw new TypeError("fetchMethod must be a function if specified");if(fe(this,bo,L),fe(this,yr,!!L),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 W(n)),fe(this,Gt,new W(n)),fe(this,vt,0),fe(this,dt,0),fe(this,mn,Vl.create(n)),fe(this,st,0),fe(this,fn,0),typeof f=="function"&&fe(this,pn,f),typeof m=="function"?(fe(this,hn,m),fe(this,ut,[])):(fe(this,hn,void 0),fe(this,ut,void 0)),fe(this,_n,!!w(this,pn)),fe(this,Tt,!!w(this,hn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!B,this.noDeleteOnFetchRejection=!!V,this.allowStaleOnFetchRejection=!!X,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!K,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,nm).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!q,this.updateAgeOnGet=!!c,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,un)===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,un)&&!w(this,Ot)){const S="LRU_CACHE_UNBOUNDED";TT(S)&&(mp.add(S),gp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",S,Fl))}}static unsafeExposeInternals(e){return{starts:w(e,yn),ttls:w(e,zt),sizes:w(e,gn),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,vt)},get tail(){return w(e,dt)},free:w(e,mn),isBackgroundFetch:n=>{var o;return le(o=e,te,Ke).call(o,n)},backgroundFetch:(n,o,s,l)=>{var c;return le(c=e,te,Ea).call(c,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,un)}get maxSize(){return w(this,Ot)}get calculatedSize(){return w(this,fn)}get size(){return w(this,st)}get fetchMethod(){return w(this,bo)}get memoMethod(){return w(this,xo)}get dispose(){return w(this,pn)}get disposeAfter(){return w(this,hn)}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])}[(wp=Symbol.iterator,Cp=Symbol.toStringTag,wp)](){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,yn)){const c=w(this,zt)[n],u=w(this,yn)[n];if(c&&u){const p=c-(Co.now()-u);l.ttl=p,l.start=Date.now()}}return w(this,gn)&&(l.size=w(this,gn)[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 c={value:l};if(w(this,zt)&&w(this,yn)){c.ttl=w(this,zt)[n];const u=Co.now()-w(this,yn)[n];c.start=Math.floor(Date.now()-u)}w(this,gn)&&(c.size=w(this,gn)[n]),e.unshift([o,c])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const s=Date.now()-o.start;o.start=Co.now()-s}this.set(n,o.value,o)}}set(e,n,o={}){var B,E,P,R,L;if(n===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:p}=o;let{noUpdateTTL:f=this.noUpdateTTL}=o;const m=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,mn).length!==0?w(this,mn).pop():w(this,st)===w(this,un)?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:V}=C;V!==void 0&&!c&&(w(this,_n)&&((B=w(this,pn))==null||B.call(this,V,e,"set")),w(this,Tt)&&((E=w(this,ut))==null||E.push([V,e,"set"])))}else c||(w(this,_n)&&((P=w(this,pn))==null||P.call(this,C,e,"set")),w(this,Tt)&&((R=w(this,ut))==null||R.push([C,e,"set"])));if(w(this,Ur).call(this,y),w(this,ko).call(this,y,m,p),w(this,be)[y]=n,p){p.set="replace";const V=C&&le(this,te,Ke).call(this,C)?C.__staleWhileFetching:C;V!==void 0&&(p.oldValue=V)}}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)),!c&&w(this,Tt)&&w(this,ut)){const C=w(this,ut);let V;for(;V=C==null?void 0:C.shift();)(L=w(this,hn))==null||L.call(this,...V)}return this}pop(){var e;try{for(;w(this,st);){const n=w(this,be)[w(this,vt)];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,hn))==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 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 o&&w(this,Zr).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:c=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:p=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:B=this.allowStaleOnFetchRejection,ignoreFetchAbort:E=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,context:R,forceRefresh:L=!1,status:C,signal:V}=n;if(!w(this,yr))return C&&(C.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});const q={allowStale:o,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:p,sizeCalculation:f,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:B,allowStaleOnFetchAbort:P,ignoreFetchAbort:E,status:C,signal:V};let X=w(this,ot).get(e);if(X===void 0){C&&(C.fetch="miss");const O=le(this,te,Ea).call(this,e,X,q,R);return O.__returned=O}else{const O=w(this,be)[X];if(le(this,te,Ke).call(this,O)){const T=o&&O.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",T&&(C.returnedStale=!0)),T?O.__staleWhileFetching:O.__returned=O}const K=w(this,$t).call(this,X);if(!L&&!K)return C&&(C.fetch="hit"),le(this,te,Xi).call(this,X),s&&w(this,Zr).call(this,X),C&&w(this,zn).call(this,C,X),O;const W=le(this,te,Ea).call(this,e,X,q,R),k=W.__staleWhileFetching!==void 0&&o;return C&&(C.fetch=K?"stale":"refresh",k&&K&&(C.returnedStale=!0)),k?W.__staleWhileFetching:W.__returned=W}}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,...c}=n,u=this.get(e,c);if(!l&&u!==void 0)return u;const p=o(e,u,{options:c,context:s});return this.set(e,p,c),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,u=w(this,ot).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&&o&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||le(this,te,Pr).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),f?p.__staleWhileFetching:(le(this,te,Xi).call(this,u),s&&w(this,Zr).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,sd).call(this,"delete")}};un=new WeakMap,Ot=new WeakMap,pn=new WeakMap,hn=new WeakMap,bo=new WeakMap,xo=new WeakMap,st=new WeakMap,fn=new WeakMap,ot=new WeakMap,je=new WeakMap,be=new WeakMap,Et=new WeakMap,Gt=new WeakMap,vt=new WeakMap,dt=new WeakMap,mn=new WeakMap,ut=new WeakMap,gn=new WeakMap,yn=new WeakMap,zt=new WeakMap,_n=new WeakMap,yr=new WeakMap,Tt=new WeakMap,te=new WeakSet,rd=function(){const e=new Vs(w(this,un)),n=new Vs(w(this,un));fe(this,zt,e),fe(this,yn,n),fe(this,Ni,(l,c,u=Co.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,Zr,l=>{n[l]=e[l]!==0?Co.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=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 c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=w(this,ot).get(l);if(c===void 0)return 0;const u=e[c],p=n[c];if(!u||!p)return 1/0;const f=(o||s())-p;return u-f},fe(this,$t,l=>{const c=n[l],u=e[l];return!!u&&!!c&&(o||s())-c>u})},Zr=new WeakMap,zn=new WeakMap,Ni=new WeakMap,$t=new WeakMap,nm=function(){const e=new Vs(w(this,un));fe(this,fn,0),fe(this,gn,e),fe(this,Ur,n=>{fe(this,fn,w(this,fn)-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,fn)>l;)le(this,te,Sa).call(this,!0)}fe(this,fn,w(this,fn)+e[n]),s&&(s.entrySize=o,s.totalCalculatedSize=w(this,fn))})},Ur=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,vt)));)n=w(this,Gt)[n]},Vr=function*({allowStale:e=this.allowStale}={}){if(w(this,st))for(let n=w(this,vt);!(!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,c;const n=w(this,vt),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,_n)||w(this,Tt))&&(w(this,_n)&&((l=w(this,pn))==null||l.call(this,s,o,"evict")),w(this,Tt)&&((c=w(this,ut))==null||c.push([s,o,"evict"]))),w(this,Ur).call(this,n),e&&(w(this,je)[n]=void 0,w(this,be)[n]=void 0,w(this,mn).push(n)),w(this,st)===1?(fe(this,vt,fe(this,dt,0)),w(this,mn).length=0):fe(this,vt,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 c=new Ns,{signal:u}=o;u==null||u.addEventListener("abort",()=>c.abort(u.reason),{signal:c.signal});const p={signal:c.signal,options:o,context:s},f=(R,L=!1)=>{const{aborted:C}=c.signal,V=o.ignoreFetchAbort&&R!==void 0;if(o.status&&(C&&!L?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,V&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),C&&!V&&!L)return y(c.signal.reason);const q=E;return w(this,be)[n]===E&&(R===void 0?q.__staleWhileFetching?w(this,be)[n]=q.__staleWhileFetching:le(this,te,Pr).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,R,p.options))),R},m=R=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=R),y(R)),y=R=>{const{aborted:L}=c.signal,C=L&&o.allowStaleOnFetchAbort,V=C||o.allowStaleOnFetchRejection,q=V||o.noDeleteOnFetchRejection,X=E;if(w(this,be)[n]===E&&(!q||X.__staleWhileFetching===void 0?le(this,te,Pr).call(this,e,"fetch"):C||(w(this,be)[n]=X.__staleWhileFetching)),V)return o.status&&X.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),X.__staleWhileFetching;if(X.__returned===X)throw R},B=(R,L)=>{var V;const C=(V=w(this,bo))==null?void 0:V.call(this,e,l,p);C&&C instanceof Promise&&C.then(q=>R(q===void 0?void 0:q),L),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(R(void 0),o.allowStaleOnFetchAbort&&(R=q=>f(q,!0)))})};o.status&&(o.status.fetchDispatched=!0);const E=new Promise(B).then(f,m),P=Object.assign(E,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,P,{...p.options,status:void 0}),n=w(this,ot).get(e)):w(this,be)[n]=P,P},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,vt)?fe(this,vt,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,c,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,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,_n)||w(this,Tt))&&(w(this,_n)&&((s=w(this,pn))==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,vt))fe(this,vt,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,mn).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,hn))==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 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,_n)&&((n=w(this,pn))==null||n.call(this,c,u,e)),w(this,Tt)&&((o=w(this,ut))==null||o.push([c,u,e]))}}if(w(this,ot).clear(),w(this,be).fill(void 0),w(this,je).fill(void 0),w(this,zt)&&w(this,yn)&&(w(this,zt).fill(0),w(this,yn).fill(0)),w(this,gn)&&w(this,gn).fill(0),fe(this,vt,0),fe(this,dt,0),w(this,mn).length=0,fe(this,fn,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,hn))==null||s.call(this,...c)}};let Pl=Fl;const BT={cacheSize:15e6};class AT{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 Wr=class Wr{constructor(e){$e(this,"fileDataCache");$e(this,"fileDataRefs",new Map);const n={...BT,...e??{}};this.fileDataCache=new Pl({maxSize:n.cacheSize,fetchMethod:async o=>new AT(await Eg().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 Wr.globalInstance.getContentBytes(e)}static getContentString(e){return Wr.globalInstance.getContentString(e)}static getContentJson(e,n){return Wr.globalInstance.getContentJson(e,n)}};$e(Wr,"globalInstance",new Wr);let Dl=Wr;M.AgGridTheme=eu,M.BlockLayout=KE,M.ContextProvider=Rk,M.DataTable=zv,M.DemoData=ME,M.DropdownListItem=po,M.LongText=vl,M.MultiError=Aa,M.PlAccordion=qb,M.PlAccordionSection=rx,M.PlAgCellFile=xT,M.PlAgDataTable=mT,M.PlAgOverlayLoading=ap,M.PlAgOverlayNoRows=lp,M.PlAlert=_C,M.PlBlockPage=oC,M.PlBtnAccent=MC,M.PlBtnDanger=LC,M.PlBtnGhost=hl,M.PlBtnGroup=sw,M.PlBtnLink=$C,M.PlBtnPrimary=ul,M.PlBtnSecondary=pl,M.PlBtnSplit=VC,M.PlCheckbox=Iu,M.PlCheckboxGroup=sb,M.PlChip=Cl,M.PlContainer=sC,M.PlDialogModal=bl,M.PlDropdown=ui,M.PlDropdownLegacy=B0,M.PlDropdownLine=Mu,M.PlDropdownMulti=tb,M.PlDropdownRef=r0,M.PlFileDialog=zu,M.PlFileInput=np,M.PlGrid=pC,M.PlIcon16=ms,M.PlIcon24=Pu,M.PlLogView=Ou,M.PlMaskIcon16=Ir,M.PlMaskIcon24=On,M.PlNotificationAlert=rp,M.PlNumberField=G0,M.PlProgressBar=D0,M.PlRow=lC,M.PlSectionSeparator=Gu,M.PlSlideModal=Cb,M.PlSpacer=Su,M.PlTableFilters=_T,M.PlTabs=$b,M.PlTextArea=Iw,M.PlTextField=Lr,M.PlToggleSwitch=gs,M.PlTooltip=kt,M.ReactiveFileContent=Dl,M.Scrollable=SS,M.Slider=op,M.SliderRange=wS,M.SliderRangeTriple=cS,M.ThemeSwitcher=Jv,M.UnresolvedError=Ba,M.ValueOrErrorsComponent=wT,M.activateAgGrid=Qd,M.animate=vu,M.animateInfinite=Hv,M.call=fu,M.computedResult=ET,M.createModel=Ra,M.debounce=Cu,M.defineApp=__,M.defineStore=ST,M.delay=mu,M.detectOutside=Lw,M.ensureError=Pa,M.eventListener=yl,M.formatZodError=Fa,M.getElementScrollPosition=Fu,M.identity=Va,M.isDefined=gm,M.isElementVisible=Du,M.isJsonEqual=Na,M.isZodError=Da,M.listToOptions=jv,M.makeEaseInOut=Wv,M.makeEaseOut=_u,M.maskIcons16=FE,M.maskIcons24=RE,M.normalizeListOptions=ar,M.notEmpty=sl,M.randomInt=yu,M.randomString=Uv,M.requestTick=al,M.scrollIntoView=di,M.showContextMenu=rl,M.throttle=wu,M.timeout=gu,M.unwrapOptionalResult=mm,M.unwrapValueOrErrors=fd,M.useClickOutside=fs,M.useDraggable=Xk,M.useEventListener=tt,M.useFormState=Yk,M.useHover=pu,M.useInterval=Kk,M.useLabelNotch=Ln,M.useLocalStorage=bu,M.useMouse=uu,M.useMouseCapture=sr,M.usePosition=ho,M.useQuery=Jk,M.useResizeObserver=ip,M.useScroll=Hk,M.useSdkPlugin=Xa,M.useSortable=qk,M.useTheme=ku,M.useWatchFetch=fp,M.wrapOptionalResult=md,M.wrapValueOrErrors=fm,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|