@platforma-sdk/ui-vue 1.17.3 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/lib.js +6110 -6057
- package/dist/lib.umd.cjs +32 -32
- package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts +1 -0
- package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/sources/export-csv.d.ts +4 -0
- package/dist/src/components/PlAgDataTable/sources/export-csv.d.ts.map +1 -0
- package/dist/src/components/PlAgDataTable/sources/focus-row.d.ts +10 -0
- package/dist/src/components/PlAgDataTable/sources/focus-row.d.ts.map +1 -0
- package/dist/src/components/PlAgDataTable/sources/row-number.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/sources/table-source.d.ts +2 -2
- package/dist/src/components/PlAgDataTable/sources/table-source.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/types.d.ts +9 -3
- package/dist/src/components/PlAgDataTable/types.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/PlAgDataTable/PlAgDataTable.vue +14 -59
- package/src/components/PlAgDataTable/sources/export-csv.ts +69 -0
- package/src/components/PlAgDataTable/sources/focus-row.ts +59 -0
- package/src/components/PlAgDataTable/sources/row-number.ts +14 -5
- package/src/components/PlAgDataTable/sources/table-source.ts +14 -52
- package/src/components/PlAgDataTable/types.ts +10 -2
- package/src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue +1 -1
- package/src/components/PlAgGridColumnManager/pl-ag-grid-column-manager.scss +1 -0
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(I,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@ag-grid-enterprise/core"),require("@ag-grid-community/core"),require("@ag-grid-community/client-side-row-model"),require("@ag-grid-community/infinite-row-model"),require("@ag-grid-enterprise/server-side-row-model"),require("@ag-grid-community/csv-export"),require("@ag-grid-enterprise/clipboard"),require("@ag-grid-enterprise/range-selection"),require("@ag-grid-enterprise/rich-select"),require("@ag-grid-enterprise/menu"),require("@ag-grid-enterprise/excel-export"),require("@ag-grid-community/theming"),require("@ag-grid-community/vue3")):typeof define=="function"&&define.amd?define(["exports","vue","@ag-grid-enterprise/core","@ag-grid-community/core","@ag-grid-community/client-side-row-model","@ag-grid-community/infinite-row-model","@ag-grid-enterprise/server-side-row-model","@ag-grid-community/csv-export","@ag-grid-enterprise/clipboard","@ag-grid-enterprise/range-selection","@ag-grid-enterprise/rich-select","@ag-grid-enterprise/menu","@ag-grid-enterprise/excel-export","@ag-grid-community/theming","@ag-grid-community/vue3"],r):(I=typeof globalThis<"u"?globalThis:I||self,r(I.SdkVueLib={},I.Vue,I.core$1,I.core,I.clientSideRowModel,I.infiniteRowModel,I.serverSideRowModel,I.csvExport,I.clipboard,I.rangeSelection,I.richSelect,I.menu,I.excelExport,I.theming,I.vue3))})(this,function(I,r,Me,k,fs,Ng,Ja,Vg,qd,Kd,Ag,Bg,Pg,Yd,Rg){"use strict";var JM=Object.defineProperty;var Eg=I=>{throw TypeError(I)};var QM=(I,r,Me)=>r in I?JM(I,r,{enumerable:!0,configurable:!0,writable:!0,value:Me}):I[r]=Me;var Ze=(I,r,Me)=>QM(I,typeof r!="symbol"?r+"":r,Me),Ud=(I,r,Me)=>r.has(I)||Eg("Cannot "+Me);var x=(I,r,Me)=>(Ud(I,r,"read from private field"),Me?Me.call(I):r.get(I)),ze=(I,r,Me)=>r.has(I)?Eg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(I):r.set(I,Me),ye=(I,r,Me,k)=>(Ud(I,r,"write to private field"),k?k.call(I,Me):r.set(I,Me),Me),ue=(I,r,Me)=>(Ud(I,r,"access private method"),Me);var Ka=(I,r,Me,k)=>({set _(fs){ye(I,r,fs,Me)},get _(){return x(I,r,k)}});var Zh,Po,Wh,jh,vn,Ht,wn,bn,Ro,Do,ut,xn,dt,Je,ke,Rt,qt,St,mt,kn,gt,En,Sn,Kt,Tn,Ar,Dt,re,Zd,Qr,Qn,Ui,Yt,Tg,eo,Io,Zi,Gr,$r,Wd,Ya,Xa,et,jd,hs,zr,Hd;function Dg(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function Ig(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Fg(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(Ig(65,91));return e}function Lg(){return Fg(42)}const Xd=Array.isArray;function Og(t){return t!==null&&typeof t=="object"}function Jd(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 Dn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Dn(t[n]);return e}else if(Og(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Dn(t[n])}),e}else return t}function Qd(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],i=e[n];Jd(o)&&Jd(i)||Xd(o)&&Xd(i)&&o.length===i.length?Qd(o,i):t[n]=i}),t}function Qa(t,e,n=!0){let o=0,i;return function(...l){i=()=>{t.apply(this,l),o=new Date().getTime()+e,i=null,n&&setTimeout(()=>{i==null||i()},e)},new Date().getTime()>o&&i()}}function Mg(t){let e=0n,n;return async function(...o){const i=++e;try{await n}catch{}if(e!==i)return{ok:!1};const l=t(...o);return n=l,{ok:!0,value:await l}}}var Xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gg=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((i,l,c)=>`${i}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,i)=>{if(e[i]===void 0||typeof e[i]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(i)}:${t(e[i])}`},"")}}`};const dr=eu(Gg);class el extends Error{}class ms extends Error{constructor(e){super(e.join(`
|
|
2
2
|
`)),this.errors=e}toString(){return this.errors.join(`
|
|
3
|
-
`)}}function Gg(t){return{ok:!0,value:t}}function tu(t){if(!t)throw new Qa;if(!t.ok)throw new fs(t.errors);return t.value}function nu(t){return{value:t,errors:void 0}}function $g(t){if(t.errors)throw new fs(t.errors);if(!t.value)throw new Qa;return t.value}function zg(t){return t!==void 0}function el(t,e){return zr(t)===zr(e)}const tl=t=>t,nl=t=>t instanceof Error?t:Error(String(t)),rl=t=>t.name==="ZodError",ol=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([i,l])=>i+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function il(t){const e=t.validate??tl,{autoSave:n}=t,o=r.ref(),i=r.ref(),l=E=>{i.value={model:Dn(E)}};r.watch(()=>t.get(),E=>l(E),{immediate:!0});const c=()=>{var E;t.onSave(e(Dn((E=i.value)==null?void 0:E.model)))},d=()=>{l(t.get()),o.value=void 0},p=E=>{const z=nl(E);rl(z)?o.value=Error(ol(z)):o.value=z},h=E=>{o.value=void 0;try{e(E),n&&c()}catch(z){p(z)}},m=r.computed({get:()=>{var E;return(E=i.value)==null?void 0:E.model},set(E){l(E),h(E)}});r.watch(i,(E,z)=>{E&&E===z&&h(E.model)},{deep:!0});const y=r.computed(()=>!o.value),w=r.computed(()=>!el(t.get(),r.unref(i))),v=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:w,error:o,errorString:v,save:c,revert:d,setError:p})}function Ug(t,e,n){const o=t.validate??tl,{autoSave:i}=t,l=r.ref(),c=r.ref(),d=$=>{var S;if(n.deepPatchModel){const B=(S=c.value)==null?void 0:S.model,D=Object.assign(Dn($),e??{});c.value={model:B?Qd(B,D):D,stage:Symbol()}}else c.value={model:Object.assign(Dn($),e??{}),stage:Symbol()}};r.watch(()=>t.get(),$=>d($),{immediate:!0});const p=()=>{var $;t.onSave(o(Dn(($=c.value)==null?void 0:$.model)))},h=()=>{d(t.get()),l.value=void 0},m=$=>{const S=nl($);rl(S)?l.value=Error(ol(S)):l.value=S},y=$=>{l.value=void 0;try{o($),i&&p()}catch(S){m(S)}},w=r.computed({get:()=>{var $;return($=c.value)==null?void 0:$.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:w.value.args,ui:w.value.ui}),()=>{var $;return($=c.value)==null?void 0:$.stage}],([$,S],[B,D])=>{S===D&&y($)},{deep:!0});const v=r.computed(()=>!l.value),E=r.computed(()=>{var B;const{args:$,ui:S}=((B=r.unref(c))==null?void 0:B.model)??{};return!el(t.get(),{args:$,ui:S})}),z=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:w,valid:v,isChanged:E,error:l,errorString:z,save:p,revert:h,setError:m})}const Zg=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Wg(t,e,n){const o=(S,...B)=>{n.debug&&console.log(`%c>>> %c${S}`,"color: orange; font-weight: bold","color: orange",...B)},l=Ja(e.setBlockArgs,100),c=Ja(e.setBlockUiState,100),d=Ja(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 S=>{S.forEach(B=>{B.key==="args"&&(p.args=Object.freeze(B.value),o("args patch",p.args)),B.key==="ui"&&(p.ui=Object.freeze(B.value),o("ui patch",p.ui)),B.key==="outputs"&&(p.outputs=Object.freeze(B.value),o("outputs patch",p.outputs)),B.key==="navigationState"&&(p.navigationState=Object.freeze(B.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const h=()=>Dn(p.args),m=()=>Dn(p.ui),y=()=>Dn(p.navigationState),w={createArgsModel(S={}){return il({get(){return S.transform?S.transform(p.args):p.args},validate:S.validate,autoSave:!0,onSave(B){l(B)}})},createUiModel(S={},B){return il({get(){return S.transform?S.transform(p.ui):p.ui??B()},validate:S.validate,autoSave:!0,onSave(D){c(D)}})},useOutputs(...S){const B=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(B,{value:this.unwrapOutputs(...S),errors:void 0})}catch(D){Object.assign(B,{value:void 0,errors:[String(D)]})}},{immediate:!0,deep:!0}),B},unwrapOutputs(...S){const B=p.outputs,D=S.map(H=>[H,tu(B[H])]);return Object.fromEntries(D)},updateArgs(S){const B=h();return S(B),e.setBlockArgs(B)},updateUiState(S){const B=m();return e.setBlockUiState(S(B))},updateNavigationState(S){const B=y();return S(B),e.setNavigationState(B)},navigateTo(S){const B=y();return B.href=S,e.setNavigationState(B)}},v=r.computed(()=>{const S=Object.entries(p.outputs).map(([B,D])=>[B,D.ok&&D.value!==void 0?D.value:void 0]);return Object.fromEntries(S)}),E=r.computed(()=>{const S=Object.entries(p.outputs).map(([B,D])=>[B,D&&!D.ok?new fs(D.errors):void 0]);return Object.fromEntries(S)}),z={snapshot:p,queryParams:r.computed(()=>Zg(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(S=>!(S!=null&&S.ok)))},$=Ug({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(S){d(S.args,S.ui)}},{outputs:v,outputErrors:E},n);return r.reactive(Object.assign($,w,z))}var Ge;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(Ge||(Ge={}));var sl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(sl||(sl={}));const ae=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),dr=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},ee=Ge.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"]),jg=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Wt 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:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Wt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Wt.create=t=>new Wt(t);const po=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ge.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.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}"`:Ge.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,Ge.assertNever(t)}return{message:n}};let ru=po;function Hg(t){ru=t}function ms(){return ru}const gs=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},qg=[];function ie(t,e){const n=ms(),o=gs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===po?void 0:po].filter(i=>!!i)});t.common.issues.push(o)}class bt{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 i of n){if(i.status==="aborted")return be;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return bt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return be;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const be=Object.freeze({status:"aborted"}),ho=t=>({status:"dirty",value:t}),Vt=t=>({status:"valid",value:t}),al=t=>t.status==="aborted",ll=t=>t.status==="dirty",Jo=t=>t.status==="valid",Qo=t=>typeof Promise<"u"&&t instanceof Promise;function ys(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 ou(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!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 he;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(he||(he={}));var ei,ti;class In{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}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 iu=(t,e)=>{if(Jo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Wt(t.common.issues);return this._error=n,this._error}}};function Ve(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=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:i}:{errorMap:(c,d)=>{var p,h;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(h=m??n)!==null&&h!==void 0?h:d.defaultError}},description:i}}class Pe{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 dr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new bt,ctx:{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Qo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const i={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:dr(e)},l=this._parseSync({data:e,path:i.path,parent:i});return iu(i,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:dr(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(Qo(i)?i:Promise.resolve(i));return iu(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:ee.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new fn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ln.create(this,this._def)}nullable(){return fr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this,this._def)}promise(){return yo.create(this,this._def)}or(e){return ii.create([this,e],this._def)}and(e){return si.create(this,e,this._def)}transform(e){return new fn({...Ve(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ui({...Ve(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new ul({typeName:ve.ZodBranded,type:this,...Ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new pi({...Ve(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 hi.create(this,e)}readonly(){return fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Kg=/^c[^\s-]{8,}$/i,Yg=/^[0-9a-z]+$/,Xg=/^[0-9A-HJKMNP-TV-Z]{26}$/,Jg=/^[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,Qg=/^[a-z0-9_-]{21}$/i,ey=/^[-+]?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)?)??$/,ty=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ny="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let cl;const ry=/^(?:(?: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])$/,oy=/^(([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})))$/,iy=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,su="((\\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])))",sy=new RegExp(`^${su}$`);function au(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 ay(t){return new RegExp(`^${au(t)}$`)}function lu(t){let e=`${su}T${au(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 ly(t,e){return!!((e==="v4"||!e)&&ry.test(t)||(e==="v6"||!e)&&oy.test(t))}class pn extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.string,received:l.parsedType}),be}const o=new bt;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.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&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.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,d=e.data.length<l.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")ty.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")cl||(cl=new RegExp(ny,"u")),cl.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")Jg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")Qg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")Kg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Yg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Xg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.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)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.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)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?lu(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?sy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?ay(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?ey.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?ly(e.data,l.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?iy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:l.message}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:ee.invalid_string,...he.errToObj(o)})}_addCheck(e){return new pn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...he.errToObj(e)})}url(e){return this._addCheck({kind:"url",...he.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...he.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...he.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...he.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...he.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...he.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...he.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...he.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...he.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,...he.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,...he.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...he.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...he.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...he.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...he.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...he.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...he.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...he.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...he.errToObj(n)})}nonempty(e){return this.min(1,he.errToObj(e))}trim(){return new pn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pn({...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}}pn.create=t=>{var e;return new pn({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};function cy(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class ur extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.number,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="int"?Ge.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?cy(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_finite,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,i){return new ur({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(i)}]})}_addCheck(e){return new ur({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:he.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:he.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.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"&&Ge.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)}}ur.create=t=>new ur({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class pr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.bigint,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,i){return new pr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(i)}]})}_addCheck(e){return new pr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.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}}pr.create=t=>{var e;return new pr({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};class ni extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.boolean,received:o.parsedType}),be}return Vt(e.data)}}ni.create=t=>new ni({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class Ur extends Pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.date,received:l.parsedType}),be}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_date}),be}const o=new bt;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ur({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:he.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:he.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}}Ur.create=t=>new Ur({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Ve(t)});class _s extends Pe{_parse(e){if(this._getType(e)!==ae.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.symbol,received:o.parsedType}),be}return Vt(e.data)}}_s.create=t=>new _s({typeName:ve.ZodSymbol,...Ve(t)});class ri extends Pe{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.undefined,received:o.parsedType}),be}return Vt(e.data)}}ri.create=t=>new ri({typeName:ve.ZodUndefined,...Ve(t)});class oi extends Pe{_parse(e){if(this._getType(e)!==ae.null){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.null,received:o.parsedType}),be}return Vt(e.data)}}oi.create=t=>new oi({typeName:ve.ZodNull,...Ve(t)});class fo extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return Vt(e.data)}}fo.create=t=>new fo({typeName:ve.ZodAny,...Ve(t)});class Zr extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Vt(e.data)}}Zr.create=t=>new Zr({typeName:ve.ZodUnknown,...Ve(t)});class Kn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:ae.never,received:n.parsedType}),be}}Kn.create=t=>new Kn({typeName:ve.ZodNever,...Ve(t)});class Cs extends Pe{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.void,received:o.parsedType}),be}return Vt(e.data)}}Cs.create=t=>new Cs({typeName:ve.ZodVoid,...Ve(t)});class hn extends Pe{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==ae.array)return ie(n,{code:ee.invalid_type,expected:ae.array,received:n.parsedType}),be;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(ie(n,{code:c?ee.too_big:ee.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new In(n,c,n.path,d)))).then(c=>bt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new In(n,c,n.path,d)));return bt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:he.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:he.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:he.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ve(e)});function mo(t){if(t instanceof nt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Ln.create(mo(o))}return new nt({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:mo(t.element)}):t instanceof Ln?Ln.create(mo(t.unwrap())):t instanceof fr?fr.create(mo(t.unwrap())):t instanceof Fn?Fn.create(t.items.map(e=>mo(e))):t}class nt extends Pe{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=Ge.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const h=this._getOrReturnCtx(e);return ie(h,{code:ee.invalid_type,expected:ae.object,received:h.parsedType}),be}const{status:o,ctx:i}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof Kn&&this._def.unknownKeys==="strip"))for(const h in i.data)c.includes(h)||d.push(h);const p=[];for(const h of c){const m=l[h],y=i.data[h];p.push({key:{status:"valid",value:h},value:m._parse(new In(i,y,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof Kn){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of d)p.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(h==="strict")d.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:d}),o.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of d){const y=i.data[m];p.push({key:{status:"valid",value:m},value:h._parse(new In(i,y,i.path,m)),alwaysSet:m in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of p){const y=await m.key,w=await m.value;h.push({key:y,value:w,alwaysSet:m.alwaysSet})}return h}).then(h=>bt.mergeObjectSync(o,h)):bt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return he.errToObj,new nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=he.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new nt({...this._def,unknownKeys:"strip"})}passthrough(){return new nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nt({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 nt({...this._def,catchall:e})}pick(e){const n={};return Ge.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}omit(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}deepPartial(){return mo(this)}partial(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new nt({...this._def,shape:()=>n})}required(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Ln;)l=l._def.innerType;n[o]=l}}),new nt({...this._def,shape:()=>n})}keyof(){return cu(Ge.objectKeys(this.shape))}}nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)});class ii extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Wt(d.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:c}),be}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(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new Wt(p));return ie(n,{code:ee.invalid_union,unionErrors:d}),be}}get options(){return this._def.options}}ii.create=(t,e)=>new ii({options:t,typeName:ve.ZodUnion,...Ve(e)});const Yn=t=>t instanceof li?Yn(t.schema):t instanceof fn?Yn(t.innerType()):t instanceof ci?[t.value]:t instanceof hr?t.options:t instanceof di?Ge.objectValues(t.enum):t instanceof ui?Yn(t._def.innerType):t instanceof ri?[void 0]:t instanceof oi?[null]:t instanceof Ln?[void 0,...Yn(t.unwrap())]:t instanceof fr?[null,...Yn(t.unwrap())]:t instanceof ul||t instanceof fi?Yn(t.unwrap()):t instanceof pi?Yn(t._def.innerType):[];class vs extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ie(n,{code:ee.invalid_type,expected:ae.object,received:n.parsedType}),be;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=Yn(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 d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new vs({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ve(o)})}}function dl(t,e){const n=dr(t),o=dr(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&o===ae.object){const i=Ge.objectKeys(e),l=Ge.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=dl(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===ae.array&&o===ae.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=dl(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class si extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(al(l)||al(c))return be;const d=dl(l.value,c.value);return d.valid?((ll(l)||ll(c))&&n.dirty(),{status:n.value,value:d.data}):(ie(o,{code:ee.invalid_intersection_types}),be)};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])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}si.create=(t,e,n)=>new si({left:t,right:e,typeName:ve.ZodIntersection,...Ve(n)});class Fn extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ie(o,{code:ee.invalid_type,expected:ae.array,received:o.parsedType}),be;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new In(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>bt.mergeArray(n,c)):bt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Fn({...this._def,rest:e})}}Fn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:t,typeName:ve.ZodTuple,rest:null,...Ve(e)})};class ai extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ie(o,{code:ee.invalid_type,expected:ae.object,received:o.parsedType}),be;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new In(o,d,o.path,d)),value:c._parse(new In(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?bt.mergeObjectAsync(n,i):bt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Pe?new ai({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ve(o)}):new ai({keyType:pn.create(),valueType:e,typeName:ve.ZodRecord,...Ve(n)})}}class ws extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ie(o,{code:ee.invalid_type,expected:ae.map,received:o.parsedType}),be;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new In(o,d,o.path,[h,"key"])),value:l._parse(new In(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}ws.create=(t,e,n)=>new ws({valueType:e,keyType:t,typeName:ve.ZodMap,...Ve(n)});class Wr extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ie(o,{code:ee.invalid_type,expected:ae.set,received:o.parsedType}),be;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ie(o,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ie(o,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return be;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new In(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Wr({...this._def,minSize:{value:e,message:he.toString(n)}})}max(e,n){return new Wr({...this._def,maxSize:{value:e,message:he.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Wr.create=(t,e)=>new Wr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ve(e)});class go extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return ie(n,{code:ee.invalid_type,expected:ae.function,received:n.parsedType}),be;function o(d,p){return gs({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ms(),po].filter(h=>!!h),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function i(d,p){return gs({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ms(),po].filter(h=>!!h),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof yo){const d=this;return Vt(async function(...p){const h=new Wt([]),m=await d._def.args.parseAsync(p,l).catch(v=>{throw h.addIssue(o(p,v)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(v=>{throw h.addIssue(i(y,v)),h})})}else{const d=this;return Vt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new Wt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new Wt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new go({...this._def,args:Fn.create(e).rest(Zr.create())})}returns(e){return new go({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new go({args:e||Fn.create([]).rest(Zr.create()),returns:n||Zr.create(),typeName:ve.ZodFunction,...Ve(o)})}}class li extends Pe{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})}}li.create=(t,e)=>new li({getter:t,typeName:ve.ZodLazy,...Ve(e)});class ci extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}}ci.create=(t,e)=>new ci({value:t,typeName:ve.ZodLiteral,...Ve(e)});function cu(t,e){return new hr({values:t,typeName:ve.ZodEnum,...Ve(e)})}class hr extends Pe{constructor(){super(...arguments),ei.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Ge.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(ys(this,ei)||ou(this,ei,new Set(this._def.values)),!ys(this,ei).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Vt(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})}}ei=new WeakMap,hr.create=cu;class di extends Pe{constructor(){super(...arguments),ti.set(this,void 0)}_parse(e){const n=Ge.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const i=Ge.objectValues(n);return ie(o,{expected:Ge.joinValues(i),received:o.parsedType,code:ee.invalid_type}),be}if(ys(this,ti)||ou(this,ti,new Set(Ge.getValidEnumValues(this._def.values))),!ys(this,ti).has(e.data)){const i=Ge.objectValues(n);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:i}),be}return Vt(e.data)}get enum(){return this._def.values}}ti=new WeakMap,di.create=(t,e)=>new di({values:t,typeName:ve.ZodNativeEnum,...Ve(e)});class yo extends Pe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:ae.promise,received:n.parsedType}),be;const o=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return Vt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}yo.create=(t,e)=>new yo({type:t,typeName:ve.ZodPromise,...Ve(e)});class fn extends Pe{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),i=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return be;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?be:p.status==="dirty"||n.value==="dirty"?ho(p.value):p});{if(n.value==="aborted")return be;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?be:d.status==="dirty"||n.value==="dirty"?ho(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,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 d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Jo(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Jo(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);Ge.assertNever(i)}}fn.create=(t,e,n)=>new fn({schema:t,typeName:ve.ZodEffects,effect:e,...Ve(n)}),fn.createWithPreprocess=(t,e,n)=>new fn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ve(n)});class Ln extends Pe{_parse(e){return this._getType(e)===ae.undefined?Vt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ln.create=(t,e)=>new Ln({innerType:t,typeName:ve.ZodOptional,...Ve(e)});class fr extends Pe{_parse(e){return this._getType(e)===ae.null?Vt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fr.create=(t,e)=>new fr({innerType:t,typeName:ve.ZodNullable,...Ve(e)});class ui extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ui.create=(t,e)=>new ui({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ve(e)});class pi extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Qo(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}pi.create=(t,e)=>new pi({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ve(e)});class bs extends Pe{_parse(e){if(this._getType(e)!==ae.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.nan,received:o.parsedType}),be}return{status:"valid",value:e.data}}}bs.create=t=>new bs({typeName:ve.ZodNaN,...Ve(t)});const dy=Symbol("zod_brand");class ul extends Pe{_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 hi extends Pe{_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"?be:l.status==="dirty"?(n.dirty(),ho(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new hi({in:e,out:n,typeName:ve.ZodPipeline})}}class fi extends Pe{_parse(e){const n=this._def.innerType._parse(e),o=i=>(Jo(i)&&(i.value=Object.freeze(i.value)),i);return Qo(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}fi.create=(t,e)=>new fi({innerType:t,typeName:ve.ZodReadonly,...Ve(e)});function du(t,e={},n){return t?fo.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):fo.create()}const uy={object:nt.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 py=(t,e={message:`Input not instance of ${t.name}`})=>du(n=>n instanceof t,e),uu=pn.create,pu=ur.create,hy=bs.create,fy=pr.create,hu=ni.create,my=Ur.create,gy=_s.create,yy=ri.create,_y=oi.create,Cy=fo.create,vy=Zr.create,wy=Kn.create,by=Cs.create,xy=hn.create,ky=nt.create,Sy=nt.strictCreate,Ey=ii.create,Ty=vs.create,Ny=si.create,Vy=Fn.create,Ay=ai.create,By=ws.create,Py=Wr.create,Ry=go.create,Dy=li.create,Iy=ci.create,Fy=hr.create,Ly=di.create,Oy=yo.create,fu=fn.create,My=Ln.create,Gy=fr.create,$y=fn.createWithPreprocess,zy=hi.create;var On=Object.freeze({__proto__:null,defaultErrorMap:po,setErrorMap:Hg,getErrorMap:ms,makeIssue:gs,EMPTY_PATH:qg,addIssueToContext:ie,ParseStatus:bt,INVALID:be,DIRTY:ho,OK:Vt,isAborted:al,isDirty:ll,isValid:Jo,isAsync:Qo,get util(){return Ge},get objectUtil(){return sl},ZodParsedType:ae,getParsedType:dr,ZodType:Pe,datetimeRegex:lu,ZodString:pn,ZodNumber:ur,ZodBigInt:pr,ZodBoolean:ni,ZodDate:Ur,ZodSymbol:_s,ZodUndefined:ri,ZodNull:oi,ZodAny:fo,ZodUnknown:Zr,ZodNever:Kn,ZodVoid:Cs,ZodArray:hn,ZodObject:nt,ZodUnion:ii,ZodDiscriminatedUnion:vs,ZodIntersection:si,ZodTuple:Fn,ZodRecord:ai,ZodMap:ws,ZodSet:Wr,ZodFunction:go,ZodLazy:li,ZodLiteral:ci,ZodEnum:hr,ZodNativeEnum:di,ZodPromise:yo,ZodEffects:fn,ZodTransformer:fn,ZodOptional:Ln,ZodNullable:fr,ZodDefault:ui,ZodCatch:pi,ZodNaN:bs,BRAND:dy,ZodBranded:ul,ZodPipeline:hi,ZodReadonly:fi,custom:du,Schema:Pe,ZodSchema:Pe,late:uy,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>pn.create({...t,coerce:!0}),number:t=>ur.create({...t,coerce:!0}),boolean:t=>ni.create({...t,coerce:!0}),bigint:t=>pr.create({...t,coerce:!0}),date:t=>Ur.create({...t,coerce:!0})},any:Cy,array:xy,bigint:fy,boolean:hu,date:my,discriminatedUnion:Ty,effect:fu,enum:Fy,function:Ry,instanceof:py,intersection:Ny,lazy:Dy,literal:Iy,map:By,nan:hy,nativeEnum:Ly,never:wy,null:_y,nullable:Gy,number:pu,object:ky,oboolean:()=>hu().optional(),onumber:()=>pu().optional(),optional:My,ostring:()=>uu().optional(),pipeline:zy,preprocess:$y,promise:Oy,record:Ay,set:Py,strictObject:Sy,string:uu,symbol:gy,transformer:fu,tuple:Vy,undefined:yy,union:Ey,unknown:vy,void:by,NEVER:be,ZodIssueCode:ee,quotelessJson:jg,ZodError:Wt});const Uy=-2147483648,mu=-9007199254740991n,Zy=NaN,Wy=NaN,jy=null,Hy=null;function qy(t,e){switch(e){case"Int":return t===Uy;case"Long":return t===Number(mu)||t===mu;case"Float":return t===Zy;case"Double":return t===Wy;case"String":return t===jy;case"Bytes":return t===Hy;default:throw Error(`unsupported data type: ${e}`)}}function Ky(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}function jr(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}On.object({__isRef:On.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:On.string().describe("Upstream block id"),name:On.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 Yy(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 Xy=On.object({type:On.string(),importance:On.number().optional(),id:On.string().optional(),label:On.string()});On.array(Xy);const Jy="1.17.0";function xs(){return Yy({sdkVersion:Jy})}function Qy(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function _o(t){return!!t&&typeof t.children<"u"}function mr(t){return _o(t)?t.groupId:t.colId}function gu(t,e,n){const o=(c,d)=>{const p=c.children.map(mr),h=x._includes(p,mr(d)),m=x._last(c.children),y=m&&mr(m)!==mr(d);return h&&y};if(!_o(t))return!0;const i=t,l=n;if(o(i,l))return i.children.push(l),!0;if(i.groupId===e){const c=i.children.map(mr);if(!x._includes(c,mr(l)))return i.children.push(l),!0}for(let c=i.children.length-1;c>=0&&!gu(i.children[c],e,n);c--);return!1}function e_(t){const e=(i,l)=>_o(i)&&_o(l)&&mr(i)===mr(l),n=(i,l)=>{if(!_o(l))return i;const c=i,d=l;return d.children&&d.groupId&&gu(c,d.groupId,d.children[0])||d.children.forEach(p=>n(c,p)),c},o=[];for(let i=1;i<=t.length;i++){const l=t[i-1],c=t[i];e(l,c)?t[i]=n(l,c):o.push(l)}return o}var t_=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(i,l)=>{if(_o(i)){const c=i,d=typeof c.groupId<"u"?c.groupId:c.headerName,p=new x.AgProvidedColumnGroup(c,d,!1,l),h=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&h.push(y)}),p.setChildren(h),p}else{const c=i,d=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(d);return p||e.push(c),p}},o=[];return t.forEach(i=>{const l=n(i,0);l&&o.push(l)}),e.length>0&&x._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=e_(e);t(n)}getLeafPathTrees(){const t=(o,i)=>{let l;if(x.isProvidedColumnGroup(o))if(o.isPadding())l=i;else{const d=Object.assign({},o.getColGroupDef());d.groupId=o.getGroupId(),d.children=[i],l=d}else{const d=Object.assign({},o.getColDef());d.colId=o.getColId(),l=d}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const i=o.getColDef();return o.isPrimary()&&!i.showRowGroup}).map(o=>t(o,o.getColDef()))}};function n_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function r_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function o_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function i_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function s_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function a_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function l_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function c_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function d_(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return x._unwrapUserComp(n)}function u_(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var p_=class extends x.Component{constructor(t){super(),this.eToggleButton=x.RefPlaceholder,this.eIconWrapper=x.RefPlaceholder,this.eLabel=x.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
3
|
+
`)}}function $g(t){return{ok:!0,value:t}}function tu(t){if(!t)throw new el;if(!t.ok)throw new ms(t.errors);return t.value}function nu(t){return{value:t,errors:void 0}}function zg(t){if(t.errors)throw new ms(t.errors);if(!t.value)throw new el;return t.value}function Ug(t){return t!==void 0}function tl(t,e){return dr(t)===dr(e)}const nl=t=>t,rl=t=>t instanceof Error?t:Error(String(t)),ol=t=>t.name==="ZodError",il=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([i,l])=>i+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function sl(t){const e=t.validate??nl,{autoSave:n}=t,o=r.ref(),i=r.ref(),l=E=>{i.value={model:Dn(E)}};r.watch(()=>t.get(),E=>l(E),{immediate:!0});const c=()=>{var E;t.onSave(e(Dn((E=i.value)==null?void 0:E.model)))},d=()=>{l(t.get()),o.value=void 0},p=E=>{const $=rl(E);ol($)?o.value=Error(il($)):o.value=$},h=E=>{o.value=void 0;try{e(E),n&&c()}catch($){p($)}},m=r.computed({get:()=>{var E;return(E=i.value)==null?void 0:E.model},set(E){l(E),h(E)}});r.watch(i,(E,$)=>{E&&E===$&&h(E.model)},{deep:!0});const y=r.computed(()=>!o.value),w=r.computed(()=>!tl(t.get(),r.unref(i))),b=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:w,error:o,errorString:b,save:c,revert:d,setError:p})}function Zg(t,e,n){const o=t.validate??nl,{autoSave:i}=t,l=r.ref(),c=r.ref(),d=O=>{var T;if(n.deepPatchModel){const P=(T=c.value)==null?void 0:T.model,R=Object.assign(Dn(O),e??{});c.value={model:P?Qd(P,R):R,stage:Symbol()}}else c.value={model:Object.assign(Dn(O),e??{}),stage:Symbol()}};r.watch(()=>t.get(),O=>d(O),{immediate:!0});const p=()=>{var O;t.onSave(o(Dn((O=c.value)==null?void 0:O.model)))},h=()=>{d(t.get()),l.value=void 0},m=O=>{const T=rl(O);ol(T)?l.value=Error(il(T)):l.value=T},y=O=>{l.value=void 0;try{o(O),i&&p()}catch(T){m(T)}},w=r.computed({get:()=>{var O;return(O=c.value)==null?void 0:O.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:w.value.args,ui:w.value.ui}),()=>{var O;return(O=c.value)==null?void 0:O.stage}],([O,T],[P,R])=>{T===R&&y(O)},{deep:!0});const b=r.computed(()=>!l.value),E=r.computed(()=>{var P;const{args:O,ui:T}=((P=r.unref(c))==null?void 0:P.model)??{};return!tl(t.get(),{args:O,ui:T})}),$=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:w,valid:b,isChanged:E,error:l,errorString:$,save:p,revert:h,setError:m})}const Wg=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function jg(t,e,n){const o=(T,...P)=>{n.debug&&console.log(`%c>>> %c${T}`,"color: orange; font-weight: bold","color: orange",...P)},l=Qa(e.setBlockArgs,100),c=Qa(e.setBlockUiState,100),d=Qa(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 T=>{T.forEach(P=>{P.key==="args"&&(p.args=Object.freeze(P.value),o("args patch",p.args)),P.key==="ui"&&(p.ui=Object.freeze(P.value),o("ui patch",p.ui)),P.key==="outputs"&&(p.outputs=Object.freeze(P.value),o("outputs patch",p.outputs)),P.key==="navigationState"&&(p.navigationState=Object.freeze(P.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const h=()=>Dn(p.args),m=()=>Dn(p.ui),y=()=>Dn(p.navigationState),w={createArgsModel(T={}){return sl({get(){return T.transform?T.transform(p.args):p.args},validate:T.validate,autoSave:!0,onSave(P){l(P)}})},createUiModel(T={},P){return sl({get(){return T.transform?T.transform(p.ui):p.ui??P()},validate:T.validate,autoSave:!0,onSave(R){c(R)}})},useOutputs(...T){const P=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(P,{value:this.unwrapOutputs(...T),errors:void 0})}catch(R){Object.assign(P,{value:void 0,errors:[String(R)]})}},{immediate:!0,deep:!0}),P},unwrapOutputs(...T){const P=p.outputs,R=T.map(j=>[j,tu(P[j])]);return Object.fromEntries(R)},updateArgs(T){const P=h();return T(P),e.setBlockArgs(P)},updateUiState(T){const P=m();return e.setBlockUiState(T(P))},updateNavigationState(T){const P=y();return T(P),e.setNavigationState(P)},navigateTo(T){const P=y();return P.href=T,e.setNavigationState(P)}},b=r.computed(()=>{const T=Object.entries(p.outputs).map(([P,R])=>[P,R.ok&&R.value!==void 0?R.value:void 0]);return Object.fromEntries(T)}),E=r.computed(()=>{const T=Object.entries(p.outputs).map(([P,R])=>[P,R&&!R.ok?new ms(R.errors):void 0]);return Object.fromEntries(T)}),$={snapshot:p,queryParams:r.computed(()=>Wg(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(T=>!(T!=null&&T.ok)))},O=Zg({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(T){d(T.args,T.ui)}},{outputs:b,outputErrors:E},n);return r.reactive(Object.assign(O,w,$))}var Ge;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(Ge||(Ge={}));var al;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(al||(al={}));const ae=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ur=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},ee=Ge.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"]),Hg=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Wt 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:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Wt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Wt.create=t=>new Wt(t);const po=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ge.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.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}"`:Ge.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,Ge.assertNever(t)}return{message:n}};let ru=po;function qg(t){ru=t}function gs(){return ru}const ys=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},Kg=[];function ie(t,e){const n=gs(),o=ys({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===po?void 0:po].filter(i=>!!i)});t.common.issues.push(o)}class bt{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 i of n){if(i.status==="aborted")return be;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return bt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return be;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const be=Object.freeze({status:"aborted"}),ho=t=>({status:"dirty",value:t}),Vt=t=>({status:"valid",value:t}),ll=t=>t.status==="aborted",cl=t=>t.status==="dirty",Jo=t=>t.status==="valid",Qo=t=>typeof Promise<"u"&&t instanceof Promise;function _s(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 ou(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!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 he;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(he||(he={}));var ei,ti;class In{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}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 iu=(t,e)=>{if(Jo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Wt(t.common.issues);return this._error=n,this._error}}};function Ve(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=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:i}:{errorMap:(c,d)=>{var p,h;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(h=m??n)!==null&&h!==void 0?h:d.defaultError}},description:i}}class Pe{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 ur(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ur(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new bt,ctx:{common:e.parent.common,data:e.data,parsedType:ur(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Qo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const i={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:ur(e)},l=this._parseSync({data:e,path:i.path,parent:i});return iu(i,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:ur(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(Qo(i)?i:Promise.resolve(i));return iu(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:ee.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new fn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ln.create(this,this._def)}nullable(){return mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this,this._def)}promise(){return yo.create(this,this._def)}or(e){return ii.create([this,e],this._def)}and(e){return si.create(this,e,this._def)}transform(e){return new fn({...Ve(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ui({...Ve(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new pl({typeName:ve.ZodBranded,type:this,...Ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new pi({...Ve(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 hi.create(this,e)}readonly(){return fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Yg=/^c[^\s-]{8,}$/i,Xg=/^[0-9a-z]+$/,Jg=/^[0-9A-HJKMNP-TV-Z]{26}$/,Qg=/^[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,ey=/^[a-z0-9_-]{21}$/i,ty=/^[-+]?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)?)??$/,ny=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ry="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let dl;const oy=/^(?:(?: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])$/,iy=/^(([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})))$/,sy=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,su="((\\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])))",ay=new RegExp(`^${su}$`);function au(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 ly(t){return new RegExp(`^${au(t)}$`)}function lu(t){let e=`${su}T${au(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 cy(t,e){return!!((e==="v4"||!e)&&oy.test(t)||(e==="v6"||!e)&&iy.test(t))}class pn extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.string,received:l.parsedType}),be}const o=new bt;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.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&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.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,d=e.data.length<l.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")ny.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")dl||(dl=new RegExp(ry,"u")),dl.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")Qg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")ey.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")Yg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")Xg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")Jg.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.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)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.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)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?lu(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?ay.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?ly(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?ty.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?cy(e.data,l.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?sy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:l.message}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:ee.invalid_string,...he.errToObj(o)})}_addCheck(e){return new pn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...he.errToObj(e)})}url(e){return this._addCheck({kind:"url",...he.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...he.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...he.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...he.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...he.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...he.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...he.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...he.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...he.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,...he.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,...he.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...he.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...he.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...he.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...he.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...he.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...he.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...he.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...he.errToObj(n)})}nonempty(e){return this.min(1,he.errToObj(e))}trim(){return new pn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pn({...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}}pn.create=t=>{var e;return new pn({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};function dy(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class pr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.number,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="int"?Ge.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?dy(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_finite,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,i){return new pr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(i)}]})}_addCheck(e){return new pr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:he.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:he.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.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"&&Ge.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)}}pr.create=t=>new pr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class hr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.bigint,received:l.parsedType}),be}let o;const i=new bt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,i){return new hr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(i)}]})}_addCheck(e){return new hr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.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}}hr.create=t=>{var e;return new hr({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};class ni extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.boolean,received:o.parsedType}),be}return Vt(e.data)}}ni.create=t=>new ni({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class Ur extends Pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.date,received:l.parsedType}),be}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_date}),be}const o=new bt;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ur({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:he.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:he.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}}Ur.create=t=>new Ur({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Ve(t)});class Cs extends Pe{_parse(e){if(this._getType(e)!==ae.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.symbol,received:o.parsedType}),be}return Vt(e.data)}}Cs.create=t=>new Cs({typeName:ve.ZodSymbol,...Ve(t)});class ri extends Pe{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.undefined,received:o.parsedType}),be}return Vt(e.data)}}ri.create=t=>new ri({typeName:ve.ZodUndefined,...Ve(t)});class oi extends Pe{_parse(e){if(this._getType(e)!==ae.null){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.null,received:o.parsedType}),be}return Vt(e.data)}}oi.create=t=>new oi({typeName:ve.ZodNull,...Ve(t)});class fo extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return Vt(e.data)}}fo.create=t=>new fo({typeName:ve.ZodAny,...Ve(t)});class Zr extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Vt(e.data)}}Zr.create=t=>new Zr({typeName:ve.ZodUnknown,...Ve(t)});class Kn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:ae.never,received:n.parsedType}),be}}Kn.create=t=>new Kn({typeName:ve.ZodNever,...Ve(t)});class vs extends Pe{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.void,received:o.parsedType}),be}return Vt(e.data)}}vs.create=t=>new vs({typeName:ve.ZodVoid,...Ve(t)});class hn extends Pe{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==ae.array)return ie(n,{code:ee.invalid_type,expected:ae.array,received:n.parsedType}),be;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(ie(n,{code:c?ee.too_big:ee.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new In(n,c,n.path,d)))).then(c=>bt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new In(n,c,n.path,d)));return bt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:he.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:he.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:he.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ve(e)});function mo(t){if(t instanceof nt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Ln.create(mo(o))}return new nt({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:mo(t.element)}):t instanceof Ln?Ln.create(mo(t.unwrap())):t instanceof mr?mr.create(mo(t.unwrap())):t instanceof Fn?Fn.create(t.items.map(e=>mo(e))):t}class nt extends Pe{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=Ge.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const h=this._getOrReturnCtx(e);return ie(h,{code:ee.invalid_type,expected:ae.object,received:h.parsedType}),be}const{status:o,ctx:i}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof Kn&&this._def.unknownKeys==="strip"))for(const h in i.data)c.includes(h)||d.push(h);const p=[];for(const h of c){const m=l[h],y=i.data[h];p.push({key:{status:"valid",value:h},value:m._parse(new In(i,y,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof Kn){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of d)p.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(h==="strict")d.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:d}),o.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of d){const y=i.data[m];p.push({key:{status:"valid",value:m},value:h._parse(new In(i,y,i.path,m)),alwaysSet:m in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of p){const y=await m.key,w=await m.value;h.push({key:y,value:w,alwaysSet:m.alwaysSet})}return h}).then(h=>bt.mergeObjectSync(o,h)):bt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return he.errToObj,new nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=he.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new nt({...this._def,unknownKeys:"strip"})}passthrough(){return new nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nt({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 nt({...this._def,catchall:e})}pick(e){const n={};return Ge.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}omit(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}deepPartial(){return mo(this)}partial(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new nt({...this._def,shape:()=>n})}required(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Ln;)l=l._def.innerType;n[o]=l}}),new nt({...this._def,shape:()=>n})}keyof(){return cu(Ge.objectKeys(this.shape))}}nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)});class ii extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Wt(d.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:c}),be}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(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new Wt(p));return ie(n,{code:ee.invalid_union,unionErrors:d}),be}}get options(){return this._def.options}}ii.create=(t,e)=>new ii({options:t,typeName:ve.ZodUnion,...Ve(e)});const Yn=t=>t instanceof li?Yn(t.schema):t instanceof fn?Yn(t.innerType()):t instanceof ci?[t.value]:t instanceof fr?t.options:t instanceof di?Ge.objectValues(t.enum):t instanceof ui?Yn(t._def.innerType):t instanceof ri?[void 0]:t instanceof oi?[null]:t instanceof Ln?[void 0,...Yn(t.unwrap())]:t instanceof mr?[null,...Yn(t.unwrap())]:t instanceof pl||t instanceof fi?Yn(t.unwrap()):t instanceof pi?Yn(t._def.innerType):[];class ws extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ie(n,{code:ee.invalid_type,expected:ae.object,received:n.parsedType}),be;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=Yn(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 d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new ws({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ve(o)})}}function ul(t,e){const n=ur(t),o=ur(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&o===ae.object){const i=Ge.objectKeys(e),l=Ge.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=ul(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===ae.array&&o===ae.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=ul(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class si extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(ll(l)||ll(c))return be;const d=ul(l.value,c.value);return d.valid?((cl(l)||cl(c))&&n.dirty(),{status:n.value,value:d.data}):(ie(o,{code:ee.invalid_intersection_types}),be)};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])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}si.create=(t,e,n)=>new si({left:t,right:e,typeName:ve.ZodIntersection,...Ve(n)});class Fn extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ie(o,{code:ee.invalid_type,expected:ae.array,received:o.parsedType}),be;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new In(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>bt.mergeArray(n,c)):bt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Fn({...this._def,rest:e})}}Fn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:t,typeName:ve.ZodTuple,rest:null,...Ve(e)})};class ai extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ie(o,{code:ee.invalid_type,expected:ae.object,received:o.parsedType}),be;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new In(o,d,o.path,d)),value:c._parse(new In(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?bt.mergeObjectAsync(n,i):bt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Pe?new ai({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ve(o)}):new ai({keyType:pn.create(),valueType:e,typeName:ve.ZodRecord,...Ve(n)})}}class bs extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ie(o,{code:ee.invalid_type,expected:ae.map,received:o.parsedType}),be;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new In(o,d,o.path,[h,"key"])),value:l._parse(new In(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}bs.create=(t,e,n)=>new bs({valueType:e,keyType:t,typeName:ve.ZodMap,...Ve(n)});class Wr extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ie(o,{code:ee.invalid_type,expected:ae.set,received:o.parsedType}),be;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ie(o,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ie(o,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return be;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new In(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Wr({...this._def,minSize:{value:e,message:he.toString(n)}})}max(e,n){return new Wr({...this._def,maxSize:{value:e,message:he.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Wr.create=(t,e)=>new Wr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ve(e)});class go extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return ie(n,{code:ee.invalid_type,expected:ae.function,received:n.parsedType}),be;function o(d,p){return ys({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,gs(),po].filter(h=>!!h),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function i(d,p){return ys({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,gs(),po].filter(h=>!!h),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof yo){const d=this;return Vt(async function(...p){const h=new Wt([]),m=await d._def.args.parseAsync(p,l).catch(b=>{throw h.addIssue(o(p,b)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(b=>{throw h.addIssue(i(y,b)),h})})}else{const d=this;return Vt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new Wt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new Wt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new go({...this._def,args:Fn.create(e).rest(Zr.create())})}returns(e){return new go({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new go({args:e||Fn.create([]).rest(Zr.create()),returns:n||Zr.create(),typeName:ve.ZodFunction,...Ve(o)})}}class li extends Pe{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})}}li.create=(t,e)=>new li({getter:t,typeName:ve.ZodLazy,...Ve(e)});class ci extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}}ci.create=(t,e)=>new ci({value:t,typeName:ve.ZodLiteral,...Ve(e)});function cu(t,e){return new fr({values:t,typeName:ve.ZodEnum,...Ve(e)})}class fr extends Pe{constructor(){super(...arguments),ei.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Ge.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(_s(this,ei)||ou(this,ei,new Set(this._def.values)),!_s(this,ei).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Vt(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 fr.create(e,{...this._def,...n})}exclude(e,n=this._def){return fr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}ei=new WeakMap,fr.create=cu;class di extends Pe{constructor(){super(...arguments),ti.set(this,void 0)}_parse(e){const n=Ge.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const i=Ge.objectValues(n);return ie(o,{expected:Ge.joinValues(i),received:o.parsedType,code:ee.invalid_type}),be}if(_s(this,ti)||ou(this,ti,new Set(Ge.getValidEnumValues(this._def.values))),!_s(this,ti).has(e.data)){const i=Ge.objectValues(n);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:i}),be}return Vt(e.data)}get enum(){return this._def.values}}ti=new WeakMap,di.create=(t,e)=>new di({values:t,typeName:ve.ZodNativeEnum,...Ve(e)});class yo extends Pe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:ae.promise,received:n.parsedType}),be;const o=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return Vt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}yo.create=(t,e)=>new yo({type:t,typeName:ve.ZodPromise,...Ve(e)});class fn extends Pe{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),i=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return be;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?be:p.status==="dirty"||n.value==="dirty"?ho(p.value):p});{if(n.value==="aborted")return be;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?be:d.status==="dirty"||n.value==="dirty"?ho(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,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 d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Jo(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Jo(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);Ge.assertNever(i)}}fn.create=(t,e,n)=>new fn({schema:t,typeName:ve.ZodEffects,effect:e,...Ve(n)}),fn.createWithPreprocess=(t,e,n)=>new fn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ve(n)});class Ln extends Pe{_parse(e){return this._getType(e)===ae.undefined?Vt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ln.create=(t,e)=>new Ln({innerType:t,typeName:ve.ZodOptional,...Ve(e)});class mr extends Pe{_parse(e){return this._getType(e)===ae.null?Vt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mr.create=(t,e)=>new mr({innerType:t,typeName:ve.ZodNullable,...Ve(e)});class ui extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ui.create=(t,e)=>new ui({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ve(e)});class pi extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Qo(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Wt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}pi.create=(t,e)=>new pi({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ve(e)});class xs extends Pe{_parse(e){if(this._getType(e)!==ae.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.nan,received:o.parsedType}),be}return{status:"valid",value:e.data}}}xs.create=t=>new xs({typeName:ve.ZodNaN,...Ve(t)});const uy=Symbol("zod_brand");class pl extends Pe{_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 hi extends Pe{_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"?be:l.status==="dirty"?(n.dirty(),ho(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new hi({in:e,out:n,typeName:ve.ZodPipeline})}}class fi extends Pe{_parse(e){const n=this._def.innerType._parse(e),o=i=>(Jo(i)&&(i.value=Object.freeze(i.value)),i);return Qo(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}fi.create=(t,e)=>new fi({innerType:t,typeName:ve.ZodReadonly,...Ve(e)});function du(t,e={},n){return t?fo.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):fo.create()}const py={object:nt.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 hy=(t,e={message:`Input not instance of ${t.name}`})=>du(n=>n instanceof t,e),uu=pn.create,pu=pr.create,fy=xs.create,my=hr.create,hu=ni.create,gy=Ur.create,yy=Cs.create,_y=ri.create,Cy=oi.create,vy=fo.create,wy=Zr.create,by=Kn.create,xy=vs.create,ky=hn.create,Ey=nt.create,Sy=nt.strictCreate,Ty=ii.create,Ny=ws.create,Vy=si.create,Ay=Fn.create,By=ai.create,Py=bs.create,Ry=Wr.create,Dy=go.create,Iy=li.create,Fy=ci.create,Ly=fr.create,Oy=di.create,My=yo.create,fu=fn.create,Gy=Ln.create,$y=mr.create,zy=fn.createWithPreprocess,Uy=hi.create;var On=Object.freeze({__proto__:null,defaultErrorMap:po,setErrorMap:qg,getErrorMap:gs,makeIssue:ys,EMPTY_PATH:Kg,addIssueToContext:ie,ParseStatus:bt,INVALID:be,DIRTY:ho,OK:Vt,isAborted:ll,isDirty:cl,isValid:Jo,isAsync:Qo,get util(){return Ge},get objectUtil(){return al},ZodParsedType:ae,getParsedType:ur,ZodType:Pe,datetimeRegex:lu,ZodString:pn,ZodNumber:pr,ZodBigInt:hr,ZodBoolean:ni,ZodDate:Ur,ZodSymbol:Cs,ZodUndefined:ri,ZodNull:oi,ZodAny:fo,ZodUnknown:Zr,ZodNever:Kn,ZodVoid:vs,ZodArray:hn,ZodObject:nt,ZodUnion:ii,ZodDiscriminatedUnion:ws,ZodIntersection:si,ZodTuple:Fn,ZodRecord:ai,ZodMap:bs,ZodSet:Wr,ZodFunction:go,ZodLazy:li,ZodLiteral:ci,ZodEnum:fr,ZodNativeEnum:di,ZodPromise:yo,ZodEffects:fn,ZodTransformer:fn,ZodOptional:Ln,ZodNullable:mr,ZodDefault:ui,ZodCatch:pi,ZodNaN:xs,BRAND:uy,ZodBranded:pl,ZodPipeline:hi,ZodReadonly:fi,custom:du,Schema:Pe,ZodSchema:Pe,late:py,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>pn.create({...t,coerce:!0}),number:t=>pr.create({...t,coerce:!0}),boolean:t=>ni.create({...t,coerce:!0}),bigint:t=>hr.create({...t,coerce:!0}),date:t=>Ur.create({...t,coerce:!0})},any:vy,array:ky,bigint:my,boolean:hu,date:gy,discriminatedUnion:Ny,effect:fu,enum:Ly,function:Dy,instanceof:hy,intersection:Vy,lazy:Iy,literal:Fy,map:Py,nan:fy,nativeEnum:Oy,never:by,null:Cy,nullable:$y,number:pu,object:Ey,oboolean:()=>hu().optional(),onumber:()=>pu().optional(),optional:Gy,ostring:()=>uu().optional(),pipeline:Uy,preprocess:zy,promise:My,record:By,set:Ry,strictObject:Sy,string:uu,symbol:yy,transformer:fu,tuple:Ay,undefined:_y,union:Ty,unknown:wy,void:xy,NEVER:be,ZodIssueCode:ee,quotelessJson:Hg,ZodError:Wt});const Zy=-2147483648,mu=-9007199254740991n,Wy=NaN,jy=NaN,Hy=null,qy=null;function Ky(t,e){switch(e){case"Int":return t===Zy;case"Long":return t===Number(mu)||t===mu;case"Float":return t===Wy;case"Double":return t===jy;case"String":return t===Hy;case"Bytes":return t===qy;default:throw Error(`unsupported data type: ${e}`)}}function Yy(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}const Xy={type:"absent"},Jy=null;function gu(t,e){if(Yy(t.absent,e))return Xy;const n=t.data[e],o=t.type;if(Ky(n,o))return Jy;switch(o){case"Int":return n;case"Long":return Number(n);case"Float":return n;case"Double":return n;case"String":return n;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${o}`)}}function jr(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}On.object({__isRef:On.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:On.string().describe("Upstream block id"),name:On.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 Qy(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 e_=On.object({type:On.string(),importance:On.number().optional(),id:On.string().optional(),label:On.string()});On.array(e_);const t_="1.18.0";function ks(){return Qy({sdkVersion:t_})}function n_(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function _o(t){return!!t&&typeof t.children<"u"}function gr(t){return _o(t)?t.groupId:t.colId}function yu(t,e,n){const o=(c,d)=>{const p=c.children.map(gr),h=k._includes(p,gr(d)),m=k._last(c.children),y=m&&gr(m)!==gr(d);return h&&y};if(!_o(t))return!0;const i=t,l=n;if(o(i,l))return i.children.push(l),!0;if(i.groupId===e){const c=i.children.map(gr);if(!k._includes(c,gr(l)))return i.children.push(l),!0}for(let c=i.children.length-1;c>=0&&!yu(i.children[c],e,n);c--);return!1}function r_(t){const e=(i,l)=>_o(i)&&_o(l)&&gr(i)===gr(l),n=(i,l)=>{if(!_o(l))return i;const c=i,d=l;return d.children&&d.groupId&&yu(c,d.groupId,d.children[0])||d.children.forEach(p=>n(c,p)),c},o=[];for(let i=1;i<=t.length;i++){const l=t[i-1],c=t[i];e(l,c)?t[i]=n(l,c):o.push(l)}return o}var o_=class extends k.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(i,l)=>{if(_o(i)){const c=i,d=typeof c.groupId<"u"?c.groupId:c.headerName,p=new k.AgProvidedColumnGroup(c,d,!1,l),h=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&h.push(y)}),p.setChildren(h),p}else{const c=i,d=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(d);return p||e.push(c),p}},o=[];return t.forEach(i=>{const l=n(i,0);l&&o.push(l)}),e.length>0&&k._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=r_(e);t(n)}getLeafPathTrees(){const t=(o,i)=>{let l;if(k.isProvidedColumnGroup(o))if(o.isPadding())l=i;else{const d=Object.assign({},o.getColGroupDef());d.groupId=o.getGroupId(),d.children=[i],l=d}else{const d=Object.assign({},o.getColDef());d.colId=o.getColId(),l=d}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const i=o.getColDef();return o.isPrimary()&&!i.showRowGroup}).map(o=>t(o,o.getColDef()))}};function i_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function s_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function a_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function l_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function c_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function d_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function u_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function p_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function h_(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return k._unwrapUserComp(n)}function f_(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var m_=class extends k.Component{constructor(t){super(),this.eToggleButton=k.RefPlaceholder,this.eIconWrapper=k.RefPlaceholder,this.eLabel=k.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",
|
|
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",k._createIconNoSpan(this.toolPanelDef.iconKey,this.gos))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(t){this.addOrRemoveCssClass("ag-selected",t),k._setAriaExpanded(this.eToggleButton,t)}getButtonElement(){return this.eToggleButton}},g_=class extends k.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!==k.KeyCode.TAB||!t.shiftKey)){if(this.focusService.focusNextGridCoreContainer(!0)){t.preventDefault();return}k._stopPropagationForAgGrid(t)}}setActiveButton(t){this.buttonComps.forEach(e=>{e.setSelected(t===e.getToolPanelId())})}addButtonComp(t){const e=this.createBean(new m_(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),k._clearElement(this.getGui()),super.destroy()}destroy(){this.clearButtons(),super.destroy()}},y_={selector:"AG-SIDE-BAR-BUTTONS",component:g_},_u={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},Cu={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},hl={columns:_u,filters:Cu};function fl(t){if(!t)return;if(t===!0)return{toolPanels:[_u,Cu],defaultToolPanel:"columns"};if(typeof t=="string")return fl([t]);if(Array.isArray(t)){const n=[];return t.forEach(o=>{const i=hl[o];if(!i){vu(o);return}n.push(i)}),n.length===0?void 0:{toolPanels:n,defaultToolPanel:n[0].id}}return{toolPanels:__(t.toolPanels),defaultToolPanel:t.defaultToolPanel,hiddenByDefault:t.hiddenByDefault,position:t.position}}function vu(t){k._warnOnce(`the key ${t} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(hl).join(",")}`)}function __(t){const e=[];return t&&t.forEach(n=>{let o=null;if(typeof n=="string"){const i=hl[n];if(!i){vu(n);return}o=i}else o=n;e.push(o)}),e}var C_=class extends k.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}},v_=class extends k.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 C_);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:i,width:l}=t;this.toolPanelId=n,this.width=l;const c=this.userComponentFactory.getToolPanelCompDetails(t,e),d=c.newAgStackInstance();if(this.params=c.params,d==null){k._warnOnce(`error processing tool panel component ${n}. You need to specify 'toolPanel'`);return}d.then(this.setToolPanelComponent.bind(this)),o!=null&&this.resizeBar.setMinWidth(o),i!=null&&this.resizeBar.setMaxWidth(i)}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)}},w_=class extends k.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>`,[f_]),this.sideBarButtons=x.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:hl(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new x.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),x._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,o=this.getGui(),i=n.getGui(),l=x._getActiveDomElement(this.gos),c=o.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),d=t.target;if(!c)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(i.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,d)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(c,d)),p||(p=i.querySelector(".ag-selected button")),p&&p!==t.target&&(t.preventDefault(),p.focus())}handleKeyDown(t){const e=x._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")),i=o.findIndex(d=>d.contains(e));let l=null;switch(t.key){case x.KeyCode.LEFT:case x.KeyCode.UP:l=Math.max(0,i-1);break;case x.KeyCode.RIGHT:case x.KeyCode.DOWN:l=Math.min(i+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 i=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(i),this.setSideBarPosition(e?e.position:this.sideBar.position),i)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 i of t)this.createToolPanelAndSideButton(i,(o=e==null?void 0:e.toolPanels)==null?void 0:o[i.id],n==null?void 0:n[i.id])}validateDef(t){var e;if(t.id==null)return x._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(x.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(x.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return x._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 i;n?i=n:(i=this.createBean(new y_),i.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),i.setDisplayed(!1);const l=i.getGui();this.appendChild(l),this.toolPanelWrappers.push(i),x._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){x._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=hl(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(o=>{var h,m;const{id:i}=o;if(!i)return;const l=(h=this.sideBar.toolPanels)==null?void 0:h.find(y=>y.id===i);if(!l||o.toolPanel!==l.toolPanel)return;const c=this.toolPanelWrappers.find(y=>y.getToolPanelId()===i);if(!c)return;const d=this.gos.addGridCommonParams({...o.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=c.getToolPanelInstance())==null?void 0:m.refresh(d))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(y=>y!==c),x._removeFromParent(c.getGui()),e[i]=c)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:e})}dispatchSideBarUpdated(){this.eventService.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(t=>{x._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},C_={selector:"AG-SIDE-BAR",component:__},v_=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return C_}},fl="32.3.3",vu=x._defineModule({version:fl,moduleName:`${x.ModuleNames.SideBarModule}-core`,beans:[t_,v_],dependantModules:[Me.EnterpriseCoreModule]}),w_=x._defineModule({version:fl,moduleName:`${x.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:n_,setSideBarVisible:r_,setSideBarPosition:o_,openToolPanel:i_,closeToolPanel:s_,getOpenedToolPanel:a_,refreshToolPanel:l_,isToolPanelShowing:c_,getToolPanelInstance:d_,getSideBar:u_},dependantModules:[vu]}),ml=x._defineModule({version:fl,moduleName:x.ModuleNames.SideBarModule,dependantModules:[vu,w_]}),b_={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},x_=class extends x.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=k_,t.first=S_,t.last=E_,t.min=T_,t.max=N_,t.count=V_,t.avg=A_,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),o=x._includes(n,e),i=x._exists(this.aggFuncsMap[e]);return o&&i}getDefaultFuncLabel(t){return b_[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(x._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return x._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),x._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 k_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];typeof i=="number"?n===null?n=i:n+=typeof n=="number"?i:BigInt(i):typeof i=="bigint"&&(n===null?n=i:n=(typeof n=="bigint"?n:BigInt(n))+i)}return n}function S_(t){return t.values.length>0?t.values[0]:null}function E_(t){return t.values.length>0?x._last(t.values):null}function T_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];(typeof i=="number"||typeof i=="bigint")&&(n===null||n>i)&&(n=i)}return n}function N_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];(typeof i=="number"||typeof i=="bigint")&&(n===null||n<i)&&(n=i)}return n}function V_(t){var i,l;const{values:e}=t;let n=0;for(let c=0;c<e.length;c++){const d=e[c];n+=d!=null&&typeof d.value=="number"?d.value:1}const o=(l=(i=t.rowNode)==null?void 0:i.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 A_(t){var c,d,p;const{values:e}=t;let n=0,o=0;for(let h=0;h<e.length;h++){const m=e[h];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 i=null;o>0&&(i=n/(typeof n=="number"?o:BigInt(o)));const l=(p=(c=t.rowNode)==null?void 0:c.aggData)==null?void 0:p[(d=t.column)==null?void 0:d.getColId()];return l&&l.count===o&&l.value===i?l:{count:o,value:i,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var B_=class extends x.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=x._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),o=t.changedPath&&t.changedPath.isActive();if(e&&n&&o)return;const i=this.createAggDetails(t);this.recursivelyCreateAggData(i)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),o=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!x._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:o,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return x._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 i;e.userAggFunc?i=e.userAggFunc({nodes:t.childrenAfterFilter}):n?i=null:o?i=this.aggregateRowNodeUsingValuesOnly(t,e):i=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(i),t.sibling&&t.sibling.setAggData(i)}aggregateRowNodeUsingValuesAndPivot(t){var i;const e={},n=((i=this.pivotResultColsService.getPivotResultCols())==null?void 0:i.list)??[];let o=!0;for(let l=0;l<n.length;l++){const c=n[l],d=c.getColDef();if(d.pivotTotalColumnIds!=null){o=!1;continue}const p=d.pivotKeys??[];let h;t.leafGroup?h=this.getValuesFromMappedSet(t.childrenMapped,p,d.pivotValueColumn):h=this.getValuesPivotNonLeaf(t,d.colId),e[d.colId]=this.aggregateValues(h,d.pivotValueColumn.getAggFunc(),d.pivotValueColumn,t,c)}if(!o)for(let l=0;l<n.length;l++){const c=n[l],d=c.getColDef();if(d.pivotTotalColumnIds==null||!d.pivotTotalColumnIds.length)continue;const p=d.pivotTotalColumnIds.map(h=>e[h]);e[d.colId]=this.aggregateValues(p,d.pivotValueColumn.getAggFunc(),d.pivotValueColumn,t,c)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},o=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,i=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,o,e.filteredOnly),c=t.aggData;return o.forEach((d,p)=>{n[d.getId()]=this.aggregateValues(l[p],d.getAggFunc(),d,t)}),i&&c&&i.forEach(d=>{n[d.getId()]=c[d.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let o=t;for(let i=0;i<e.length;i++){const l=e[i];o=o?o[l]:null}return o?o.map(i=>this.valueService.getValue(n,i)):[]}getValuesNormal(t,e,n){const o=[];e.forEach(()=>o.push([]));const i=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,c=l.length;for(let d=0;d<c;d++){const p=l[d];for(let h=0;h<i;h++){const m=e[h],y=this.valueService.getValue(m,p);o[h].push(y)}}return o}aggregateValues(t,e,n,o,i){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return x._errorOnce(`unrecognised aggregation function ${e}`),null;const c=l,d=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:i,rowNode:o,data:o?o.data:void 0});return c(d)}},P_=class extends x.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=x._isGroupMultiAutoColumn(this.gos);return n&&o&&(x._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((i,l)=>{e.push(this.createOneAutoCol(i,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=`${x.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=x.GROUP_AUTO_COLUMN_ID;const o=this.createAutoColDef(n,t,e);o.colId=n;const i=new x.AgColumn(o,null,n,!0);return this.createBean(i),i}updateOneAutoCol(t,e,n){const o=t.getColDef(),i=typeof o.showRowGroup=="string"?o.showRowGroup:void 0,l=i!=null?this.columnModel.getColDefCol(i):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 i=this.gos.get("autoGroupColumnDef");x._mergeDeep(o,i),o=this.columnFactory.addColumnDefaultAndTypes(o,t),this.gos.get("treeData")||x._missing(o.field)&&x._missing(o.valueGetter)&&x._missing(o.filterValueGetter)&&o.filter!=="agGroupColumnFilter"&&(o.filter=!1),n&&n>0&&(o.headerCheckboxSelection=!1);const l=x._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}},R_=class extends Me.PillDragComp{constructor(t,e,n,o,i){super(e,n,i,`
|
|
10
|
+
</div>`,[y_]),this.sideBarButtons=k.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:fl(this.gos.get("sideBar")),sideBarState:t}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),this.sideBarService.registerSideBarComp(this);const e=this.getFocusableElement();this.createManagedBean(new k.ManagedFocusFeature(e,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),k._addFocusableContainerListener(this,e,this.focusService)}onTabKeyDown(t){if(t.defaultPrevented)return;const{focusService:e,sideBarButtons:n}=this,o=this.getGui(),i=n.getGui(),l=k._getActiveDomElement(this.gos),c=o.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),d=t.target;if(!c)return e.focusNextGridCoreContainer(t.shiftKey,!0);if(i.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,d)&&t.shiftKey&&(p=this.focusService.findFocusableElementBeforeTabGuard(c,d)),p||(p=i.querySelector(".ag-selected button")),p&&p!==t.target&&(t.preventDefault(),p.focus())}handleKeyDown(t){const e=k._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")),i=o.findIndex(d=>d.contains(e));let l=null;switch(t.key){case k.KeyCode.LEFT:case k.KeyCode.UP:l=Math.max(0,i-1);break;case k.KeyCode.RIGHT:case k.KeyCode.DOWN:l=Math.min(i+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 i=e?e.visible:!this.sideBar.hiddenByDefault;if(this.setDisplayed(i),this.setSideBarPosition(e?e.position:this.sideBar.position),i)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 i of t)this.createToolPanelAndSideButton(i,(o=e==null?void 0:e.toolPanels)==null?void 0:o[i.id],n==null?void 0:n[i.id])}validateDef(t){var e;if(t.id==null)return k._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(k.ModuleNames.ColumnsToolPanelModule,"Column Tool Panel"))return!1;if(t.toolPanel==="agFiltersToolPanel"){if(!this.gos.assertModuleRegistered(k.ModuleNames.FiltersToolPanelModule,"Filters Tool Panel"))return!1;if((e=this.filterManager)!=null&&e.isAdvancedFilterEnabled())return k._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 i;n?i=n:(i=this.createBean(new v_),i.setToolPanelDef(t,{initialState:e,onStateUpdated:()=>this.dispatchSideBarUpdated()})),i.setDisplayed(!1);const l=i.getGui();this.appendChild(l),this.toolPanelWrappers.push(i),k._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){k._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=fl(this.gos.get("sideBar")),e={};t&&this.sideBar&&((n=t.toolPanels)==null||n.forEach(o=>{var h,m;const{id:i}=o;if(!i)return;const l=(h=this.sideBar.toolPanels)==null?void 0:h.find(y=>y.id===i);if(!l||o.toolPanel!==l.toolPanel)return;const c=this.toolPanelWrappers.find(y=>y.getToolPanelId()===i);if(!c)return;const d=this.gos.addGridCommonParams({...o.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});((m=c.getToolPanelInstance())==null?void 0:m.refresh(d))===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(y=>y!==c),k._removeFromParent(c.getGui()),e[i]=c)})),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,existingToolPanelWrappers:e})}dispatchSideBarUpdated(){this.eventService.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(t=>{k._removeFromParent(t.getGui()),this.destroyBean(t)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},b_={selector:"AG-SIDE-BAR",component:w_},x_=class extends k.BeanStub{constructor(){super(...arguments),this.beanName="sideBarService"}registerSideBarComp(t){this.sideBarComp=t}getSideBarComp(){return this.sideBarComp}getSideBarSelector(){return b_}},ml="32.3.3",wu=k._defineModule({version:ml,moduleName:`${k.ModuleNames.SideBarModule}-core`,beans:[o_,x_],dependantModules:[Me.EnterpriseCoreModule]}),k_=k._defineModule({version:ml,moduleName:`${k.ModuleNames.SideBarModule}-api`,apiFunctions:{isSideBarVisible:i_,setSideBarVisible:s_,setSideBarPosition:a_,openToolPanel:l_,closeToolPanel:c_,getOpenedToolPanel:d_,refreshToolPanel:u_,isToolPanelShowing:p_,getToolPanelInstance:h_,getSideBar:f_},dependantModules:[wu]}),gl=k._defineModule({version:ml,moduleName:k.ModuleNames.SideBarModule,dependantModules:[wu,k_]}),E_={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},S_=class extends k.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=T_,t.first=N_,t.last=V_,t.min=A_,t.max=B_,t.count=P_,t.avg=R_,this.initialised=!0}isAggFuncPossible(t,e){const n=this.getFuncNames(t),o=k._includes(n,e),i=k._exists(this.aggFuncsMap[e]);return o&&i}getDefaultFuncLabel(t){return E_[t]??t}getDefaultAggFunc(t){const e=t.getColDef().defaultAggFunc;if(k._exists(e)&&this.isAggFuncPossible(t,e))return e;if(this.isAggFuncPossible(t,"sum"))return"sum";const n=this.getFuncNames(t);return k._existsAndNotEmpty(n)?n[0]:null}addAggFuncs(t){this.init(),k._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 T_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];typeof i=="number"?n===null?n=i:n+=typeof n=="number"?i:BigInt(i):typeof i=="bigint"&&(n===null?n=i:n=(typeof n=="bigint"?n:BigInt(n))+i)}return n}function N_(t){return t.values.length>0?t.values[0]:null}function V_(t){return t.values.length>0?k._last(t.values):null}function A_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];(typeof i=="number"||typeof i=="bigint")&&(n===null||n>i)&&(n=i)}return n}function B_(t){const{values:e}=t;let n=null;for(let o=0;o<e.length;o++){const i=e[o];(typeof i=="number"||typeof i=="bigint")&&(n===null||n<i)&&(n=i)}return n}function P_(t){var i,l;const{values:e}=t;let n=0;for(let c=0;c<e.length;c++){const d=e[c];n+=d!=null&&typeof d.value=="number"?d.value:1}const o=(l=(i=t.rowNode)==null?void 0:i.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 R_(t){var c,d,p;const{values:e}=t;let n=0,o=0;for(let h=0;h<e.length;h++){const m=e[h];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 i=null;o>0&&(i=n/(typeof n=="number"?o:BigInt(o)));const l=(p=(c=t.rowNode)==null?void 0:c.aggData)==null?void 0:p[(d=t.column)==null?void 0:d.getColId()];return l&&l.count===o&&l.value===i?l:{count:o,value:i,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}var D_=class extends k.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=k._missingOrEmpty(this.funcColsService.getValueColumns()),n=!this.gos.getCallback("getGroupRowAgg"),o=t.changedPath&&t.changedPath.isActive();if(e&&n&&o)return;const i=this.createAggDetails(t);this.recursivelyCreateAggData(i)}createAggDetails(t){const e=this.columnModel.isPivotActive(),n=this.funcColsService.getValueColumns(),o=e?this.funcColsService.getPivotColumns():[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!k._getGrandTotalRow(this.gos),changedPath:t.changedPath,valueColumns:n,pivotColumns:o,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return k._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 i;e.userAggFunc?i=e.userAggFunc({nodes:t.childrenAfterFilter}):n?i=null:o?i=this.aggregateRowNodeUsingValuesOnly(t,e):i=this.aggregateRowNodeUsingValuesAndPivot(t),t.setAggData(i),t.sibling&&t.sibling.setAggData(i)}aggregateRowNodeUsingValuesAndPivot(t){var i;const e={},n=((i=this.pivotResultColsService.getPivotResultCols())==null?void 0:i.list)??[];let o=!0;for(let l=0;l<n.length;l++){const c=n[l],d=c.getColDef();if(d.pivotTotalColumnIds!=null){o=!1;continue}const p=d.pivotKeys??[];let h;t.leafGroup?h=this.getValuesFromMappedSet(t.childrenMapped,p,d.pivotValueColumn):h=this.getValuesPivotNonLeaf(t,d.colId),e[d.colId]=this.aggregateValues(h,d.pivotValueColumn.getAggFunc(),d.pivotValueColumn,t,c)}if(!o)for(let l=0;l<n.length;l++){const c=n[l],d=c.getColDef();if(d.pivotTotalColumnIds==null||!d.pivotTotalColumnIds.length)continue;const p=d.pivotTotalColumnIds.map(h=>e[h]);e[d.colId]=this.aggregateValues(p,d.pivotValueColumn.getAggFunc(),d.pivotValueColumn,t,c)}return e}aggregateRowNodeUsingValuesOnly(t,e){const n={},o=e.changedPath.isActive()?e.changedPath.getValueColumnsForNode(t,e.valueColumns):e.valueColumns,i=e.changedPath.isActive()?e.changedPath.getNotValueColumnsForNode(t,e.valueColumns):null,l=this.getValuesNormal(t,o,e.filteredOnly),c=t.aggData;return o.forEach((d,p)=>{n[d.getId()]=this.aggregateValues(l[p],d.getAggFunc(),d,t)}),i&&c&&i.forEach(d=>{n[d.getId()]=c[d.getId()]}),n}getValuesPivotNonLeaf(t,e){return t.childrenAfterFilter.map(n=>n.aggData[e])}getValuesFromMappedSet(t,e,n){let o=t;for(let i=0;i<e.length;i++){const l=e[i];o=o?o[l]:null}return o?o.map(i=>this.valueService.getValue(n,i)):[]}getValuesNormal(t,e,n){const o=[];e.forEach(()=>o.push([]));const i=e.length,l=n?t.childrenAfterFilter:t.childrenAfterGroup,c=l.length;for(let d=0;d<c;d++){const p=l[d];for(let h=0;h<i;h++){const m=e[h],y=this.valueService.getValue(m,p);o[h].push(y)}}return o}aggregateValues(t,e,n,o,i){const l=typeof e=="string"?this.aggFuncService.getAggFunc(e):e;if(typeof l!="function")return k._errorOnce(`unrecognised aggregation function ${e}`),null;const c=l,d=this.gos.addGridCommonParams({values:t,column:n,colDef:n?n.getColDef():void 0,pivotResultColumn:i,rowNode:o,data:o?o.data:void 0});return c(d)}},I_=class extends k.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=k._isGroupMultiAutoColumn(this.gos);return n&&o&&(k._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((i,l)=>{e.push(this.createOneAutoCol(i,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=`${k.GROUP_AUTO_COLUMN_ID}-${t.getId()}`:n=k.GROUP_AUTO_COLUMN_ID;const o=this.createAutoColDef(n,t,e);o.colId=n;const i=new k.AgColumn(o,null,n,!0);return this.createBean(i),i}updateOneAutoCol(t,e,n){const o=t.getColDef(),i=typeof o.showRowGroup=="string"?o.showRowGroup:void 0,l=i!=null?this.columnModel.getColDefCol(i):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 i=this.gos.get("autoGroupColumnDef");k._mergeDeep(o,i),o=this.columnFactory.addColumnDefaultAndTypes(o,t),this.gos.get("treeData")||k._missing(o.field)&&k._missing(o.valueGetter)&&k._missing(o.filterValueGetter)&&o.filter!=="agGroupColumnFilter"&&(o.filter=!1),n&&n>0&&(o.headerCheckboxSelection=!1);const l=k._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}},F_=class extends Me.PillDragComp{constructor(t,e,n,o,i){super(e,n,i,`
|
|
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
|
-
`,[x.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=o,this.eSortIndicator=x.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 i=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(i)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const i=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(i)}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 "),i={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&&`, ${i[l]}`].filter(d=>!!d).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===x.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===x.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 Me.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 i=x._loadTemplate('<div class="ag-select-agg-func-popup"></div>');i.style.top="0px",i.style.left="0px",i.appendChild(o),i.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(i,{focusout:m=>{!i.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()},d=this.localeService.getLocaleTextFunc(),p=this.popupService.addPopup({modal:!0,eChild:i,closeOnEsc:!0,closedCallback:c,ariaLabel:d("ariaLabelAggregationFunction","Aggregation Function")});p&&t.setComponentCreator(this.createAggSelect.bind(this,p.hideFunc)),t.addGuiEventListener("keydown",m=>{if(m.key===x.KeyCode.ENTER||m.key===x.KeyCode.SPACE){const y=t.getLastFocusedRow();if(y==null)return;const w=t.getComponentAt(y);w&&w.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:i,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let h=e.findIndex(m=>m===this.column.getAggFunc());h===-1&&(h=0),t.focusRow(h)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},o=this.localeService.getLocaleTextFunc(),i=e.toString(),l=o(i,i);return new D_(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return x.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},D_=class extends x.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},gl=class extends Me.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===x.DragSourceType.HeaderCell||t===x.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(i=>!i.getColDef().lockVisible);this.columnModel.setColsVisible(o,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,o){return new R_(t,e,n,this.dropZonePurpose,o)}},yl=class extends gl{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:x._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()}},_l=class extends gl{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:x._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()}},I_=class extends x.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"),x._setAriaRole(t,"presentation"),this.rowGroupComp=new _l(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new yl(!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)}},F_={selector:"AG-GRID-HEADER-DROP-ZONES",component:I_},L_=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return F_}},O_=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var h,m;const e=this.columnModel.isPivotMode(),n=((h=this.filterManager)==null?void 0:h.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),o=y=>!y.node.group,i=y=>y.node.leafGroup,l=x._getGroupAggFiltering(this.gos)||(e?i:o),{changedPath:c}=t,d=(y,w=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,w&&y.childrenAfterAggFilter.forEach(v=>d(v,w)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var w;y.childrenAfterAggFilter=((w=y.childrenAfterFilter)==null?void 0:w.filter(v=>{var $;return l({node:v})&&this.filterManager.doesRowPassAggregateFilters({rowNode:v})?(d(v,!0),!0):($=v.childrenAfterAggFilter)==null?void 0:$.length}))||null,this.setAllChildrenCount(y),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)};c.forEachChangedNodeDepthFirst(n?p:d,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const o=e.length;n=o;for(let i=0;i<o;++i)n+=e[i].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)}},M_=class extends x.TabGuardComp{constructor(){super(`
|
|
17
|
+
`,[k.SortIndicatorSelector]),this.column=t,this.dropZonePurpose=o,this.eSortIndicator=k.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 i=e("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");t.push(i)}if(this.isGroupingZone()&&this.column.isSortable()&&!n){const i=e("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");t.push(i)}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 "),i={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&&`, ${i[l]}`].filter(d=>!!d).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===k.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===k.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 Me.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 i=k._loadTemplate('<div class="ag-select-agg-func-popup"></div>');i.style.top="0px",i.style.left="0px",i.appendChild(o),i.style.width=`${n.clientWidth}px`;const[l]=this.addManagedElementListeners(i,{focusout:m=>{!i.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()},d=this.localeService.getLocaleTextFunc(),p=this.popupService.addPopup({modal:!0,eChild:i,closeOnEsc:!0,closedCallback:c,ariaLabel:d("ariaLabelAggregationFunction","Aggregation Function")});p&&t.setComponentCreator(this.createAggSelect.bind(this,p.hideFunc)),t.addGuiEventListener("keydown",m=>{if(m.key===k.KeyCode.ENTER||m.key===k.KeyCode.SPACE){const y=t.getLastFocusedRow();if(y==null)return;const w=t.getComponentAt(y);w&&w.selectItem()}}),this.popupService.positionPopupByComponent({type:"aggFuncSelect",eventSource:n,ePopup:i,keepWithinBounds:!0,column:this.column,position:"under"}),t.refresh();let h=e.findIndex(m=>m===this.column.getAggFunc());h===-1&&(h=0),t.focusRow(h)}createAggSelect(t,e){const n=()=>{t(),this.getGui().focus(),this.funcColsService.setColumnAggFunc(this.column,e,"toolPanelDragAndDrop")},o=this.localeService.getLocaleTextFunc(),i=e.toString(),l=o(i,i);return new L_(n,l)}isGroupingAndLocked(){return this.isGroupingZone()&&this.columnModel.isColGroupLocked(this.column)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return k.DragSourceType.ToolPanel}destroy(){super.destroy(),this.column=null}},L_=class extends k.Component{constructor(t,e){super('<div class="ag-select-agg-func-item"/>'),this.selectItem=t,this.getGui().innerText=e,this.addGuiEventListener("click",this.selectItem)}},yl=class extends Me.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===k.DragSourceType.HeaderCell||t===k.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(i=>!i.getColDef().lockVisible);this.columnModel.setColsVisible(o,e,n)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(t,e,n,o){return new F_(t,e,n,this.dropZonePurpose,o)}},_l=class extends yl{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:k._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()}},Cl=class extends yl{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:k._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()}},O_=class extends k.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"),k._setAriaRole(t,"presentation"),this.rowGroupComp=new Cl(!0),this.createManagedBean(this.rowGroupComp),this.pivotComp=new _l(!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)}},M_={selector:"AG-GRID-HEADER-DROP-ZONES",component:O_},G_=class extends k.BeanStub{constructor(){super(...arguments),this.beanName="columnDropZonesService"}getDropZoneSelector(){return M_}},$_=class extends k.BeanStub{constructor(){super(...arguments),this.beanName="filterAggregatesStage"}wireBeans(t){this.filterManager=t.filterManager,this.columnModel=t.columnModel}execute(t){var h,m;const e=this.columnModel.isPivotMode(),n=((h=this.filterManager)==null?void 0:h.isAggregateFilterPresent())||((m=this.filterManager)==null?void 0:m.isAggregateQuickFilterPresent()),o=y=>!y.node.group,i=y=>y.node.leafGroup,l=k._getGroupAggFiltering(this.gos)||(e?i:o),{changedPath:c}=t,d=(y,w=!1)=>{y.childrenAfterFilter&&(y.childrenAfterAggFilter=y.childrenAfterFilter,w&&y.childrenAfterAggFilter.forEach(b=>d(b,w)),this.setAllChildrenCount(y)),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)},p=y=>{var w;y.childrenAfterAggFilter=((w=y.childrenAfterFilter)==null?void 0:w.filter(b=>{var O;return l({node:b})&&this.filterManager.doesRowPassAggregateFilters({rowNode:b})?(d(b,!0),!0):(O=b.childrenAfterAggFilter)==null?void 0:O.length}))||null,this.setAllChildrenCount(y),y.sibling&&(y.sibling.childrenAfterAggFilter=y.childrenAfterAggFilter)};c.forEachChangedNodeDepthFirst(n?p:d,!0)}setAllChildrenCountTreeData(t){const e=t.childrenAfterAggFilter;let n=0;if(e){const o=e.length;n=o;for(let i=0;i<o;++i)n+=e[i].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)}},z_=class extends k.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=
|
|
22
|
+
`),this.eGroupField=k.RefPlaceholder,this.eUnderlyingFilter=k.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&&k._warnOnce('Group Column Filter does not work with the colDef property "field". This property will be ignored.'),t.filterValueGetter&&k._warnOnce('Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.'),t.filterParams&&k._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 k._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||(k._warnOnce("Group Column Filter only works on group columns. Please use a different filter."),[])}updateGroupField(){k._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],k._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(k._loadTemplate('<div class="ag-filter-separator"></div>')),k._setDisplayed(this.eGroupField,!0)),e):(this.selectedColumn=void 0,k._setDisplayed(this.eGroupField,!1),null)}createGroupFieldSelectElement(t){this.eGroupFieldSelect=this.createManagedBean(new k.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"),k.AgPromise.resolve();const e=[],n=[];return t.forEach(o=>{const i=this.filterManager.getOrCreateFilterWrapper(o);i!=null&&i.filterPromise&&e.push(i.filterPromise.then(l=>(l&&n.push({filter:l,column:o}),o.getId()===this.selectedColumn.getId()&&(this.selectedFilter=l??void 0),l)))}),k.AgPromise.all(e).then(()=>{this.filterColumnPairs=n,this.groupColumn.setFilterActive(this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){var e;if(k._clearElement(this.eUnderlyingFilter),!this.selectedColumn)return k.AgPromise.resolve();const t=this.createManagedBean(new k.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()}))??k.AgPromise.resolve()):k.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 k.AgPromise.resolve()}afterGuiAttached(t){this.afterGuiAttachedParams=t,this.addUnderlyingFilterElement()}afterGuiDetached(){var t,e;k._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:i})=>i.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()}},U_=class extends k.Component{constructor(){super(`
|
|
23
23
|
<div data-ref="eFloatingFilter" class="ag-group-floating-filter ag-floating-filter-input" role="presentation"></div>
|
|
24
|
-
`),this.eFloatingFilter=x.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 x.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 x.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,x._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,i;this.underlyingFloatingFilter=n,(i=this.underlyingFloatingFilter)==null||i.onParentModelChanged((o=this.parentFilterInstance.getSelectedFilter())==null?void 0:o.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),x.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,o,i;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):(i=(o=this.underlyingFloatingFilter)==null?void 0:o.onParamsUpdated)==null||i.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()}},Cl=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(i=>!e.removeFromChildrenAfterGroup[i.id]),t.allLeafChildren=((o=t.allLeafChildren)==null?void 0:o.filter(i=>!e.removeFromAllLeafChildren[i.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function $_(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(wu(t[o-1],t[o])>0){n=!0;break}return n?(t.sort(wu),!0):!1}function wu(t,e){const n=t.sourceRowIndex,o=e.sourceRowIndex,i=n>=0,l=o>=0,c=i&&l,d=!i&&!l;return c?n-o:d?t.__objectId-e.__objectId:i?1:-1}var z_=class extends x.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 i;e.childrenAfterGroup.forEach(l=>{var c;(c=l.childrenAfterGroup)!=null&&c.length?l.key===""&&!i?i=l:o.push(l):n.push(l)}),i&&o.push(i),e.childrenAfterGroup=[...n,...o]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:o,rowNodesOrderChanged:i}=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:!!i,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(d=>d.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new Cl;x._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),x._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),x._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=>{$_(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;x._exists(e)&&n(t.rootNode);function n(o){x._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 i=p=>p.key,l=this.getExistingPathForNode(o,e).map(i),c=this.getGroupInfo(o,e).map(i);x._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,i=n||new Cl;t.forEach(l=>{this.removeFromParent(l,i),this.forEachParentGroup(e,l.parent,c=>{i.removeFromAllLeafChildren(c,l)})}),o&&i.flush()}removeEmptyGroups(t,e){let n=!0;const o=i=>{var p;const l=this.getChildrenMappedKey(i.key,i.rowGroupColumn),c=i.parent;return(c!=null&&c.childrenMapped?!c.childrenMapped[l]:!0)?!1:!!i.group&&(((p=i.childrenAfterGroup)==null?void 0:p.length)??0)===0};for(;n;){n=!1;const i=new Cl;t.forEach(l=>{this.forEachParentGroup(e,l,c=>{o(c)&&(n=!0,this.removeFromParent(c,i),c.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),i.flush()}}removeFromParent(t,e){var o;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(x._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:x._areEqual(t.groupedCols,e.groupedCols)&&x._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 i=o.sibling;i&&(i.childrenAfterGroup=o.childrenAfterGroup,i.childrenMapped=o.childrenMapped),this.insertNodes(o.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const o=this.showRowGroupColsService.getShowRowGroupCols(),i=o?o.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==i&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=i,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),i=this.findParentForNode(t,o,e,n);i.group||x._warnOnce("duplicate group keys for row data, keys should be unique",[i.data,t.data]),t.parent=i,t.level=o.length,i.childrenAfterGroup.push(t),i.updateHasChildren()}findParentForNode(t,e,n,o){let i=n.rootNode;return e.forEach((l,c)=>{i=this.getOrCreateNextNode(i,l,c,n),o!=null&&o.isRemoveFromAllLeafChildren(i,t)?o==null||o.preventRemoveFromAllLeafChildren(i,t):i.allLeafChildren.push(t)}),i}getOrCreateNextNode(t,e,n,o){var c;const i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(c=t==null?void 0:t.childrenMapped)==null?void 0:c[i];return l||(l=this.createGroup(e,t,n,o),this.addToParent(l,t)),l}createGroup(t,e,n,o){const i=new x.RowNode(this.beans);return i.group=!0,i.field=t.field,i.rowGroupColumn=t.rowGroupColumn,this.setGroupData(i,t,o),i.key=t.key,i.id=this.createGroupId(i,e,n),i.level=n,i.leafGroup=n===o.groupedColCount-1,i.allLeafChildren=[],i.setAllChildrenCount(0),i.rowGroupIndex=n,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren(),i.parent=e,this.setExpandedInitialValue(o,i),i}createGroupId(t,e,n){const o=(i,l)=>{if(!i.rowGroupColumn)return null;const c=l?o(l,l.parent):null;return`${c==null?"":c+"-"}${i.rowGroupColumn.getColId()}-${i.key}`};return x.RowNode.ID_PREFIX_ROW_GROUP+o(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(i=>{const l=t.rowGroupColumn;l!==null&&i.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[i.getColId()]=e.key:t.groupData[i.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 i=this.valueService.getKeyForNode(o,t),l=i!=null&&i!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(i="",l=!0),l){const d={key:i,field:o.getColDef().field,rowGroupColumn:o,leafNode:t};n.push(d)}}),n}},U_=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,ft=Object.freeze([]),Z_=ft.values(),ks=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},W_=class Sg{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=ft,this.allLeafChildren=ft,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())??Z_}upsertKey(e){var o,i;typeof e!="string"&&(e=String(e));let n=(o=this.children)==null?void 0:o.get(e);return n||(n=new Sg(this,e,this.level+1),(i=this.children??(this.children=new Map))==null||i.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&&ks(e,!0),this.parent=null)}setRow(e){const{level:n,row:o,childrenAfterGroup:i}=this;if(n<0)o!==null&&o!==e&&ks(o,!0);else{if(o===e)return!1;o!==null?(e.allLeafChildren=o.allLeafChildren??this.allLeafChildren??ft,ks(o,!1)):e.allLeafChildren=this.allLeafChildren??ft}return e.level=n,e.childrenAfterGroup=i,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:o,duplicateRows:i,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??ft)):this.row=null}else{if(!(i!=null&&i.delete(e)))return!1;i.size===0&&(this.duplicateRows=null)}return ks(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=ft),e.childrenAfterGroup=ft,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let o=n;for(const i of e)i.sourceRowIndex<o.sourceRowIndex&&(o=i);return o!==n&&(o.childrenAfterGroup=this.childrenAfterGroup,o.allLeafChildren=n.allLeafChildren??this.allLeafChildren??ft,n.childrenAfterGroup=ft,n.allLeafChildren=ft,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 d;this.childrenChanged=!1;const e=((d=this.children)==null?void 0:d.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=ft,this.row.childrenAfterGroup=ft,!0);let n=!1,o=this.childrenAfterGroup;o===ft?(o=new Array(e),this.childrenAfterGroup=o,this.row.childrenAfterGroup=o,n=!0):o.length!==e&&(o.length=e,n=!0);let i=0,l=-1,c=!1;for(const p of this.enumChildren()){const h=p.getRowPosition();h<l&&(c=!0),l=h,p.oldSourceRowIndex=h;const m=p.row;o[i]!==m&&(o[i]=m,n=!0),++i}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(o),n||c}reorderChildrenList(e){const n=e.length,o=this.children;e.sort(U_),o.clear();for(let i=0;i<n;++i){const l=e[i].treeNode;o.set(l.key,l)}}updateAllLeafChildren(){var c,d;const{parent:e,row:n,childrenAfterGroup:o}=this;this.leafChildrenChanged=!1;let i=!1;const l=o.length;if(l===0)i=((c=n.allLeafChildren)==null?void 0:c.length)!==0,n.allLeafChildren=ft,this.allLeafChildren=ft;else if(l===1&&((d=o[0].allLeafChildren)!=null&&d.length))n.allLeafChildren=o[0].allLeafChildren,this.allLeafChildren=null,i=!0;else{let p=this.allLeafChildren;(p===ft||p===null)&&(p=[],this.allLeafChildren=p);const h=p.length;let m=0;for(let y=0;y<l;++y){const w=o[y],v=w.allLeafChildren,E=v.length;if(E)for(let z=0;z<E;++z){const $=v[z];(m>=h||p[m]!==$)&&(p[m]=$,i=!0),++m}else(m>=h||p[m]!==w)&&w&&(p[m]=w,i=!0),++m}h!==m&&(p.length=m,i=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,i=!0)}i&&e&&(e.leafChildrenChanged=!0)}},bu=t=>(t.treeNodeFlags&1)!==0,xu=t=>(t.treeNodeFlags&2)!==0,ku=t=>(t.treeNodeFlags&4)!==0,j_=t=>(t.treeNodeFlags&8)!==0,Su=t=>(t.treeNodeFlags&16)!==0,Eu=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},H_=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},q_=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},gr=t=>{t.treeNodeFlags|=16},Tu=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},mi=t=>{t.treeNodeFlags=0},K_=class extends x.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new W_(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),mi(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:o}=t,i=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(i),i.leafGroup=!1;const p=i.sibling;p&&(p.childrenAfterGroup=i.childrenAfterGroup,p.childrenMapped=i.childrenMapped),e?this.handleTransaction(c,e,n):this.handleRowData(c,i,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var i,l,c;const o=this.root;if(n||this.oldGroupDisplayColIds===void 0){const d=((l=(i=this.showRowGroupColsService)==null?void 0:i.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==d&&this.checkAllGroupDataAfterColsChanged((c=o.row)==null?void 0:c.childrenAfterGroup);return}this.oldGroupDisplayColIds=d}this.clearTree(o),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:o,update:i,add:l}of e)this.removeRows(o),this.addOrUpdateRows(t,i,!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 i=t[n].treeNode;i&&i.oldSourceRowIndex!==n&&i.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,o=(t==null?void 0:t.length)??0;n<o;++n){const i=t[n];this.setGroupData(i,((e=i.treeNode)==null?void 0:e.key)??i.key),this.checkAllGroupDataAfterColsChanged(i.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let o=0,i=(e==null?void 0:e.length)??0;o<i;++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],i=o.treeNode;i!==null&&this.removeRow(i,o)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||ft;return n.length||x._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 i=e.upsertKey(t[o]);if(o>=n)return i.invalidate(),i;e=i}return null}addOrUpdateRow(t,e,n){var c;const{level:o,row:i}=t;if(o<0)return;let l=!1;if(i!==e){const d=e.treeNode;d!==null&&d!==t&&(d.removeRow(e),d.invalidate()),i===null?(t.setRow(e),l=!0):i.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(i,!0),l=!0)}n&&!ku(e)&&(H_(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 i=!1;t.removeRow(e)&&(i=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),i&&t.invalidate()}commitTree(t){var o;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&gr(n),n.updateHasChildren(),Su(n)&&(o=t.changedPath)!=null&&o.isActive()&&t.changedPath.addParentNode(n),Tu(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 i of e.enumChildren()){const l=i.row;l!==null&&(l.parent=n)}const o=e.key;n.key!==o?(n.key=o,q_(n),this.setGroupData(n,o)):n.groupData||this.setGroupData(n,o)}commitNodePostOrder(t,e,n){var h,m,y;const o=n.row,i=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&gr(o),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const c=!!((h=o.childrenAfterGroup)!=null&&h.length),d=c||!o.data,p=o.group;p!==d?(gr(o),o.setGroup(d),!d&&!o.expanded&&Eu(o,!1)):o.hasChildren()!==c&&(gr(o),o.updateHasChildren()),o.group&&!xu(o)&&(i!==o&&i!==null&&i.group&&xu(i)&&!t.isGroupOpenByDefault?o.expanded=i.expanded:o.expanded=this.getExpandedInitialValue(t,o),Eu(o,!0)),ku(o)&&(gr(e.row),j_(o)&&o.setData(o.data)),i!==o&&(n.oldRow=o,i!==null&&(p||n.hasChildren())&&gr(o),e.childrenChanged=!0,gr(e.row)),Su(o)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(o):bu(o)||(o.childrenAfterFilter||(o.childrenAfterFilter=o.childrenAfterGroup.slice()),o.childrenAfterAggFilter||(o.childrenAfterAggFilter=o.childrenAfterFilter.slice()),o.childrenAfterSort||(o.childrenAfterSort=o.childrenAfterAggFilter.slice())),Tu(o),(y=n.duplicateRows)!=null&&y.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,x._warnOnce("duplicate group keys for row data, keys should be unique",[o.id,o.data,...Array.from(n.duplicateRows).map(w=>w.data)]))}createFillerRow(t){const e=new x.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 i=o.parent;if(i===null)break;n=`${o.level}-${o.key}-${n}`,o=i}return e.id=x.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var i;const n={};t.groupData=n;const o=(i=this.showRowGroupColsService)==null?void 0:i.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:i}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&gr(e.row)),o!==null&&i>=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):mi(e)),o)for(const i of o)n>=0&&!i.data?this.destroyRow(i,!0):mi(i);for(const i of t.enumChildren())this.destroyTree(i);t.destroy()}destroyRow(t,e){if(!bu(t)){mi(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}mi(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)}}},Y_=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?K_:z_;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()}},Nu="PivotRowTotal_",X_=class extends x.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(d=>{d.children!==void 0?n(d.children,c):c.push(d)}),c}const o=n(e);this.addRowGroupTotals(e,o),this.addExpandablePivotGroups(e,o),this.addPivotTotalsToGroups(e,o);const i=o.map(l=>x._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:i}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,o,i){const l=this.funcColsService.getValueColumns();if(t>=o)return this.buildMeasureCols(n);const c=i[t].getColDef(),d=this.headerNameComparator.bind(this,c.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===o-1){const h=[];return x._iterateObject(e,m=>{const y=[...n,m],w=this.createColDef(l[0],m,y);w.columnGroupShow="open",h.push(w)}),h.sort(d),h}const p=[];return x._iterateObject(e,(h,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,w=[...n,h];p.push({children:this.recursivelyBuildGroup(t+1,m,w,o,i),headerName:h,pivotKeys:w,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(w)})}),p.sort(d),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=(i,l,c)=>{if("children"in i){const h=new Map;i.children.forEach(y=>{o(y,l,h)});const m=!i.children.some(y=>y.children);this.funcColsService.getValueColumns().forEach(y=>{const w=this.columnNameService.getDisplayNameForColumn(y,"header"),v=this.createColDef(y,w,i.pivotKeys);v.pivotTotalColumnIds=h.get(y.getColId()),v.columnGroupShow=n?"open":"closed",v.aggFunc=y.getAggFunc(),m||(i.children.push(v),l.push(v))}),this.merge(c,h);return}if(!i.pivotValueColumn)return;const d=i.pivotValueColumn.getColId();c.has(d)?c.get(d).push(i.colId):c.set(d,[i.colId])};t.forEach(i=>{o(i,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",o=this.funcColsService.getValueColumns(),i=o.map(c=>c.getAggFunc());if(!i||i.length<1||!this.sameAggFuncs(i))return;const l=o[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,o){const i=t;if(!i.children){const c=t;return c.colId?[c.colId]:null}let l=[];if(i.children.forEach(c=>{const d=this.recursivelyAddPivotTotal(c,e,n,o);d&&(l=l.concat(d))}),i.children.length>1){const d=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,d,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const h=t.children;o?h.push(p):h.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",i=this.funcColsService.getValueColumns().slice();n||i.reverse();const l=i.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let c=0;c<i.length;c++){const d=i[c],p=this.columnNameService.getDisplayNameForColumn(d,"header"),h=this.createColDef(d,p,[]),m=[];for(let w=0;w<e.length;w++){const v=e[w];v.pivotValueColumn===d&&m.push(v.colId)}h.pivotTotalColumnIds=m,h.colId=Nu+h.colId;const y=l?{children:[h],pivotKeys:[],groupId:`${Nu}_pivotGroup_${d.getColId()}`}:h;e.push(h),n?t.push(y):t.unshift(y)}}createColDef(t,e,n,o=!1){const i={};if(t){const l=t.getColDef();Object.assign(i,l),i.hide=!1}return i.headerName=e,i.colId=this.generateColumnId(n||[],t&&!o?t.getColId():""),i.field=i.colId,i.valueGetter=l=>{var c;return(c=l.data)==null?void 0:c[l.colDef.field]},i.pivotKeys=n,i.pivotValueColumn=t,i.filter===!0&&(i.filter="agNumberColumnFilter"),i}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 i=0;i<t.length;i++){const c=t[i].split(this.fieldSeparator);let d=e;for(let p=0;p<c.length;p++){const h=c[p];d[h]==null&&(d[h]={}),d=d[h]}}const n=(i,l,c,d)=>{const p=[];for(const y in c){const w=c[y],v=n(`${i}${this.fieldSeparator}${y}`,y,w,d+1);p.push(v)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const v=this.columnNameService.getDisplayNameForColumn(y,"header")??l,E=this.createColDef(y,v,void 0,!1);return E.colId=i,E.aggFunc=y.getAggFunc(),E.valueGetter=z=>{var $;return($=z.data)==null?void 0:$[i]},E}return{colId:i,headerName:l,valueGetter:v=>{var E;return(E=v.data)==null?void 0:E[i]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||d<this.pivotDefaultExpanded,groupId:i,headerName:l,children:p}},o=[];for(const i in e){const l=e[i],c=n(i,i,l,0);o.push(c)}return o}},Vu="Exceeded maximum allowed pivot column count.",J_=class extends x.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(S){if(S.message===Vu){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:S.message}),this.lastTimeFailed=!0;return}throw S}const i=this.setUniqueValues(o),l=this.funcColsService.getValueColumns(),c=l.map(S=>`${S.getId()}-${S.getColDef().headerName}`).join("#"),d=l.map(S=>S.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,h=this.aggregationFuncsHashLastTime!==d;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=d;const m=this.funcColsService.getRowGroupColumns().map(S=>S.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const w=this.gos.get("pivotRowTotals"),v=this.gos.get("pivotColumnGroupTotals"),E=this.gos.get("suppressExpandablePivotGroups"),z=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),$=w!==this.pivotRowTotalsLastTime||v!==this.pivotColumnGroupTotalsLastTime||E!==this.suppressExpandablePivotGroupsLastTime||z!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=w,this.pivotColumnGroupTotalsLastTime=v,this.suppressExpandablePivotGroupsLastTime=E,this.removePivotHeaderRowWhenSingleValueColumnLastTime=z,this.lastTimeFailed||i||p||y||h||$){const{pivotColumnGroupDefs:S,pivotColumnDefs:B}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=B,this.pivotResultColsService.setPivotResultCols(S,"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 i;o.leafGroup?this.bucketRowNode(o,e):(i=o.childrenAfterFilter)==null||i.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 i={},l=e[n];if(t.forEach(c=>{let d=this.valueService.getKeyForNode(l,c);if(x._missing(d)&&(d=""),!o[d]){this.currentUniqueCount+=1,o[d]={};const p=this.maxUniqueValues!==-1,h=this.currentUniqueCount>this.maxUniqueValues;if(p&&h)throw Error(Vu)}i[d]||(i[d]=[]),i[d].push(c)}),n===e.length-1)return i;{const c={};return x._iterateObject(i,(d,p)=>{c[d]=this.bucketChildren(p,e,n+1,o[d])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function Q_(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function eC(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function tC(t){t.aggFuncService&&t.aggFuncService.clear()}function nC(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function rC(t){return t.columnModel.isPivotMode()}function oC(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function iC(t,e){t.funcColsService.setValueColumns(e,"api")}function sC(t){return t.funcColsService.getValueColumns()}function aC(t,e){t.funcColsService.removeValueColumns([e],"api")}function lC(t,e){t.funcColsService.removeValueColumns(e,"api")}function cC(t,e){t.funcColsService.addValueColumns([e],"api")}function dC(t,e){t.funcColsService.addValueColumns(e,"api")}function uC(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function pC(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function hC(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function fC(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function mC(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function gC(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function yC(t){return t.funcColsService.getRowGroupColumns()}function _C(t,e){t.funcColsService.setPivotColumns(e,"api")}function CC(t,e){t.funcColsService.removePivotColumns([e],"api")}function vC(t,e){t.funcColsService.removePivotColumns(e,"api")}function wC(t,e){t.funcColsService.addPivotColumns([e],"api")}function bC(t,e){t.funcColsService.addPivotColumns(e,"api")}function xC(t){return t.funcColsService.getPivotColumns()}function kC(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function SC(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var EC=class extends x.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]}},gi="32.3.3",vl=x._defineModule({version:gi,moduleName:`${x.ModuleNames.RowGroupingModule}-core`,beans:[B_,O_,Y_,X_,J_,x_,P_,EC,L_],userComponents:[{name:"agGroupRowRenderer",classImp:Me.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Me.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Me.GroupCellRendererCtrl}],dependantModules:[Me.EnterpriseCoreModule]}),TC=x._defineModule({version:gi,moduleName:`${x.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:Q_,addAggFuncs:eC,clearAggFuncs:tC,setColumnAggFunc:nC,isPivotMode:rC,getPivotResultColumn:oC,setValueColumns:iC,getValueColumns:sC,removeValueColumn:aC,removeValueColumns:lC,addValueColumn:cC,addValueColumns:dC,setRowGroupColumns:uC,removeRowGroupColumn:pC,removeRowGroupColumns:hC,addRowGroupColumn:fC,addRowGroupColumns:mC,getRowGroupColumns:yC,moveRowGroupColumn:gC,setPivotColumns:_C,removePivotColumn:CC,removePivotColumns:vC,addPivotColumn:wC,addPivotColumns:bC,getPivotColumns:xC,setPivotResultColumns:kC,getPivotResultColumns:SC},dependantModules:[vl]}),Au=x._defineModule({version:gi,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:M_}],dependantModules:[vl,x._ColumnFilterModule]}),NC=x._defineModule({version:gi,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:G_}],dependantModules:[Au,x._FloatingFilterModule]}),VC=x._defineModule({version:gi,moduleName:x.ModuleNames.RowGroupingModule,dependantModules:[vl,TC,Au,NC]}),Bu=class extends gl{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:x._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()}},Pu=300,AC=class extends x.Component{constructor(){super(`<div class="ag-column-select-header" role="presentation">
|
|
24
|
+
`),this.eFloatingFilter=k.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 k.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 k.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,k._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,i;this.underlyingFloatingFilter=n,(i=this.underlyingFloatingFilter)==null||i.onParentModelChanged((o=this.parentFilterInstance.getSelectedFilter())==null?void 0:o.getModel()),this.appendChild(n.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),k.AgPromise.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(t){var n,o,i;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):(i=(o=this.underlyingFloatingFilter)==null?void 0:o.onParamsUpdated)==null||i.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()}},vl=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(i=>!e.removeFromChildrenAfterGroup[i.id]),t.allLeafChildren=((o=t.allLeafChildren)==null?void 0:o.filter(i=>!e.removeFromAllLeafChildren[i.id]))??null,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=t.childrenAfterGroup,n.allLeafChildren=t.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function Z_(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(bu(t[o-1],t[o])>0){n=!0;break}return n?(t.sort(bu),!0):!1}function bu(t,e){const n=t.sourceRowIndex,o=e.sourceRowIndex,i=n>=0,l=o>=0,c=i&&l,d=!i&&!l;return c?n-o:d?t.__objectId-e.__objectId:i?1:-1}var W_=class extends k.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 i;e.childrenAfterGroup.forEach(l=>{var c;(c=l.childrenAfterGroup)!=null&&c.length?l.key===""&&!i?i=l:o.push(l):n.push(l)}),i&&o.push(i),e.childrenAfterGroup=[...n,...o]}},!1)}createGroupingDetails(t){const{rowNode:e,changedPath:n,rowNodeTransactions:o,rowNodesOrderChanged:i}=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:!!i,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(d=>d.getColDef().keyCreator))??[]}}handleTransaction(t){t.transactions.forEach(e=>{const n=new vl;k._existsAndNotEmpty(e.remove)&&this.removeNodes(e.remove,t,n),k._existsAndNotEmpty(e.update)&&this.moveNodesInWrongPath(e.update,t,n),k._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=>{Z_(e.childrenAfterGroup)&&t.changedPath.addParentNode(e)},!1,!0)}orderGroups(t){const e=t.initialGroupOrderComparator;k._exists(e)&&n(t.rootNode);function n(o){k._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 i=p=>p.key,l=this.getExistingPathForNode(o,e).map(i),c=this.getGroupInfo(o,e).map(i);k._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,i=n||new vl;t.forEach(l=>{this.removeFromParent(l,i),this.forEachParentGroup(e,l.parent,c=>{i.removeFromAllLeafChildren(c,l)})}),o&&i.flush()}removeEmptyGroups(t,e){let n=!0;const o=i=>{var p;const l=this.getChildrenMappedKey(i.key,i.rowGroupColumn),c=i.parent;return(c!=null&&c.childrenMapped?!c.childrenMapped[l]:!0)?!1:!!i.group&&(((p=i.childrenAfterGroup)==null?void 0:p.length)??0)===0};for(;n;){n=!1;const i=new vl;t.forEach(l=>{this.forEachParentGroup(e,l,c=>{o(c)&&(n=!0,this.removeFromParent(c,i),c.setSelectedParams({newValue:!1,source:"rowGroupChanged"}))})}),i.flush()}}removeFromParent(t,e){var o;t.parent&&(e?e.removeFromChildrenAfterGroup(t.parent,t):(k._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:k._areEqual(t.groupedCols,e.groupedCols)&&k._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 i=o.sibling;i&&(i.childrenAfterGroup=o.childrenAfterGroup,i.childrenMapped=o.childrenMapped),this.insertNodes(o.allLeafChildren,t)}noChangeInGroupingColumns(t,e){let n=!1;const o=this.showRowGroupColsService.getShowRowGroupCols(),i=o?o.map(l=>l.getId()).join("-"):"";return e&&(n=this.areGroupColsEqual(t,this.oldGroupingDetails),this.oldGroupDisplayColIds!==i&&this.checkAllGroupDataAfterColsChanged(t)),this.oldGroupingDetails=t,this.oldGroupDisplayColIds=i,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),i=this.findParentForNode(t,o,e,n);i.group||k._warnOnce("duplicate group keys for row data, keys should be unique",[i.data,t.data]),t.parent=i,t.level=o.length,i.childrenAfterGroup.push(t),i.updateHasChildren()}findParentForNode(t,e,n,o){let i=n.rootNode;return e.forEach((l,c)=>{i=this.getOrCreateNextNode(i,l,c,n),o!=null&&o.isRemoveFromAllLeafChildren(i,t)?o==null||o.preventRemoveFromAllLeafChildren(i,t):i.allLeafChildren.push(t)}),i}getOrCreateNextNode(t,e,n,o){var c;const i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);let l=(c=t==null?void 0:t.childrenMapped)==null?void 0:c[i];return l||(l=this.createGroup(e,t,n,o),this.addToParent(l,t)),l}createGroup(t,e,n,o){const i=new k.RowNode(this.beans);return i.group=!0,i.field=t.field,i.rowGroupColumn=t.rowGroupColumn,this.setGroupData(i,t,o),i.key=t.key,i.id=this.createGroupId(i,e,n),i.level=n,i.leafGroup=n===o.groupedColCount-1,i.allLeafChildren=[],i.setAllChildrenCount(0),i.rowGroupIndex=n,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren(),i.parent=e,this.setExpandedInitialValue(o,i),i}createGroupId(t,e,n){const o=(i,l)=>{if(!i.rowGroupColumn)return null;const c=l?o(l,l.parent):null;return`${c==null?"":c+"-"}${i.rowGroupColumn.getColId()}-${i.key}`};return k.RowNode.ID_PREFIX_ROW_GROUP+o(t,e)}setGroupData(t,e,n){t.groupData={},this.showRowGroupColsService.getShowRowGroupCols().forEach(i=>{const l=t.rowGroupColumn;l!==null&&i.isRowGroupDisplayed(l.getId())&&(n.suppressGroupMaintainValueType?t.groupData[i.getColId()]=e.key:t.groupData[i.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 i=this.valueService.getKeyForNode(o,t),l=i!=null&&i!=="";if((e.pivotMode||!e.groupAllowUnbalanced)&&!l&&(i="",l=!0),l){const d={key:i,field:o.getColDef().field,rowGroupColumn:o,leafNode:t};n.push(d)}}),n}},j_=(t,e)=>t.treeNode.oldSourceRowIndex-e.treeNode.oldSourceRowIndex,ft=Object.freeze([]),H_=ft.values(),Es=(t,e)=>{t.parent=null,t.treeNode=null,e?t.childrenAfterGroup=[]:(t.level=0,t.childrenAfterGroup=null,t.allLeafChildren=null)},q_=class Sg{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=ft,this.allLeafChildren=ft,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())??H_}upsertKey(e){var o,i;typeof e!="string"&&(e=String(e));let n=(o=this.children)==null?void 0:o.get(e);return n||(n=new Sg(this,e,this.level+1),(i=this.children??(this.children=new Map))==null||i.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&&Es(e,!0),this.parent=null)}setRow(e){const{level:n,row:o,childrenAfterGroup:i}=this;if(n<0)o!==null&&o!==e&&Es(o,!0);else{if(o===e)return!1;o!==null?(e.allLeafChildren=o.allLeafChildren??this.allLeafChildren??ft,Es(o,!1)):e.allLeafChildren=this.allLeafChildren??ft}return e.level=n,e.childrenAfterGroup=i,e.treeNode=this,this.row=e,!0}removeRow(e){const{level:n,row:o,duplicateRows:i,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??ft)):this.row=null}else{if(!(i!=null&&i.delete(e)))return!1;i.size===0&&(this.duplicateRows=null)}return Es(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=ft),e.childrenAfterGroup=ft,!0}sortFirstDuplicateRow(){const e=this.duplicateRows,n=this.row;if(!n||!e)return n;let o=n;for(const i of e)i.sourceRowIndex<o.sourceRowIndex&&(o=i);return o!==n&&(o.childrenAfterGroup=this.childrenAfterGroup,o.allLeafChildren=n.allLeafChildren??this.allLeafChildren??ft,n.childrenAfterGroup=ft,n.allLeafChildren=ft,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 d;this.childrenChanged=!1;const e=((d=this.children)==null?void 0:d.size)??0;if(e===0)return this.childrenAfterGroup.length===0?!1:(this.leafChildrenChanged=!0,this.childrenAfterGroup=ft,this.row.childrenAfterGroup=ft,!0);let n=!1,o=this.childrenAfterGroup;o===ft?(o=new Array(e),this.childrenAfterGroup=o,this.row.childrenAfterGroup=o,n=!0):o.length!==e&&(o.length=e,n=!0);let i=0,l=-1,c=!1;for(const p of this.enumChildren()){const h=p.getRowPosition();h<l&&(c=!0),l=h,p.oldSourceRowIndex=h;const m=p.row;o[i]!==m&&(o[i]=m,n=!0),++i}return n&&(this.leafChildrenChanged=!0),c&&this.reorderChildrenList(o),n||c}reorderChildrenList(e){const n=e.length,o=this.children;e.sort(j_),o.clear();for(let i=0;i<n;++i){const l=e[i].treeNode;o.set(l.key,l)}}updateAllLeafChildren(){var c,d;const{parent:e,row:n,childrenAfterGroup:o}=this;this.leafChildrenChanged=!1;let i=!1;const l=o.length;if(l===0)i=((c=n.allLeafChildren)==null?void 0:c.length)!==0,n.allLeafChildren=ft,this.allLeafChildren=ft;else if(l===1&&((d=o[0].allLeafChildren)!=null&&d.length))n.allLeafChildren=o[0].allLeafChildren,this.allLeafChildren=null,i=!0;else{let p=this.allLeafChildren;(p===ft||p===null)&&(p=[],this.allLeafChildren=p);const h=p.length;let m=0;for(let y=0;y<l;++y){const w=o[y],b=w.allLeafChildren,E=b.length;if(E)for(let $=0;$<E;++$){const O=b[$];(m>=h||p[m]!==O)&&(p[m]=O,i=!0),++m}else(m>=h||p[m]!==w)&&w&&(p[m]=w,i=!0),++m}h!==m&&(p.length=m,i=!0),n.allLeafChildren!==p&&(n.allLeafChildren=p,i=!0)}i&&e&&(e.leafChildrenChanged=!0)}},xu=t=>(t.treeNodeFlags&1)!==0,ku=t=>(t.treeNodeFlags&2)!==0,Eu=t=>(t.treeNodeFlags&4)!==0,K_=t=>(t.treeNodeFlags&8)!==0,Su=t=>(t.treeNodeFlags&16)!==0,Tu=(t,e)=>{e?t.treeNodeFlags|=2:t.treeNodeFlags&=-3},Y_=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|4)},X_=t=>{const e=t.treeNodeFlags;e&1&&(t.treeNodeFlags=e|12)},yr=t=>{t.treeNodeFlags|=16},Nu=t=>{t.treeNodeFlags=1|t.treeNodeFlags&-29},mi=t=>{t.treeNodeFlags=0},J_=class extends k.BeanStub{constructor(){super(...arguments),this.rowsPendingDestruction=null,this.root=new q_(null,"",-1)}wireBeans(t){this.beans=t,this.showRowGroupColsService=t.showRowGroupColsService}destroy(){const t=this.root.row;t!==null&&(this.root.removeRow(t),mi(t)),this.destroyTree(this.root),this.commitDestroyedRows(),super.destroy()}execute(t){const{rowNodeTransactions:e,rowNodesOrderChanged:n,changedPath:o}=t,i=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(i),i.leafGroup=!1;const p=i.sibling;p&&(p.childrenAfterGroup=i.childrenAfterGroup,p.childrenMapped=i.childrenMapped),e?this.handleTransaction(c,e,n):this.handleRowData(c,i,t.afterColumnsChanged===!0)}handleRowData(t,e,n){var i,l,c;const o=this.root;if(n||this.oldGroupDisplayColIds===void 0){const d=((l=(i=this.showRowGroupColsService)==null?void 0:i.getShowRowGroupCols())==null?void 0:l.map(p=>p.getId()).join("-"))??"";if(n){this.oldGroupDisplayColIds!==d&&this.checkAllGroupDataAfterColsChanged((c=o.row)==null?void 0:c.childrenAfterGroup);return}this.oldGroupDisplayColIds=d}this.clearTree(o),this.addOrUpdateRows(t,e.allLeafChildren,!1),this.commitTree(t)}handleTransaction(t,e,n){for(const{remove:o,update:i,add:l}of e)this.removeRows(o),this.addOrUpdateRows(t,i,!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 i=t[n].treeNode;i&&i.oldSourceRowIndex!==n&&i.invalidateOrder()}}checkAllGroupDataAfterColsChanged(t){var e;for(let n=0,o=(t==null?void 0:t.length)??0;n<o;++n){const i=t[n];this.setGroupData(i,((e=i.treeNode)==null?void 0:e.key)??i.key),this.checkAllGroupDataAfterColsChanged(i.childrenAfterGroup)}}addOrUpdateRows(t,e,n){for(let o=0,i=(e==null?void 0:e.length)??0;o<i;++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],i=o.treeNode;i!==null&&this.removeRow(i,o)}}getDataPath({getDataPath:t},{data:e}){const n=(t==null?void 0:t(e))||ft;return n.length||k._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 i=e.upsertKey(t[o]);if(o>=n)return i.invalidate(),i;e=i}return null}addOrUpdateRow(t,e,n){var c;const{level:o,row:i}=t;if(o<0)return;let l=!1;if(i!==e){const d=e.treeNode;d!==null&&d!==t&&(d.removeRow(e),d.invalidate()),i===null?(t.setRow(e),l=!0):i.data?t.addDuplicateRow(e)&&(l=!0):(t.setRow(e),this.destroyRow(i,!0),l=!0)}n&&!Eu(e)&&(Y_(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 i=!1;t.removeRow(e)&&(i=!0,n&&(n.childrenChanged=!0),this.destroyRow(e,!e.data)),i&&t.invalidate()}commitTree(t){var o;const e=this.root;this.commitInvalidatedChildren(t,e);const n=e.row;e.childrenChanged&&e.updateChildrenAfterGroup()&&yr(n),n.updateHasChildren(),Su(n)&&(o=t.changedPath)!=null&&o.isActive()&&t.changedPath.addParentNode(n),Nu(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 i of e.enumChildren()){const l=i.row;l!==null&&(l.parent=n)}const o=e.key;n.key!==o?(n.key=o,X_(n),this.setGroupData(n,o)):n.groupData||this.setGroupData(n,o)}commitNodePostOrder(t,e,n){var h,m,y;const o=n.row,i=n.oldRow;if(n.isEmptyFillerNode()){this.clearTree(n);return}n.childrenChanged&&n.updateChildrenAfterGroup()&&yr(o),n.leafChildrenChanged&&n.updateAllLeafChildren();const l=n.getRowPosition();n.oldSourceRowIndex!==l&&(n.oldSourceRowIndex=l,e.childrenChanged=!0);const c=!!((h=o.childrenAfterGroup)!=null&&h.length),d=c||!o.data,p=o.group;p!==d?(yr(o),o.setGroup(d),!d&&!o.expanded&&Tu(o,!1)):o.hasChildren()!==c&&(yr(o),o.updateHasChildren()),o.group&&!ku(o)&&(i!==o&&i!==null&&i.group&&ku(i)&&!t.isGroupOpenByDefault?o.expanded=i.expanded:o.expanded=this.getExpandedInitialValue(t,o),Tu(o,!0)),Eu(o)&&(yr(e.row),K_(o)&&o.setData(o.data)),i!==o&&(n.oldRow=o,i!==null&&(p||n.hasChildren())&&yr(o),e.childrenChanged=!0,yr(e.row)),Su(o)?(m=t.changedPath)!=null&&m.isActive()&&t.changedPath.addParentNode(o):xu(o)||(o.childrenAfterFilter||(o.childrenAfterFilter=o.childrenAfterGroup.slice()),o.childrenAfterAggFilter||(o.childrenAfterAggFilter=o.childrenAfterFilter.slice()),o.childrenAfterSort||(o.childrenAfterSort=o.childrenAfterAggFilter.slice())),Nu(o),(y=n.duplicateRows)!=null&&y.size&&!n.duplicateRowsWarned&&(n.duplicateRowsWarned=!0,k._warnOnce("duplicate group keys for row data, keys should be unique",[o.id,o.data,...Array.from(n.duplicateRows).map(w=>w.data)]))}createFillerRow(t){const e=new k.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 i=o.parent;if(i===null)break;n=`${o.level}-${o.key}-${n}`,o=i}return e.id=k.RowNode.ID_PREFIX_ROW_GROUP+n,e}setGroupData(t,e){var i;const n={};t.groupData=n;const o=(i=this.showRowGroupColsService)==null?void 0:i.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:i}=t;if(e!==null&&n!==null&&(e.childrenChanged=!0,e.row!==null&&yr(e.row)),o!==null&&i>=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):mi(e)),o)for(const i of o)n>=0&&!i.data?this.destroyRow(i,!0):mi(i);for(const i of t.enumChildren())this.destroyTree(i);t.destroy()}destroyRow(t,e){if(!xu(t)){mi(t);return}if(!e){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(t);return}mi(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)}}},Q_=class extends k.BeanStub{constructor(){super(...arguments),this.beanName="groupStage"}wireBeans(t){this.selectableService=t.selectableService}execute(t){const e=this.gos.get("treeData")?J_:W_;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()}},Vu="PivotRowTotal_",eC=class extends k.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(d=>{d.children!==void 0?n(d.children,c):c.push(d)}),c}const o=n(e);this.addRowGroupTotals(e,o),this.addExpandablePivotGroups(e,o),this.addPivotTotalsToGroups(e,o);const i=o.map(l=>k._cloneObject(l));return{pivotColumnGroupDefs:e,pivotColumnDefs:i}}createPivotColumnsFromUniqueValues(t){const e=this.funcColsService.getPivotColumns(),n=e.length;return this.recursivelyBuildGroup(0,t,[],n,e)}recursivelyBuildGroup(t,e,n,o,i){const l=this.funcColsService.getValueColumns();if(t>=o)return this.buildMeasureCols(n);const c=i[t].getColDef(),d=this.headerNameComparator.bind(this,c.pivotComparator);if(l.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&t===o-1){const h=[];return k._iterateObject(e,m=>{const y=[...n,m],w=this.createColDef(l[0],m,y);w.columnGroupShow="open",h.push(w)}),h.sort(d),h}const p=[];return k._iterateObject(e,(h,m)=>{const y=this.pivotDefaultExpanded===-1||t<this.pivotDefaultExpanded,w=[...n,h];p.push({children:this.recursivelyBuildGroup(t+1,m,w,o,i),headerName:h,pivotKeys:w,columnGroupShow:"open",openByDefault:y,groupId:this.generateColumnGroupId(w)})}),p.sort(d),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=(i,l,c)=>{if("children"in i){const h=new Map;i.children.forEach(y=>{o(y,l,h)});const m=!i.children.some(y=>y.children);this.funcColsService.getValueColumns().forEach(y=>{const w=this.columnNameService.getDisplayNameForColumn(y,"header"),b=this.createColDef(y,w,i.pivotKeys);b.pivotTotalColumnIds=h.get(y.getColId()),b.columnGroupShow=n?"open":"closed",b.aggFunc=y.getAggFunc(),m||(i.children.push(b),l.push(b))}),this.merge(c,h);return}if(!i.pivotValueColumn)return;const d=i.pivotValueColumn.getColId();c.has(d)?c.get(d).push(i.colId):c.set(d,[i.colId])};t.forEach(i=>{o(i,e,new Map)})}addPivotTotalsToGroups(t,e){if(!this.gos.get("pivotColumnGroupTotals"))return;const n=this.gos.get("pivotColumnGroupTotals")==="after",o=this.funcColsService.getValueColumns(),i=o.map(c=>c.getAggFunc());if(!i||i.length<1||!this.sameAggFuncs(i))return;const l=o[0];t.forEach(c=>{this.recursivelyAddPivotTotal(c,e,l,n)})}recursivelyAddPivotTotal(t,e,n,o){const i=t;if(!i.children){const c=t;return c.colId?[c.colId]:null}let l=[];if(i.children.forEach(c=>{const d=this.recursivelyAddPivotTotal(c,e,n,o);d&&(l=l.concat(d))}),i.children.length>1){const d=this.localeService.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),p=this.createColDef(n,d,t.pivotKeys,!0);p.pivotTotalColumnIds=l,p.aggFunc=n.getAggFunc(),p.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const h=t.children;o?h.push(p):h.unshift(p),e.push(p)}return l}addRowGroupTotals(t,e){if(!this.gos.get("pivotRowTotals"))return;const n=this.gos.get("pivotRowTotals")==="after",i=this.funcColsService.getValueColumns().slice();n||i.reverse();const l=i.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let c=0;c<i.length;c++){const d=i[c],p=this.columnNameService.getDisplayNameForColumn(d,"header"),h=this.createColDef(d,p,[]),m=[];for(let w=0;w<e.length;w++){const b=e[w];b.pivotValueColumn===d&&m.push(b.colId)}h.pivotTotalColumnIds=m,h.colId=Vu+h.colId;const y=l?{children:[h],pivotKeys:[],groupId:`${Vu}_pivotGroup_${d.getColId()}`}:h;e.push(h),n?t.push(y):t.unshift(y)}}createColDef(t,e,n,o=!1){const i={};if(t){const l=t.getColDef();Object.assign(i,l),i.hide=!1}return i.headerName=e,i.colId=this.generateColumnId(n||[],t&&!o?t.getColId():""),i.field=i.colId,i.valueGetter=l=>{var c;return(c=l.data)==null?void 0:c[l.colDef.field]},i.pivotKeys=n,i.pivotValueColumn=t,i.filter===!0&&(i.filter="agNumberColumnFilter"),i}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 i=0;i<t.length;i++){const c=t[i].split(this.fieldSeparator);let d=e;for(let p=0;p<c.length;p++){const h=c[p];d[h]==null&&(d[h]={}),d=d[h]}}const n=(i,l,c,d)=>{const p=[];for(const y in c){const w=c[y],b=n(`${i}${this.fieldSeparator}${y}`,y,w,d+1);p.push(b)}if(p.length===0){const y=this.columnModel.getColDefCol(l);if(y){const b=this.columnNameService.getDisplayNameForColumn(y,"header")??l,E=this.createColDef(y,b,void 0,!1);return E.colId=i,E.aggFunc=y.getAggFunc(),E.valueGetter=$=>{var O;return(O=$.data)==null?void 0:O[i]},E}return{colId:i,headerName:l,valueGetter:b=>{var E;return(E=b.data)==null?void 0:E[i]}}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&p.length===1&&"colId"in p[0]?(p[0].headerName=l,p[0]):{openByDefault:this.pivotDefaultExpanded===-1||d<this.pivotDefaultExpanded,groupId:i,headerName:l,children:p}},o=[];for(const i in e){const l=e[i],c=n(i,i,l,0);o.push(c)}return o}},Au="Exceeded maximum allowed pivot column count.",tC=class extends k.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(T){if(T.message===Au){this.pivotResultColsService.setPivotResultCols([],"rowModelUpdated"),this.eventService.dispatchEvent({type:"pivotMaxColumnsExceeded",message:T.message}),this.lastTimeFailed=!0;return}throw T}const i=this.setUniqueValues(o),l=this.funcColsService.getValueColumns(),c=l.map(T=>`${T.getId()}-${T.getColDef().headerName}`).join("#"),d=l.map(T=>T.getAggFunc().toString()).join("#"),p=this.aggregationColumnsHashLastTime!==c,h=this.aggregationFuncsHashLastTime!==d;this.aggregationColumnsHashLastTime=c,this.aggregationFuncsHashLastTime=d;const m=this.funcColsService.getRowGroupColumns().map(T=>T.getId()).join("#"),y=m!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=m;const w=this.gos.get("pivotRowTotals"),b=this.gos.get("pivotColumnGroupTotals"),E=this.gos.get("suppressExpandablePivotGroups"),$=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),O=w!==this.pivotRowTotalsLastTime||b!==this.pivotColumnGroupTotalsLastTime||E!==this.suppressExpandablePivotGroupsLastTime||$!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=w,this.pivotColumnGroupTotalsLastTime=b,this.suppressExpandablePivotGroupsLastTime=E,this.removePivotHeaderRowWhenSingleValueColumnLastTime=$,this.lastTimeFailed||i||p||y||h||O){const{pivotColumnGroupDefs:T,pivotColumnDefs:P}=this.pivotColDefService.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=P,this.pivotResultColsService.setPivotResultCols(T,"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 i;o.leafGroup?this.bucketRowNode(o,e):(i=o.childrenAfterFilter)==null||i.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 i={},l=e[n];if(t.forEach(c=>{let d=this.valueService.getKeyForNode(l,c);if(k._missing(d)&&(d=""),!o[d]){this.currentUniqueCount+=1,o[d]={};const p=this.maxUniqueValues!==-1,h=this.currentUniqueCount>this.maxUniqueValues;if(p&&h)throw Error(Au)}i[d]||(i[d]=[]),i[d].push(c)}),n===e.length-1)return i;{const c={};return k._iterateObject(i,(d,p)=>{c[d]=this.bucketChildren(p,e,n+1,o[d])}),c}}getPivotColumnDefs(){return this.pivotColumnDefs}};function nC(t,e,n){t.aggFuncService&&t.aggFuncService.addAggFuncs({key:n})}function rC(t,e){t.aggFuncService&&t.aggFuncService.addAggFuncs(e)}function oC(t){t.aggFuncService&&t.aggFuncService.clear()}function iC(t,e,n){t.funcColsService.setColumnAggFunc(e,n,"api")}function sC(t){return t.columnModel.isPivotMode()}function aC(t,e,n){return t.pivotResultColsService.lookupPivotResultCol(e,n)}function lC(t,e){t.funcColsService.setValueColumns(e,"api")}function cC(t){return t.funcColsService.getValueColumns()}function dC(t,e){t.funcColsService.removeValueColumns([e],"api")}function uC(t,e){t.funcColsService.removeValueColumns(e,"api")}function pC(t,e){t.funcColsService.addValueColumns([e],"api")}function hC(t,e){t.funcColsService.addValueColumns(e,"api")}function fC(t,e){t.funcColsService.setRowGroupColumns(e,"api")}function mC(t,e){t.funcColsService.removeRowGroupColumns([e],"api")}function gC(t,e){t.funcColsService.removeRowGroupColumns(e,"api")}function yC(t,e){t.funcColsService.addRowGroupColumns([e],"api")}function _C(t,e){t.funcColsService.addRowGroupColumns(e,"api")}function CC(t,e,n){t.funcColsService.moveRowGroupColumn(e,n,"api")}function vC(t){return t.funcColsService.getRowGroupColumns()}function wC(t,e){t.funcColsService.setPivotColumns(e,"api")}function bC(t,e){t.funcColsService.removePivotColumns([e],"api")}function xC(t,e){t.funcColsService.removePivotColumns(e,"api")}function kC(t,e){t.funcColsService.addPivotColumns([e],"api")}function EC(t,e){t.funcColsService.addPivotColumns(e,"api")}function SC(t){return t.funcColsService.getPivotColumns()}function TC(t,e){t.pivotResultColsService.setPivotResultCols(e,"api")}function NC(t){const e=t.pivotResultColsService.getPivotResultCols();return e?e.list:null}var VC=class extends k.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]}},gi="32.3.3",wl=k._defineModule({version:gi,moduleName:`${k.ModuleNames.RowGroupingModule}-core`,beans:[D_,$_,Q_,eC,tC,S_,I_,VC,G_],userComponents:[{name:"agGroupRowRenderer",classImp:Me.GroupCellRenderer},{name:"agGroupCellRenderer",classImp:Me.GroupCellRenderer}],controllers:[{name:"groupCellRendererCtrl",classImp:Me.GroupCellRendererCtrl}],dependantModules:[Me.EnterpriseCoreModule]}),AC=k._defineModule({version:gi,moduleName:`${k.ModuleNames.RowGroupingModule}-api`,apiFunctions:{addAggFunc:nC,addAggFuncs:rC,clearAggFuncs:oC,setColumnAggFunc:iC,isPivotMode:sC,getPivotResultColumn:aC,setValueColumns:lC,getValueColumns:cC,removeValueColumn:dC,removeValueColumns:uC,addValueColumn:pC,addValueColumns:hC,setRowGroupColumns:fC,removeRowGroupColumn:mC,removeRowGroupColumns:gC,addRowGroupColumn:yC,addRowGroupColumns:_C,getRowGroupColumns:vC,moveRowGroupColumn:CC,setPivotColumns:wC,removePivotColumn:bC,removePivotColumns:xC,addPivotColumn:kC,addPivotColumns:EC,getPivotColumns:SC,setPivotResultColumns:TC,getPivotResultColumns:NC},dependantModules:[wl]}),Bu=k._defineModule({version:gi,moduleName:"@ag-grid-enterprise/group-filter",userComponents:[{name:"agGroupColumnFilter",classImp:z_}],dependantModules:[wl,k._ColumnFilterModule]}),BC=k._defineModule({version:gi,moduleName:"@ag-grid-enterprise/group-floating-filter",userComponents:[{name:"agGroupColumnFloatingFilter",classImp:U_}],dependantModules:[Bu,k._FloatingFilterModule]}),PC=k._defineModule({version:gi,moduleName:k.ModuleNames.RowGroupingModule,dependantModules:[wl,AC,Bu,BC]}),Pu=class extends yl{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:k._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()}},Ru=300,RC=class extends k.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>`,[
|
|
28
|
+
</div>`,[k.AgCheckboxSelector,k.AgInputTextFieldSelector]),this.eExpand=k.RefPlaceholder,this.eSelect=k.RefPlaceholder,this.eFilterTextField=k.RefPlaceholder}wireBeans(t){this.columnModel=t.columnModel}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===k.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=k._createIconNoSpan("columnSelectOpen",this.gos)),this.eExpand.appendChild(this.eExpandUnchecked=k._createIconNoSpan("columnSelectClosed",this.gos)),this.eExpand.appendChild(this.eExpandIndeterminate=k._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(),i=this.localeService.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(i("searchOoo","Search...")),k._setDisplayed(this.eFilterTextField.getGui(),t),k._setDisplayed(this.eSelect.getGui(),e),k._setDisplayed(this.eExpand,n&&o)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=k._debounce(()=>{const t=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:t})},Ru)),this.onFilterTextChangedDebounced()}onMiniFilterKeyDown(t){t.key===k.KeyCode.ENTER&&setTimeout(()=>this.onSelectClicked(),Ru)}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(t){this.expandState=t,k._setDisplayed(this.eExpandChecked,this.expandState===0),k._setDisplayed(this.eExpandUnchecked,this.expandState===1),k._setDisplayed(this.eExpandIndeterminate,this.expandState===2)}setSelectionState(t){this.selectState=t,this.eSelect.setValue(this.selectState)}},DC={selector:"AG-PRIMARY-COLS-HEADER",component:RC},Du=class{constructor(t,e,n,o=!1,i){this.localEventService=new k.LocalEventService,this.displayName=t,this.dept=n,this.group=o,o?(this.columnGroup=e,this.expanded=i,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)}},Iu=class extends k.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(),k.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){k.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 Me.AgMenuList),o=this.localeService.getLocaleTextFunc();let i=()=>{};e.appendChild(n.getGui()),n.addMenuItems(t),n.addManagedListeners(n,{closeMenu:()=>{this.parentEl.focus(),i()}});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&&(i=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(i=>e.allowedFunction(i)&&!e.activeFunction(i)),o=this.columns.some(i=>e.allowedFunction(i)&&e.activeFunction(i));n&&t.push({name:e.activateLabel(this.displayName),icon:k._createIconNoSpan(e.addIcon,this.gos,null),action:()=>e.activateFunction()}),o&&t.push({name:e.deactivateLabel(this.displayName),icon:k._createIconNoSpan(e.removeIcon,this.gos,null),action:()=>e.deActivateFunction()})}return t}},Fu=class extends k.Component{constructor(t,e,n,o){super(),this.modelItem=t,this.allowDragging=e,this.eventType=n,this.focusWrapper=o,this.cbSelect=k.RefPlaceholder,this.eLabel=k.RefPlaceholder,this.eGroupOpenedIcon=k.RefPlaceholder,this.eGroupClosedIcon=k.RefPlaceholder,this.eColumnGroupIcons=k.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>`,[
|
|
35
|
+
</div>`,[k.AgCheckboxSelector]),this.eDragHandle=k._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(),k._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 i=t.headerTooltip;this.setTooltip({newTooltipText:i,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 k.KeyCode.LEFT:t.preventDefault(),this.modelItem.setExpanded(!1);break;case k.KeyCode.RIGHT:t.preventDefault(),this.modelItem.setExpanded(!0);break;case k.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 Iu(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){k._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:k.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 i=o.getId();e[i]=o.isVisible(),n[i]=this.modelItemUtils.createPivotState(o)}),{columns:t,visibleState:e,pivotState:n}}setupExpandContract(){this.eGroupClosedIcon.appendChild(k._createIcon("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(k._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 k.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"),i=t("ariaToggleVisibility","Press SPACE to toggle visibility");k._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${i} (${o})`),k._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(i=>{!t&&i.getColDef().lockVisible||(this.isColumnChecked(i,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(),i=t.isValueActive();return n||o||i}return t.isVisible()}onExpandOrContractClicked(){const t=this.modelItem.isExpanded();this.modelItem.setExpanded(!t)}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const t=this.modelItem.isExpanded();k._setDisplayed(this.eGroupClosedIcon,!t),k._setDisplayed(this.eGroupOpenedIcon,t)}refreshAriaExpanded(){k._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)}},IC=class extends k.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 Me.VirtualListDragFeature(this.comp,this.virtualList,{dragSourceType:k.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 k.isProvidedColumnGroup(t)?t.getLeafColumns():t?[t]:[]}isMoveBlocked(t){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumnsBeingMoved(t).find(i=>{const l=i.getColDef();return!!l.suppressMovable||!!l.lockPosition})}moveItem(t,e){if(!e)return;const{component:n}=e;let o=null,i=e.position==="top";if(n instanceof Fu?(o=n.getColumns()[0],i=!0):n&&(o=n.getColumn()),!o)return;const l=this.getMoveTargetIndex({currentColumns:t,lastHoveredColumn:o,isBefore:i});l!=null&&this.columnMoveService.moveColumns(t,l,"toolPanelUi")}getMoveTargetIndex(t){const{currentColumns:e,lastHoveredColumn:n,isBefore:o}=t;if(!n||!e)return null;const i=this.columnModel.getCols().indexOf(n),l=o?i:i+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],i=t.length;return n.indexOf(o)<e?i:0}},FC=class extends k.Component{constructor(t,e,n,o){super(),this.allowDragging=e,this.groupsExist=n,this.focusWrapper=o,this.eLabel=k.RefPlaceholder,this.cbSelect=k.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>`,[x.AgCheckboxSelector]),this.eDragHandle=x._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=x._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 i=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:i}),this.addManagedListeners(this.column,{columnValueChanged:i,columnPivotChanged:i,columnRowGroupChanged:i,visibleChanged:i}),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(),x._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 Du(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}handleKeyDown(t){t.key===x.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");x._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${o} (${n})`),x._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){x._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:x.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"),i=!this.column.isAnyFunctionAllowed();e=!o&&!i,n=e}else{const{enableRowGroup:o,enableValue:i,lockPosition:l,suppressMovable:c,lockVisible:d}=this.column.getColDef(),p=!!o||!!i,h=!!l||!!c;e=!d,n=p||!h}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){x._warnOnce("can not expand a column item that does not represent a column group header")}},DC=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},IC="ag-column-select-list",FC=class extends x.Component{constructor(){super(`<div class="${IC}" 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 Me.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((i,l)=>(x._setAriaLevel(l,i.getDept()+1),this.createComponentFromItem(i,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new PC(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const o=new Iu(t,this.allowDragging,this.eventType,e);return this.createBean(o),o}const n=new RC(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 i=t[o.getId()];(i!=null||e)&&n.setExpanded(!!i)}})}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 d=c.removeEventListener.bind(c,"expandedChanged",e);this.destroyColumnItemFuncs.push(d)},o=(c,d,p)=>{c.forEach(h=>{x.isProvidedColumnGroup(h)?i(h,d,p):l(h,d,p)})},i=(c,d,p)=>{const h=c.getColGroupDef();if(h&&h.suppressColumnsToolPanel)return;if(c.isPadding()){o(c.getChildren(),d,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),w=new Ru(y,c,d,!0,this.expandGroupsByDefault);p.push(w),n(w),o(c.getChildren(),d+1,w.getChildren())},l=(c,d,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new Ru(m,c,d))};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 DC(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;x._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(i=>{if(!i.isGroup())return;const l=i.getColumnGroup().getId();e.indexOf(l)>=0&&(i.setExpanded(t),n.push(l))});const o=e.filter(i=>!x._includes(n,i));o.length>0&&x._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 i=o.getColumn(),l=i.getColDef();let c;if(n){if(!i.isAllowPivot()&&!i.isAllowRowGroup()&&!i.isAllowValue())return;c=i.isValueActive()||i.isPivotActive()||i.isRowGroupActive()}else{if(l.lockVisible)return;c=i.isVisible()}c?t++:e++}),!(t>0&&e>0))return!(t===0||e>0)}setFilterText(t){this.filterText=x._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!x._exists(this.filterText))return!0;const o=n.getDisplayName();return o==null||o.toLowerCase().indexOf(this.filterText)!==-1},e=(n,o)=>{let i=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(d=>{const p=e(d,c||o);p&&(i=p)})}const l=o||i?!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}},LC={selector:"AG-PRIMARY-COLS-LIST",component:FC},OC=class extends x.Component{constructor(){super(`<div class="ag-column-select">
|
|
38
|
+
</div>`,[k.AgCheckboxSelector]),this.eDragHandle=k._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=k._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 i=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:i}),this.addManagedListeners(this.column,{columnValueChanged:i,columnPivotChanged:i,columnRowGroupChanged:i,visibleChanged:i}),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(),k._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 Iu(e,t,this.focusWrapper));this.addDestroyFunc(()=>{o.isAlive()&&this.destroyBean(o)})}handleKeyDown(t){t.key===k.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");k._setAriaLabel(this.focusWrapper,`${this.displayName} ${e}`),this.cbSelect.setInputAriaLabel(`${o} (${n})`),k._setAriaDescribedBy(this.focusWrapper,this.cbSelect.getInputElement().id)}setupDragging(){if(!this.allowDragging){k._setDisplayed(this.eDragHandle,!1);return}let t=!this.gos.get("suppressDragLeaveHidesColumns");const e={type:k.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"),i=!this.column.isAnyFunctionAllowed();e=!o&&!i,n=e}else{const{enableRowGroup:o,enableValue:i,lockPosition:l,suppressMovable:c,lockVisible:d}=this.column.getColDef(),p=!!o||!!i,h=!!l||!!c;e=!d,n=p||!h}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){k._warnOnce("can not expand a column item that does not represent a column group header")}},LC=class{constructor(t){this.items=t}getRowCount(){return this.items.length}getRow(t){return this.items[t]}},OC="ag-column-select-list",MC=class extends k.Component{constructor(){super(`<div class="${OC}" 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 Me.VirtualList({cssIdentifier:"column-select",ariaRole:"tree"})),this.appendChild(this.virtualList.getGui()),this.virtualList.setComponentCreator((i,l)=>(k._setAriaLevel(l,i.getDept()+1),this.createComponentFromItem(i,l))),this.columnModel.isReady()&&this.onColumnsChanged(),!this.params.suppressColumnMove&&this.createManagedBean(new IC(this,this.virtualList))}createComponentFromItem(t,e){if(t.isGroup()){const o=new Fu(t,this.allowDragging,this.eventType,e);return this.createBean(o),o}const n=new FC(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 i=t[o.getId()];(i!=null||e)&&n.setExpanded(!!i)}})}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 d=c.removeEventListener.bind(c,"expandedChanged",e);this.destroyColumnItemFuncs.push(d)},o=(c,d,p)=>{c.forEach(h=>{k.isProvidedColumnGroup(h)?i(h,d,p):l(h,d,p)})},i=(c,d,p)=>{const h=c.getColGroupDef();if(h&&h.suppressColumnsToolPanel)return;if(c.isPadding()){o(c.getChildren(),d,p);return}const y=this.columnNameService.getDisplayNameForProvidedColumnGroup(null,c,"columnToolPanel"),w=new Du(y,c,d,!0,this.expandGroupsByDefault);p.push(w),n(w),o(c.getChildren(),d+1,w.getChildren())},l=(c,d,p)=>{if(c.getColDef()&&c.getColDef().suppressColumnsToolPanel)return;const m=this.columnNameService.getDisplayNameForColumn(c,"columnToolPanel");p.push(new Du(m,c,d))};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 LC(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;k._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(i=>{if(!i.isGroup())return;const l=i.getColumnGroup().getId();e.indexOf(l)>=0&&(i.setExpanded(t),n.push(l))});const o=e.filter(i=>!k._includes(n,i));o.length>0&&k._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 i=o.getColumn(),l=i.getColDef();let c;if(n){if(!i.isAllowPivot()&&!i.isAllowRowGroup()&&!i.isAllowValue())return;c=i.isValueActive()||i.isPivotActive()||i.isRowGroupActive()}else{if(l.lockVisible)return;c=i.isVisible()}c?t++:e++}),!(t>0&&e>0))return!(t===0||e>0)}setFilterText(t){this.filterText=k._exists(t)?t.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const t=n=>{if(!k._exists(this.filterText))return!0;const o=n.getDisplayName();return o==null||o.toLowerCase().indexOf(this.filterText)!==-1},e=(n,o)=>{let i=!1;if(n.isGroup()){const c=t(n);n.getChildren().forEach(d=>{const p=e(d,c||o);p&&(i=p)})}const l=o||i?!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}},GC={selector:"AG-PRIMARY-COLS-LIST",component:MC},$C=class extends k.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>`,[DC,GC]),this.primaryColsHeaderPanel=k.RefPlaceholder,this.primaryColsListPanel=k.RefPlaceholder}init(t,e,n){this.allowDragging=t,this.params=e,this.eventType=n,this.primaryColsHeaderPanel.init(this.params);const o=this.params.suppressColumnFilter,i=this.params.suppressColumnSelectAll;this.params.suppressColumnExpandAll&&o&&i&&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 k.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()}},Lu=class extends k.Component{constructor(){super(...arguments),this.cbPivotMode=k.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(),[
|
|
43
|
+
</div>`}postConstruct(){this.setTemplate(this.createTemplate(),[k.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)}},zC=class extends k.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 Lu),this.childDestroyFuncs.push(()=>this.destroyBean(this.pivotModePanel)),this.appendChild(this.pivotModePanel)),this.primaryColsPanel=this.createBean(new $C),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 Cl(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.rowGroupDropZonePanel)),this.appendChild(this.rowGroupDropZonePanel)),this.params.suppressValues||(this.valuesDropZonePanel=this.createBean(new Pu(!1)),this.childDestroyFuncs.push(()=>this.destroyBean(this.valuesDropZonePanel)),this.appendChild(this.valuesDropZonePanel)),this.params.suppressPivots||(this.pivotDropZonePanel=this.createBean(new _l(!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 Lu),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 Cl(!1)),this.appendChild(this.rowGroupDropZonePanel)),this.setLastVisible())}setValuesSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.valuesDropZonePanel?this.valuesDropZonePanel.setDisplayed(t):t&&(this.valuesDropZonePanel=this.createManagedBean(new Pu(!1)),this.appendChild(this.valuesDropZonePanel)),this.setLastVisible())}setPivotSectionVisible(t){this.isRowGroupingModuleLoaded()&&(this.pivotDropZonePanel?this.pivotDropZonePanel.setDisplayed(t):t&&(this.pivotDropZonePanel=this.createManagedBean(new _l(!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(i=>i.classList.remove("ag-last-column-drop"));const n=t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),o=k._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(k.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,k._clearElement(this.getGui())}refresh(t){return this.destroyChildren(),this.init(t),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},UC=class extends k.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(i=>{i.isPassesFilter()&&(i.isGroup()?n(i.getChildren()):e.push(i.getColumn()))})};return n(t),e}setAllVisible(t,e,n){const o=[];t.forEach(i=>{i.getColDef().lockVisible||i.isVisible()!=e&&o.push({colId:i.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?d=>{var p;if(!d.isAnyFunctionActive())if(d.isAllowValue()){const h=typeof d.getAggFunc()=="string"?d.getAggFunc():(p=this.aggFuncService)==null?void 0:p.getDefaultAggFunc(d);o.push({colId:d.getId(),aggFunc:h})}else d.isAllowRowGroup()?o.push({colId:d.getId(),rowGroup:!0}):d.isAllowPivot()&&o.push({colId:d.getId(),pivot:!0})}:d=>{(d.isPivotActive()||d.isRowGroupActive()||d.isValueActive())&&o.push({colId:d.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:i}=t,l=e.map(c=>{const d=c.getColId();if(this.columnModel.isPivotMode()){const p=o==null?void 0:o[d];return{colId:d,pivot:p==null?void 0:p.pivot,rowGroup:p==null?void 0:p.rowGroup,aggFunc:p==null?void 0:p.aggFunc}}else return{colId:d,hide:!(n!=null&&n[d])}});this.columnApplyStateService.applyColumnState({state:l},i)}createPivotState(t){return{pivot:t.isPivotActive(),rowGroup:t.isRowGroupActive(),aggFunc:t.isValueActive()?t.getAggFunc():void 0}}},ZC="32.3.3",WC=k._defineModule({version:ZC,moduleName:k.ModuleNames.ColumnsToolPanelModule,beans:[UC],userComponents:[{name:"agColumnsToolPanel",classImp:zC},{name:"agMenuItem",classImp:Me.AgMenuItemRenderer}],dependantModules:[Me.EnterpriseCoreModule,PC,gl]});const jC=`.ag-header {
|
|
44
44
|
border-bottom: 1px solid var(--border-color-default);
|
|
45
|
-
}`;function Ou(){x.ModuleRegistry.registerModules([hs.ClientSideRowModelModule,Tg.InfiniteRowModelModule,Hd.ServerSideRowModelModule,Ng.CsvExportModule,qd.ClipboardModule,Kd.RangeSelectionModule,Vg.RichSelectModule,Ag.MenuModule,Bg.ExcelExportModule,ml,Lu]);const t=Qy("AGGRID_LICENSE");t?(Me.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const UC=Yd.createPart("headerBottomBorder").withCSS(zC),Mu=Yd.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#49cc49",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",checkboxCheckedBackgroundColor:"#110529",checkboxCheckedBorderColor:"#110529",checkboxIndeterminateBackgroundColor:"#110529",checkboxIndeterminateBorderColor:"#110529",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(UC),Gu=Symbol("sdk-vue");function wl(){return r.inject(Gu)}function ZC(t,e,n={}){let o;Ou();const i=()=>{t.loadBlockState().then(c=>{l.loaded=!0;const d=Wg(c,t,n),p=e(d),h=Object.fromEntries(Object.entries(p.routes).map(([m,y])=>{const w=typeof y=="function"?y():y;return[m,r.markRaw(w)]}));o=Object.assign(d,{...p,getRoute(m){return h[m]}})}).catch(c=>{console.error("load initial state error",c),l.error=c})},l=r.reactive({loaded:!1,error:void 0,useApp(){return Rg(o,"App is not loaded")},install(c){c.provide(Gu,this),i()}});return l}var WC=Object.defineProperty,jC=(t,e,n)=>e in t?WC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,HC=(t,e,n)=>jC(t,e+"",n);function Ss(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function qC(t,e,n){const o=Math.min(e,n),i=Math.max(e,n);return t>=o&&t<=i}function KC(t){return new Promise(e=>setTimeout(e,t))}function YC(t){return t()}function Es(t,e,n){return e>t?e:t>n?n:t}function $u(t,e){return e(t)}function yr(t,e){if(t!=null)return e(t)}function XC(t){if(t&&t.ok)return t.value}async function JC(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const zu=t=>t;function QC(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function ev(t,e=[]){for(t=t?String(t):"";e.includes(t.charAt(0));)t=t.substring(1);return t}function tv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(QC(65,91));return e}function Uu(){return tv(42)}const bl=Array.isArray;function yi(t){return t!==null&&typeof t=="object"}function xl(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 nv(t,e){return Object.keys(t).map(n=>e(t[n],n))}function _i(t,e){return yi(t)&&yi(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>_i(t[n],e[n])):t===e}function Ci(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Ci(t[n]);return e}else if(yi(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Ci(t[n])}),e}else return t}function rv(t){return Array.isArray(t)?Object.assign([],t):yi(t)?Object.assign({},t):t}function ov(t,e){const n={};for(const o in e)e[o]!==t[o]&&(n[o]=t[o]);return n}function iv(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function sv(t,e,n){return t[e]=n,t}function av(t,e){return t[e]}function lv(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function cv(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function dv(t,...e){return e.map(n=>t[n])}function uv(t,...e){const n=Object.assign({},t);return e.forEach(o=>delete n[o]),n}function Zu(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],i=e[n];xl(o)&&xl(i)||bl(o)&&bl(i)&&o.length===i.length?Zu(o,i):t[n]=i}),t}const kl=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:iv,deepClone:Ci,deepEqual:_i,deepPatch:Zu,getProp:av,isArray:bl,isObject:yi,isPlainObject:xl,map:nv,omit:uv,pick:cv,pickValues:dv,setProp:sv,shallowClone:rv,shallowDiff:ov,shiftProp:lv},Symbol.toStringTag,{value:"Module"}));function pv(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let i=n;i<t.length;i++)if(!e(t[i],i))return i;return t.length})();return t.slice(n,o)}function hv(t,e,n){let o;return function(...i){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,t.apply(this,i)},e)}}const fv=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],mv=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],gv=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],yv=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Wu=(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 Sl(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?yv:gv:e.binary?mv:fv;if(e.signed&&t===0)return` 0 ${n[0]}`;const o=t<0,i=o?"-":e.signed?"+":"";if(o&&(t=-t),t<1){const p=Wu(t,e.locale);return i+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=Wu(Number(t),e.locale),d=n[l];return i+c+" "+d}const _v={class:"context-menu"},Cv=["onClick"],vv=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,o=i=>{i.cb(),n("close")};return(i,l)=>(r.openBlock(),r.createElementBlock("div",_v,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.options,(c,d)=>(r.openBlock(),r.createElementBlock("div",{key:d,onClick:r.withModifiers(p=>o(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,Cv))),128))]))}}),Mt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},wv=Mt(vv,[["__scopeId","data-v-12530966"]]);function El(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},o=r.h(wv,{options:e,onClose:()=>{n()}});r.render(o,document.body);const i=o.el;return i.style.top=t.clientY+"px",i.style.left=t.clientX+"px",document.addEventListener("click",l=>{i.contains(l.target)||n()}),n}const ju=Symbol(),Ts=()=>r.inject(ju),bv=["value"],xv={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,i=r.reactive({edit:!1}),l=r.computed(()=>o.valueType),c=h=>{var m;const y=(m=h.target)==null?void 0:m.value,w=r.unref(l),v=YC(()=>w==="integer"?parseInt(y,10):w==="float"?Number(y):y);n("update:modelValue",v),i.edit=!1},d=r.ref(),p=h=>{!h.metaKey&&o.editable&&(i.edit=!0,requestAnimationFrame(()=>{var m,y;(y=(m=d.value)==null?void 0:m.querySelector("input"))==null||y.focus()}))};return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"baseRef",ref:d,class:r.normalizeClass(["base-cell",{"base-cell__edit":i.edit}]),onClick:p},[i.edit?(r.openBlock(),r.createElementBlock("input",{key:0,value:h.modelValue,onFocusout:m[0]||(m[0]=y=>i.edit=!1),onChange:c},null,40,bv)):(r.openBlock(),r.createElementBlock("div",xv,r.toDisplayString(h.modelValue),1))],2))}}),Sv=["^data-row-index"],Ev={key:0,class:"control-cell"},Tv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=Ts(),o=r.computed(()=>e.cell.column.valueType),i=h=>{yr(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,w={...y.dataRow,[e.cell.id]:h};m({...y,dataRow:w})})},l=h=>{h.metaKey&&n.selectRow(e.cell.row.primaryKey)},c=(h,m)=>{if(h.type==="contextmenu")h.preventDefault();else return;const y=n.settings??{},w=[],{onSelectedRows:v,onSelectedColumns:E}=y.value,z=n.data.selectedRows.has(m.primaryKey);v&&v.length&&(z?w.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):w.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),E&&E.length&&(w.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),w.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),w.length&&El(h,w)},d=r.ref(),p=r.computed(()=>e.cell.column.component?e.cell.column.component():void 0);return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"cellRef",ref:d,class:r.normalizeClass(["td-cell",{[h.cell.class]:!0}]),"^data-row-index":h.cell.row.index,onClick:l,onContextmenu:m[0]||(m[0]=y=>c(y,h.cell.row))},[h.cell.control?(r.openBlock(),r.createElementBlock("div",Ev,r.toDisplayString(h.cell.row.index),1)):p.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.value),{key:1,"model-value":h.cell.value,"onUpdate:modelValue":i},null,8,["model-value"])):(r.openBlock(),r.createBlock(kv,{key:2,"model-value":h.cell.value,"value-type":o.value,editable:h.cell.column.editable,"onUpdate:modelValue":i},null,8,["model-value","value-type","editable"]))],42,Sv))}}),Nv={},Vv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Av(t,e){return r.openBlock(),r.createElementBlock("svg",Vv,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 Bv=Mt(Nv,[["render",Av]]),Pv={class:"tr-head"},Rv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Pv,[r.renderSlot(e.$slots,"default")]))}});function Dv(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function Iv(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let i=n;i<t.length;i++)if(!e(t[i],i))return i;return t.length})();return t.slice(n,o)}const Fv=["^data-col-id"],Lv=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&&El(l,c)}function i(l){var c;const d=((c=l.sort)==null?void 0:c.direction)??"DESC";n("change:sort",{colId:l.id,direction:Dv(d,["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(()=>i(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,Fv))}}),Ov=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{yr(e.value,o=>o.scrollLeft=0)})};return(o,i)=>(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))}}),Mv=r.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(t){const e=Ts(),n=t,o=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:o.value,frozen:i.column.frozen}])},null,2))}});function st(t,e,n,o){r.onMounted(()=>{var i;return(i=r.unref(t))==null?void 0:i.addEventListener(e,n,o)}),r.onUnmounted(()=>{var i;return(i=r.unref(t))==null?void 0:i.removeEventListener(e,n,o)})}function Gv(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function $v(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function zv(t,e){let n;function o(l){n={...l}}Gv(()=>{n=void 0,e()});const i=$v(t);return st(window,"mousemove",l=>{n&&i({x:n.x,width:n.width,diff:l.x-n.x})}),{start:o}}const Co=1,Uv=10,Zv=30,Hu=60;function qu(){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 Ku(t,e={}){const{delayEnter:n=0,delayLeave:o=0}=e,i=r.ref(!1);let l;const c=d=>{const p=d?n:o;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>i.value=d,p):i.value=d};return window&&(st(t,"mouseenter",()=>c(!0)),st(t,"mouseleave",()=>c(!1))),i}function Wv(t){var e;const n=yr((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),o=>[...o])??[];return n.map(o=>{const{width:i,x:l}=o.getBoundingClientRect(),c=o.getAttribute("data-col-id");return zu({colId:c,width:i,x:l,right:l+i})}).slice(0,n.length-1)}function jv(t,e){const n=qu(),o=Ku(e,{}),{data:i}=t,l=zv(d=>{yr(i.resizeTh,p=>{const h=i.columns.find(m=>m.id===p.colId);h&&(h.width=Es(d.width+d.diff,Zv,1e4),t.adjustWidth())})},()=>{i.resize=!1,i.resizeTh=void 0,document.body.style.cursor=""}),c=d=>{i.resizeTh&&(i.resize=!0,l.start({x:d.x,width:i.resizeTh.width}))};return r.watchEffect(()=>{if(!o.value){document.body.style.cursor="";return}if(i.resize)return;const d=Wv(e).find(p=>Math.abs(n.x-p.right)<Uv);d?(document.body.style.cursor="col-resize",i.resizeTh=d):(i.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const Hv={key:0,class:"command-menu"},qv={key:0},Kv=["onClick"],Yv=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=Ts(),n=r.computed(()=>e.getSelectedRows()),o=r.computed(()=>n.value.length>0),i=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedRows)??[]}),l=r.computed(()=>i.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(c,d)=>o.value?(r.openBlock(),r.createElementBlock("div",Hv,[n.value.length?(r.openBlock(),r.createElementBlock("span",qv,r.toDisplayString(n.value.length)+" rows selected",1)):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),d[1]||(d[1]=r.createElementVNode("hr",null,null,-1)),d[2]||(d[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,h)=>(r.openBlock(),r.createElementBlock("span",{key:h,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,Kv))),128))])):r.createCommentVNode("",!0)}}),Xv={key:0,class:"command-menu"},Jv={key:0},Qv=["onClick"],e0=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=Ts(),n=r.computed(()=>e.getSelectedColumns()),o=r.computed(()=>n.value.length>0),i=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedColumns)??[]}),l=r.computed(()=>i.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedColumns.clear()}})));return(c,d)=>o.value?(r.openBlock(),r.createElementBlock("div",Xv,[n.value.length?(r.openBlock(),r.createElementBlock("span",Jv,"selected columns "+r.toDisplayString(n.value.length),1)):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),d[1]||(d[1]=r.createElementVNode("hr",null,null,-1)),d[2]||(d[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,h)=>(r.openBlock(),r.createElementBlock("span",{key:h,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,Qv))),128))])):r.createCommentVNode("",!0)}});function _r(t,e){const n={el:void 0,x:0,y:0},o=i=>({x:i.x,y:i.y,dx:i.x-n.x,dy:i.y-n.y});st(document,"mousedown",i=>{i.target===r.unref(t)&&(i.stopPropagation&&i.stopPropagation(),i.preventDefault&&i.preventDefault(),n.el=r.unref(t),n.x=i.x,n.y=i.y)}),st(document,"mouseup",i=>{n.el&&(n.el=void 0,e({...o(i),stop:!0},n))}),st(document,"mousemove",i=>{n.el&&e(o(i),n)})}const t0=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.windowSize-12),c=r.computed(()=>o.windowSize<o.dataSize),d=r.computed(()=>Math.ceil(o.offset*(l.value/o.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/o.dataSize)),h=r.computed(()=>({top:`${d.value}px`,height:`${p.value}px`}));return _r(i,(m,y)=>{const w=(d.value+m.dy)*o.dataSize/l.value;n("change:offset",w),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:i,class:"t-scroll__handle",style:r.normalizeStyle(h.value)},null,4)):r.createCommentVNode("",!0)])],4))}});function n0(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:o,scrollLeft:i}=e,l=[...e.columns],c=Uu();n.value.controlColumn&&l.unshift({id:c,label:"#",width:60,frozen:!0});let d=0;const p=l.map(m=>{const y={...m,offset:d};return d+=m.width+Co,y}),h=p.filter(m=>m.frozen);return pv(p,m=>m.frozen?!1:i<m.offset+m.width&&m.offset<o+i).concat(h).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===c}))})}function r0(t,e){const n=r.computed(()=>e.value.reduce((o,i)=>(o[i.id]=i.justify?"justify-"+i.justify:"",o),{}));return r.computed(()=>t.rows.map(o=>{const i=n.value,{primaryKey:l,offset:c,dataRow:d,height:p}=o,h=e.value.map(m=>({id:m.id,column:m,row:o,value:d[m.id],class:i[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return zu({style:{top:`${c-t.scrollTop}px`,height:`${o.height}px`},primaryKey:l,offset:c,height:p,cells:h,selected:t.selectedRows.has(l)})}))}const o0=async(t,e)=>{const{scrollTop:n,bodyHeight:o}=t;return await KC(0),JC({rows:e.getRows(n,o),dataWindow:t})};function i0(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=Ci(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(y=>{e.dataHeight=y,h.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)),i=r.computed(()=>$u(h.data.dataHeight-h.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>$u(o.value-h.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),d=n0({data:e,settings:n}),p=r0(e,d),h={data:e,settings:n,tableColumns:d,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((w,v)=>w+v.width+Co,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const w=e.columns[e.columns.length-1];w.width=w.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=Es(m,0,i.value)},updateScrollLeft(m){e.scrollLeft=Es(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:y}=e,w=m>y?y:m;e.bodyHeight=w},updateDimensions(m){this.updateBodyHeight(),h.data.bodyWidth=m.width,h.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,y)=>{const w=m.current;(!w||m.scrollTop<w.scrollTop||m.scrollTop+m.bodyHeight>w.bodyHeight+w.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-Hu,bodyHeight:m.bodyHeight+Hu*2},o0(Ci(e.currentWindow),n.value.dataSource).then(({rows:v,dataWindow:E})=>{_i(e.currentWindow,E)&&(e.rows=v)}))},{deep:!0,immediate:!0}),r.provide(ju,h),h}const s0={class:"command-menu__container"},a0={key:0,class:"table-body__no-data"},l0={class:"carets"},Tl=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,o=t,i=i0(o),l=r.computed(()=>i.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":i.data.bodyHeight+"px"}));r.watch(i.data,z=>n("update:data",z),{deep:!0}),r.watch(o,()=>m);const d=r.ref(),p=r.ref(),h=r.ref(),m=()=>{yr(h.value,z=>{i.updateDimensions(z.getBoundingClientRect())})},y=i.tableColumns,w=i.tableRows,{mouseDown:v}=jv(i,d);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),st(window,"resize",()=>r.nextTick(m));const E=z=>{z.preventDefault(),i.updateOffsets(z)};return(z,$)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:d,class:"data-table",onMousedown:$[2]||($[2]=(...S)=>r.unref(v)&&r.unref(v)(...S))},[r.createElementVNode("div",s0,[r.createVNode(Yv),$[3]||($[3]=r.createTextVNode()),r.createVNode(e0)]),$[7]||($[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(Rv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(S,B)=>(r.openBlock(),r.createBlock(Lv,{key:B,col:S,style:r.normalizeStyle(S.style),"onChange:sort":$[0]||($[0]=D=>z.$emit("change:sort",D))},null,8,["col","style"]))),128))]),_:1})],512),$[8]||($[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:h,class:"table-body",style:r.normalizeStyle(c.value),onWheel:E},[l.value?(r.openBlock(),r.createElementBlock("div",a0,[r.createElementVNode("div",null,[r.createVNode(Bv),$[4]||($[4]=r.createTextVNode()),$[5]||($[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),$[6]||($[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(w),(S,B)=>(r.openBlock(),r.createBlock(Ov,{key:B,row:S},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S.cells,D=>(r.openBlock(),r.createBlock(Tv,{key:D.column.id+":"+B,cell:D,style:r.normalizeStyle(D.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),$[9]||($[9]=r.createTextVNode()),r.createElementVNode("div",l0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(S,B)=>(r.openBlock(),r.createBlock(Mv,{key:B,column:S,style:r.normalizeStyle(S.style),"onChange:sort":$[1]||($[1]=D=>z.$emit("change:sort",D))},null,8,["column","style"]))),128))]),$[10]||($[10]=r.createTextVNode()),r.createVNode(t0,{offset:r.unref(i).data.scrollTop,"window-size":r.unref(i).data.bodyHeight,"data-size":r.unref(i).data.dataHeight,"onChange:offset":r.unref(i).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),Yu=new WeakMap;class c0{constructor(e,n,o){HC(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=o;const i=e.reduce((c,d,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(d,p)+Co,c),{total:0,indices:new Map});this.dataHeight=i.total;const l=e.map((c,d)=>({dataRow:c,index:d,primaryKey:this.resolvePrimaryKey(c,d),offset:Ss(i.indices.get(d)),height:this.resolveHeight(c,d)}));Yu.set(this,l)}get rows(){return Yu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return Iv(this.rows,o=>{const i=o.offset;return e<i+o.height&&i<n+e})}}class d0{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=Es(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),i=Math.ceil(n+40/this.height);return(await this.api.query({offset:o,limit:i})).map((l,c)=>({dataRow:l,index:o+c,primaryKey:this.resolvePrimaryKey(l,o+c),offset:(o+c)*(this.rowHeight+Co),height:this.rowHeight}))}}function u0(t){return Object.freeze(t)}function p0(t){return r.h(Tl,{settings:Object.freeze(t)})}function Nl(t,e){const n=new c0(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function h0(t,e){return r.computed(()=>{const n=r.unref(t);return Nl(n,r.unref(e))})}function f0(t,e){const n=r.computed(()=>{const i=r.unref(t);return Nl(i,r.unref(e))}),o=r.reactive({settings:n});return r.computed(()=>r.h(Tl,o))}const m0=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:d0,Component:Tl,factory:p0,rawDataSettings:Nl,settings:u0,useRawData:h0,useRawDataComponent:f0},Symbol.toStringTag,{value:"Module"}));function*g0(t,e){for(const n of t)yield e(n)}function y0(t){const e=[];for(const n of t)e.push(n);return e}function Xu(t){return t()}function Vl(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 Ju(t){return new Promise(e=>setTimeout(e,t))}function Qu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function ep(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function _0(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(ep(65,91));return e}function tp(t){return function(e){return 1-t(1-e)}}function C0(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function np(t){const{duration:e,draw:n,timing:o}=t,i=performance.now();let l=!1;return requestAnimationFrame(function c(d){let p=(d-i)/e;(p>1||l)&&(p=1);const h=o(p);n(h),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function v0(t){const{getFraction:e,draw:n,timing:o}=t,i=performance.now();let l=!1;return requestAnimationFrame(function c(d){let p=e(d-i);if(l)return;p>1&&(p=1);const h=o(p);n(h),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function rp(t,e){let n=-1;return(...o)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...o),e)}}function op(t,e,n=!0){let o=0,i;return function(...l){i=()=>{t.apply(this,l),o=new Date().getTime()+e,i=null,n&&setTimeout(()=>{i==null||i()},e)},new Date().getTime()>o&&i()}}function w0(t){return t.map(e=>({text:String(e),value:e}))}function Cr(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const Bl=new Map;function b0(t){return Bl.has(t)||Bl.set(t,r.ref(localStorage.getItem(t))),Vl(Bl.get(t),"...")}function x0(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function ip(t){const e=b0(t);return r.watch(e,n=>x0(t,n)),e}const Pl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{y0(g0(Pl.values(),e=>e(t.matches?"dark":"light")))});const k0=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",sp=r.ref(k0),Rl=ip("theme");function ap(t){const e=r.computed(()=>Rl.value?Rl.value:sp.value),n=i=>{sp.value=i,t==null||t(i)};function o(){Rl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,i=>{t==null||t(r.unref(i))}),r.onMounted(()=>{Pl.add(n)}),r.onUnmounted(()=>{Pl.delete(n)}),[e,o]}const S0=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=ap();return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:i[0]||(i[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},i[1]||(i[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),E0={key:0,class:"pl-block-page__title"},T0={class:"pl-block-page__title__default"},N0={class:"pl-block-page__title__append"},V0={key:1},A0={class:"pl-block-page__body"},B0={name:"PlBlockPage"},P0=r.defineComponent({...B0,props:{noBodyGutters:{type:Boolean}},setup(t){const e=r.useSlots();return(n,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-block-page",{noBodyGutters:n.noBodyGutters}])},[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",E0,[r.createElementVNode("div",T0,[r.renderSlot(n.$slots,"title")]),o[0]||(o[0]=r.createTextVNode()),r.createElementVNode("div",N0,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",V0)),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",A0,[r.renderSlot(n.$slots,"default")])],2))}}),R0={name:"PlContainer"},D0=r.defineComponent({...R0,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),I0={name:"PlRow"},F0=r.defineComponent({...I0,props:{wrap:{type:Boolean},alignCenter:{type:Boolean},noGap:{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))}}),L0={class:"pl-layout-component",style:{"flex-grow":"1"}},O0={name:"PlSpacer"},lp=r.defineComponent({...O0,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",L0))}}),M0={name:"PlGrid"},G0=r.defineComponent({...M0,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),$0={key:0,class:"pl-alert__icon"},z0={class:"pl-alert__main"},U0={key:0},Z0={class:"pl-alert__main__text"},W0={name:"PlAlert"},j0=r.defineComponent({...W0,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",$0,[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",z0,[n.label?(r.openBlock(),r.createElementBlock("label",U0,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",Z0,[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]=i=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),H0=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
45
|
+
}`;function Ou(){k.ModuleRegistry.registerModules([fs.ClientSideRowModelModule,Ng.InfiniteRowModelModule,Ja.ServerSideRowModelModule,Vg.CsvExportModule,qd.ClipboardModule,Kd.RangeSelectionModule,Ag.RichSelectModule,Bg.MenuModule,Pg.ExcelExportModule,gl,WC]);const t=n_("AGGRID_LICENSE");t?(Me.LicenseManager.setLicenseKey(t),console.log("AG Grid Activated")):console.log("AG Grid License not found")}const HC=Yd.createPart("headerBottomBorder").withCSS(jC),Mu=Yd.themeQuartz.withParams({headerColumnResizeHandleColor:"transparent",accentColor:"#49cc49",borderColor:"#E1E3EB",cellHorizontalPaddingScale:1,checkboxBorderRadius:"3px",checkboxCheckedBackgroundColor:"#110529",checkboxCheckedBorderColor:"#110529",checkboxIndeterminateBackgroundColor:"#110529",checkboxIndeterminateBorderColor:"#110529",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(HC),Gu=Symbol("sdk-vue");function bl(){return r.inject(Gu)}function qC(t,e,n={}){let o;Ou();const i=()=>{t.loadBlockState().then(c=>{l.loaded=!0;const d=jg(c,t,n),p=e(d),h=Object.fromEntries(Object.entries(p.routes).map(([m,y])=>{const w=typeof y=="function"?y():y;return[m,r.markRaw(w)]}));o=Object.assign(d,{...p,getRoute(m){return h[m]}})}).catch(c=>{console.error("load initial state error",c),l.error=c})},l=r.reactive({loaded:!1,error:void 0,useApp(){return Dg(o,"App is not loaded")},install(c){c.provide(Gu,this),i()}});return l}var KC=Object.defineProperty,YC=(t,e,n)=>e in t?KC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,XC=(t,e,n)=>YC(t,e+"",n);function Ss(t,e){if(t==null)throw Error("Empty (null | undefined) value");return t}function JC(t,e,n){const o=Math.min(e,n),i=Math.max(e,n);return t>=o&&t<=i}function QC(t){return new Promise(e=>setTimeout(e,t))}function ev(t){return t()}function Ts(t,e,n){return e>t?e:t>n?n:t}function $u(t,e){return e(t)}function _r(t,e){if(t!=null)return e(t)}function tv(t){if(t&&t.ok)return t.value}async function nv(t){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,n])=>[e,await n])))}const zu=t=>t;function rv(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function ov(t,e=[]){for(t=t?String(t):"";e.includes(t.charAt(0));)t=t.substring(1);return t}function iv(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(rv(65,91));return e}function Uu(){return iv(42)}const xl=Array.isArray;function yi(t){return t!==null&&typeof t=="object"}function kl(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 sv(t,e){return Object.keys(t).map(n=>e(t[n],n))}function _i(t,e){return yi(t)&&yi(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>_i(t[n],e[n])):t===e}function Ci(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Ci(t[n]);return e}else if(yi(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Ci(t[n])}),e}else return t}function av(t){return Array.isArray(t)?Object.assign([],t):yi(t)?Object.assign({},t):t}function lv(t,e){const n={};for(const o in e)e[o]!==t[o]&&(n[o]=t[o]);return n}function cv(t){return Object.entries(t).forEach(([e,n])=>{n instanceof Function&&(t[e]=n.bind(t))}),t}function dv(t,e,n){return t[e]=n,t}function uv(t,e){return t[e]}function pv(t,e){t={...t};const n=t[e];return delete t[e],[n,t]}function hv(t,...e){return Object.assign({},...e.map(n=>({[n]:t[n]})))}function fv(t,...e){return e.map(n=>t[n])}function mv(t,...e){const n=Object.assign({},t);return e.forEach(o=>delete n[o]),n}function Zu(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],i=e[n];kl(o)&&kl(i)||xl(o)&&xl(i)&&o.length===i.length?Zu(o,i):t[n]=i}),t}const El=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:cv,deepClone:Ci,deepEqual:_i,deepPatch:Zu,getProp:uv,isArray:xl,isObject:yi,isPlainObject:kl,map:sv,omit:mv,pick:hv,pickValues:fv,setProp:dv,shallowClone:av,shallowDiff:lv,shiftProp:pv},Symbol.toStringTag,{value:"Module"}));function gv(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let i=n;i<t.length;i++)if(!e(t[i],i))return i;return t.length})();return t.slice(n,o)}function yv(t,e,n){let o;return function(...i){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,t.apply(this,i)},e)}}const _v=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Cv=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],vv=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],wv=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Wu=(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 Sl(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?wv:vv:e.binary?Cv:_v;if(e.signed&&t===0)return` 0 ${n[0]}`;const o=t<0,i=o?"-":e.signed?"+":"";if(o&&(t=-t),t<1){const p=Wu(t,e.locale);return i+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=Wu(Number(t),e.locale),d=n[l];return i+c+" "+d}const bv={class:"context-menu"},xv=["onClick"],kv=r.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(t,{emit:e}){const n=e,o=i=>{i.cb(),n("close")};return(i,l)=>(r.openBlock(),r.createElementBlock("div",bv,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.options,(c,d)=>(r.openBlock(),r.createElementBlock("div",{key:d,onClick:r.withModifiers(p=>o(c),["stop"])},[r.createElementVNode("span",null,r.toDisplayString(c.text),1)],8,xv))),128))]))}}),Mt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Ev=Mt(kv,[["__scopeId","data-v-12530966"]]);function Tl(t,e){t.preventDefault();const n=()=>{r.render(null,document.body)},o=r.h(Ev,{options:e,onClose:()=>{n()}});r.render(o,document.body);const i=o.el;return i.style.top=t.clientY+"px",i.style.left=t.clientX+"px",document.addEventListener("click",l=>{i.contains(l.target)||n()}),n}const ju=Symbol(),Ns=()=>r.inject(ju),Sv=["value"],Tv={key:1},Nv=r.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.reactive({edit:!1}),l=r.computed(()=>o.valueType),c=h=>{var m;const y=(m=h.target)==null?void 0:m.value,w=r.unref(l),b=ev(()=>w==="integer"?parseInt(y,10):w==="float"?Number(y):y);n("update:modelValue",b),i.edit=!1},d=r.ref(),p=h=>{!h.metaKey&&o.editable&&(i.edit=!0,requestAnimationFrame(()=>{var m,y;(y=(m=d.value)==null?void 0:m.querySelector("input"))==null||y.focus()}))};return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"baseRef",ref:d,class:r.normalizeClass(["base-cell",{"base-cell__edit":i.edit}]),onClick:p},[i.edit?(r.openBlock(),r.createElementBlock("input",{key:0,value:h.modelValue,onFocusout:m[0]||(m[0]=y=>i.edit=!1),onChange:c},null,40,Sv)):(r.openBlock(),r.createElementBlock("div",Tv,r.toDisplayString(h.modelValue),1))],2))}}),Vv=["^data-row-index"],Av={key:0,class:"control-cell"},Bv=r.defineComponent({__name:"TdCell",props:{cell:{}},setup(t){const e=t,n=Ns(),o=r.computed(()=>e.cell.column.valueType),i=h=>{_r(n.settings.value.onUpdatedRow,m=>{const y=e.cell.row,w={...y.dataRow,[e.cell.id]:h};m({...y,dataRow:w})})},l=h=>{h.metaKey&&n.selectRow(e.cell.row.primaryKey)},c=(h,m)=>{if(h.type==="contextmenu")h.preventDefault();else return;const y=n.settings??{},w=[],{onSelectedRows:b,onSelectedColumns:E}=y.value,$=n.data.selectedRows.has(m.primaryKey);b&&b.length&&($?w.push({text:"Deselect row",cb(){n.data.selectedRows.delete(e.cell.row.primaryKey)}}):w.push({text:"Select row",cb(){n.selectRow(e.cell.row.primaryKey)}})),E&&E.length&&(w.push({text:"Select column",cb(){n.selectColumn(e.cell.column.id)}}),w.push({text:"Unselect column",cb(){n.unselectColumn(e.cell.column.id)}})),w.length&&Tl(h,w)},d=r.ref(),p=r.computed(()=>e.cell.column.component?e.cell.column.component():void 0);return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"cellRef",ref:d,class:r.normalizeClass(["td-cell",{[h.cell.class]:!0}]),"^data-row-index":h.cell.row.index,onClick:l,onContextmenu:m[0]||(m[0]=y=>c(y,h.cell.row))},[h.cell.control?(r.openBlock(),r.createElementBlock("div",Av,r.toDisplayString(h.cell.row.index),1)):p.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.value),{key:1,"model-value":h.cell.value,"onUpdate:modelValue":i},null,8,["model-value"])):(r.openBlock(),r.createBlock(Nv,{key:2,"model-value":h.cell.value,"value-type":o.value,editable:h.cell.column.editable,"onUpdate:modelValue":i},null,8,["model-value","value-type","editable"]))],42,Vv))}}),Pv={},Rv={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Dv(t,e){return r.openBlock(),r.createElementBlock("svg",Rv,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 Iv=Mt(Pv,[["render",Dv]]),Fv={class:"tr-head"},Lv=r.defineComponent({__name:"TrHead",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Fv,[r.renderSlot(e.$slots,"default")]))}});function Ov(t,e){const n=e.indexOf(t)+1;return e[n>=e.length?0:n]}function Mv(t,e){const n=t.findIndex(e);if(n<0)return[];const o=(()=>{for(let i=n;i<t.length;i++)if(!e(t[i],i))return i;return t.length})();return t.slice(n,o)}const Gv=["^data-col-id"],$v=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&&Tl(l,c)}function i(l){var c;const d=((c=l.sort)==null?void 0:c.direction)??"DESC";n("change:sort",{colId:l.id,direction:Ov(d,["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(()=>i(l.col),["stop"]))},null,2)):r.createCommentVNode("",!0)],42,Gv))}}),zv=r.defineComponent({__name:"TrBody",props:{row:{}},setup(t){const e=r.ref(),n=()=>{r.nextTick().then(()=>{_r(e.value,o=>o.scrollLeft=0)})};return(o,i)=>(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=Ns(),n=t,o=r.computed(()=>e.data.selectedColumns.has(n.column.id));return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["column-caret",{selected:o.value,frozen:i.column.frozen}])},null,2))}});function st(t,e,n,o){r.onMounted(()=>{var i;return(i=r.unref(t))==null?void 0:i.addEventListener(e,n,o)}),r.onUnmounted(()=>{var i;return(i=r.unref(t))==null?void 0:i.removeEventListener(e,n,o)})}function Zv(t){r.onMounted(()=>window.addEventListener("mouseup",t)),r.onUnmounted(()=>window.removeEventListener("mouseup",t))}function Wv(t){let e=!1;return function(...n){e?console.log("handle pressure"):(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function jv(t,e){let n;function o(l){n={...l}}Zv(()=>{n=void 0,e()});const i=Wv(t);return st(window,"mousemove",l=>{n&&i({x:n.x,width:n.width,diff:l.x-n.x})}),{start:o}}const Co=1,Hv=10,qv=30,Hu=60;function qu(){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 Ku(t,e={}){const{delayEnter:n=0,delayLeave:o=0}=e,i=r.ref(!1);let l;const c=d=>{const p=d?n:o;l&&(clearTimeout(l),l=void 0),p?l=setTimeout(()=>i.value=d,p):i.value=d};return window&&(st(t,"mouseenter",()=>c(!0)),st(t,"mouseleave",()=>c(!1))),i}function Kv(t){var e;const n=_r((e=r.unref(t))==null?void 0:e.querySelectorAll(".th-cell"),o=>[...o])??[];return n.map(o=>{const{width:i,x:l}=o.getBoundingClientRect(),c=o.getAttribute("data-col-id");return zu({colId:c,width:i,x:l,right:l+i})}).slice(0,n.length-1)}function Yv(t,e){const n=qu(),o=Ku(e,{}),{data:i}=t,l=jv(d=>{_r(i.resizeTh,p=>{const h=i.columns.find(m=>m.id===p.colId);h&&(h.width=Ts(d.width+d.diff,qv,1e4),t.adjustWidth())})},()=>{i.resize=!1,i.resizeTh=void 0,document.body.style.cursor=""}),c=d=>{i.resizeTh&&(i.resize=!0,l.start({x:d.x,width:i.resizeTh.width}))};return r.watchEffect(()=>{if(!o.value){document.body.style.cursor="";return}if(i.resize)return;const d=Kv(e).find(p=>Math.abs(n.x-p.right)<Hv);d?(document.body.style.cursor="col-resize",i.resizeTh=d):(i.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:c}}const Xv={key:0,class:"command-menu"},Jv={key:0},Qv=["onClick"],e0=r.defineComponent({__name:"RowsCommandMenu",setup(t){const e=Ns(),n=r.computed(()=>e.getSelectedRows()),o=r.computed(()=>n.value.length>0),i=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedRows)??[]}),l=r.computed(()=>i.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedRows.clear(),e.data.rows=[]}})));return(c,d)=>o.value?(r.openBlock(),r.createElementBlock("div",Xv,[n.value.length?(r.openBlock(),r.createElementBlock("span",Jv,r.toDisplayString(n.value.length)+" rows selected",1)):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),d[1]||(d[1]=r.createElementVNode("hr",null,null,-1)),d[2]||(d[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,h)=>(r.openBlock(),r.createElementBlock("span",{key:h,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,Qv))),128))])):r.createCommentVNode("",!0)}}),t0={key:0,class:"command-menu"},n0={key:0},r0=["onClick"],o0=r.defineComponent({__name:"ColumnsCommandMenu",setup(t){const e=Ns(),n=r.computed(()=>e.getSelectedColumns()),o=r.computed(()=>n.value.length>0),i=r.computed(()=>{var c;return((c=e.settings)==null?void 0:c.value.onSelectedColumns)??[]}),l=r.computed(()=>i.value.map(c=>({label:c.label,cb:()=>{c.cb(n.value),e.data.selectedColumns.clear()}})));return(c,d)=>o.value?(r.openBlock(),r.createElementBlock("div",t0,[n.value.length?(r.openBlock(),r.createElementBlock("span",n0,"selected columns "+r.toDisplayString(n.value.length),1)):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),d[1]||(d[1]=r.createElementVNode("hr",null,null,-1)),d[2]||(d[2]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(p,h)=>(r.openBlock(),r.createElementBlock("span",{key:h,class:"command",onClick:r.withModifiers(p.cb,["stop"])},r.toDisplayString(p.label),9,r0))),128))])):r.createCommentVNode("",!0)}});function Cr(t,e){const n={el:void 0,x:0,y:0},o=i=>({x:i.x,y:i.y,dx:i.x-n.x,dy:i.y-n.y});st(document,"mousedown",i=>{i.target===r.unref(t)&&(i.stopPropagation&&i.stopPropagation(),i.preventDefault&&i.preventDefault(),n.el=r.unref(t),n.x=i.x,n.y=i.y)}),st(document,"mouseup",i=>{n.el&&(n.el=void 0,e({...o(i),stop:!0},n))}),st(document,"mousemove",i=>{n.el&&e(o(i),n)})}const i0=r.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.windowSize-12),c=r.computed(()=>o.windowSize<o.dataSize),d=r.computed(()=>Math.ceil(o.offset*(l.value/o.dataSize))),p=r.computed(()=>Math.ceil(l.value*l.value/o.dataSize)),h=r.computed(()=>({top:`${d.value}px`,height:`${p.value}px`}));return Cr(i,(m,y)=>{const w=(d.value+m.dy)*o.dataSize/l.value;n("change:offset",w),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:i,class:"t-scroll__handle",style:r.normalizeStyle(h.value)},null,4)):r.createCommentVNode("",!0)])],4))}});function s0(t){return r.computed(()=>{const{data:e,settings:n}=t,{bodyWidth:o,scrollLeft:i}=e,l=[...e.columns],c=Uu();n.value.controlColumn&&l.unshift({id:c,label:"#",width:60,frozen:!0});let d=0;const p=l.map(m=>{const y={...m,offset:d};return d+=m.width+Co,y}),h=p.filter(m=>m.frozen);return gv(p,m=>m.frozen?!1:i<m.offset+m.width&&m.offset<o+i).concat(h).map(m=>({...m,style:{left:m.frozen?`${m.offset}px`:`${m.offset-e.scrollLeft}px`,width:`${m.width}px`},control:m.id===c}))})}function a0(t,e){const n=r.computed(()=>e.value.reduce((o,i)=>(o[i.id]=i.justify?"justify-"+i.justify:"",o),{}));return r.computed(()=>t.rows.map(o=>{const i=n.value,{primaryKey:l,offset:c,dataRow:d,height:p}=o,h=e.value.map(m=>({id:m.id,column:m,row:o,value:d[m.id],class:i[m.id],editable:m.editable,width:m.width,style:m.style,control:m.control}));return zu({style:{top:`${c-t.scrollTop}px`,height:`${o.height}px`},primaryKey:l,offset:c,height:p,cells:h,selected:t.selectedRows.has(l)})}))}const l0=async(t,e)=>{const{scrollTop:n,bodyHeight:o}=t;return await QC(0),nv({rows:e.getRows(n,o),dataWindow:t})};function c0(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=Ci(m.columns),e.currentWindow=void 0,m.dataSource.getHeight().then(y=>{e.dataHeight=y,h.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)),i=r.computed(()=>$u(h.data.dataHeight-h.data.bodyHeight,m=>m>0?m:0)),l=r.computed(()=>$u(o.value-h.data.bodyWidth,m=>m>0?m:0)),c=r.computed(()=>({bodyHeight:e.bodyHeight,scrollTop:e.scrollTop,current:e.currentWindow})),d=s0({data:e,settings:n}),p=a0(e,d),h={data:e,settings:n,tableColumns:d,tableRows:p,adjustWidth:()=>{const m=e.columns.reduce((w,b)=>w+b.width+Co,0),y=e.bodyWidth+e.scrollLeft;if(m<y){const w=e.columns[e.columns.length-1];w.width=w.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=Ts(m,0,i.value)},updateScrollLeft(m){e.scrollLeft=Ts(m,0,l.value)},updateBodyHeight(){const{height:m}=t.settings,{dataHeight:y}=e,w=m>y?y:m;e.bodyHeight=w},updateDimensions(m){this.updateBodyHeight(),h.data.bodyWidth=m.width,h.adjustWidth(),e.rows=[],e.currentWindow=void 0}};return r.watch(c,(m,y)=>{const w=m.current;(!w||m.scrollTop<w.scrollTop||m.scrollTop+m.bodyHeight>w.bodyHeight+w.scrollTop)&&(e.currentWindow={scrollTop:m.scrollTop-Hu,bodyHeight:m.bodyHeight+Hu*2},l0(Ci(e.currentWindow),n.value.dataSource).then(({rows:b,dataWindow:E})=>{_i(e.currentWindow,E)&&(e.rows=b)}))},{deep:!0,immediate:!0}),r.provide(ju,h),h}const d0={class:"command-menu__container"},u0={key:0,class:"table-body__no-data"},p0={class:"carets"},Nl=r.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(t,{emit:e}){const n=e,o=t,i=c0(o),l=r.computed(()=>i.data.rows.length===0),c=r.computed(()=>({height:l.value?"212px":i.data.bodyHeight+"px"}));r.watch(i.data,$=>n("update:data",$),{deep:!0}),r.watch(o,()=>m);const d=r.ref(),p=r.ref(),h=r.ref(),m=()=>{_r(h.value,$=>{i.updateDimensions($.getBoundingClientRect())})},y=i.tableColumns,w=i.tableRows,{mouseDown:b}=Yv(i,d);r.onMounted(()=>{r.nextTick(m)}),r.watchPostEffect(()=>{r.unref(o.settings),r.nextTick(m)}),st(window,"resize",()=>r.nextTick(m));const E=$=>{$.preventDefault(),i.updateOffsets($)};return($,O)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"tableRef",ref:d,class:"data-table",onMousedown:O[2]||(O[2]=(...T)=>r.unref(b)&&r.unref(b)(...T))},[r.createElementVNode("div",d0,[r.createVNode(e0),O[3]||(O[3]=r.createTextVNode()),r.createVNode(o0)]),O[7]||(O[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"headRef",ref:p,class:"table-head"},[r.createVNode(Lv,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(T,P)=>(r.openBlock(),r.createBlock($v,{key:P,col:T,style:r.normalizeStyle(T.style),"onChange:sort":O[0]||(O[0]=R=>$.$emit("change:sort",R))},null,8,["col","style"]))),128))]),_:1})],512),O[8]||(O[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"bodyRef",ref:h,class:"table-body",style:r.normalizeStyle(c.value),onWheel:E},[l.value?(r.openBlock(),r.createElementBlock("div",u0,[r.createElementVNode("div",null,[r.createVNode(Iv),O[4]||(O[4]=r.createTextVNode()),O[5]||(O[5]=r.createElementVNode("div",null,"No Data To Show",-1))])])):r.createCommentVNode("",!0),O[6]||(O[6]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(w),(T,P)=>(r.openBlock(),r.createBlock(zv,{key:P,row:T},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(T.cells,R=>(r.openBlock(),r.createBlock(Bv,{key:R.column.id+":"+P,cell:R,style:r.normalizeStyle(R.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),O[9]||(O[9]=r.createTextVNode()),r.createElementVNode("div",p0,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(y),(T,P)=>(r.openBlock(),r.createBlock(Uv,{key:P,column:T,style:r.normalizeStyle(T.style),"onChange:sort":O[1]||(O[1]=R=>$.$emit("change:sort",R))},null,8,["column","style"]))),128))]),O[10]||(O[10]=r.createTextVNode()),r.createVNode(i0,{offset:r.unref(i).data.scrollTop,"window-size":r.unref(i).data.bodyHeight,"data-size":r.unref(i).data.dataHeight,"onChange:offset":r.unref(i).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),Yu=new WeakMap;class h0{constructor(e,n,o){XC(this,"dataHeight"),this.datum=e,this.resolveHeight=n,this.resolvePrimaryKey=o;const i=e.reduce((c,d,p)=>(c.indices.set(p,c.total),c.total+=this.resolveHeight(d,p)+Co,c),{total:0,indices:new Map});this.dataHeight=i.total;const l=e.map((c,d)=>({dataRow:c,index:d,primaryKey:this.resolvePrimaryKey(c,d),offset:Ss(i.indices.get(d)),height:this.resolveHeight(c,d)}));Yu.set(this,l)}get rows(){return Yu.get(this)}async getHeight(){return this.dataHeight}async getRows(e,n){return Mv(this.rows,o=>{const i=o.offset;return e<i+o.height&&i<n+e})}}class f0{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=Ts(Math.floor(e/this.height),0,Number.POSITIVE_INFINITY),i=Math.ceil(n+40/this.height);return(await this.api.query({offset:o,limit:i})).map((l,c)=>({dataRow:l,index:o+c,primaryKey:this.resolvePrimaryKey(l,o+c),offset:(o+c)*(this.rowHeight+Co),height:this.rowHeight}))}}function m0(t){return Object.freeze(t)}function g0(t){return r.h(Nl,{settings:Object.freeze(t)})}function Vl(t,e){const n=new h0(t,e.resolveRowHeight,e.resolvePrimaryKey);return{...e,dataSource:n}}function y0(t,e){return r.computed(()=>{const n=r.unref(t);return Vl(n,r.unref(e))})}function _0(t,e){const n=r.computed(()=>{const i=r.unref(t);return Vl(i,r.unref(e))}),o=r.reactive({settings:n});return r.computed(()=>r.h(Nl,o))}const C0=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:f0,Component:Nl,factory:g0,rawDataSettings:Vl,settings:m0,useRawData:y0,useRawDataComponent:_0},Symbol.toStringTag,{value:"Module"}));function*v0(t,e){for(const n of t)yield e(n)}function w0(t){const e=[];for(const n of t)e.push(n);return e}function Xu(t){return t()}function Al(t,e){if(t==null)throw Error(e);return t}function Bl(t){let e=!1;return function(...n){e||(requestAnimationFrame(()=>{t(...n),e=!1}),e=!0)}}function Ju(t){return new Promise(e=>setTimeout(e,t))}function Qu(t,e){const n=setTimeout(t,e);return()=>{clearTimeout(n)}}function ep(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function b0(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(ep(65,91));return e}function tp(t){return function(e){return 1-t(1-e)}}function x0(t){return function(e){return e<.5?t(2*e)/2:(2-t(2*(1-e)))/2}}function np(t){const{duration:e,draw:n,timing:o}=t,i=performance.now();let l=!1;return requestAnimationFrame(function c(d){let p=(d-i)/e;(p>1||l)&&(p=1);const h=o(p);n(h),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function k0(t){const{getFraction:e,draw:n,timing:o}=t,i=performance.now();let l=!1;return requestAnimationFrame(function c(d){let p=e(d-i);if(l)return;p>1&&(p=1);const h=o(p);n(h),p<1&&requestAnimationFrame(c)}),function(){l=!0}}function rp(t,e){let n=-1;return(...o)=>{n!==-1&&(clearTimeout(n),n=-1),n=window.setTimeout(()=>t(...o),e)}}function op(t,e,n=!0){let o=0,i;return function(...l){i=()=>{t.apply(this,l),o=new Date().getTime()+e,i=null,n&&setTimeout(()=>{i==null||i()},e)},new Date().getTime()>o&&i()}}function E0(t){return t.map(e=>({text:String(e),value:e}))}function vr(t){return t.map(e=>({label:"label"in e?e.label:e.text,value:e.value,description:e.description}))}const Pl=new Map;function S0(t){return Pl.has(t)||Pl.set(t,r.ref(localStorage.getItem(t))),Al(Pl.get(t),"...")}function T0(t,e){e==null?localStorage.removeItem(t):localStorage.setItem(t,e)}function ip(t){const e=S0(t);return r.watch(e,n=>T0(t,n)),e}const Rl=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{w0(v0(Rl.values(),e=>e(t.matches?"dark":"light")))});const N0=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",sp=r.ref(N0),Dl=ip("theme");function ap(t){const e=r.computed(()=>Dl.value?Dl.value:sp.value),n=i=>{sp.value=i,t==null||t(i)};function o(){Dl.value=e.value==="light"?"dark":(e.value,"light")}return r.watch(e,i=>{t==null||t(r.unref(i))}),r.onMounted(()=>{Rl.add(n)}),r.onUnmounted(()=>{Rl.delete(n)}),[e,o]}const V0=r.defineComponent({__name:"ThemeSwitcher",setup(t){const[e,n]=ap();return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-theme-switcher",r.unref(e)]),onClick:i[0]||(i[0]=(...l)=>r.unref(n)&&r.unref(n)(...l))},i[1]||(i[1]=[r.createElementVNode("div",null,null,-1)]),2))}}),A0={key:0,class:"pl-block-page__title"},B0={class:"pl-block-page__title__default"},P0={class:"pl-block-page__title__append"},R0={key:1},D0={class:"pl-block-page__body"},I0={name:"PlBlockPage"},F0=r.defineComponent({...I0,props:{noBodyGutters:{type:Boolean}},setup(t){const e=r.useSlots();return(n,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-layout-component pl-block-page",{noBodyGutters:n.noBodyGutters}])},[r.unref(e).title?(r.openBlock(),r.createElementBlock("div",A0,[r.createElementVNode("div",B0,[r.renderSlot(n.$slots,"title")]),o[0]||(o[0]=r.createTextVNode()),r.createElementVNode("div",P0,[r.renderSlot(n.$slots,"append")])])):(r.openBlock(),r.createElementBlock("div",R0)),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",D0,[r.renderSlot(n.$slots,"default")])],2))}}),L0={name:"PlContainer"},O0=r.defineComponent({...L0,props:{width:{}},setup(t){const e=t,n=r.computed(()=>({width:e.width}));return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-container pl-layout-component",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),M0={name:"PlRow"},G0=r.defineComponent({...M0,props:{wrap:{type:Boolean},alignCenter:{type:Boolean},noGap:{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))}}),$0={class:"pl-layout-component",style:{"flex-grow":"1"}},z0={name:"PlSpacer"},lp=r.defineComponent({...z0,setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",$0))}}),U0={name:"PlGrid"},Z0=r.defineComponent({...U0,props:{columns:{}},setup(t){const e=t,n=r.computed(()=>({gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`}));return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-layout-component pl-grid",style:r.normalizeStyle(n.value)},[r.renderSlot(o.$slots,"default")],4))}}),W0={key:0,class:"pl-alert__icon"},j0={class:"pl-alert__main"},H0={key:0},q0={class:"pl-alert__main__text"},K0={name:"PlAlert"},Y0=r.defineComponent({...K0,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",W0,[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",j0,[n.label?(r.openBlock(),r.createElementBlock("label",H0,r.toDisplayString(n.label),1)):r.createCommentVNode("",!0),o[1]||(o[1]=r.createTextVNode()),r.createElementVNode("div",q0,[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]=i=>n.$emit("update:modelValue",!1))})):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),X0=`<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
|
+
`,J0=`<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
|
-
`,K0=["innerHTML"],Y0={class:"dropdown-list-item__title-container"},X0={class:"dropdown-list-item__title text-s"},J0={key:0,class:"dropdown-list-item__description text-description"},Q0={key:1,class:"dropdown-list-item__icon flex-self-start"},vo=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(" ")}),i=r.computed(()=>e.isSelected?q0:H0);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:i.value},null,10,K0)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",Y0,[r.createElementVNode("div",X0,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",J0,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",Q0)):r.createCommentVNode("",!0)],2))}});function vi(t,e){const n=Al(()=>{if(t.value){const{scrollTop:o,scrollLeft:i,scrollHeight:l,scrollWidth:c,clientHeight:d,clientWidth:p}=document.documentElement,h=t.value.getBoundingClientRect();e({scrollTop:o,scrollLeft:i,scrollHeight:l,scrollWidth:c,clientHeight:d,clientWidth:p,offsetY:o+h.y,offsetX:i+h.x,top:h.top,right:h.right,bottom:h.bottom,left:h.left,width:h.width,height:h.height,x:h.x,y:h.y})}});r.onMounted(n),st(window,"scroll",n,{capture:!0,passive:!0}),st(window,"resize",n,{passive:!0}),st(window,"adjust",n,!0)}const ew=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(i,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,i.$style.icon])},null,6))}}),tw="_icon_1ugxm_2",nw={icon:tw},rw={$style:nw},At=Mt(ew,[["__cssModules",rw]]),ow=["onKeyup"],iw=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,i=n,l=r.useModel(t,"modelValue"),c=r.ref(),d=r.ref(),p=r.ref(),h=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(d,A=>{if(A){const N=A.getBoundingClientRect();m.optionsHeight=N.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const w=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),v=r.computed(()=>(o.options??[]).findIndex(A=>_i(A.value,l.value))),E=r.computed(()=>Cr(o.options??[]).map((A,N)=>({...A,index:N,isSelected:N===v.value,isActive:N===m.activeIndex}))),z=r.computed(()=>o.loading||o.options===void 0),$=r.computed(()=>{var A;return((A=E.value.find(N=>_i(N.value,l.value)))==null?void 0:A.label)??(o.options===void 0?"...":"")});vi(c,A=>{const N=A.top+A.height+3;N+m.optionsHeight>A.clientHeight?y.top=A.top-m.optionsHeight-3+"px":y.top=N+"px",y.left=A.left+"px",y.width=A.width+"px"});const S=A=>{var N;l.value=A,m.open=!1,(N=c==null?void 0:c.value)==null||N.focus()};function B(){i("click")}const D=A=>{var N,j;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(A.code))A.preventDefault();else return;if(A.target===h.value&&A.code==="Enter"){B();return}const{open:J,activeIndex:Z}=m;if(!J&&A.target===p.value){A.code==="Enter"&&(m.open=!0);return}A.code==="Escape"&&(m.open=!1,(N=c.value)==null||N.focus());const R=r.unref(E),{length:O}=R;if(!O)return;A.code==="Enter"&&S((j=R.find(M=>M.index===Z))==null?void 0:j.value);const G=R.findIndex(M=>M.index===Z)??-1,P=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0,T=Math.abs(G+P+O)%O;m.activeIndex=E.value[T].index??-1},H=A=>{var N,j;const J=A.relatedTarget;!((N=c.value)!=null&&N.contains(J))&&!((j=d.value)!=null&&j.contains(J))&&(m.open=!1)};return(A,N)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass([{disabled:A.disabled||z.value,loading:z.value},"pl-btn-split d-flex"]),onFocusout:H,onKeydown:D},[r.createElementVNode("div",{ref_key:"buttonAction",ref:h,class:"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn",tabindex:"0",onClick:B,onKeyup:r.withKeys(r.withModifiers(B,["stop"]),["enter"])},r.toDisplayString($.value),41,ow),N[1]||(N[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:N[0]||(N[0]=j=>m.open=!m.open)},[z.value?(r.openBlock(),r.createBlock(At,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([w.value,"pl-btn-split__icon"])},null,2))],512),N[2]||(N[2]=r.createTextVNode()),m.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:d,class:"pl-dropdown__options",style:r.normalizeStyle(y),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,(j,J)=>(r.openBlock(),r.createBlock(vo,{key:J,option:j,"is-selected":j.isSelected,"is-hovered":j.isActive,size:"medium",onClick:r.withModifiers(Z=>S(j.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function cp(t){function e(n){const o=n.currentTarget,i=document.createElement("span"),l=Math.max(o.clientWidth,o.clientHeight),c=l/2;i.style.width=i.style.height=`${l}px`,i.style.left=`${n.clientX-o.offsetLeft-c}px`,i.style.top=`${n.clientY-o.offsetTop-c}px`,i.classList.add("ripple");const d=o.getElementsByClassName("ripple")[0];d&&d.remove(),o.appendChild(i)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const sw={key:0},aw={inheritAttrs:!1},Ns=r.defineComponent({...aw,__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"),i=r.computed(()=>e.large||e.size==="large");return cp(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:i.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",sw,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(At),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(At),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),lw={name:"PlBtnPrimary"},Vs=r.defineComponent({...lw,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(Ns,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),cw={name:"PlBtnAccent"},dw=r.defineComponent({...cw,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(Ns,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),uw={name:"PlBtnDanger"},pw=r.defineComponent({...uw,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(Ns,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),hw={name:"PlBtnSecondary"},Dl=r.defineComponent({...hw,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(Ns,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),fw={key:0},mw={name:"PlBtnGhost"},wo=r.defineComponent({...mw,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"),i=r.ref(),l=r.useSlots();return cp(i),(c,d)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:i,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",fw,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(At),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(At),{key:2,name:c.icon,size:c.size},null,8,["name","size"])):r.createCommentVNode("",!0),d[1]||(d[1]=r.createTextVNode()),r.renderSlot(c.$slots,"append")],16))}}),gw=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,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:o.disabled,loading:o.loading,hover:n.value}]),onMouseover:i[0]||(i[0]=l=>n.value=!0),onMouseleave:i[1]||(i[1]=l=>n.value=!1)},[r.createVNode(Dl,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),i[2]||(i[2]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],34))}});function yw(t,e){const n=r.ref();return vi(t,o=>{n.value=o}),r.computed(()=>{const o=r.unref(n),i=r.unref(e),l=i.position??"top",c=i.gap??8;if(!o)return"";const d=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: ${d}px;`:l==="left"?`right: ${o.scrollWidth-o.x+c}px; top: ${d}px;`:l==="southwest"?`left: ${o.offsetX+o.width}px; top: ${o.offsetY+o.height+c}px;`:""})}function wi(t,e){return e(t)}function _t(t,e){if(t!=null)return e(t)}function _w(t){return Array.isArray(t)?t:[t]}function Cw(t,e,...n){n.forEach(o=>{t[o]=e[o]})}function As(t,e){st(document,"click",n=>{document.contains(n.target)&&(_w(t).map(o=>o.value).filter(o=>!!o).some(o=>o==null?void 0:o.contains(n.target))||e())})}const vw={},ww={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function bw(t,e){return r.openBlock(),r.createElementBlock("svg",ww,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 xw=Mt(vw,[["render",bw]]),Il=new Map,kw={name:"PlTooltip"},Ct=r.defineComponent({...kw,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"},maxWidth:{default:"300px"}},emits:["tooltip:close"],setup(t,{emit:e}){const n=e,o=Symbol(),i=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});Il.set(o,()=>h()),r.watch(()=>l.open,$=>{requestAnimationFrame(()=>{l.tooltipOpen=$})});let c=()=>{};const d=op(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(const[$,S]of Il.entries())$!==o&&S()},h=()=>{l.open=!1,n("tooltip:close")},m=async()=>{i.hide||(d(),l.over=!0,c(),await Ju(100),l.over&&p())},y=()=>{l.over=!1,c=Qu(()=>{l.over||h()},i.closeDelay)};r.watch(()=>i.hide,$=>{$&&h()});const w=r.ref(),v=r.ref(),E=yw(w,r.toRef(i));As([w,v],()=>h());const z=r.computed(()=>({"--pl-tooltip-max-width":i.maxWidth}));return r.onUnmounted(()=>{Il.delete(o)}),($,S)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent($.element),r.mergeProps($.$attrs,{ref_key:"rootRef",ref:w,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot($.$slots,"default"),S[1]||(S[1]=r.createTextVNode()),$.$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(E))},[r.createElementVNode("div",{ref_key:"tooltip",ref:v,class:r.normalizeClass(["pl-tooltip",$.position]),style:r.normalizeStyle(z.value),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot($.$slots,"tooltip")]),S[0]||(S[0]=r.createTextVNode()),r.createVNode(xw)],38)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),Sw={},Ew={class:"inner-border"};function Tw(t,e,n,o,i,l){return r.openBlock(),r.createElementBlock("div",Ew,[r.renderSlot(t.$slots,"default")])}const Nw=Mt(Sw,[["render",Tw]]),Vw={key:0},Aw=["tabindex","onKeydown","onClick"],Bw={key:1,class:"pl-btn-group__helper"},Pw={key:2,class:"pl-btn-group__error"},Rw={name:"PlBtnGroup"},dp=r.defineComponent({...Rw,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,i=d=>o("update:modelValue",d),l=t,c=r.computed(()=>l.options.map(d=>({label:"label"in d?d.label:d.text,value:d.value})));return(d,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-btn-group",{disabled:d.disabled,compact:d.compact}])},[d.label?(r.openBlock(),r.createElementBlock("label",Vw,[r.createElementVNode("span",null,r.toDisplayString(d.label),1),p[0]||(p[0]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(d.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Nw,{class:"pl-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(h,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["pl-btn-group__option text-s",{active:d.modelValue===h.value}]),tabindex:d.modelValue===h.value||d.disabled?void 0:0,onKeydown:r.withKeys(y=>i(h.value),["enter"]),onClick:y=>i(h.value)},r.toDisplayString(h.label),43,Aw))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),d.helper?(r.openBlock(),r.createElementBlock("div",Bw,r.toDisplayString(d.helper),1)):d.error?(r.openBlock(),r.createElementBlock("div",Pw,r.toDisplayString(d.error),1)):r.createCommentVNode("",!0)],2))}});function Dw(t,e){const n=r.ref(),o=r.ref(),{parse:i,update:l}=e,c=()=>{n.value=void 0,o.value=void 0},d=r.computed({get(){return n.value!==void 0?n.value:t.value},set(p){c();try{const h=i?i(p):p;!l||l(h)?t.value=h:n.value=h}catch(h){n.value=p,o.value=h instanceof Error?h.message:String(h)}}});return r.reactive({value:d,error:o,reset:c})}const Iw="_component_1abv8_1",Fw="_container_1abv8_15",Lw="_error_1abv8_69",Fl={component:Iw,container:Fw,error:Lw},Ow={key:0},Mw=["placeholder"],Gw=r.defineComponent({__name:"PlEditableTitle",props:r.mergeModels({placeholder:{default:"Title"},maxWidth:{default:"80%"},prefix:{default:void 0},maxLength:{default:1e3},minLength:{default:void 0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,o=Dw(e,{update(){return!1},parse:d=>{if(typeof d!="string")throw Error("value should be a string");if(n.maxLength&&d.length>n.maxLength)throw Error(`Max title length is ${n.maxLength} characters`);if(n.minLength&&d.length<n.minLength)throw Error(`Min title length is ${n.minLength} characters`);return d.trim()}}),i=r.computed(()=>({maxWidth:n.maxWidth??"80%"})),l=()=>{e.value=o.value&&!o.error?o.value:e.value,o.reset()},c=r.ref();return(d,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-editable-title",r.unref(Fl).component]),style:r.normalizeStyle(i.value)},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(Fl).container),onClick:p[3]||(p[3]=()=>{var h;return(h=c.value)==null?void 0:h.focus()})},[d.prefix?(r.openBlock(),r.createElementBlock("span",Ow,r.toDisplayString(d.prefix.trim())+" ",1)):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":p[0]||(p[0]=h=>r.unref(o).value=h),placeholder:d.placeholder,onFocusout:l,onKeydown:[p[1]||(p[1]=r.withKeys((...h)=>r.unref(o).reset&&r.unref(o).reset(...h),["escape"])),p[2]||(p[2]=r.withKeys(h=>{var m;return(m=h.target)==null?void 0:m.blur()},["enter"]))]},null,40,Mw),[[r.vModelText,r.unref(o).value]])],2),p[5]||(p[5]=r.createTextVNode()),r.unref(o).error?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(r.unref(Fl).error)},r.toDisplayString(r.unref(o).error),3)):r.createCommentVNode("",!0)],6))}}),$w={inheritAttrs:!1},zw={class:"double-contour"};function Uw(t,e,n,o,i,l){return r.openBlock(),r.createElementBlock("div",zw,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const vr=Mt($w,[["render",Uw]]);function up(t){r.onMounted(t),r.onUpdated(t)}const Ll=new WeakMap,Ol=new ResizeObserver(t=>{for(const e of t)_t(Ll.get(e.target),n=>n(e))});function pp(t,e){Ll.set(t,e),Ol.unobserve(t),Ol.observe(t)}function hp(t){Ol.unobserve(t),Ll.delete(t)}const Zw=8,fp=4;function Xn(t,e="label"){const n=new Set;up(()=>{_t(t==null?void 0:t.value,o=>{const i=o.querySelector(e);i&&(n.add(i),pp(i,()=>{const l=Xu(()=>i.getBoundingClientRect().width+wi(Zw,c=>Number.isNaN(c)?fp:c+fp));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=>hp(o))})}function Ww(t,e){const n=[];return e&&e.length>0&&e.forEach(o=>{const i=o(t);typeof i=="string"&&n.push(i)}),{isValid:n.length===0,errors:n}}function mp(t,e){return r.computed(()=>Ww(t.value,e))}const jw=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(i,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,i.$style.icon])},null,6))}}),Hw="_icon_1ugxm_2",qw={icon:Hw},Kw={$style:qw},Hr=Mt(jw,[["__cssModules",Kw]]),Yw=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(o,i)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),Xw="_icon_1ugxm_2",Jw={icon:Xw},Qw={$style:Jw},xt=Mt(Yw,[["__cssModules",Qw]]),eb={class:"pl-text-field__envelope"},tb={key:0,ref:"label"},nb={key:0,class:"required-icon"},rb={key:1,class:"pl-text-field__prefix"},ob=["disabled","placeholder","type"],ib={class:"pl-text-field__append"},sb={key:0,class:"pl-text-field__error"},ab={key:1,class:"pl-text-field__helper"},lb={name:"PlTextField"},qr=r.defineComponent({...lb,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,i=r.ref(void 0),l=r.ref(),c=r.ref(!1),d=r.reactive({cached:void 0}),p=r.computed({get(){return d.cached?d.cached.value:n.value===void 0||n.value===null?"":String(n.value)},set(H){if(d.cached=void 0,o.parse)try{n.value=o.parse(H)}catch(A){d.cached={error:A instanceof Error?A.message:String(A),value:H}}else n.value=H}}),h=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&&(d.cached=void 0,n.value=o.clearable===!0?"":o.clearable())},w=mp(p,o.rules||[]),v=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),E=r.computed(()=>!v.value),z=r.computed(()=>{const H=[];return o.error&&H.push(o.error),d.cached&&H.push(d.cached.error),w.value.isValid||H.push(...w.value.errors),H}),$=r.computed(()=>z.value.length>0),S=r.computed(()=>o.clearable&&E.value&&o.type!=="password"&&!o.disabled),B=()=>c.value=!c.value,D=()=>{d.cached=void 0};return Xn(i),(H,A)=>(r.openBlock(),r.createElementBlock("div",eb,[r.createElementVNode("div",{ref_key:"rootRef",ref:i,class:r.normalizeClass(["pl-text-field",{error:$.value,disabled:H.disabled,dashed:H.dashed,nonEmpty:E.value}])},[H.label?(r.openBlock(),r.createElementBlock("label",tb,[H.required?(r.openBlock(),r.createElementBlock("i",nb)):r.createCommentVNode("",!0),A[1]||(A[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(H.label),1),A[2]||(A[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(H.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),A[5]||(A[5]=r.createTextVNode()),H.prefix?(r.openBlock(),r.createElementBlock("div",rb,r.toDisplayString(H.prefix),1)):r.createCommentVNode("",!0),A[6]||(A[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":A[0]||(A[0]=N=>p.value=N),disabled:H.disabled,placeholder:H.placeholder||"...",type:h.value,spellcheck:"false",onFocusout:D},null,40,ob),[[r.vModelDynamic,p.value]]),A[7]||(A[7]=r.createTextVNode()),r.createElementVNode("div",ib,[S.value?(r.openBlock(),r.createBlock(r.unref(Hr),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),A[3]||(A[3]=r.createTextVNode()),H.type==="password"?(r.openBlock(),r.createBlock(r.unref(xt),{key:1,name:m.value,style:{cursor:"pointer"},onClick:B},null,8,["name"])):r.createCommentVNode("",!0),A[4]||(A[4]=r.createTextVNode()),r.renderSlot(H.$slots,"append")]),A[8]||(A[8]=r.createTextVNode()),r.createVNode(vr,{class:"pl-text-field__contour"})],2),A[9]||(A[9]=r.createTextVNode()),$.value?(r.openBlock(),r.createElementBlock("div",sb,r.toDisplayString(z.value.join(" ")),1)):H.helper?(r.openBlock(),r.createElementBlock("div",ab,r.toDisplayString(H.helper),1)):r.createCommentVNode("",!0)]))}}),cb=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(o,i)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),db="_icon_1ugxm_2",ub={icon:db},pb={$style:ub},Bs=Mt(cb,[["__cssModules",pb]]),hb=["disabled","placeholder"],fb=r.defineComponent({__name:"PlSearchField",props:{modelValue:{},clearable:{type:Boolean},placeholder:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(void 0),l=r.ref(),c=r.computed({get(){return o.modelValue??""},set(h){n("update:modelValue",h)}}),d=r.computed(()=>!!o.modelValue),p=()=>n("update:modelValue","");return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:i,class:r.normalizeClass(["pl-search-field",[h.$style.component]])},[r.createVNode(r.unref(Bs),{name:"search"}),m[1]||(m[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:l,"onUpdate:modelValue":m[0]||(m[0]=y=>c.value=y),disabled:h.disabled,type:"text",placeholder:h.placeholder||"Find...",spellcheck:"false"},null,8,hb),[[r.vModelText,c.value]]),m[2]||(m[2]=r.createTextVNode()),h.clearable&&d.value?(r.openBlock(),r.createBlock(r.unref(Hr),{key:0,class:r.normalizeClass(h.$style.clear),name:"delete-clear",onClick:r.withModifiers(p,["stop"])},null,8,["class"])):r.createCommentVNode("",!0)],2))}}),mb="_component_1ng5b_1",gb="_clear_1ng5b_35",yb={component:mb,clear:gb},_b={$style:yb},gp=Mt(fb,[["__cssModules",_b]]),Cb={class:"ui-text-area__envelope"},vb={key:0,ref:"label"},wb={key:0,class:"required-icon"},bb=["readonly","rows","disabled","placeholder"],xb={class:"ui-text-area__append"},kb={key:0,class:"ui-text-area__error"},Sb={key:1,class:"ui-text-area__helper"},Eb={name:"PlTextArea"},Tb=r.defineComponent({...Eb,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,i=t,l=r.ref(),c=r.ref(),d=r.computed({get(){return i.modelValue??""},set(v){o("update:modelValue",v)}}),p=r.computed(()=>!!i.modelValue),h=mp(d,i.rules||[]);Xn(l);const m=r.computed(()=>{const v=[];return i.error&&v.push(i.error),v.push(...h.value.errors),v}),y=r.computed(()=>m.value.length>0),w=()=>{if(!i.autogrow)return;const v=c.value;v&&(v.style.height="auto",v.style.height=`${v.scrollHeight}px`)};return r.onMounted(()=>{w()}),(v,E)=>(r.openBlock(),r.createElementBlock("div",Cb,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:v.disabled,dashed:v.dashed,nonEmpty:p.value}])},[v.label?(r.openBlock(),r.createElementBlock("label",vb,[v.required?(r.openBlock(),r.createElementBlock("i",wb)):r.createCommentVNode("",!0),E[1]||(E[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(v.label),1),E[2]||(E[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(v.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),E[3]||(E[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":E[0]||(E[0]=z=>d.value=z),readonly:v.readonly,rows:v.rows,disabled:v.disabled,placeholder:v.placeholder??"...",spellcheck:"false",onInput:w},null,40,bb),[[r.vModelText,d.value]]),E[4]||(E[4]=r.createTextVNode()),r.createElementVNode("div",xb,[r.renderSlot(v.$slots,"append")]),E[5]||(E[5]=r.createTextVNode()),r.createVNode(vr,{class:"ui-text-area__contour"})],2),E[6]||(E[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",kb,r.toDisplayString(m.value.join(" ")),1)):v.helper?(r.openBlock(),r.createElementBlock("div",Sb,r.toDisplayString(v.helper),1)):r.createCommentVNode("",!0)]))}});function yp(t){return t!==null&&typeof t=="object"}function Gt(t,e){return yp(t)&&yp(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Gt(t[n],e[n])):t===e}function Ml(t,e){return t.some(n=>Gt(n,e))}const Gl=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),o=r.ref(!1),i=r.computed(()=>o.value&&e.value?"ui-lt-animate":""),l=rp(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 d(){const m=Vl(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){d(),l(!0)}function h(){l(!1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(m.$attrs,{class:"ui-lt-container"}),[r.createElementVNode("span",{onMouseover:p,onMouseleave:h},[r.createElementVNode("span",{ref_key:"span",ref:n,class:r.normalizeClass(i.value)},[r.renderSlot(m.$slots,"default")],2)],32)],16))}});function _p(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,i=e.offsetTop,l=e.getBoundingClientRect().height;return i+l<o+n&&i>n}function Cp(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,i=e.offsetTop,l=e.getBoundingClientRect().height;return i+l<o+n?"ceil":i>n?"floor":"visible"}function Ps(t,e,n={}){const o=t.scrollTop,i=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,d=Cp(t,e);if(d==="visible")return;const p=h=>{const m=d==="floor"?c-(i-l):c;t.scrollTop=o+h*(m-o)};_p(t,e)||np({duration:n.duration||100,timing:tp(h=>h),draw:p})}function $l(t,e,n,o){return t.addEventListener(e,n,o),function(){t.removeEventListener(e,n)}}function Nb(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}const zl=r.defineComponent({__name:"DropdownOverlay",props:{root:{},gap:{}},setup(t,{expose:e}){const n=t,o=r.reactive({optionsHeight:0}),i=r.reactive({top:"0px",left:"0px",width:"0px"}),l=r.toRef(n,"root"),c=r.ref();return e({scrollIntoActive:()=>{const d=c.value;d&&yr(d.querySelector(".hovered-item"),p=>{Ps(d,p)})},listRef:c}),r.watch(c,d=>{d&&requestAnimationFrame(()=>{const p=d.getBoundingClientRect();o.optionsHeight=p.height,window.dispatchEvent(new CustomEvent("adjust"))})}),vi(l,d=>{const p=document.body.getBoundingClientRect(),h=d.top-p.top,m=d.left-p.left,y=n.gap??0,w=h+d.height+y;w+o.optionsHeight>d.clientHeight?i.top=h-o.optionsHeight-y+"px":i.top=w+"px",i.left=m+"px",i.width=d.width+"px"}),(d,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createElementVNode("div",r.mergeProps({ref_key:"listRef",ref:c},d.$attrs,{style:i,tabindex:"-1"}),[r.renderSlot(d.$slots,"default",{ref:"list"})],16)]))}}),Vb={class:"pl-dropdown__envelope"},Ab=["tabindex"],Bb={class:"pl-dropdown__container"},Pb={class:"pl-dropdown__field"},Rb=["disabled","placeholder"],Db={class:"pl-dropdown__controls"},Ib={key:0},Fb={key:0,class:"required-icon"},Lb={key:0,class:"nothing-found"},Ob={key:0,class:"pl-dropdown__error"},Mb={key:1,class:"pl-dropdown__helper"},Gb={key:2,class:"pl-dropdown__helper"},$b={name:"PlDropdown"},bo=r.defineComponent({...$b,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,i=r.useSlots(),l=r.ref(),c=r.ref(),d=r.useTemplateRef("overlay"),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),h=()=>wi(D.value.findIndex(G=>Gt(G.value,o.modelValue)),G=>G<0?0:G),m=()=>p.activeIndex=h(),y=r.computed(()=>o.options===void 0),w=r.computed(()=>y.value?!0:o.disabled),v=r.computed(()=>(o.options??[]).findIndex(G=>Gt(G.value,o.modelValue))),E=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&v.value===-1)return"The selected value is not one of the options"}}),z=r.computed(()=>Cr(o.options??[]).map((G,P)=>({...G,index:P,isSelected:P===v.value,isActive:P===p.activeIndex}))),$=r.computed(()=>{const G=r.unref(z).find(P=>Gt(P.value,o.modelValue));return(G==null?void 0:G.label)||o.modelValue}),S=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String($.value):o.placeholder),B=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),D=r.computed(()=>{const G=z.value;return p.search?G.filter(P=>{const T=p.search.toLowerCase();return P.label.toLowerCase().includes(T)||P.description&&P.description.toLowerCase().includes(T)?!0:typeof P.value=="string"?P.value.toLowerCase().includes(T):P.value===p.search}):G}),H=r.computed(()=>w.value?void 0:"0"),A=G=>{var P;n("update:modelValue",G),p.search="",p.open=!1,(P=l==null?void 0:l.value)==null||P.focus()},N=()=>n("update:modelValue",void 0),j=()=>{var G;return(G=c.value)==null?void 0:G.focus()},J=()=>p.open=!p.open,Z=()=>p.open=!0,R=G=>{var P,T,M;const U=G.relatedTarget;!((P=l.value)!=null&&P.contains(U))&&!((M=(T=d.value)==null?void 0:T.listRef)!=null&&M.contains(U))&&(p.search="",p.open=!1)},O=G=>{var P,T;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(G.code))G.preventDefault();else return;const{open:M,activeIndex:U}=p;if(!M){G.code==="Enter"&&(p.open=!0);return}G.code==="Escape"&&(p.open=!1,(P=l.value)==null||P.focus());const X=r.unref(D),{length:ne}=X;if(!ne)return;G.code==="Enter"&&A((T=X.find(Se=>Se.index===U))==null?void 0:T.value);const de=X.findIndex(Se=>Se.index===U)??-1,me=G.code==="ArrowDown"?1:G.code==="ArrowUp"?-1:0,Te=Math.abs(de+me+ne)%ne;p.activeIndex=D.value[Te].index??-1};return Xn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,G=>{var P;return G?(P=c.value)==null?void 0:P.focus():""}),r.watchPostEffect(()=>{var G;p.search,p.activeIndex>=0&&p.open&&((G=d.value)==null||G.scrollIntoActive())}),(G,P)=>(r.openBlock(),r.createElementBlock("div",Vb,[r.createElementVNode("div",{ref_key:"rootRef",ref:l,tabindex:H.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:G.error,disabled:w.value}]),onKeydown:O,onFocusout:R},[r.createElementVNode("div",Bb,[r.createElementVNode("div",Pb,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":P[0]||(P[0]=T=>p.search=T),type:"text",tabindex:"-1",disabled:w.value,placeholder:S.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z},null,40,Rb),[[r.vModelText,p.search]]),P[4]||(P[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:j},[r.createVNode(Gl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString($.value),1)]),_:1})])),P[5]||(P[5]=r.createTextVNode()),r.createElementVNode("div",Db,[y.value?(r.openBlock(),r.createBlock(r.unref(xt),{key:0,name:"loading"})):r.createCommentVNode("",!0),P[1]||(P[1]=r.createTextVNode()),G.clearable&&B.value?(r.openBlock(),r.createBlock(r.unref(Hr),{key:1,name:"delete-clear",onClick:r.withModifiers(N,["stop"])})):r.createCommentVNode("",!0),P[2]||(P[2]=r.createTextVNode()),r.renderSlot(G.$slots,"append"),P[3]||(P[3]=r.createTextVNode()),G.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${G.arrowIconLarge}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):G.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${G.arrowIcon}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(J,["stop"])}))])]),P[9]||(P[9]=r.createTextVNode()),G.label?(r.openBlock(),r.createElementBlock("label",Ib,[G.required?(r.openBlock(),r.createElementBlock("i",Fb)):r.createCommentVNode("",!0),P[6]||(P[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(G.label),1),P[7]||(P[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(G.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),P[10]||(P[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.unref(zl),{key:1,ref_key:"overlay",ref:d,root:l.value,class:"pl-dropdown__options",tabindex:"-1",gap:3},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(D.value,(T,M)=>(r.openBlock(),r.createBlock(vo,{key:M,option:T,"is-selected":T.isSelected,"is-hovered":T.isActive,size:G.optionSize,onClick:r.withModifiers(U=>A(T.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),P[8]||(P[8]=r.createTextVNode()),D.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Lb,"Nothing found"))]),_:1},8,["root"])):r.createCommentVNode("",!0),P[11]||(P[11]=r.createTextVNode()),r.createVNode(vr,{class:"pl-dropdown__contour"})])],42,Ab),P[12]||(P[12]=r.createTextVNode()),E.value?(r.openBlock(),r.createElementBlock("div",Ob,r.toDisplayString(E.value),1)):y.value&&G.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",Mb,r.toDisplayString(G.loadingOptionsHelper),1)):G.helper?(r.openBlock(),r.createElementBlock("div",Gb,r.toDisplayString(G.helper),1)):r.createCommentVNode("",!0)]))}}),zb={name:"PlDropdownRef"},Ub=r.defineComponent({...zb,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 i;return(i=e.options)==null?void 0:i.map(l=>({label:l.label,value:l.ref}))}),o=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(i,l)=>(r.openBlock(),r.createBlock(r.unref(bo),r.mergeProps(e,{options:n.value,"loading-options-helper":i.loadingOptionsHelper,"arrow-icon-large":o.value,"onUpdate:modelValue":l[0]||(l[0]=c=>i.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function Zb(t,e){return r.computed(()=>{const n=Cr(t.value);return e.value?n.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):n})}const Wb={class:"resizable-input"},jb=["placeholder","value","disabled"],Hb=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,i=r.computed(()=>{var d;return n.placeholder?n.placeholder:(d=n.modelValue||n.value)==null?void 0:d.replace('"',"")}),l=r.computed(()=>{const d={};return n.width&&(d.width=n.width),n.maxWidth&&(d.maxWidth=n.maxWidth),d});function c(d){const p=d.target.value;o("update:modelValue",p)}return(d,p)=>(r.openBlock(),r.createElementBlock("div",Wb,[r.createElementVNode("span",{style:r.normalizeStyle(l.value),class:"resizable-input__size-span"},r.toDisplayString(i.value),5),p[0]||(p[0]=r.createTextVNode()),r.createElementVNode("input",r.mergeProps(d.$attrs,{placeholder:d.placeholder,value:n.modelValue,disabled:n.disabled,style:l.value,onInput:c}),null,16,jb)]))}}),qb={class:"dropdown-tab-item__title text-caps13"},Kb=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 i=[];return e.isSelected&&i.push("dropdown-tab-item__selected"),e.isHovered&&i.push("hovered-item"),i.join(" ")});return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([o.value,"dropdown-tab-item"])},[r.createElementVNode("div",qb,r.toDisplayString(n.value),1)],2))}}),Yb={class:"pl-line-dropdown__prefix"},Xb={class:"pl-line-dropdown__icon-wrapper"},Jb={class:"pl-line-dropdown__icon"},Qb={key:0,class:"pl-line-dropdown__no-item"},ex={key:0,class:"pl-line-dropdown__no-item"},vp=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,i=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),c=r.ref(),d=r.computed(()=>{const R=[];return i.isOpen&&R.push("open"),o.disabled&&R.push("disabled"),R.join(" ")}),p=r.ref(""),h=Zb(r.toRef(o,"options"),p),m=r.computed(()=>!!(o.clearable&&i.isOpen&&o.modelValue&&y.value)),y=r.computed(()=>{if(o.modelValue){const R=E();if(R!==-1){const O=Cr(o.options)[R];return typeof O.label=="object"?O.label.title:O.label}}return""}),w=r.ref(y.value),v=r.computed(()=>i.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");As(l,()=>{o.mode==="list"&&(i.isOpen=!1)}),r.watch(()=>w.value,R=>{y.value!==R?p.value=R:p.value=""}),r.watch(()=>i.isOpen,R=>{var O;R&&l.value&&((O=l.value.querySelector("input"))==null||O.focus(),r.nextTick(()=>j()))}),r.watch(()=>o.modelValue,()=>z(),{immediate:!0});function E(){return o.options.findIndex(R=>Gt(R.value,o.modelValue))}function z(){i.activeOption=wi(h.value.findIndex(R=>Gt(R.value,o.modelValue)),R=>R<0?0:R),w.value=y.value}function $(){p.value=""}function S(){o.disabled?i.isOpen=!1:r.nextTick(()=>{i.isOpen=!i.isOpen})}function B(){o.mode==="list"&&(i.isOpen=!1)}function D(R){R&&(n("update:modelValue",R.value),B(),$())}function H(R){return Gt(R.value,o.modelValue)}const A=R=>{var O,G;const P=R.relatedTarget;!((O=l.value)!=null&&O.contains(P))&&!((G=c.value)!=null&&G.contains(P))&&(p.value="",i.isOpen=!1)};function N(R){const{activeOption:O}=i;if(!i.isOpen&&R.code==="Enter"){i.isOpen=!0;return}const{length:G}=h.value;if(!G)return;["ArrowDown","ArrowUp","Enter"].includes(R.code)&&R.preventDefault(),R.code==="Enter"&&D(h.value[O]);const P=R.code==="ArrowDown"?1:R.code==="ArrowUp"?-1:0;i.activeOption=Math.abs(O+P+G)%G,requestAnimationFrame(j)}function j(){const R=c.value;R&&_t(R.querySelector(".hovered-item"),O=>{o.mode==="list"?Ps(R,O):O.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function J(){n("update:modelValue",void 0)}const Z=r.reactive({top:"0px",left:"0px"});return r.watch(c,R=>{if(R){const O=R.getBoundingClientRect();i.optionsHeight=O.height,window.dispatchEvent(new CustomEvent("adjust"))}}),vi(l,R=>{const O=R.top+R.height+2;O+i.optionsHeight>R.clientHeight?Z.top=R.top-i.optionsHeight-2+"px":Z.top=O+"px",Z.left=R.left+"px"}),(R,O)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([d.value,"pl-line-dropdown uc-pointer"]),onKeydown:N,onFocusout:A,onClick:S},[r.createElementVNode("div",Yb,r.toDisplayString(o==null?void 0:o.prefix),1),O[6]||(O[6]=r.createTextVNode()),r.createVNode(Hb,{modelValue:w.value,"onUpdate:modelValue":O[0]||(O[0]=G=>w.value=G),placeholder:v.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),O[7]||(O[7]=r.createTextVNode()),r.createElementVNode("div",Xb,[r.withDirectives(r.createElementVNode("div",Jb,null,512),[[r.vShow,!m.value]]),O[1]||(O[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:J},null,512),[[r.vShow,m.value]])]),O[8]||(O[8]=r.createTextVNode()),i.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(Z),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:A},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(h),(G,P)=>r.renderSlot(R.$slots,"item",{key:P,item:G,textItem:"text",isSelected:H(G),isHovered:i.activeOption==P,onClick:r.withModifiers(T=>D(G),["stop"])},()=>[r.createVNode(vo,{option:G,"text-item":"text","is-selected":H(G),"is-hovered":i.activeOption==P,size:"medium",onClick:r.withModifiers(T=>D(G),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),O[3]||(O[3]=r.createTextVNode()),r.unref(h).length===0?(r.openBlock(),r.createElementBlock("div",Qb,O[2]||(O[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(Z),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:A},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(h),(G,P)=>r.renderSlot(R.$slots,"item",{key:P,item:G,isSelected:H(G),isHovered:i.activeOption==P,onClick:r.withModifiers(T=>D(G),["stop"])},()=>[r.createVNode(Kb,{option:G,"is-selected":H(G),"is-hovered":i.activeOption==P,onClick:r.withModifiers(T=>D(G),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),O[5]||(O[5]=r.createTextVNode()),r.unref(h).length===0?(r.openBlock(),r.createElementBlock("div",ex,O[4]||(O[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))}}),tx={class:"ui-dropdown__envelope"},nx=["tabindex"],rx={class:"ui-dropdown__container"},ox={class:"ui-dropdown__field"},ix=["disabled","placeholder"],sx={class:"ui-dropdown__controls"},ax={key:0},lx={key:0,class:"required-icon"},cx={key:0,class:"nothing-found"},dx={key:0,class:"ui-dropdown__error"},ux={key:1,class:"ui-dropdown__helper"},px={key:2,class:"ui-dropdown__helper"},hx={name:"PlDropdown"},fx=r.defineComponent({...hx,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,i=r.useSlots(),l=r.ref(),c=r.ref(),d=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),h=()=>wi(D.value.findIndex(P=>Gt(P.value,o.modelValue)),P=>P<0?0:P),m=()=>p.activeIndex=h(),y=r.computed(()=>o.options===void 0),w=r.computed(()=>y.value?!0:o.disabled),v=r.computed(()=>(o.options??[]).findIndex(P=>Gt(P.value,o.modelValue))),E=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&v.value===-1)return"The selected value is not one of the options"}}),z=r.computed(()=>Cr(o.options??[]).map((P,T)=>({...P,index:T,isSelected:T===v.value,isActive:T===p.activeIndex}))),$=r.computed(()=>{const P=r.unref(z).find(T=>Gt(T.value,o.modelValue));return(P==null?void 0:P.label)||o.modelValue}),S=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String($.value):o.placeholder),B=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),D=r.computed(()=>{const P=z.value;return p.search?P.filter(T=>{const M=p.search.toLowerCase();return T.label.toLowerCase().includes(M)||T.description&&T.description.toLowerCase().includes(M)?!0:typeof T.value=="string"?T.value.toLowerCase().includes(M):T.value===p.search}):P}),H=r.computed(()=>w.value?void 0:"0"),A=P=>{var T;n("update:modelValue",P),p.search="",p.open=!1,(T=l==null?void 0:l.value)==null||T.focus()},N=()=>n("update:modelValue",void 0),j=()=>{var P;return(P=d.value)==null?void 0:P.focus()},J=()=>p.open=!p.open,Z=()=>p.open=!0,R=P=>{var T;(T=l==null?void 0:l.value)!=null&&T.contains(P.relatedTarget)||(p.search="",p.open=!1)},O=()=>{const P=c.value;P&&_t(P.querySelector(".hovered-item"),T=>{Ps(P,T)})},G=P=>{var T,M;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(P.code))P.preventDefault();else return;const{open:U,activeIndex:X}=p;if(!U){P.code==="Enter"&&(p.open=!0);return}P.code==="Escape"&&(p.open=!1,(T=l.value)==null||T.focus());const ne=r.unref(D),{length:de}=ne;if(!de)return;P.code==="Enter"&&A((M=ne.find(je=>je.index===X))==null?void 0:M.value);const me=ne.findIndex(je=>je.index===X)??-1,Te=P.code==="ArrowDown"?1:P.code==="ArrowUp"?-1:0,Se=Math.abs(me+Te+de)%de;p.activeIndex=D.value[Se].index??-1};return Xn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,P=>{var T;return P?(T=d.value)==null?void 0:T.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&O()}),(P,T)=>(r.openBlock(),r.createElementBlock("div",tx,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:H.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:P.error,disabled:w.value}]),onKeydown:G,onFocusout:R},[r.createElementVNode("div",rx,[r.createElementVNode("div",ox,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":T[0]||(T[0]=M=>p.search=M),type:"text",tabindex:"-1",disabled:w.value,placeholder:S.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Z},null,40,ix),[[r.vModelText,p.search]]),T[4]||(T[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:j},[r.createVNode(Gl,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString($.value),1)]),_:1})])),T[5]||(T[5]=r.createTextVNode()),r.createElementVNode("div",sx,[y.value?(r.openBlock(),r.createBlock(r.unref(xt),{key:0,name:"loading"})):r.createCommentVNode("",!0),T[1]||(T[1]=r.createTextVNode()),P.clearable&&B.value?(r.openBlock(),r.createBlock(r.unref(Hr),{key:1,name:"delete-clear",onClick:r.withModifiers(N,["stop"])})):r.createCommentVNode("",!0),T[2]||(T[2]=r.createTextVNode()),r.renderSlot(P.$slots,"append"),T[3]||(T[3]=r.createTextVNode()),P.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${P.arrowIconLarge}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):P.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${P.arrowIcon}`]]),onClick:r.withModifiers(J,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(J,["stop"])}))])]),T[9]||(T[9]=r.createTextVNode()),P.label?(r.openBlock(),r.createElementBlock("label",ax,[P.required?(r.openBlock(),r.createElementBlock("i",lx)):r.createCommentVNode("",!0),T[6]||(T[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(P.label),1),T[7]||(T[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(P.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),T[10]||(T[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(D.value,(M,U)=>(r.openBlock(),r.createBlock(vo,{key:U,option:M,"is-selected":M.isSelected,"is-hovered":M.isActive,size:P.optionSize,onClick:r.withModifiers(X=>A(M.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),T[8]||(T[8]=r.createTextVNode()),D.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",cx,"Nothing found"))],512)):r.createCommentVNode("",!0),T[11]||(T[11]=r.createTextVNode()),r.createVNode(vr,{class:"ui-dropdown__contour"})])],42,nx),T[12]||(T[12]=r.createTextVNode()),E.value?(r.openBlock(),r.createElementBlock("div",dx,r.toDisplayString(E.value),1)):y.value&&P.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",ux,r.toDisplayString(P.loadingOptionsHelper),1)):P.helper?(r.openBlock(),r.createElementBlock("div",px,r.toDisplayString(P.helper),1)):r.createCommentVNode("",!0)]))}}),mx={key:0,class:"ui-progress-bar"},gx={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},yx={class:"ui-progress-bar__message flex-grow-1"},_x={class:"ui-progress-bar__percent"},Cx=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,i)=>o.loading?(r.openBlock(),r.createElementBlock("div",mx,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:o.progress+"%"})},null,4),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",gx,[r.createElementVNode("div",yx,r.toDisplayString(n.value),1),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",_x,r.toDisplayString(o.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),vx={class:"mi-number-field__main-wrapper d-flex"},wx={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},bx={key:0,class:"text-description"},xx=["disabled","placeholder"],kx={class:"mi-number-field__icons d-flex-column"},Sx={key:0,class:"mi-number-field__hint text-description"},Ex=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,i=r.ref(),l=r.useSlots(),c=r.ref();Xn(i);const d=r.ref(!0),p=r.computed({get(){return d.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(S){var B;S=S.replace(/,/g,""),w(S)?(o("update:modelValue",+S),S.toString()!==((B=n.modelValue)==null?void 0:B.toString())&&+S===n.modelValue&&S[S.length-1]!=="."&&(d.value=!1,r.nextTick(()=>{d.value=!0}))):(S.trim()===""&&o("update:modelValue",void 0),d.value=!1,r.nextTick(()=>{d.value=!0}))}}),h=r.computed(()=>{let S=[];return n.errorMessage&&S.push(n.errorMessage),w(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&S.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&S.push(`Model value must be less than ${n.maxValue}`)):S.push("Model value is not a number."),S=[...S],S.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 w(S){return S!==void 0?(S=S==null?void 0:S.toString(),!isNaN(+S)&&!isNaN(parseFloat(S))):!1}function v(){if(!m.value){let S=0;n.modelValue===void 0?S=n.minValue?n.minValue:0:S=+(n.modelValue||0)+n.step,p.value=S.toString()}}function E(){if(!y.value){let S=0;n.modelValue===void 0?S=0:S=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,S).toString():S.toString()}}function z(S){["ArrowDown","ArrowUp"].includes(S.code)&&S.preventDefault(),S.code==="ArrowUp"?v():S.code==="ArrowDown"&&E()}const $=S=>{S.detail>1&&S.preventDefault()};return(S,B)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:i,class:r.normalizeClass([{error:!!h.value.trim(),disabled:S.disabled},"mi-number-field d-flex-column"]),onMousedown:$,onKeydown:B[1]||(B[1]=D=>z(D))},[r.createElementVNode("div",vx,[r.createVNode(vr,{class:"mi-number-field__contour"}),B[6]||(B[6]=r.createTextVNode()),r.createElementVNode("div",wx,[S.label?(r.openBlock(),r.createElementBlock("label",bx,[r.createTextVNode(r.toDisplayString(S.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(S.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),B[2]||(B[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":B[0]||(B[0]=D=>p.value=D),disabled:S.disabled,placeholder:S.placeholder,class:"text-s flex-grow"},null,8,xx),[[r.vModelText,p.value]])]),B[7]||(B[7]=r.createTextVNode()),r.createElementVNode("div",kx,[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:v},B[3]||(B[3]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),B[5]||(B[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([{disabled:y.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:E},B[4]||(B[4]=[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),B[8]||(B[8]=r.createTextVNode()),h.value.trim()?(r.openBlock(),r.createElementBlock("div",Sx,r.toDisplayString(h.value),1)):r.createCommentVNode("",!0)],34))}}),Tx={class:"pl-chip__text"},Ul=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,i)=>(r.openBlock(),r.createBlock(r.unref(Ct),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[i[4]||(i[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:o.small}])},[r.createElementVNode("div",Tx,[r.renderSlot(o.$slots,"default")]),i[3]||(i[3]=r.createTextVNode()),o.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:i[0]||(i[0]=r.withKeys(l=>o.$emit("close"),["enter"])),onClick:i[1]||(i[1]=r.withModifiers(l=>o.$emit("close"),["stop"]))},i[2]||(i[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))}}),Nx={class:"pl-multi-dropdown__envelope"},Vx=["tabindex"],Ax={class:"pl-multi-dropdown__container"},Bx={class:"pl-multi-dropdown__field"},Px=["disabled","placeholder"],Rx={class:"pl-multi-dropdown__append"},Dx={key:0},Ix={key:0,class:"required-icon"},Fx={class:"pl-multi-dropdown__open-chips-container"},Lx={key:0,class:"nothing-found"},Ox={key:0,class:"pl-multi-dropdown__error"},Mx={key:1,class:"pl-multi-dropdown__helper"},Gx={name:"PlDropdownMulti"},$x=r.defineComponent({...Gx,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=N=>n("update:modelValue",N),i=r.useSlots(),l=t,c=r.ref(),d=r.ref(),p=r.useTemplateRef("overlay"),h=r.reactive({search:"",activeOption:-1,open:!1,optionsHeight:0}),m=r.computed(()=>Array.isArray(l.modelValue)?l.modelValue:[]),y=r.computed(()=>h.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),w=r.computed(()=>Cr(l.options).filter(N=>Ml(m.value,N.value))),v=r.computed(()=>{const N=r.unref(m),j=Cr(l.options);return(h.search?j.filter(J=>{const Z=h.search.toLowerCase();return J.label.toLowerCase().includes(Z)?!0:typeof J.value=="string"?J.value.toLowerCase().includes(Z):J.value===h.search}):[...j]).map(J=>({...J,selected:Ml(N,J.value)}))}),E=r.computed(()=>l.disabled?void 0:"0"),z=()=>{h.activeOption=wi(v.value.findIndex(N=>Gt(N.value,l.modelValue)),N=>N<0?0:N)},$=N=>{var j;const J=r.unref(m);o(Ml(J,N)?J.filter(Z=>!Gt(Z,N)):[...J,N]),h.search="",(j=c==null?void 0:c.value)==null||j.focus()},S=N=>o(r.unref(m).filter(j=>!Gt(j,N))),B=()=>{var N;return(N=d.value)==null?void 0:N.focus()},D=()=>h.open=!h.open,H=N=>{var j,J,Z,R;const O=N.relatedTarget;console.log(">>>> overlay.value?.$el",(j=p.value)==null?void 0:j.$el),!((J=c.value)!=null&&J.contains(O))&&!((R=(Z=p.value)==null?void 0:Z.listRef)!=null&&R.contains(O))&&(h.search="",h.open=!1)},A=N=>{var j;const{open:J,activeOption:Z}=h;if(!J){N.code==="Enter"&&(h.open=!0);return}N.code==="Escape"&&(h.open=!1,(j=c.value)==null||j.focus());const R=r.unref(v),{length:O}=R;if(!O)return;["ArrowDown","ArrowUp","Enter"].includes(N.code)&&N.preventDefault(),N.code==="Enter"&&$(R[Z].value);const G=N.code==="ArrowDown"?1:N.code==="ArrowUp"?-1:0;h.activeOption=Math.abs(Z+G+O)%O,requestAnimationFrame(()=>{var P;return(P=p.value)==null?void 0:P.scrollIntoActive()})};return Xn(c),r.watch(()=>l.modelValue,()=>z(),{immediate:!0}),r.watchPostEffect(()=>{var N;h.search,h.open&&((N=p.value)==null||N.scrollIntoActive())}),(N,j)=>(r.openBlock(),r.createElementBlock("div",Nx,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:E.value,class:r.normalizeClass(["pl-multi-dropdown",{open:h.open,error:N.error,disabled:N.disabled}]),onKeydown:A,onFocusout:H},[r.createElementVNode("div",Ax,[r.createElementVNode("div",Bx,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":j[0]||(j[0]=J=>h.search=J),type:"text",tabindex:"-1",disabled:N.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:j[1]||(j[1]=J=>h.open=!0)},null,40,Px),[[r.vModelText,h.search]]),j[3]||(j[3]=r.createTextVNode()),h.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:B},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,(J,Z)=>(r.openBlock(),r.createBlock(r.unref(Ul),{key:Z,closeable:"",small:"",onClick:j[2]||(j[2]=r.withModifiers(R=>h.open=!0,["stop"])),onClose:R=>S(J.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(J.label||J.value),1)]),_:2},1032,["onClose"]))),128))])),j[4]||(j[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(D,["stop"])}),j[5]||(j[5]=r.createTextVNode()),r.createElementVNode("div",Rx,[r.renderSlot(N.$slots,"append")])]),j[10]||(j[10]=r.createTextVNode()),N.label?(r.openBlock(),r.createElementBlock("label",Dx,[N.required?(r.openBlock(),r.createElementBlock("i",Ix)):r.createCommentVNode("",!0),j[6]||(j[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(N.label),1),j[7]||(j[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(N.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),j[11]||(j[11]=r.createTextVNode()),h.open?(r.openBlock(),r.createBlock(zl,{key:1,ref_key:"overlay",ref:p,root:c.value,class:"pl-multi-dropdown__options",gap:3,tabindex:"-1",onFocusout:H},{default:r.withCtx(()=>[r.createElementVNode("div",Fx,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,(J,Z)=>(r.openBlock(),r.createBlock(r.unref(Ul),{key:Z,closeable:"",small:"",onClose:R=>S(J.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(J.label||J.value),1)]),_:2},1032,["onClose"]))),128))]),j[8]||(j[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(v.value,(J,Z)=>(r.openBlock(),r.createBlock(vo,{key:Z,option:J,"text-item":"text","is-selected":J.selected,"is-hovered":h.activeOption==Z,size:"medium","use-checkbox":"",onClick:r.withModifiers(R=>$(J.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),j[9]||(j[9]=r.createTextVNode()),v.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Lx,"Nothing found"))]),_:1},8,["root"])):r.createCommentVNode("",!0),j[12]||(j[12]=r.createTextVNode()),r.createVNode(vr,{class:"pl-multi-dropdown__contour"})])],42,Vx),j[13]||(j[13]=r.createTextVNode()),N.error?(r.openBlock(),r.createElementBlock("div",Ox,r.toDisplayString(N.error),1)):N.helper?(r.openBlock(),r.createElementBlock("div",Mx,r.toDisplayString(N.helper),1)):r.createCommentVNode("",!0)]))}}),Zl=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,i)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:o.disabled}]),onClick:i[0]||(i[0]=l=>o.$emit("update:modelValue",!o.modelValue)),onKeydown:i[1]||(i[1]=r.withKeys(l=>o.$emit("update:modelValue",!o.modelValue),["enter"]))},null,34))}}),zx={name:"PlCheckbox"},Ux=r.defineComponent({...zx,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(o,i)=>r.unref(n).default?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["pl-checkbox",{disabled:o.disabled}])},[r.createVNode(Zl,r.mergeProps(e,{"onUpdate:modelValue":i[0]||(i[0]=l=>o.$emit("update:modelValue",l))}),null,16),i[3]||(i[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:i[1]||(i[1]=l=>o.$emit("update:modelValue",!o.$props.modelValue))},[r.renderSlot(o.$slots,"default")])],2)):(r.openBlock(),r.createBlock(Zl,r.mergeProps({key:1},e,{"onUpdate:modelValue":i[2]||(i[2]=l=>o.$emit("update:modelValue",l))}),null,16))}}),Zx={key:0},Wx=["onClick"],jx={name:"PlCheckboxGroup"},Hx=r.defineComponent({...jx,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=c=>o.modelValue.includes(c),l=c=>{const d=o.modelValue??[];n("update:modelValue",i(c)?d.filter(p=>p!==c):[...d,c])};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:c.disabled}])},[c.label?(r.openBlock(),r.createElementBlock("label",Zx,r.toDisplayString(c.label),1)):r.createCommentVNode("",!0),d[1]||(d[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,h)=>(r.openBlock(),r.createElementBlock("div",{key:h},[r.createVNode(Zl,{disabled:c.disabled,label:p.label,"model-value":i(p.value),"onUpdate:modelValue":()=>l(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),d[0]||(d[0]=r.createTextVNode()),r.createElementVNode("label",{onClick:r.withModifiers(()=>l(p.value),["stop"])},r.toDisplayString(p.label),9,Wx)]))),128))],2))}}),qx="_component_tupwt_1",Kx={component:qx},Yx={};function Xx(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 Jx={$style:Kx},wp=Mt(Yx,[["render",Xx],["__cssModules",Jx]]),Qx={key:1,class:"pl-dialog-modal__title"},ek={inheritAttrs:!1},Wl=r.defineComponent({...ek,__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,i=t,l=r.ref(),c=r.useAttrs();function d(p){l.value&&i.closeOnOutsideClick&&document.contains(p.target)&&!l.value.contains(p.target)&&o("update:modelValue",!1)}return st(document.body,"keyup",p=>{i.modelValue&&p.code==="Escape"&&o("update:modelValue",!1)}),(p,h)=>(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:d},[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(wp,{key:0,class:"close-modal-btn",onClick:h[0]||(h[0]=r.withModifiers(m=>o("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),h[1]||(h[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",Qx,[r.renderSlot(p.$slots,"title")])):r.createCommentVNode("",!0),h[2]||(h[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),h[3]||(h[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})]))}}),tk=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(o,i)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),nk={key:0,class:"pl-slide-modal__title"},rk={class:"pl-slide-modal__content"},ok={key:1,class:"pl-slide-modal__actions"},ik={name:"PlSlideModal",inheritAttrs:!1},Rs=r.defineComponent({...ik,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,i=t,l=r.ref(),c=r.useAttrs();return As(l,()=>{i.modelValue&&i.closeOnOutsideClick&&o("update:modelValue",!1)}),st(document,"keydown",d=>{d.key==="Escape"&&o("update:modelValue",!1)}),(d,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(tk,null,{default:r.withCtx(()=>[d.modelValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref_key:"modal",ref:l,style:{width:d.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(h=>o("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=h=>o("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",nk,[r.renderSlot(d.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",rk,[r.renderSlot(d.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",ok,[r.renderSlot(d.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),d.modelValue&&d.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(h=>o("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),sk={key:0,class:"label"},ak={name:"PlToggleSwitch"},Ds=r.defineComponent({...ak,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",sk,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function bp(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function lk(t){return r.unref(t)}const ck=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function dk(t,e,n={}){const{immediate:o=!0}=n,i=r.ref(!1);let l=null;function c(){l&&(clearTimeout(l),l=null)}function d(){i.value=!1,c()}function p(...h){c(),i.value=!0,l=setTimeout(()=>{i.value=!1,l=null,t(...h)},lk(e))}return o&&(i.value=!0,ck&&p()),bp(d),{isPending:r.readonly(i),start:p,stop:d}}function uk(t,e,n){return r.watch(t,(o,i,l)=>{o&&e(o,i,l)},{...n,once:!1})}function pk(t,e,n){const{start:o}=dk(l,e,{immediate:!1}),i=r.ref(!1);async function l(){i.value&&(await t(),o())}function c(){i.value||(i.value=!0,l())}function d(){i.value=!1}return n!=null&&n.immediate&&c(),bp(d),{isActive:i,pause:d,resume:c}}const hk="[==PROGRESS==]";function fk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mk(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 d=t.mockPlatforma??window.platforma;if(!d){console.warn("Platforma API is not available");return}for(;;){const p=await d.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 h=t.progressPrefix??hk,m=new TextDecoder().decode(p.data).replace(new RegExp(`${fk(h)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const i=pk(()=>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 uk(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>i.pause()),r.watch(()=>t.logHandle,l=>{var c;l===void 0?(e.value=void 0,i.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,i.resume())},{immediate:!0}),e}const gk={key:0},yk={class:"pl-log-view__copy"},_k={key:1,class:"pl-log-view__error"},Ck={name:"PlLogView"},xp=r.defineComponent({...Ck,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=E=>{if(E&&E.ok===!1)return E.errors.join(`
|
|
53
|
-
`)},n=t,o=mk(n),i=r.ref(!0),l=r.ref(),c=r.ref(),d=r.computed(()=>{var E;return((E=o.value)==null?void 0:E.error)??n.error??e(n.output)}),p=r.computed(()=>{var E;return((E=o.value)==null?void 0:E.lines)??n.value??XC(n.output)}),h=r.ref(!1);Xn(c);const m=r.computed(()=>h.value?"clipboard-copied":"clipboard"),y=()=>{h.value=!0,setTimeout(()=>{h.value=!1},1200),p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},w=()=>{yr(l.value,E=>{i.value&&E.scrollTo(E.scrollLeft,E.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{w()})},{immediate:!0});const v=E=>{const z=E.target;i.value=z.scrollTop+20>=z.scrollHeight-z.offsetHeight};return(E,z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":d.value}])},[E.label?(r.openBlock(),r.createElementBlock("label",gk,r.toDisplayString(E.label),1)):r.createCommentVNode("",!0),z[1]||(z[1]=r.createTextVNode()),r.createVNode(vr,{class:"pl-log-view__contour"}),z[2]||(z[2]=r.createTextVNode()),r.createElementVNode("div",yk,[r.createVNode(r.unref(Ct),{"close-delay":800,position:"top"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(h.value?"copied":"copy"),1)]),default:r.withCtx(()=>[r.createVNode(r.unref(xt),{title:"Copy content",name:m.value,onClick:y},null,8,["name"]),z[0]||(z[0]=r.createTextVNode())]),_:1})]),z[3]||(z[3]=r.createTextVNode()),d.value?(r.openBlock(),r.createElementBlock("div",_k,r.toDisplayString(d.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:v},r.toDisplayString(p.value),545))],2))}}),vk="_component_1ukal_1",wk="_tab_1ukal_14",bk="_disabled_1ukal_27",xk="_active_1ukal_56",kk="_topLine_1ukal_69",xo={component:vk,tab:wk,disabled:bk,active:xk,topLine:kk},Sk=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 i=o.$el.querySelector("span");i&&requestAnimationFrame(()=>{i.offsetWidth<i.scrollWidth&&(n.isOverflown=!0)})}),(o,i)=>(r.openBlock(),r.createBlock(r.unref(Ct),{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"),i[0]||(i[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Ek={name:"PlTabs"},Tk=r.defineComponent({...Ek,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=i=>n("update:modelValue",i);return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(xo).component,{[r.unref(xo).disabled]:i.disabled,[r.unref(xo).topLine]:i.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.options,(c,d)=>(r.openBlock(),r.createBlock(Sk,{key:d,tabindex:i.modelValue===c.value||i.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(xo).active]:i.modelValue===c.value,[r.unref(xo).disabled]:c.disabled},r.unref(xo).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??i.maxTabWidth}),onKeydown:r.withKeys(p=>o(c.value),["enter"]),onClick:p=>o(c.value)},{default:r.withCtx(()=>[r.renderSlot(i.$slots,c.value,{option:c},()=>[r.createElementVNode("span",null,r.toDisplayString(c.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}}),Nk=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))}}),Vk="_compact_rhd5u_16",Ak="_content_rhd5u_20",Bk={compact:Vk,content:Ak},Pk={$style:Bk},kp=Mt(Nk,[["__cssModules",Pk]]),Rk=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,i)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.renderSlot(o.$slots,"header"),i[0]||(i[0]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],64))}}),Dk=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,i)=>(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}))}}),Ik=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"),i=Uu(),l=r.computed(()=>!n||n.value.multiple),c=r.computed({get(){return l.value?o.value:e?e.value===i:o.value},set(d){l.value?o.value=d:e&&(e.value=e.value===i?"":i)}});return(d,p)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(kp),{class:r.normalizeClass(d.$style.separator),compact:d.compact,onClick:p[0]||(p[0]=h=>c.value=!c.value)},{default:r.withCtx(()=>[r.createVNode(r.unref(At),{name:"chevron-right",class:r.normalizeClass([{[d.$style.down]:c.value},d.$style.chevron])},null,8,["class"]),r.createTextVNode(" "+r.toDisplayString(d.label),1)]),_:1},8,["class","compact"]),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Dk,null,{default:r.withCtx(()=>[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(d.$style.content)},[r.renderSlot(d.$slots,"default")],2)):r.createCommentVNode("",!0)]),_:3})],64))}}),Fk="_content_jmjfk_2",Lk="_separator_jmjfk_14",Ok="_chevron_jmjfk_19",Mk="_down_jmjfk_23",Gk={content:Fk,separator:Lk,chevron:Ok,down:Mk},$k={$style:Gk},zk=Mt(Ik,[["__cssModules",$k]]),Uk="_component_1ietr_1",Zk="_local_1ietr_1",Wk="_supported_1ietr_26",jk="_remote_1ietr_32",Hk="_search_1ietr_40",qk="_selected_1ietr_72",Kk="_breadcrumbs_1ietr_86",Yk="_cat_1ietr_116",Xk="_message_1ietr_122",Jk="_isFile_1ietr_197",Qk="_isDir_1ietr_201",eS="_canBeSelected_1ietr_207",tS="_spin_1ietr_1",ct={component:Uk,local:Zk,supported:Wk,remote:jk,search:Hk,"ls-container":"_ls-container_1ietr_50","ls-head":"_ls-head_1ietr_57",selected:qk,breadcrumbs:Kk,"ls-error":"_ls-error_1ietr_108",cat:Yk,message:Xk,"ls-empty":"_ls-empty_1ietr_131","ls-body":"_ls-body_1ietr_152",isFile:Jk,isDir:Qk,canBeSelected:eS,"ls-loader":"_ls-loader_1ietr_213","loader-icon":"_loader-icon_1ietr_221",spin:tS},nS=r.defineComponent({__name:"Shortcuts",setup(t){return(e,n)=>(r.openBlock(),r.createBlock(r.unref(Ct),{class:"info",position:"southwest","max-width":"420px"},{tooltip:r.withCtx(()=>[r.createElementVNode("span",{class:r.normalizeClass(e.$style.title)},"Shortcuts",2),n[2]||(n[2]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([e.$style.row,e.$style.head])},n[0]||(n[0]=[r.createElementVNode("div",null,null,-1),r.createTextVNode(),r.createElementVNode("div",null,"MacOS",-1),r.createTextVNode(),r.createElementVNode("div",null,"Windows/Linux",-1)]),2),n[3]||(n[3]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([e.$style.row,e.$style.body])},n[1]||(n[1]=[r.createElementVNode("div",null,"Single File",-1),r.createTextVNode(),r.createElementVNode("div",null,"Click the file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Click the file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Adjacent multiple files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Shift, click first and last files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Shift, click first and last files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Non-adjacent multiple files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Command (⌘), click each file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Ctrl, click each file",-1),r.createTextVNode(),r.createElementVNode("div",null,"All files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Press Command (⌘) + A",-1),r.createTextVNode(),r.createElementVNode("div",null,"Press Ctrl + A",-1)]),2)]),_:1}))}}),rS="_title_14dct_2",oS="_row_14dct_10",iS="_head_14dct_30",sS="_body_14dct_58",aS={title:rS,row:oS,head:iS,body:sS},lS={$style:aS},cS=Mt(nS,[["__cssModules",lS]]),Sp=()=>({dirPath:"",search:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1});function dS(t){return r.computed(()=>{let e=t.items;if(t.showHiddenItems||(e=e.filter(n=>!n.name.startsWith("."))),t.search){const n=t.search.toLocaleLowerCase();e=e.filter(o=>o.name.toLocaleLowerCase().includes(n))}return e})}const Ep={mounted:t=>{if(t.clientWidth<t.scrollWidth){const e=t.innerText;t.innerText=e.substring(0,57)+"..."+e.substring(e.length-10)}}};function Tp(t){return t?t.map(e=>"."+ev(e,["."])):void 0}function uS(t){const e=t.split("/");e[0]!==""&&e.unshift("");const 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).filter(i=>i!=="").join("/")});return n}const pS=["title","onClick"],hS={key:0,class:"ls-loader"},fS=["onClick"],mS=["title"],gS=["onClick"],yS=["title"],_S=r.defineComponent({__name:"Remote",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},submit:{}},emits:["update:modelValue","import:files"],setup(t,{expose:e}){const n=A=>A.ctrlKey||A.metaKey,o=t,i=r.reactive(Sp()),l=()=>{i.search="",i.error="",i.lastSelected=void 0},c=r.computed(()=>Tp(o.extensions)),d=dS(i),p=r.computed(()=>{var A;return{modelValue:o.modelValue,dirPath:i.dirPath,storageHandle:(A=i.storageEntry)==null?void 0:A.handle}}),h=(A,N)=>{window.platforma&&i.currentLoadingPath!==N&&(i.currentLoadingPath=N,window.platforma.lsDriver.listFiles(A,N).then(j=>{N===i.dirPath&&(i.items=Ss(j).entries.map(J=>({path:J.fullPath,name:J.name,isDir:J.type==="dir",canBeSelected:J.type==="file"&&(!c.value||c.value.some(Z=>J.fullPath.endsWith(Z))),handle:J.type==="file"?J.handle:void 0,selected:!1})).sort((J,Z)=>J.isDir&&!Z.isDir?-1:!J.isDir&&Z.isDir?1:J.name.localeCompare(Z.name)).map((J,Z)=>({id:Z,...J})),i.lastSelected=void 0)}).catch(j=>i.error=String(j)).finally(()=>{i.currentLoadingPath=void 0}))},m=()=>{l();const{storageHandle:A,dirPath:N,modelValue:j}=p.value;A&&j&&h(A,N)},y=r.computed(()=>uS(i.dirPath)),w=r.computed(()=>i.items.filter(A=>A.canBeSelected&&A.selected&&!A.isDir)),v=r.computed(()=>{var A;return w.value.length>0&&((A=i.storageEntry)==null?void 0:A.handle)}),E=()=>{var A;return{storageHandle:Ss((A=i.storageEntry)==null?void 0:A.handle),files:w.value.map(N=>N.handle)}},z=A=>{i.dirPath=A},$=(A,N)=>{const{shiftKey:j}=A,J=n(A),{lastSelected:Z}=i;if(A.preventDefault(),N.canBeSelected){if(o.multi||i.items.forEach(R=>R.selected=!1),N.selected=!N.selected,!o.multi)return;!J&&!j&&i.items.forEach(R=>{R.id!==N.id&&(R.selected=!1)}),j&&Z!==void 0&&i.items.forEach(R=>{qC(R.id,Z,N.id)&&(R.selected=!0)}),N.selected&&(i.lastSelected=N.id)}},S=A=>{A&&!o.multi||i.items.filter(N=>N.canBeSelected).forEach(N=>{N.selected=A})},B=()=>S(!0),D=()=>S(!1),H=()=>{if(l(),D(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(A=>{A=A.filter(N=>N.name!=="local"&&!N.name.startsWith("local_disk_")),i.storageOptions=A.map(N=>({text:N.name,value:N})),o.autoSelectStorage&&yr(A[0],N=>{i.storageEntry=N})}).catch(A=>i.error=String(A))};return r.watch(r.toRef(i,"storageEntry"),A=>{l(),i.dirPath=(A==null?void 0:A.initialFullPath)??""},{immediate:!0}),r.watch([()=>i.dirPath,()=>i.storageEntry],()=>{m()}),r.watch(()=>o.modelValue,A=>{A?H():Object.assign(i,Sp())},{immediate:!0}),st(document,"keydown",A=>{if(!o.modelValue||A.target!==document.body)return;const N=n(A);N&&A.code==="KeyA"&&(A.preventDefault(),B()),N&&A.shiftKey&&A.code==="Period"&&(A.preventDefault(),i.showHiddenItems=!i.showHiddenItems),A.code==="Enter"&&o.submit()}),e({isReady:v,getFilesToImport:E}),r.onMounted(H),(A,N)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(ct).remote),onClick:r.withModifiers(D,["stop"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).search)},[r.createElementVNode("div",null,[r.createVNode(r.unref(bo),{modelValue:i.storageEntry,"onUpdate:modelValue":N[0]||(N[0]=j=>i.storageEntry=j),label:"Select storage",options:i.storageOptions},null,8,["modelValue","options"])]),N[2]||(N[2]=r.createTextVNode()),r.createElementVNode("div",null,[r.createVNode(r.unref(gp),{modelValue:i.search,"onUpdate:modelValue":N[1]||(N[1]=j=>i.search=j),label:"Search in folder",clearable:""},null,8,["modelValue"])])],2),N[12]||(N[12]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct)["ls-container"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct)["ls-head"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).breadcrumbs)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(j,J)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:J},[r.createElementVNode("div",{title:j.path,onClick:Z=>z(j.path)},r.toDisplayString(j.name),9,pS),N[3]||(N[3]=r.createTextVNode()),j.index!==y.value.length-1?(r.openBlock(),r.createBlock(r.unref(Hr),{key:0,name:"chevron-right"})):r.createCommentVNode("",!0)],64))),128))],2),N[5]||(N[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).selected)},[r.createElementVNode("span",null,"Selected: "+r.toDisplayString(w.value.length),1),N[4]||(N[4]=r.createTextVNode()),r.createVNode(cS)],2)],2),N[11]||(N[11]=r.createTextVNode()),i.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",hS,N[6]||(N[6]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):i.storageEntry?i.error?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(r.unref(ct)["ls-error"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).cat)},null,2),N[8]||(N[8]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).message)},r.toDisplayString(i.error),3)],2)):(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(r.unref(ct)["ls-body"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d),j=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:j.id},[j.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(r.unref(ct).isDir),onClick:J=>z(j.path)},[r.createVNode(r.unref(Hr),{name:"chevron-right"}),N[9]||(N[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:j.name},[r.createTextVNode(r.toDisplayString(j.name),1)],8,mS)),[[r.unref(Ep)]])],10,fS)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({[r.unref(ct).canBeSelected]:j.canBeSelected,[r.unref(ct).selected]:j.selected}),onClick:r.withModifiers(J=>$(J,j),["stop"])},[r.createVNode(r.unref(At),{name:"box",class:r.normalizeClass(r.unref(ct).isFile)},null,8,["class"]),N[10]||(N[10]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:j.name},[r.createTextVNode(r.toDisplayString(j.name),1)],8,yS)),[[r.unref(Ep)]])],10,gS))],64))),128))],2)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(r.unref(ct)["ls-empty"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).cat)},null,2),N[7]||(N[7]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).message)},"Select storage to preview",2)],2))],2)],2))}}),CS={key:1,class:"alert-error"},vS=r.defineComponent({__name:"Local",props:{importFiles:{type:Function},multi:{type:Boolean},extensions:{}},setup(t){const e=t,n=r.reactive({error:void 0}),o=r.computed(()=>e.multi?"Drag & Drop files here or click to add":"Drag & Drop file here or click to add"),i=async c=>{var d,p,h;const m=(p=(d=window.platforma)==null?void 0:d.lsDriver)==null?void 0:p.fileToImportHandle;if(!m)return console.error("API platforma.lsDriver.fileToImportHandle is not available");const y=Tp(e.extensions),w=await Promise.all([...((h=c.dataTransfer)==null?void 0:h.files)??[]].filter(v=>!!v).filter(v=>y?y.some(E=>v.name.endsWith(E)):!0).map(v=>m(v)));w.length&&e.importFiles({files:w})},l=async()=>{var c,d;const p=e.extensions?[{name:"All Files",extensions:e.extensions}]:[];e.multi?(c=window.platforma)==null||c.lsDriver.showOpenMultipleFilesDialog({title:"Select files to import",filters:p}).then(({files:h})=>{h&&e.importFiles({files:h})}).catch(h=>n.error=h):(d=window.platforma)==null||d.lsDriver.showOpenSingleFileDialog({title:"Select file to import",filters:p}).then(({file:h})=>{h&&e.importFiles({files:[h]})}).catch(h=>n.error=h)};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(ct).local),onDrop:i,onDragover:d[0]||(d[0]=r.withModifiers(()=>{},["prevent"])),onClick:l},[r.createVNode(r.unref(Bs),{name:"cloud-upload"}),d[1]||(d[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(o.value),1),d[2]||(d[2]=r.createTextVNode()),c.extensions?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(r.unref(ct).supported)},"Supported formats: "+r.toDisplayString(c.extensions.join(", ")),3)):r.createCommentVNode("",!0),d[3]||(d[3]=r.createTextVNode()),n.error?(r.openBlock(),r.createElementBlock("span",CS,r.toDisplayString(n.error),1)):r.createCommentVNode("",!0)],34))}}),wS={style:{margin:"0 24px"}},Np=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,i=r.ref("local"),l=r.computed(()=>o.multi?"Select Files to Import":"Select File to Import"),c=[{label:"My Computer",value:"local"},{label:"Remote",value:"remote"}],d=()=>n("update:modelValue",!1),p=r.useTemplateRef("remote"),h=()=>{var y,w;(y=p.value)!=null&&y.isReady&&(n("import:files",Ss((w=p.value)==null?void 0:w.getFilesToImport())),d())},m=y=>{n("import:files",y),d()};return(y,w)=>(r.openBlock(),r.createBlock(r.unref(Wl),{"no-content-gutters":!0,"close-on-outside-click":y.closeOnOutsideClick,class:r.normalizeClass(["pl-dialog-modal",r.unref(ct).component]),"model-value":y.modelValue,width:"688px",height:"720px","onUpdate:modelValue":d},r.createSlots({title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(y.title??l.value),1)]),default:r.withCtx(()=>[w[4]||(w[4]=r.createTextVNode()),r.createElementVNode("div",wS,[r.createVNode(r.unref(dp),{modelValue:i.value,"onUpdate:modelValue":w[0]||(w[0]=v=>i.value=v),options:c},null,8,["modelValue"])]),w[5]||(w[5]=r.createTextVNode()),i.value==="remote"?(r.openBlock(),r.createBlock(_S,r.mergeProps({key:0,ref:"remote"},y.$props,{submit:h}),null,16)):r.createCommentVNode("",!0),w[6]||(w[6]=r.createTextVNode()),i.value==="local"?(r.openBlock(),r.createBlock(vS,r.mergeProps({key:1,"import-files":m},y.$props),null,16)):r.createCommentVNode("",!0),w[7]||(w[7]=r.createTextVNode())]),_:2},[i.value==="remote"?{name:"actions",fn:r.withCtx(()=>{var v;return[r.createVNode(r.unref(Vs),{style:{"min-width":"160px"},disabled:!((v=r.unref(p))!=null&&v.isReady),onClick:r.withModifiers(h,["stop"])},{default:r.withCtx(()=>w[1]||(w[1]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),w[3]||(w[3]=r.createTextVNode()),r.createVNode(r.unref(wo),{"justify-center":!1,onClick:r.withModifiers(d,["stop"])},{default:r.withCtx(()=>w[2]||(w[2]=[r.createTextVNode("Cancel")])),_:1})]}),key:"0"}:void 0]),1032,["close-on-outside-click","class","model-value"]))}});var $e;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})($e||($e={}));var jl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(jl||(jl={}));const le=$e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wr=t=>{switch(typeof t){case"undefined":return le.undefined;case"string":return le.string;case"number":return isNaN(t)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(t)?le.array:t===null?le.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?le.promise:typeof Map<"u"&&t instanceof Map?le.map:typeof Set<"u"&&t instanceof Set?le.set:typeof Date<"u"&&t instanceof Date?le.date:le.object;default:return le.unknown}},te=$e.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"]),bS=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class jt 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:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof jt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}jt.create=t=>new jt(t);const ko=(t,e)=>{let n;switch(t.code){case te.invalid_type:t.received===le.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,$e.jsonStringifyReplacer)}`;break;case te.unrecognized_keys:n=`Unrecognized key(s) in object: ${$e.joinValues(t.keys,", ")}`;break;case te.invalid_union:n="Invalid input";break;case te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${$e.joinValues(t.options)}`;break;case te.invalid_enum_value:n=`Invalid enum value. Expected ${$e.joinValues(t.options)}, received '${t.received}'`;break;case te.invalid_arguments:n="Invalid function arguments";break;case te.invalid_return_type:n="Invalid function return type";break;case te.invalid_date:n="Invalid date";break;case te.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}"`:$e.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case te.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 te.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 te.custom:n="Invalid input";break;case te.invalid_intersection_types:n="Intersection results could not be merged";break;case te.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case te.not_finite:n="Number must be finite";break;default:n=e.defaultError,$e.assertNever(t)}return{message:n}};let Vp=ko;function xS(t){Vp=t}function Is(){return Vp}const Fs=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},kS=[];function se(t,e){const n=Is(),o=Fs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ko?void 0:ko].filter(i=>!!i)});t.common.issues.push(o)}class kt{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 i of n){if(i.status==="aborted")return xe;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return kt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return xe;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const xe=Object.freeze({status:"aborted"}),Ls=t=>({status:"dirty",value:t}),Bt=t=>({status:"valid",value:t}),Hl=t=>t.status==="aborted",ql=t=>t.status==="dirty",bi=t=>t.status==="valid",xi=t=>typeof Promise<"u"&&t instanceof Promise;function Os(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 Ap(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!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 fe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(fe||(fe={}));var ki,Si;class Mn{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}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 Bp=(t,e)=>{if(bi(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 jt(t.common.issues);return this._error=n,this._error}}};function Ae(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=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:i}:{errorMap:(l,c)=>{var d,p;const{message:h}=t;return l.code==="invalid_enum_value"?{message:h??c.defaultError}:typeof c.data>"u"?{message:(d=h??o)!==null&&d!==void 0?d:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(p=h??n)!==null&&p!==void 0?p:c.defaultError}},description:i}}class Re{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 wr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new kt,ctx:{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(xi(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 i={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:wr(e)},l=this._parseSync({data:e,path:i.path,parent:i});return Bp(i,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:wr(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(xi(i)?i:Promise.resolve(i));return Bp(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:te.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new yn({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return $n.create(this,this._def)}nullable(){return Er.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gn.create(this,this._def)}promise(){return No.create(this,this._def)}or(e){return Vi.create([this,e],this._def)}and(e){return Ai.create(this,e,this._def)}transform(e){return new yn({...Ae(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ii({...Ae(this._def),innerType:this,defaultValue:n,typeName:we.ZodDefault})}brand(){return new Xl({typeName:we.ZodBranded,type:this,...Ae(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Fi({...Ae(this._def),innerType:this,catchValue:n,typeName:we.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Li.create(this,e)}readonly(){return Oi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SS=/^c[^\s-]{8,}$/i,ES=/^[0-9a-z]+$/,TS=/^[0-9A-HJKMNP-TV-Z]{26}$/,NS=/^[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,VS=/^[a-z0-9_-]{21}$/i,AS=/^[-+]?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)?)??$/,BS=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Kl;const RS=/^(?:(?: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])$/,DS=/^(([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})))$/,IS=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Pp="((\\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])))",FS=new RegExp(`^${Pp}$`);function Rp(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 LS(t){return new RegExp(`^${Rp(t)}$`)}function Dp(t){let e=`${Pp}T${Rp(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 OS(t,e){return!!((e==="v4"||!e)&&RS.test(t)||(e==="v6"||!e)&&DS.test(t))}class mn extends Re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:le.string,received:i.parsedType}),xe}const n=new kt;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const l=e.data.length>i.value,c=e.data.length<i.value;(l||c)&&(o=this._getOrReturnCtx(e,o),l?se(o,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&se(o,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")BS.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"email",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Kl||(Kl=new RegExp(PS,"u")),Kl.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"emoji",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")NS.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"uuid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")VS.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"nanoid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")SS.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"cuid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")ES.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"cuid2",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")TS.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"ulid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),se(o,{validation:"url",code:te.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"regex",code:te.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Dp(i).test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?FS.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?LS(i).test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?AS.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"duration",code:te.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?OS(e.data,i.version)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"ip",code:te.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?IS.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"base64",code:te.invalid_string,message:i.message}),n.dirty()):$e.assertNever(i);return{status:n.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:te.invalid_string,...fe.errToObj(o)})}_addCheck(e){return new mn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.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,...fe.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,...fe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...fe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...fe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...fe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...fe.errToObj(n)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new mn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mn({...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}}mn.create=t=>{var e;return new mn({checks:[],typeName:we.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function MS(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class br extends Re{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)!==le.number){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:le.number,received:i.parsedType}),xe}let n;const o=new kt;for(const i of this._def.checks)i.kind==="int"?$e.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:te.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?MS(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_finite,message:i.message}),o.dirty()):$e.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new br({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new br({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.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"&&$e.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)}}br.create=t=>new br({checks:[],typeName:we.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ae(t)});class xr extends Re{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)!==le.bigint){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:le.bigint,received:i.parsedType}),xe}let n;const o=new kt;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):$e.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new xr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new xr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.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}}xr.create=t=>{var e;return new xr({checks:[],typeName:we.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};class Ei extends Re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==le.boolean){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.boolean,received:n.parsedType}),xe}return Bt(e.data)}}Ei.create=t=>new Ei({typeName:we.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ae(t)});class Kr extends Re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==le.date){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:le.date,received:i.parsedType}),xe}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_date}),xe}const n=new kt;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):$e.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Kr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:fe.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}}Kr.create=t=>new Kr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:we.ZodDate,...Ae(t)});class Ms extends Re{_parse(e){if(this._getType(e)!==le.symbol){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.symbol,received:n.parsedType}),xe}return Bt(e.data)}}Ms.create=t=>new Ms({typeName:we.ZodSymbol,...Ae(t)});class Ti extends Re{_parse(e){if(this._getType(e)!==le.undefined){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.undefined,received:n.parsedType}),xe}return Bt(e.data)}}Ti.create=t=>new Ti({typeName:we.ZodUndefined,...Ae(t)});class Ni extends Re{_parse(e){if(this._getType(e)!==le.null){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.null,received:n.parsedType}),xe}return Bt(e.data)}}Ni.create=t=>new Ni({typeName:we.ZodNull,...Ae(t)});class So extends Re{constructor(){super(...arguments),this._any=!0}_parse(e){return Bt(e.data)}}So.create=t=>new So({typeName:we.ZodAny,...Ae(t)});class Yr extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Bt(e.data)}}Yr.create=t=>new Yr({typeName:we.ZodUnknown,...Ae(t)});class Jn extends Re{_parse(e){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.never,received:n.parsedType}),xe}}Jn.create=t=>new Jn({typeName:we.ZodNever,...Ae(t)});class Gs extends Re{_parse(e){if(this._getType(e)!==le.undefined){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.void,received:n.parsedType}),xe}return Bt(e.data)}}Gs.create=t=>new Gs({typeName:we.ZodVoid,...Ae(t)});class gn extends Re{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==le.array)return se(n,{code:te.invalid_type,expected:le.array,received:n.parsedType}),xe;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(se(n,{code:c?te.too_big:te.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(se(n,{code:te.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(se(n,{code:te.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new Mn(n,c,n.path,d)))).then(c=>kt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new Mn(n,c,n.path,d)));return kt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new gn({...this._def,minLength:{value:e,message:fe.toString(n)}})}max(e,n){return new gn({...this._def,maxLength:{value:e,message:fe.toString(n)}})}length(e,n){return new gn({...this._def,exactLength:{value:e,message:fe.toString(n)}})}nonempty(e){return this.min(1,e)}}gn.create=(t,e)=>new gn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Ae(e)});function Eo(t){if(t instanceof rt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=$n.create(Eo(o))}return new rt({...t._def,shape:()=>e})}else return t instanceof gn?new gn({...t._def,type:Eo(t.element)}):t instanceof $n?$n.create(Eo(t.unwrap())):t instanceof Er?Er.create(Eo(t.unwrap())):t instanceof Gn?Gn.create(t.items.map(e=>Eo(e))):t}class rt extends Re{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=$e.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==le.object){const p=this._getOrReturnCtx(e);return se(p,{code:te.invalid_type,expected:le.object,received:p.parsedType}),xe}const{status:n,ctx:o}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof Jn&&this._def.unknownKeys==="strip"))for(const p in o.data)l.includes(p)||c.push(p);const d=[];for(const p of l){const h=i[p],m=o.data[p];d.push({key:{status:"valid",value:p},value:h._parse(new Mn(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof Jn){const p=this._def.unknownKeys;if(p==="passthrough")for(const h of c)d.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(p==="strict")c.length>0&&(se(o,{code:te.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 h of c){const m=o.data[h];d.push({key:{status:"valid",value:h},value:p._parse(new Mn(o,m,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const p=[];for(const h of d){const m=await h.key,y=await h.value;p.push({key:m,value:y,alwaysSet:h.alwaysSet})}return p}).then(p=>kt.mergeObjectSync(n,p)):kt.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new rt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=fe.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new rt({...this._def,unknownKeys:"strip"})}passthrough(){return new rt({...this._def,unknownKeys:"passthrough"})}extend(e){return new rt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new rt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:we.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new rt({...this._def,catchall:e})}pick(e){const n={};return $e.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new rt({...this._def,shape:()=>n})}omit(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new rt({...this._def,shape:()=>n})}deepPartial(){return Eo(this)}partial(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new rt({...this._def,shape:()=>n})}required(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof $n;)i=i._def.innerType;n[o]=i}}),new rt({...this._def,shape:()=>n})}keyof(){return Ip($e.objectKeys(this.shape))}}rt.create=(t,e)=>new rt({shape:()=>t,unknownKeys:"strip",catchall:Jn.create(),typeName:we.ZodObject,...Ae(e)}),rt.strictCreate=(t,e)=>new rt({shape:()=>t,unknownKeys:"strict",catchall:Jn.create(),typeName:we.ZodObject,...Ae(e)}),rt.lazycreate=(t,e)=>new rt({shape:t,unknownKeys:"strip",catchall:Jn.create(),typeName:we.ZodObject,...Ae(e)});class Vi extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new jt(d.ctx.common.issues));return se(n,{code:te.invalid_union,unionErrors:c}),xe}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(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new jt(p));return se(n,{code:te.invalid_union,unionErrors:d}),xe}}get options(){return this._def.options}}Vi.create=(t,e)=>new Vi({options:t,typeName:we.ZodUnion,...Ae(e)});const kr=t=>t instanceof Pi?kr(t.schema):t instanceof yn?kr(t.innerType()):t instanceof Ri?[t.value]:t instanceof Sr?t.options:t instanceof Di?$e.objectValues(t.enum):t instanceof Ii?kr(t._def.innerType):t instanceof Ti?[void 0]:t instanceof Ni?[null]:t instanceof $n?[void 0,...kr(t.unwrap())]:t instanceof Er?[null,...kr(t.unwrap())]:t instanceof Xl||t instanceof Oi?kr(t.unwrap()):t instanceof Fi?kr(t._def.innerType):[];class $s extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.object)return se(n,{code:te.invalid_type,expected:le.object,received:n.parsedType}),xe;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);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}):(se(n,{code:te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=kr(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 d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new $s({typeName:we.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ae(o)})}}function Yl(t,e){const n=wr(t),o=wr(e);if(t===e)return{valid:!0,data:t};if(n===le.object&&o===le.object){const i=$e.objectKeys(e),l=$e.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=Yl(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===le.array&&o===le.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=Yl(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===le.date&&o===le.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ai extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(Hl(l)||Hl(c))return xe;const d=Yl(l.value,c.value);return d.valid?((ql(l)||ql(c))&&n.dirty(),{status:n.value,value:d.data}):(se(o,{code:te.invalid_intersection_types}),xe)};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])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Ai.create=(t,e,n)=>new Ai({left:t,right:e,typeName:we.ZodIntersection,...Ae(n)});class Gn extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.array)return se(o,{code:te.invalid_type,expected:le.array,received:o.parsedType}),xe;if(o.data.length<this._def.items.length)return se(o,{code:te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&o.data.length>this._def.items.length&&(se(o,{code:te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...o.data].map((l,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new Mn(o,l,o.path,c)):null}).filter(l=>!!l);return o.common.async?Promise.all(i).then(l=>kt.mergeArray(n,l)):kt.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Gn({...this._def,rest:e})}}Gn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gn({items:t,typeName:we.ZodTuple,rest:null,...Ae(e)})};class Bi extends Re{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!==le.object)return se(o,{code:te.invalid_type,expected:le.object,received:o.parsedType}),xe;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new Mn(o,d,o.path,d)),value:c._parse(new Mn(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?kt.mergeObjectAsync(n,i):kt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Re?new Bi({keyType:e,valueType:n,typeName:we.ZodRecord,...Ae(o)}):new Bi({keyType:mn.create(),valueType:e,typeName:we.ZodRecord,...Ae(n)})}}class zs extends Re{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!==le.map)return se(o,{code:te.invalid_type,expected:le.map,received:o.parsedType}),xe;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new Mn(o,d,o.path,[h,"key"])),value:l._parse(new Mn(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return xe;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return xe;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}zs.create=(t,e,n)=>new zs({valueType:e,keyType:t,typeName:we.ZodMap,...Ae(n)});class Xr extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.set)return se(o,{code:te.invalid_type,expected:le.set,received:o.parsedType}),xe;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(se(o,{code:te.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(se(o,{code:te.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return xe;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new Mn(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Xr({...this._def,minSize:{value:e,message:fe.toString(n)}})}max(e,n){return new Xr({...this._def,maxSize:{value:e,message:fe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Xr.create=(t,e)=>new Xr({valueType:t,minSize:null,maxSize:null,typeName:we.ZodSet,...Ae(e)});class To extends Re{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.function)return se(n,{code:te.invalid_type,expected:le.function,received:n.parsedType}),xe;function o(d,p){return Fs({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Is(),ko].filter(h=>!!h),issueData:{code:te.invalid_arguments,argumentsError:p}})}function i(d,p){return Fs({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Is(),ko].filter(h=>!!h),issueData:{code:te.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof No){const d=this;return Bt(async function(...p){const h=new jt([]),m=await d._def.args.parseAsync(p,l).catch(w=>{throw h.addIssue(o(p,w)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(w=>{throw h.addIssue(i(y,w)),h})})}else{const d=this;return Bt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new jt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new jt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new To({...this._def,args:Gn.create(e).rest(Yr.create())})}returns(e){return new To({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new To({args:e||Gn.create([]).rest(Yr.create()),returns:n||Yr.create(),typeName:we.ZodFunction,...Ae(o)})}}class Pi extends Re{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})}}Pi.create=(t,e)=>new Pi({getter:t,typeName:we.ZodLazy,...Ae(e)});class Ri extends Re{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return se(n,{received:n.data,code:te.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ri.create=(t,e)=>new Ri({value:t,typeName:we.ZodLiteral,...Ae(e)});function Ip(t,e){return new Sr({values:t,typeName:we.ZodEnum,...Ae(e)})}class Sr extends Re{constructor(){super(...arguments),ki.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{expected:$e.joinValues(o),received:n.parsedType,code:te.invalid_type}),xe}if(Os(this,ki)||Ap(this,ki,new Set(this._def.values)),!Os(this,ki).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{received:n.data,code:te.invalid_enum_value,options:o}),xe}return Bt(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 Sr.create(e,{...this._def,...n})}exclude(e,n=this._def){return Sr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}ki=new WeakMap,Sr.create=Ip;class Di extends Re{constructor(){super(...arguments),Si.set(this,void 0)}_parse(e){const n=$e.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==le.string&&o.parsedType!==le.number){const i=$e.objectValues(n);return se(o,{expected:$e.joinValues(i),received:o.parsedType,code:te.invalid_type}),xe}if(Os(this,Si)||Ap(this,Si,new Set($e.getValidEnumValues(this._def.values))),!Os(this,Si).has(e.data)){const i=$e.objectValues(n);return se(o,{received:o.data,code:te.invalid_enum_value,options:i}),xe}return Bt(e.data)}get enum(){return this._def.values}}Si=new WeakMap,Di.create=(t,e)=>new Di({values:t,typeName:we.ZodNativeEnum,...Ae(e)});class No extends Re{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.promise&&n.common.async===!1)return se(n,{code:te.invalid_type,expected:le.promise,received:n.parsedType}),xe;const o=n.parsedType===le.promise?n.data:Promise.resolve(n.data);return Bt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}No.create=(t,e)=>new No({type:t,typeName:we.ZodPromise,...Ae(e)});class yn extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{se(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return xe;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?xe:p.status==="dirty"||n.value==="dirty"?Ls(p.value):p});{if(n.value==="aborted")return xe;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?xe:d.status==="dirty"||n.value==="dirty"?Ls(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,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 d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?xe:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?xe:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!bi(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>bi(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);$e.assertNever(i)}}yn.create=(t,e,n)=>new yn({schema:t,typeName:we.ZodEffects,effect:e,...Ae(n)}),yn.createWithPreprocess=(t,e,n)=>new yn({schema:e,effect:{type:"preprocess",transform:t},typeName:we.ZodEffects,...Ae(n)});class $n extends Re{_parse(e){return this._getType(e)===le.undefined?Bt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$n.create=(t,e)=>new $n({innerType:t,typeName:we.ZodOptional,...Ae(e)});class Er extends Re{_parse(e){return this._getType(e)===le.null?Bt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Er.create=(t,e)=>new Er({innerType:t,typeName:we.ZodNullable,...Ae(e)});class Ii extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===le.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ii.create=(t,e)=>new Ii({innerType:t,typeName:we.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});class Fi extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return xi(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new jt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new jt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Fi.create=(t,e)=>new Fi({innerType:t,typeName:we.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});class Us extends Re{_parse(e){if(this._getType(e)!==le.nan){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.nan,received:n.parsedType}),xe}return{status:"valid",value:e.data}}}Us.create=t=>new Us({typeName:we.ZodNaN,...Ae(t)});const GS=Symbol("zod_brand");class Xl extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class Li extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),Ls(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new Li({in:e,out:n,typeName:we.ZodPipeline})}}class Oi extends Re{_parse(e){const n=this._def.innerType._parse(e),o=i=>(bi(i)&&(i.value=Object.freeze(i.value)),i);return xi(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}Oi.create=(t,e)=>new Oi({innerType:t,typeName:we.ZodReadonly,...Ae(e)});function Fp(t,e={},n){return t?So.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):So.create()}const $S={object:rt.lazycreate};var we;(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"})(we||(we={}));const zS=(t,e={message:`Input not instance of ${t.name}`})=>Fp(n=>n instanceof t,e),Lp=mn.create,Op=br.create,US=Us.create,ZS=xr.create,Mp=Ei.create,WS=Kr.create,jS=Ms.create,HS=Ti.create,qS=Ni.create,KS=So.create,YS=Yr.create,XS=Jn.create,JS=Gs.create,QS=gn.create,eE=rt.create,tE=rt.strictCreate,nE=Vi.create,rE=$s.create,oE=Ai.create,iE=Gn.create,sE=Bi.create,aE=zs.create,lE=Xr.create,cE=To.create,dE=Pi.create,uE=Ri.create,pE=Sr.create,hE=Di.create,fE=No.create,Gp=yn.create,mE=$n.create,gE=Er.create,yE=yn.createWithPreprocess,_E=Li.create;var zn=Object.freeze({__proto__:null,defaultErrorMap:ko,setErrorMap:xS,getErrorMap:Is,makeIssue:Fs,EMPTY_PATH:kS,addIssueToContext:se,ParseStatus:kt,INVALID:xe,DIRTY:Ls,OK:Bt,isAborted:Hl,isDirty:ql,isValid:bi,isAsync:xi,get util(){return $e},get objectUtil(){return jl},ZodParsedType:le,getParsedType:wr,ZodType:Re,datetimeRegex:Dp,ZodString:mn,ZodNumber:br,ZodBigInt:xr,ZodBoolean:Ei,ZodDate:Kr,ZodSymbol:Ms,ZodUndefined:Ti,ZodNull:Ni,ZodAny:So,ZodUnknown:Yr,ZodNever:Jn,ZodVoid:Gs,ZodArray:gn,ZodObject:rt,ZodUnion:Vi,ZodDiscriminatedUnion:$s,ZodIntersection:Ai,ZodTuple:Gn,ZodRecord:Bi,ZodMap:zs,ZodSet:Xr,ZodFunction:To,ZodLazy:Pi,ZodLiteral:Ri,ZodEnum:Sr,ZodNativeEnum:Di,ZodPromise:No,ZodEffects:yn,ZodTransformer:yn,ZodOptional:$n,ZodNullable:Er,ZodDefault:Ii,ZodCatch:Fi,ZodNaN:Us,BRAND:GS,ZodBranded:Xl,ZodPipeline:Li,ZodReadonly:Oi,custom:Fp,Schema:Re,ZodSchema:Re,late:$S,get ZodFirstPartyTypeKind(){return we},coerce:{string:t=>mn.create({...t,coerce:!0}),number:t=>br.create({...t,coerce:!0}),boolean:t=>Ei.create({...t,coerce:!0}),bigint:t=>xr.create({...t,coerce:!0}),date:t=>Kr.create({...t,coerce:!0})},any:KS,array:QS,bigint:ZS,boolean:Mp,date:WS,discriminatedUnion:rE,effect:Gp,enum:pE,function:cE,instanceof:zS,intersection:oE,lazy:dE,literal:uE,map:aE,nan:US,nativeEnum:hE,never:XS,null:qS,nullable:gE,number:Op,object:eE,oboolean:()=>Mp().optional(),onumber:()=>Op().optional(),optional:mE,ostring:()=>Lp().optional(),pipeline:_E,preprocess:yE,promise:fE,record:sE,set:lE,strictObject:tE,string:Lp,symbol:jS,transformer:Gp,tuple:iE,undefined:HS,union:nE,unknown:YS,void:JS,NEVER:xe,ZodIssueCode:te,quotelessJson:bS,ZodError:jt});function CE(t){throw new Error("Unexpected object: "+t)}const $p="upload://upload/",zp="index://index/";function vE(t){return t.startsWith($p)}function wE(t){return t.startsWith(zp)}function Up(t){if(wE(t)){const e=t.slice(zp.length);return JSON.parse(decodeURIComponent(e)).path}else if(vE(t)){const e=t.slice($p.length);return JSON.parse(decodeURIComponent(e)).localPath}CE(t)}function bE(t){return t.replace(/^.*[\\/]/,"")}function xE(t){return bE(Up(t))}zn.object({__isRef:zn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:zn.string().describe("Upstream block id"),name:zn.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();const kE=zn.object({type:zn.string(),importance:zn.number().optional(),id:zn.string().optional(),label:zn.string()});zn.array(kE);const SE={key:0,ref:"label"},EE={key:0,class:"required-icon"},TE=["data-placeholder"],NE={key:5,class:"pl-file-input__stats"},VE={key:0,class:"pl-file-input__error"},AE={key:1,class:"pl-file-input__helper"},Zp=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},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,error:""}),o=r.useSlots(),i=e,l=t,c=(D,H)=>{if(D)try{return H(D)}catch(A){return n.error=A instanceof Error?A.message:String(A),D}},d=r.computed(()=>c(l.modelValue,xE)),p=r.computed(()=>c(l.modelValue,Up)),h=r.computed(()=>l.progress&&!l.progress.done),m=r.computed(()=>l.progress&&l.progress.done),y=r.computed(()=>n.error??l.error),w=r.computed(()=>!!y.value),v=r.computed(()=>{const{status:D,done:H}=l.progress??{};return!D||!D.bytesTotal?"":D.bytesProcessed&&!H?Sl(D.bytesProcessed,{})+" / "+Sl(D.bytesTotal,{}):Sl(D.bytesTotal,{})}),E=r.computed(()=>{var D;const{progress:H}=l;return H?{width:H.done?"100%":Math.round((((D=H.status)==null?void 0:D.progress)??0)*100)+"%"}:{}}),z=()=>{n.fileDialogOpen=!0},$=D=>{D.files.length&&i("update:modelValue",D.files[0])},S=()=>i("update:modelValue",void 0);r.watch(()=>l.modelValue,()=>{n.error=""},{immediate:!0});const B=r.ref();return l.cellStyle||Xn(B),(D,H)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!D.cellStyle,"has-file":!!d.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:B,class:r.normalizeClass(["pl-file-input",{dashed:D.dashed,error:w.value}]),tabindex:"0",onKeyup:r.withKeys(z,["enter"]),onClick:r.withModifiers(z,["stop"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(E.value)},null,4),H[3]||(H[3]=r.createTextVNode()),!D.cellStyle&&D.label?(r.openBlock(),r.createElementBlock("label",SE,[D.required?(r.openBlock(),r.createElementBlock("i",EE)):r.createCommentVNode("",!0),H[1]||(H[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(D.label),1),H[2]||(H[2]=r.createTextVNode()),r.unref(o).tooltip||p.value?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.unref(o).tooltip?r.renderSlot(D.$slots,"tooltip",{key:0}):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(p.value),1)],64))]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),H[4]||(H[4]=r.createTextVNode()),w.value?(r.openBlock(),r.createBlock(r.unref(xt),{key:1,name:"restart"})):h.value?(r.openBlock(),r.createBlock(r.unref(xt),{key:2,name:"cloud-upload"})):m.value?(r.openBlock(),r.createBlock(r.unref(xt),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(xt),{key:4,name:"paper-clip"})),H[5]||(H[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":D.placeholder??"Choose file",class:"pl-file-input__filename"},r.toDisplayString(d.value),9,TE),H[6]||(H[6]=r.createTextVNode()),v.value?(r.openBlock(),r.createElementBlock("div",NE,r.toDisplayString(v.value),1)):r.createCommentVNode("",!0),H[7]||(H[7]=r.createTextVNode()),D.modelValue?(r.openBlock(),r.createBlock(r.unref(xt),{key:6,name:"close",onClick:r.withModifiers(S,["stop"])})):r.createCommentVNode("",!0),H[8]||(H[8]=r.createTextVNode()),r.createVNode(vr,{class:"pl-file-input__contour"})],34),H[9]||(H[9]=r.createTextVNode()),w.value?(r.openBlock(),r.createElementBlock("div",VE,r.toDisplayString(y.value),1)):D.helper?(r.openBlock(),r.createElementBlock("div",AE,r.toDisplayString(D.helper),1)):r.createCommentVNode("",!0)],2),H[10]||(H[10]=r.createTextVNode()),r.createVNode(r.unref(Np),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":H[0]||(H[0]=A=>n.fileDialogOpen=A),extensions:D.extensions,title:D.fileDialogTitle,"close-on-outside-click":D.fileDialogCloseOnOutsideClick,"onImport:files":$},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),BE={class:"pl-notification-alert__wrapper d-flex text-s"},PE={class:"pl-notification-alert__content flex-grow-1"},RE={key:0,class:"pl-notification-alert__close"},DE={key:0,class:"pl-notification-alert__actions d-flex"},Wp=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(i,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([i.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${i.width}`})},[r.createElementVNode("div",BE,[r.createElementVNode("div",PE,[r.renderSlot(i.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),i.closable?(r.openBlock(),r.createElementBlock("div",RE,[r.createVNode(r.unref(wo),{icon:"close",onClick:o})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),i.$slots.actions?(r.openBlock(),r.createElementBlock("div",DE,[r.renderSlot(i.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),IE=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 St(t,e,n){return e>t?e:t>n?n:t}const Jl=t=>r.computed(()=>{const e=[100],{min:n,max:o,step:i}=t.value;let l=n;for(;l<o;){l+=i;const c=(1-(St(l,n,o)-n)/(o-n))*100;e.push(c)}return e}),FE={class:"ui-slider__wrapper"},LE={class:"ui-slider__label-section"},OE={key:0,class:"text-s"},ME={key:1,class:"ui-slider__value-static text-s"},GE={class:"ui-slider__base"},$E={class:"ui-slider__container"},zE={class:"ui-slider__container ui-slider__container-thumb"},UE={class:"ui-slider__input-wrapper d-flex"},ZE=["value"],WE={key:0,class:"ui-slider__error"},jp=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,i=t,l=r.reactive({deltaValue:0}),c=r.computed(()=>i.max-i.min),d=r.computed(()=>St((i.modelValue??0)+l.deltaValue,i.min,i.max)),p=r.ref(i.modelValue),h=r.computed(()=>{const A=i.modelValue;return Number.isFinite(A)?A<i.min?`Min value: ${i.min}`:A>i.max?`Max value: ${i.max}`:i.error:"Not a number"}),m=r.computed(()=>i),y=Jl(m),w=r.computed(()=>(d.value-i.min)/c.value),v=r.computed(()=>({right:Math.ceil((1-w.value)*100)+"%"})),E=r.computed(()=>({right:`calc(${Math.ceil((1-w.value)*100)}%) `})),z=r.ref(),$=r.ref();r.watch(()=>i.modelValue,A=>{p.value=A});function S(A){const N=St(A,i.min,i.max);return Math.round((N+Number.EPSILON)*(1/i.step))/(1/i.step)}_r($,A=>{var N;_t((N=r.unref(z))==null?void 0:N.getBoundingClientRect(),j=>{const{dx:J}=A;l.deltaValue=J/j.width*c.value,p.value=S(St((i.modelValue??0)+l.deltaValue,i.min,i.max)),A.stop&&(o("update:modelValue",S(d.value)),l.deltaValue=0)})});function B(A){o("update:modelValue",S(A))}function D(A){B(+A.target.value)}function H(A){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(A.code)&&A.preventDefault();const N=A.code==="ArrowUp"||A.code==="ArrowRight"?i.step*1:A.code==="ArrowDown"||A.code==="ArrowLeft"?i.step*-1:0;B(i.modelValue+N)}return(A,N)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",FE,[r.createElementVNode("div",LE,[A.label?(r.openBlock(),r.createElementBlock("label",OE,[r.createElementVNode("span",null,r.toDisplayString(A.label),1),N[1]||(N[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(A.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),N[2]||(N[2]=r.createTextVNode()),i.mode==="text"?(r.openBlock(),r.createElementBlock("div",ME,r.toDisplayString(p.value)+r.toDisplayString(A.measure),1)):r.createCommentVNode("",!0)]),N[6]||(N[6]=r.createTextVNode()),r.createElementVNode("div",GE,[r.createElementVNode("div",$E,[r.createElementVNode("div",{ref_key:"barRef",ref:z,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(v.value)},null,4)],512)]),N[5]||(N[5]=r.createTextVNode()),r.createElementVNode("div",zE,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(j,J)=>(r.openBlock(),r.createElementBlock("div",{key:J,style:r.normalizeStyle({right:`${j}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),N[4]||(N[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:$,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(E.value),onKeydown:H},N[3]||(N[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),N[7]||(N[7]=r.createTextVNode()),r.createElementVNode("div",UE,[i.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:N[0]||(N[0]=j=>D(j))},null,40,ZE)):r.createCommentVNode("",!0)])],2),N[8]||(N[8]=r.createTextVNode()),h.value?(r.openBlock(),r.createElementBlock("div",WE,r.toDisplayString(h.value),1)):r.createCommentVNode("",!0)],2))}});function jE(t,e=null,n=null){function o(d){const{scrollTop:p,scrollHeight:h,clientHeight:m}=d;if(!(h>m)||!e)return null;const y=h-p-m,w=p>e?e:0,v=y>e?m-e-w:m;return`linear-gradient(
|
|
52
|
+
`,Q0=["innerHTML"],ew={class:"dropdown-list-item__title-container"},tw={class:"dropdown-list-item__title text-s"},nw={key:0,class:"dropdown-list-item__description text-description"},rw={key:1,class:"dropdown-list-item__icon flex-self-start"},vo=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(" ")}),i=r.computed(()=>e.isSelected?J0:X0);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:i.value},null,10,Q0)):r.createCommentVNode("",!0),c[1]||(c[1]=r.createTextVNode()),r.createElementVNode("div",ew,[r.createElementVNode("div",tw,r.toDisplayString(l.option.label),1),c[0]||(c[0]=r.createTextVNode()),l.option.description?(r.openBlock(),r.createElementBlock("div",nw,r.toDisplayString(l.option.description),1)):r.createCommentVNode("",!0)]),c[2]||(c[2]=r.createTextVNode()),!e.useCheckbox&&e.isSelected?(r.openBlock(),r.createElementBlock("div",rw)):r.createCommentVNode("",!0)],2))}});function vi(t,e){const n=Bl(()=>{if(t.value){const{scrollTop:o,scrollLeft:i,scrollHeight:l,scrollWidth:c,clientHeight:d,clientWidth:p}=document.documentElement,h=t.value.getBoundingClientRect();e({scrollTop:o,scrollLeft:i,scrollHeight:l,scrollWidth:c,clientHeight:d,clientWidth:p,offsetY:o+h.y,offsetX:i+h.x,top:h.top,right:h.right,bottom:h.bottom,left:h.left,width:h.width,height:h.height,x:h.x,y:h.y})}});r.onMounted(n),st(window,"scroll",n,{capture:!0,passive:!0}),st(window,"resize",n,{passive:!0}),st(window,"adjust",n,!0)}const ow=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(i,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,i.$style.icon])},null,6))}}),iw="_icon_1ugxm_2",sw={icon:iw},aw={$style:sw},At=Mt(ow,[["__cssModules",aw]]),lw=["onKeyup"],cw=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,i=n,l=r.useModel(t,"modelValue"),c=r.ref(),d=r.ref(),p=r.ref(),h=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(d,N=>{if(N){const v=N.getBoundingClientRect();m.optionsHeight=v.height,window.dispatchEvent(new CustomEvent("adjust"))}},{immediate:!0});const w=r.computed(()=>m.open?"mask-24 mask-chevron-up":"mask-24 mask-chevron-down"),b=r.computed(()=>(o.options??[]).findIndex(N=>_i(N.value,l.value))),E=r.computed(()=>vr(o.options??[]).map((N,v)=>({...N,index:v,isSelected:v===b.value,isActive:v===m.activeIndex}))),$=r.computed(()=>o.loading||o.options===void 0),O=r.computed(()=>{var N;return((N=E.value.find(v=>_i(v.value,l.value)))==null?void 0:N.label)??(o.options===void 0?"...":"")});vi(c,N=>{const v=N.top+N.height+3;v+m.optionsHeight>N.clientHeight?y.top=N.top-m.optionsHeight-3+"px":y.top=v+"px",y.left=N.left+"px",y.width=N.width+"px"});const T=N=>{var v;l.value=N,m.open=!1,(v=c==null?void 0:c.value)==null||v.focus()};function P(){i("click")}const R=N=>{var v,L;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(N.code))N.preventDefault();else return;if(N.target===h.value&&N.code==="Enter"){P();return}const{open:U,activeIndex:Q}=m;if(!U&&N.target===p.value){N.code==="Enter"&&(m.open=!0);return}N.code==="Escape"&&(m.open=!1,(v=c.value)==null||v.focus());const M=r.unref(E),{length:Z}=M;if(!Z)return;N.code==="Enter"&&T((L=M.find(G=>G.index===Q))==null?void 0:L.value);const z=M.findIndex(G=>G.index===Q)??-1,B=N.code==="ArrowDown"?1:N.code==="ArrowUp"?-1:0,A=Math.abs(z+B+Z)%Z;m.activeIndex=E.value[A].index??-1},j=N=>{var v,L;const U=N.relatedTarget;!((v=c.value)!=null&&v.contains(U))&&!((L=d.value)!=null&&L.contains(U))&&(m.open=!1)};return(N,v)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass([{disabled:N.disabled||$.value,loading:$.value},"pl-btn-split d-flex"]),onFocusout:j,onKeydown:R},[r.createElementVNode("div",{ref_key:"buttonAction",ref:h,class:"pl-btn-split__title flex-grow-1 d-flex align-center text-s-btn",tabindex:"0",onClick:P,onKeyup:r.withKeys(r.withModifiers(P,["stop"]),["enter"])},r.toDisplayString(O.value),41,lw),v[1]||(v[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:v[0]||(v[0]=L=>m.open=!m.open)},[$.value?(r.openBlock(),r.createBlock(At,{key:0,name:"loading"})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([w.value,"pl-btn-split__icon"])},null,2))],512),v[2]||(v[2]=r.createTextVNode()),m.open?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:"body"},[r.createElementVNode("div",{ref_key:"list",ref:d,class:"pl-dropdown__options",style:r.normalizeStyle(y),tabindex:"-1"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,(L,U)=>(r.openBlock(),r.createBlock(vo,{key:U,option:L,"is-selected":L.isSelected,"is-hovered":L.isActive,size:"medium",onClick:r.withModifiers(Q=>T(L.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128))],4)])):r.createCommentVNode("",!0)],34))}});function cp(t){function e(n){const o=n.currentTarget,i=document.createElement("span"),l=Math.max(o.clientWidth,o.clientHeight),c=l/2;i.style.width=i.style.height=`${l}px`,i.style.left=`${n.clientX-o.offsetLeft-c}px`,i.style.top=`${n.clientY-o.offsetTop-c}px`,i.classList.add("ripple");const d=o.getElementsByClassName("ripple")[0];d&&d.remove(),o.appendChild(i)}r.onMounted(()=>{var n;(n=t.value)==null||n.addEventListener("click",e)})}const dw={key:0},uw={inheritAttrs:!1},Vs=r.defineComponent({...uw,__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"),i=r.computed(()=>e.large||e.size==="large");return cp(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:i.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",dw,[r.renderSlot(l.$slots,"default")])),c[0]||(c[0]=r.createTextVNode()),l.loading?(r.openBlock(),r.createBlock(r.unref(At),{key:1,name:"loading",size:l.size},null,8,["size"])):l.icon?(r.openBlock(),r.createBlock(r.unref(At),{key:2,name:l.icon,size:l.size},null,8,["name","size"])):r.createCommentVNode("",!0)],16))}}),pw={name:"PlBtnPrimary"},As=r.defineComponent({...pw,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(Vs,r.mergeProps({class:"pl-btn-primary"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),hw={name:"PlBtnAccent"},fw=r.defineComponent({...hw,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(Vs,r.mergeProps({class:"pl-btn-accent"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),mw={name:"PlBtnDanger"},gw=r.defineComponent({...mw,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(Vs,r.mergeProps({class:"pl-btn-danger"},e),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),yw={name:"PlBtnSecondary"},Il=r.defineComponent({...yw,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(Vs,r.mergeProps(e,{class:"pl-btn-secondary"}),{default:r.withCtx(()=>[r.renderSlot(n.$slots,"default")]),_:3},16))}}),_w={key:0},Cw={name:"PlBtnGhost"},wo=r.defineComponent({...Cw,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"),i=r.ref(),l=r.useSlots();return cp(i),(c,d)=>(r.openBlock(),r.createElementBlock("button",r.mergeProps({ref_key:"btnRef",ref:i,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",_w,[r.renderSlot(c.$slots,"default")])):r.createCommentVNode("",!0),d[0]||(d[0]=r.createTextVNode()),c.loading?(r.openBlock(),r.createBlock(r.unref(At),{key:1,name:"loading",size:c.size},null,8,["size"])):c.icon?(r.openBlock(),r.createBlock(r.unref(At),{key:2,name:c.icon,size:c.size},null,8,["name","size"])):r.createCommentVNode("",!0),d[1]||(d[1]=r.createTextVNode()),r.renderSlot(c.$slots,"append")],16))}}),vw=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,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-btn-link",{disabled:o.disabled,loading:o.loading,hover:n.value}]),onMouseover:i[0]||(i[0]=l=>n.value=!0),onMouseleave:i[1]||(i[1]=l=>n.value=!1)},[r.createVNode(Il,r.mergeProps({round:"",hover:n.value},e),null,16,["hover"]),i[2]||(i[2]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],34))}});function ww(t,e){const n=r.ref();return vi(t,o=>{n.value=o}),r.computed(()=>{const o=r.unref(n),i=r.unref(e),l=i.position??"top",c=i.gap??8;if(!o)return"";const d=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: ${d}px;`:l==="left"?`right: ${o.scrollWidth-o.x+c}px; top: ${d}px;`:l==="southwest"?`left: ${o.offsetX+o.width}px; top: ${o.offsetY+o.height+c}px;`:""})}function wi(t,e){return e(t)}function _t(t,e){if(t!=null)return e(t)}function bw(t){return Array.isArray(t)?t:[t]}function xw(t,e,...n){n.forEach(o=>{t[o]=e[o]})}function Bs(t,e){st(document,"click",n=>{document.contains(n.target)&&(bw(t).map(o=>o.value).filter(o=>!!o).some(o=>o==null?void 0:o.contains(n.target))||e())})}const kw={},Ew={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Sw(t,e){return r.openBlock(),r.createElementBlock("svg",Ew,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 Tw=Mt(kw,[["render",Sw]]),Fl=new Map,Nw={name:"PlTooltip"},Ct=r.defineComponent({...Nw,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"},maxWidth:{default:"300px"}},emits:["tooltip:close"],setup(t,{emit:e}){const n=e,o=Symbol(),i=t,l=r.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});Fl.set(o,()=>h()),r.watch(()=>l.open,O=>{requestAnimationFrame(()=>{l.tooltipOpen=O})});let c=()=>{};const d=op(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),p=()=>{l.open=!0;for(const[O,T]of Fl.entries())O!==o&&T()},h=()=>{l.open=!1,n("tooltip:close")},m=async()=>{i.hide||(d(),l.over=!0,c(),await Ju(100),l.over&&p())},y=()=>{l.over=!1,c=Qu(()=>{l.over||h()},i.closeDelay)};r.watch(()=>i.hide,O=>{O&&h()});const w=r.ref(),b=r.ref(),E=ww(w,r.toRef(i));Bs([w,b],()=>h());const $=r.computed(()=>({"--pl-tooltip-max-width":i.maxWidth}));return r.onUnmounted(()=>{Fl.delete(o)}),(O,T)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(O.element),r.mergeProps(O.$attrs,{ref_key:"rootRef",ref:w,onClick:m,onMouseover:m,onMouseleave:y}),{default:r.withCtx(()=>[r.renderSlot(O.$slots,"default"),T[1]||(T[1]=r.createTextVNode()),O.$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(E))},[r.createElementVNode("div",{ref_key:"tooltip",ref:b,class:r.normalizeClass(["pl-tooltip",O.position]),style:r.normalizeStyle($.value),onMouseover:m,onMouseleave:y},[r.createElementVNode("div",null,[r.renderSlot(O.$slots,"tooltip")]),T[0]||(T[0]=r.createTextVNode()),r.createVNode(Tw)],38)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)]),_:3},16))}}),Vw={},Aw={class:"inner-border"};function Bw(t,e,n,o,i,l){return r.openBlock(),r.createElementBlock("div",Aw,[r.renderSlot(t.$slots,"default")])}const Pw=Mt(Vw,[["render",Bw]]),Rw={key:0},Dw=["tabindex","onKeydown","onClick"],Iw={key:1,class:"pl-btn-group__helper"},Fw={key:2,class:"pl-btn-group__error"},Lw={name:"PlBtnGroup"},dp=r.defineComponent({...Lw,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,i=d=>o("update:modelValue",d),l=t,c=r.computed(()=>l.options.map(d=>({label:"label"in d?d.label:d.text,value:d.value})));return(d,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-btn-group",{disabled:d.disabled,compact:d.compact}])},[d.label?(r.openBlock(),r.createElementBlock("label",Rw,[r.createElementVNode("span",null,r.toDisplayString(d.label),1),p[0]||(p[0]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(d.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Pw,{class:"pl-btn-group__container"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(h,m)=>(r.openBlock(),r.createElementBlock("div",{key:m,class:r.normalizeClass(["pl-btn-group__option text-s",{active:d.modelValue===h.value}]),tabindex:d.modelValue===h.value||d.disabled?void 0:0,onKeydown:r.withKeys(y=>i(h.value),["enter"]),onClick:y=>i(h.value)},r.toDisplayString(h.label),43,Dw))),128))]),_:1}),p[2]||(p[2]=r.createTextVNode()),d.helper?(r.openBlock(),r.createElementBlock("div",Iw,r.toDisplayString(d.helper),1)):d.error?(r.openBlock(),r.createElementBlock("div",Fw,r.toDisplayString(d.error),1)):r.createCommentVNode("",!0)],2))}});function Ow(t,e){const n=r.ref(),o=r.ref(),{parse:i,update:l}=e,c=()=>{n.value=void 0,o.value=void 0},d=r.computed({get(){return n.value!==void 0?n.value:t.value},set(p){c();try{const h=i?i(p):p;!l||l(h)?t.value=h:n.value=h}catch(h){n.value=p,o.value=h instanceof Error?h.message:String(h)}}});return r.reactive({value:d,error:o,reset:c})}const Mw="_component_1abv8_1",Gw="_container_1abv8_15",$w="_error_1abv8_69",Ll={component:Mw,container:Gw,error:$w},zw={key:0},Uw=["placeholder"],Zw=r.defineComponent({__name:"PlEditableTitle",props:r.mergeModels({placeholder:{default:"Title"},maxWidth:{default:"80%"},prefix:{default:void 0},maxLength:{default:1e3},minLength:{default:void 0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,o=Ow(e,{update(){return!1},parse:d=>{if(typeof d!="string")throw Error("value should be a string");if(n.maxLength&&d.length>n.maxLength)throw Error(`Max title length is ${n.maxLength} characters`);if(n.minLength&&d.length<n.minLength)throw Error(`Min title length is ${n.minLength} characters`);return d.trim()}}),i=r.computed(()=>({maxWidth:n.maxWidth??"80%"})),l=()=>{e.value=o.value&&!o.error?o.value:e.value,o.reset()},c=r.ref();return(d,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["pl-editable-title",r.unref(Ll).component]),style:r.normalizeStyle(i.value)},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(Ll).container),onClick:p[3]||(p[3]=()=>{var h;return(h=c.value)==null?void 0:h.focus()})},[d.prefix?(r.openBlock(),r.createElementBlock("span",zw,r.toDisplayString(d.prefix.trim())+" ",1)):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":p[0]||(p[0]=h=>r.unref(o).value=h),placeholder:d.placeholder,onFocusout:l,onKeydown:[p[1]||(p[1]=r.withKeys((...h)=>r.unref(o).reset&&r.unref(o).reset(...h),["escape"])),p[2]||(p[2]=r.withKeys(h=>{var m;return(m=h.target)==null?void 0:m.blur()},["enter"]))]},null,40,Uw),[[r.vModelText,r.unref(o).value]])],2),p[5]||(p[5]=r.createTextVNode()),r.unref(o).error?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(r.unref(Ll).error)},r.toDisplayString(r.unref(o).error),3)):r.createCommentVNode("",!0)],6))}}),Ww={inheritAttrs:!1},jw={class:"double-contour"};function Hw(t,e,n,o,i,l){return r.openBlock(),r.createElementBlock("div",jw,[r.createElementVNode("div",r.normalizeProps(r.guardReactiveProps(t.$attrs)),[r.renderSlot(t.$slots,"default")],16)])}const wr=Mt(Ww,[["render",Hw]]);function up(t){r.onMounted(t),r.onUpdated(t)}const Ol=new WeakMap,Ml=new ResizeObserver(t=>{for(const e of t)_t(Ol.get(e.target),n=>n(e))});function pp(t,e){Ol.set(t,e),Ml.unobserve(t),Ml.observe(t)}function hp(t){Ml.unobserve(t),Ol.delete(t)}const qw=8,fp=4;function Xn(t,e="label"){const n=new Set;up(()=>{_t(t==null?void 0:t.value,o=>{const i=o.querySelector(e);i&&(n.add(i),pp(i,()=>{const l=Xu(()=>i.getBoundingClientRect().width+wi(qw,c=>Number.isNaN(c)?fp:c+fp));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=>hp(o))})}function Kw(t,e){const n=[];return e&&e.length>0&&e.forEach(o=>{const i=o(t);typeof i=="string"&&n.push(i)}),{isValid:n.length===0,errors:n}}function mp(t,e){return r.computed(()=>Kw(t.value,e))}const Yw=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(i,l)=>(r.openBlock(),r.createElementBlock("i",{style:r.normalizeStyle(n.value),class:r.normalizeClass([o.value,i.$style.icon])},null,6))}}),Xw="_icon_1ugxm_2",Jw={icon:Xw},Qw={$style:Jw},Hr=Mt(Yw,[["__cssModules",Qw]]),eb=r.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`mask-24 mask-${e.name}`);return(o,i)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),tb="_icon_1ugxm_2",nb={icon:tb},rb={$style:nb},xt=Mt(eb,[["__cssModules",rb]]),ob={class:"pl-text-field__envelope"},ib={key:0,ref:"label"},sb={key:0,class:"required-icon"},ab={key:1,class:"pl-text-field__prefix"},lb=["disabled","placeholder","type"],cb={class:"pl-text-field__append"},db={key:0,class:"pl-text-field__error"},ub={key:1,class:"pl-text-field__helper"},pb={name:"PlTextField"},qr=r.defineComponent({...pb,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,i=r.ref(void 0),l=r.ref(),c=r.ref(!1),d=r.reactive({cached:void 0}),p=r.computed({get(){return d.cached?d.cached.value:n.value===void 0||n.value===null?"":String(n.value)},set(j){if(d.cached=void 0,o.parse)try{n.value=o.parse(j)}catch(N){d.cached={error:N instanceof Error?N.message:String(N),value:j}}else n.value=j}}),h=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&&(d.cached=void 0,n.value=o.clearable===!0?"":o.clearable())},w=mp(p,o.rules||[]),b=r.computed(()=>o.clearable?o.clearable===!0?n.value==="":n.value===o.clearable():n.value===""),E=r.computed(()=>!b.value),$=r.computed(()=>{const j=[];return o.error&&j.push(o.error),d.cached&&j.push(d.cached.error),w.value.isValid||j.push(...w.value.errors),j}),O=r.computed(()=>$.value.length>0),T=r.computed(()=>o.clearable&&E.value&&o.type!=="password"&&!o.disabled),P=()=>c.value=!c.value,R=()=>{d.cached=void 0};return Xn(i),(j,N)=>(r.openBlock(),r.createElementBlock("div",ob,[r.createElementVNode("div",{ref_key:"rootRef",ref:i,class:r.normalizeClass(["pl-text-field",{error:O.value,disabled:j.disabled,dashed:j.dashed,nonEmpty:E.value}])},[j.label?(r.openBlock(),r.createElementBlock("label",ib,[j.required?(r.openBlock(),r.createElementBlock("i",sb)):r.createCommentVNode("",!0),N[1]||(N[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(j.label),1),N[2]||(N[2]=r.createTextVNode()),r.unref(e).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(j.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),N[5]||(N[5]=r.createTextVNode()),j.prefix?(r.openBlock(),r.createElementBlock("div",ab,r.toDisplayString(j.prefix),1)):r.createCommentVNode("",!0),N[6]||(N[6]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":N[0]||(N[0]=v=>p.value=v),disabled:j.disabled,placeholder:j.placeholder||"...",type:h.value,spellcheck:"false",onFocusout:R},null,40,lb),[[r.vModelDynamic,p.value]]),N[7]||(N[7]=r.createTextVNode()),r.createElementVNode("div",cb,[T.value?(r.openBlock(),r.createBlock(r.unref(Hr),{key:0,class:"pl-text-field__clearable",name:"delete-clear",onClick:y})):r.createCommentVNode("",!0),N[3]||(N[3]=r.createTextVNode()),j.type==="password"?(r.openBlock(),r.createBlock(r.unref(xt),{key:1,name:m.value,style:{cursor:"pointer"},onClick:P},null,8,["name"])):r.createCommentVNode("",!0),N[4]||(N[4]=r.createTextVNode()),r.renderSlot(j.$slots,"append")]),N[8]||(N[8]=r.createTextVNode()),r.createVNode(wr,{class:"pl-text-field__contour"})],2),N[9]||(N[9]=r.createTextVNode()),O.value?(r.openBlock(),r.createElementBlock("div",db,r.toDisplayString($.value.join(" ")),1)):j.helper?(r.openBlock(),r.createElementBlock("div",ub,r.toDisplayString(j.helper),1)):r.createCommentVNode("",!0)]))}}),hb=r.defineComponent({__name:"PlIcon24",props:{name:{},size:{}},setup(t){const e=t,n=r.computed(()=>`icon-24 icon-${e.name}`);return(o,i)=>(r.openBlock(),r.createElementBlock("i",{class:r.normalizeClass([n.value,o.$style.icon])},null,2))}}),fb="_icon_1ugxm_2",mb={icon:fb},gb={$style:mb},Ps=Mt(hb,[["__cssModules",gb]]),yb=["disabled","placeholder"],_b=r.defineComponent({__name:"PlSearchField",props:{modelValue:{},clearable:{type:Boolean},placeholder:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(void 0),l=r.ref(),c=r.computed({get(){return o.modelValue??""},set(h){n("update:modelValue",h)}}),d=r.computed(()=>!!o.modelValue),p=()=>n("update:modelValue","");return(h,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:i,class:r.normalizeClass(["pl-search-field",[h.$style.component]])},[r.createVNode(r.unref(Ps),{name:"search"}),m[1]||(m[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:l,"onUpdate:modelValue":m[0]||(m[0]=y=>c.value=y),disabled:h.disabled,type:"text",placeholder:h.placeholder||"Find...",spellcheck:"false"},null,8,yb),[[r.vModelText,c.value]]),m[2]||(m[2]=r.createTextVNode()),h.clearable&&d.value?(r.openBlock(),r.createBlock(r.unref(Hr),{key:0,class:r.normalizeClass(h.$style.clear),name:"delete-clear",onClick:r.withModifiers(p,["stop"])},null,8,["class"])):r.createCommentVNode("",!0)],2))}}),Cb="_component_1ng5b_1",vb="_clear_1ng5b_35",wb={component:Cb,clear:vb},bb={$style:wb},gp=Mt(_b,[["__cssModules",bb]]),xb={class:"ui-text-area__envelope"},kb={key:0,ref:"label"},Eb={key:0,class:"required-icon"},Sb=["readonly","rows","disabled","placeholder"],Tb={class:"ui-text-area__append"},Nb={key:0,class:"ui-text-area__error"},Vb={key:1,class:"ui-text-area__helper"},Ab={name:"PlTextArea"},Bb=r.defineComponent({...Ab,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,i=t,l=r.ref(),c=r.ref(),d=r.computed({get(){return i.modelValue??""},set(b){o("update:modelValue",b)}}),p=r.computed(()=>!!i.modelValue),h=mp(d,i.rules||[]);Xn(l);const m=r.computed(()=>{const b=[];return i.error&&b.push(i.error),b.push(...h.value.errors),b}),y=r.computed(()=>m.value.length>0),w=()=>{if(!i.autogrow)return;const b=c.value;b&&(b.style.height="auto",b.style.height=`${b.scrollHeight}px`)};return r.onMounted(()=>{w()}),(b,E)=>(r.openBlock(),r.createElementBlock("div",xb,[r.createElementVNode("div",{ref_key:"root",ref:l,class:r.normalizeClass(["ui-text-area",{error:y.value,disabled:b.disabled,dashed:b.dashed,nonEmpty:p.value}])},[b.label?(r.openBlock(),r.createElementBlock("label",kb,[b.required?(r.openBlock(),r.createElementBlock("i",Eb)):r.createCommentVNode("",!0),E[1]||(E[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(b.label),1),E[2]||(E[2]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(b.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),E[3]||(E[3]=r.createTextVNode()),r.withDirectives(r.createElementVNode("textarea",{ref_key:"input",ref:c,"onUpdate:modelValue":E[0]||(E[0]=$=>d.value=$),readonly:b.readonly,rows:b.rows,disabled:b.disabled,placeholder:b.placeholder??"...",spellcheck:"false",onInput:w},null,40,Sb),[[r.vModelText,d.value]]),E[4]||(E[4]=r.createTextVNode()),r.createElementVNode("div",Tb,[r.renderSlot(b.$slots,"append")]),E[5]||(E[5]=r.createTextVNode()),r.createVNode(wr,{class:"ui-text-area__contour"})],2),E[6]||(E[6]=r.createTextVNode()),y.value?(r.openBlock(),r.createElementBlock("div",Nb,r.toDisplayString(m.value.join(" ")),1)):b.helper?(r.openBlock(),r.createElementBlock("div",Vb,r.toDisplayString(b.helper),1)):r.createCommentVNode("",!0)]))}});function yp(t){return t!==null&&typeof t=="object"}function Gt(t,e){return yp(t)&&yp(e)?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>Gt(t[n],e[n])):t===e}function Gl(t,e){return t.some(n=>Gt(n,e))}const $l=r.defineComponent({__name:"LongText",setup(t){r.useCssVars(m=>({"8d68520c":c.value}));const e=r.ref(!1),n=r.ref(),o=r.ref(!1),i=r.computed(()=>o.value&&e.value?"ui-lt-animate":""),l=rp(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 d(){const m=Al(n.value,"span cannot be empty");e.value=m.clientWidth<m.scrollWidth}function p(){d(),l(!0)}function h(){l(!1)}return(m,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(m.$attrs,{class:"ui-lt-container"}),[r.createElementVNode("span",{onMouseover:p,onMouseleave:h},[r.createElementVNode("span",{ref_key:"span",ref:n,class:r.normalizeClass(i.value)},[r.renderSlot(m.$slots,"default")],2)],32)],16))}});function _p(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,i=e.offsetTop,l=e.getBoundingClientRect().height;return i+l<o+n&&i>n}function Cp(t,e){const n=t.scrollTop,o=t.getBoundingClientRect().height,i=e.offsetTop,l=e.getBoundingClientRect().height;return i+l<o+n?"ceil":i>n?"floor":"visible"}function Rs(t,e,n={}){const o=t.scrollTop,i=t.getBoundingClientRect().height,l=e.getBoundingClientRect().height,c=e.offsetTop,d=Cp(t,e);if(d==="visible")return;const p=h=>{const m=d==="floor"?c-(i-l):c;t.scrollTop=o+h*(m-o)};_p(t,e)||np({duration:n.duration||100,timing:tp(h=>h),draw:p})}function zl(t,e,n,o){return t.addEventListener(e,n,o),function(){t.removeEventListener(e,n)}}function Pb(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}const Ul=r.defineComponent({__name:"DropdownOverlay",props:{root:{},gap:{}},setup(t,{expose:e}){const n=t,o=r.reactive({optionsHeight:0}),i=r.reactive({top:"0px",left:"0px",width:"0px"}),l=r.toRef(n,"root"),c=r.ref();return e({scrollIntoActive:()=>{const d=c.value;d&&_r(d.querySelector(".hovered-item"),p=>{Rs(d,p)})},listRef:c}),r.watch(c,d=>{d&&requestAnimationFrame(()=>{const p=d.getBoundingClientRect();o.optionsHeight=p.height,window.dispatchEvent(new CustomEvent("adjust"))})}),vi(l,d=>{const p=document.body.getBoundingClientRect(),h=d.top-p.top,m=d.left-p.left,y=n.gap??0,w=h+d.height+y;w+o.optionsHeight>d.clientHeight?i.top=h-o.optionsHeight-y+"px":i.top=w+"px",i.left=m+"px",i.width=d.width+"px"}),(d,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createElementVNode("div",r.mergeProps({ref_key:"listRef",ref:c},d.$attrs,{style:i,tabindex:"-1"}),[r.renderSlot(d.$slots,"default",{ref:"list"})],16)]))}}),Rb={class:"pl-dropdown__envelope"},Db=["tabindex"],Ib={class:"pl-dropdown__container"},Fb={class:"pl-dropdown__field"},Lb=["disabled","placeholder"],Ob={class:"pl-dropdown__controls"},Mb={key:0},Gb={key:0,class:"required-icon"},$b={key:0,class:"nothing-found"},zb={key:0,class:"pl-dropdown__error"},Ub={key:1,class:"pl-dropdown__helper"},Zb={key:2,class:"pl-dropdown__helper"},Wb={name:"PlDropdown"},bo=r.defineComponent({...Wb,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,i=r.useSlots(),l=r.ref(),c=r.ref(),d=r.useTemplateRef("overlay"),p=r.reactive({search:"",activeIndex:-1,open:!1,optionsHeight:0}),h=()=>wi(R.value.findIndex(z=>Gt(z.value,o.modelValue)),z=>z<0?0:z),m=()=>p.activeIndex=h(),y=r.computed(()=>o.options===void 0),w=r.computed(()=>y.value?!0:o.disabled),b=r.computed(()=>(o.options??[]).findIndex(z=>Gt(z.value,o.modelValue))),E=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&b.value===-1)return"The selected value is not one of the options"}}),$=r.computed(()=>vr(o.options??[]).map((z,B)=>({...z,index:B,isSelected:B===b.value,isActive:B===p.activeIndex}))),O=r.computed(()=>{const z=r.unref($).find(B=>Gt(B.value,o.modelValue));return(z==null?void 0:z.label)||o.modelValue}),T=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(O.value):o.placeholder),P=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),R=r.computed(()=>{const z=$.value;return p.search?z.filter(B=>{const A=p.search.toLowerCase();return B.label.toLowerCase().includes(A)||B.description&&B.description.toLowerCase().includes(A)?!0:typeof B.value=="string"?B.value.toLowerCase().includes(A):B.value===p.search}):z}),j=r.computed(()=>w.value?void 0:"0"),N=z=>{var B;n("update:modelValue",z),p.search="",p.open=!1,(B=l==null?void 0:l.value)==null||B.focus()},v=()=>n("update:modelValue",void 0),L=()=>{var z;return(z=c.value)==null?void 0:z.focus()},U=()=>p.open=!p.open,Q=()=>p.open=!0,M=z=>{var B,A,G;const H=z.relatedTarget;!((B=l.value)!=null&&B.contains(H))&&!((G=(A=d.value)==null?void 0:A.listRef)!=null&&G.contains(H))&&(p.search="",p.open=!1)},Z=z=>{var B,A;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(z.code))z.preventDefault();else return;const{open:G,activeIndex:H}=p;if(!G){z.code==="Enter"&&(p.open=!0);return}z.code==="Escape"&&(p.open=!1,(B=l.value)==null||B.focus());const X=r.unref(R),{length:ne}=X;if(!ne)return;z.code==="Enter"&&N((A=X.find(Ee=>Ee.index===H))==null?void 0:A.value);const de=X.findIndex(Ee=>Ee.index===H)??-1,me=z.code==="ArrowDown"?1:z.code==="ArrowUp"?-1:0,Te=Math.abs(de+me+ne)%ne;p.activeIndex=R.value[Te].index??-1};return Xn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,z=>{var B;return z?(B=c.value)==null?void 0:B.focus():""}),r.watchPostEffect(()=>{var z;p.search,p.activeIndex>=0&&p.open&&((z=d.value)==null||z.scrollIntoActive())}),(z,B)=>(r.openBlock(),r.createElementBlock("div",Rb,[r.createElementVNode("div",{ref_key:"rootRef",ref:l,tabindex:j.value,class:r.normalizeClass(["pl-dropdown",{open:p.open,error:z.error,disabled:w.value}]),onKeydown:Z,onFocusout:M},[r.createElementVNode("div",Ib,[r.createElementVNode("div",Fb,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":B[0]||(B[0]=A=>p.search=A),type:"text",tabindex:"-1",disabled:w.value,placeholder:T.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Q},null,40,Lb),[[r.vModelText,p.search]]),B[4]||(B[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:L},[r.createVNode($l,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.value),1)]),_:1})])),B[5]||(B[5]=r.createTextVNode()),r.createElementVNode("div",Ob,[y.value?(r.openBlock(),r.createBlock(r.unref(xt),{key:0,name:"loading"})):r.createCommentVNode("",!0),B[1]||(B[1]=r.createTextVNode()),z.clearable&&P.value?(r.openBlock(),r.createBlock(r.unref(Hr),{key:1,name:"delete-clear",onClick:r.withModifiers(v,["stop"])})):r.createCommentVNode("",!0),B[2]||(B[2]=r.createTextVNode()),r.renderSlot(z.$slots,"append"),B[3]||(B[3]=r.createTextVNode()),z.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${z.arrowIconLarge}`]]),onClick:r.withModifiers(U,["stop"])},null,2)):z.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${z.arrowIcon}`]]),onClick:r.withModifiers(U,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(U,["stop"])}))])]),B[9]||(B[9]=r.createTextVNode()),z.label?(r.openBlock(),r.createElementBlock("label",Mb,[z.required?(r.openBlock(),r.createElementBlock("i",Gb)):r.createCommentVNode("",!0),B[6]||(B[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(z.label),1),B[7]||(B[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(z.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),B[10]||(B[10]=r.createTextVNode()),p.open?(r.openBlock(),r.createBlock(r.unref(Ul),{key:1,ref_key:"overlay",ref:d,root:l.value,class:"pl-dropdown__options",tabindex:"-1",gap:3},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(R.value,(A,G)=>(r.openBlock(),r.createBlock(vo,{key:G,option:A,"is-selected":A.isSelected,"is-hovered":A.isActive,size:z.optionSize,onClick:r.withModifiers(H=>N(A.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),B[8]||(B[8]=r.createTextVNode()),R.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",$b,"Nothing found"))]),_:1},8,["root"])):r.createCommentVNode("",!0),B[11]||(B[11]=r.createTextVNode()),r.createVNode(wr,{class:"pl-dropdown__contour"})])],42,Db),B[12]||(B[12]=r.createTextVNode()),E.value?(r.openBlock(),r.createElementBlock("div",zb,r.toDisplayString(E.value),1)):y.value&&z.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",Ub,r.toDisplayString(z.loadingOptionsHelper),1)):z.helper?(r.openBlock(),r.createElementBlock("div",Zb,r.toDisplayString(z.helper),1)):r.createCommentVNode("",!0)]))}}),jb={name:"PlDropdownRef"},Hb=r.defineComponent({...jb,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 i;return(i=e.options)==null?void 0:i.map(l=>({label:l.label,value:l.ref}))}),o=r.computed(()=>e.disabled?"icon-link-disabled":"icon-link");return(i,l)=>(r.openBlock(),r.createBlock(r.unref(bo),r.mergeProps(e,{options:n.value,"loading-options-helper":i.loadingOptionsHelper,"arrow-icon-large":o.value,"onUpdate:modelValue":l[0]||(l[0]=c=>i.$emit("update:modelValue",c))}),null,16,["options","loading-options-helper","arrow-icon-large"]))}});function qb(t,e){return r.computed(()=>{const n=vr(t.value);return e.value?n.filter(o=>o.label.toLowerCase().includes(e.value.toLowerCase())):n})}const Kb={class:"resizable-input"},Yb=["placeholder","value","disabled"],Xb=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,i=r.computed(()=>{var d;return n.placeholder?n.placeholder:(d=n.modelValue||n.value)==null?void 0:d.replace('"',"")}),l=r.computed(()=>{const d={};return n.width&&(d.width=n.width),n.maxWidth&&(d.maxWidth=n.maxWidth),d});function c(d){const p=d.target.value;o("update:modelValue",p)}return(d,p)=>(r.openBlock(),r.createElementBlock("div",Kb,[r.createElementVNode("span",{style:r.normalizeStyle(l.value),class:"resizable-input__size-span"},r.toDisplayString(i.value),5),p[0]||(p[0]=r.createTextVNode()),r.createElementVNode("input",r.mergeProps(d.$attrs,{placeholder:d.placeholder,value:n.modelValue,disabled:n.disabled,style:l.value,onInput:c}),null,16,Yb)]))}}),Jb={class:"dropdown-tab-item__title text-caps13"},Qb=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 i=[];return e.isSelected&&i.push("dropdown-tab-item__selected"),e.isHovered&&i.push("hovered-item"),i.join(" ")});return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([o.value,"dropdown-tab-item"])},[r.createElementVNode("div",Jb,r.toDisplayString(n.value),1)],2))}}),ex={class:"pl-line-dropdown__prefix"},tx={class:"pl-line-dropdown__icon-wrapper"},nx={class:"pl-line-dropdown__icon"},rx={key:0,class:"pl-line-dropdown__no-item"},ox={key:0,class:"pl-line-dropdown__no-item"},vp=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,i=r.reactive({isOpen:!1,activeOption:-1,optionsHeight:0}),l=r.ref(),c=r.ref(),d=r.computed(()=>{const M=[];return i.isOpen&&M.push("open"),o.disabled&&M.push("disabled"),M.join(" ")}),p=r.ref(""),h=qb(r.toRef(o,"options"),p),m=r.computed(()=>!!(o.clearable&&i.isOpen&&o.modelValue&&y.value)),y=r.computed(()=>{if(o.modelValue){const M=E();if(M!==-1){const Z=vr(o.options)[M];return typeof Z.label=="object"?Z.label.title:Z.label}}return""}),w=r.ref(y.value),b=r.computed(()=>i.isOpen&&p.value&&p.value.length>=y.value.length-1?p.value:y.value??"...");Bs(l,()=>{o.mode==="list"&&(i.isOpen=!1)}),r.watch(()=>w.value,M=>{y.value!==M?p.value=M:p.value=""}),r.watch(()=>i.isOpen,M=>{var Z;M&&l.value&&((Z=l.value.querySelector("input"))==null||Z.focus(),r.nextTick(()=>L()))}),r.watch(()=>o.modelValue,()=>$(),{immediate:!0});function E(){return o.options.findIndex(M=>Gt(M.value,o.modelValue))}function $(){i.activeOption=wi(h.value.findIndex(M=>Gt(M.value,o.modelValue)),M=>M<0?0:M),w.value=y.value}function O(){p.value=""}function T(){o.disabled?i.isOpen=!1:r.nextTick(()=>{i.isOpen=!i.isOpen})}function P(){o.mode==="list"&&(i.isOpen=!1)}function R(M){M&&(n("update:modelValue",M.value),P(),O())}function j(M){return Gt(M.value,o.modelValue)}const N=M=>{var Z,z;const B=M.relatedTarget;!((Z=l.value)!=null&&Z.contains(B))&&!((z=c.value)!=null&&z.contains(B))&&(p.value="",i.isOpen=!1)};function v(M){const{activeOption:Z}=i;if(!i.isOpen&&M.code==="Enter"){i.isOpen=!0;return}const{length:z}=h.value;if(!z)return;["ArrowDown","ArrowUp","Enter"].includes(M.code)&&M.preventDefault(),M.code==="Enter"&&R(h.value[Z]);const B=M.code==="ArrowDown"?1:M.code==="ArrowUp"?-1:0;i.activeOption=Math.abs(Z+B+z)%z,requestAnimationFrame(L)}function L(){const M=c.value;M&&_t(M.querySelector(".hovered-item"),Z=>{o.mode==="list"?Rs(M,Z):Z.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function U(){n("update:modelValue",void 0)}const Q=r.reactive({top:"0px",left:"0px"});return r.watch(c,M=>{if(M){const Z=M.getBoundingClientRect();i.optionsHeight=Z.height,window.dispatchEvent(new CustomEvent("adjust"))}}),vi(l,M=>{const Z=M.top+M.height+2;Z+i.optionsHeight>M.clientHeight?Q.top=M.top-i.optionsHeight-2+"px":Q.top=Z+"px",Q.left=M.left+"px"}),(M,Z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"container",ref:l,tabindex:"0",class:r.normalizeClass([d.value,"pl-line-dropdown uc-pointer"]),onKeydown:v,onFocusout:N,onClick:T},[r.createElementVNode("div",ex,r.toDisplayString(o==null?void 0:o.prefix),1),Z[6]||(Z[6]=r.createTextVNode()),r.createVNode(Xb,{modelValue:w.value,"onUpdate:modelValue":Z[0]||(Z[0]=z=>w.value=z),placeholder:b.value,disabled:o.disabled,class:"pl-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),Z[7]||(Z[7]=r.createTextVNode()),r.createElementVNode("div",tx,[r.withDirectives(r.createElementVNode("div",nx,null,512),[[r.vShow,!m.value]]),Z[1]||(Z[1]=r.createTextVNode()),r.withDirectives(r.createElementVNode("div",{class:"pl-line-dropdown__icon-clear",onClick:U},null,512),[[r.vShow,m.value]])]),Z[8]||(Z[8]=r.createTextVNode()),i.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(Q),tabindex:"-1",class:"pl-line-dropdown__items",onFocusout:N},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(h),(z,B)=>r.renderSlot(M.$slots,"item",{key:B,item:z,textItem:"text",isSelected:j(z),isHovered:i.activeOption==B,onClick:r.withModifiers(A=>R(z),["stop"])},()=>[r.createVNode(vo,{option:z,"text-item":"text","is-selected":j(z),"is-hovered":i.activeOption==B,size:"medium",onClick:r.withModifiers(A=>R(z),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),Z[3]||(Z[3]=r.createTextVNode()),r.unref(h).length===0?(r.openBlock(),r.createElementBlock("div",rx,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(Q),tabindex:"-1",class:"pl-line-dropdown__items-tabs",onFocusout:N},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(h),(z,B)=>r.renderSlot(M.$slots,"item",{key:B,item:z,isSelected:j(z),isHovered:i.activeOption==B,onClick:r.withModifiers(A=>R(z),["stop"])},()=>[r.createVNode(Qb,{option:z,"is-selected":j(z),"is-hovered":i.activeOption==B,onClick:r.withModifiers(A=>R(z),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),Z[5]||(Z[5]=r.createTextVNode()),r.unref(h).length===0?(r.openBlock(),r.createElementBlock("div",ox,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))}}),ix={class:"ui-dropdown__envelope"},sx=["tabindex"],ax={class:"ui-dropdown__container"},lx={class:"ui-dropdown__field"},cx=["disabled","placeholder"],dx={class:"ui-dropdown__controls"},ux={key:0},px={key:0,class:"required-icon"},hx={key:0,class:"nothing-found"},fx={key:0,class:"ui-dropdown__error"},mx={key:1,class:"ui-dropdown__helper"},gx={key:2,class:"ui-dropdown__helper"},yx={name:"PlDropdown"},_x=r.defineComponent({...yx,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,i=r.useSlots(),l=r.ref(),c=r.ref(),d=r.ref(),p=r.reactive({search:"",activeIndex:-1,open:!1}),h=()=>wi(R.value.findIndex(B=>Gt(B.value,o.modelValue)),B=>B<0?0:B),m=()=>p.activeIndex=h(),y=r.computed(()=>o.options===void 0),w=r.computed(()=>y.value?!0:o.disabled),b=r.computed(()=>(o.options??[]).findIndex(B=>Gt(B.value,o.modelValue))),E=r.computed(()=>{if(!y.value){if(o.error)return o.error;if(o.modelValue!==void 0&&b.value===-1)return"The selected value is not one of the options"}}),$=r.computed(()=>vr(o.options??[]).map((B,A)=>({...B,index:A,isSelected:A===b.value,isActive:A===p.activeIndex}))),O=r.computed(()=>{const B=r.unref($).find(A=>Gt(A.value,o.modelValue));return(B==null?void 0:B.label)||o.modelValue}),T=r.computed(()=>!p.open&&o.modelValue?"":o.modelValue?String(O.value):o.placeholder),P=r.computed(()=>o.modelValue!==void 0&&o.modelValue!==null),R=r.computed(()=>{const B=$.value;return p.search?B.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}):B}),j=r.computed(()=>w.value?void 0:"0"),N=B=>{var A;n("update:modelValue",B),p.search="",p.open=!1,(A=l==null?void 0:l.value)==null||A.focus()},v=()=>n("update:modelValue",void 0),L=()=>{var B;return(B=d.value)==null?void 0:B.focus()},U=()=>p.open=!p.open,Q=()=>p.open=!0,M=B=>{var A;(A=l==null?void 0:l.value)!=null&&A.contains(B.relatedTarget)||(p.search="",p.open=!1)},Z=()=>{const B=c.value;B&&_t(B.querySelector(".hovered-item"),A=>{Rs(B,A)})},z=B=>{var A,G;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(B.code))B.preventDefault();else return;const{open:H,activeIndex:X}=p;if(!H){B.code==="Enter"&&(p.open=!0);return}B.code==="Escape"&&(p.open=!1,(A=l.value)==null||A.focus());const ne=r.unref(R),{length:de}=ne;if(!de)return;B.code==="Enter"&&N((G=ne.find(je=>je.index===X))==null?void 0:G.value);const me=ne.findIndex(je=>je.index===X)??-1,Te=B.code==="ArrowDown"?1:B.code==="ArrowUp"?-1:0,Ee=Math.abs(me+Te+de)%de;p.activeIndex=R.value[Ee].index??-1};return Xn(l),r.watch(()=>o.modelValue,m,{immediate:!0}),r.watch(()=>p.open,B=>{var A;return B?(A=d.value)==null?void 0:A.focus():""}),r.watchPostEffect(()=>{p.search,p.activeIndex>=0&&p.open&&Z()}),(B,A)=>(r.openBlock(),r.createElementBlock("div",ix,[r.createElementVNode("div",{ref_key:"root",ref:l,tabindex:j.value,class:r.normalizeClass(["ui-dropdown",{open:p.open,error:B.error,disabled:w.value}]),onKeydown:z,onFocusout:M},[r.createElementVNode("div",ax,[r.createElementVNode("div",lx,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":A[0]||(A[0]=G=>p.search=G),type:"text",tabindex:"-1",disabled:w.value,placeholder:T.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:Q},null,40,cx),[[r.vModelText,p.search]]),A[4]||(A[4]=r.createTextVNode()),p.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:L},[r.createVNode($l,{class:"input-value"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.value),1)]),_:1})])),A[5]||(A[5]=r.createTextVNode()),r.createElementVNode("div",dx,[y.value?(r.openBlock(),r.createBlock(r.unref(xt),{key:0,name:"loading"})):r.createCommentVNode("",!0),A[1]||(A[1]=r.createTextVNode()),B.clearable&&P.value?(r.openBlock(),r.createBlock(r.unref(Hr),{key:1,name:"delete-clear",onClick:r.withModifiers(v,["stop"])})):r.createCommentVNode("",!0),A[2]||(A[2]=r.createTextVNode()),r.renderSlot(B.$slots,"append"),A[3]||(A[3]=r.createTextVNode()),B.arrowIconLarge?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(["arrow-icon",[`icon-24 ${B.arrowIconLarge}`]]),onClick:r.withModifiers(U,["stop"])},null,2)):B.arrowIcon?(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(["arrow-icon",[`icon-16 ${B.arrowIcon}`]]),onClick:r.withModifiers(U,["stop"])},null,2)):(r.openBlock(),r.createElementBlock("div",{key:4,class:"arrow-icon arrow-icon-default",onClick:r.withModifiers(U,["stop"])}))])]),A[9]||(A[9]=r.createTextVNode()),B.label?(r.openBlock(),r.createElementBlock("label",ux,[B.required?(r.openBlock(),r.createElementBlock("i",px)):r.createCommentVNode("",!0),A[6]||(A[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(B.label),1),A[7]||(A[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(B.$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(R.value,(G,H)=>(r.openBlock(),r.createBlock(vo,{key:H,option:G,"is-selected":G.isSelected,"is-hovered":G.isActive,size:B.optionSize,onClick:r.withModifiers(X=>N(G.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),A[8]||(A[8]=r.createTextVNode()),R.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",hx,"Nothing found"))],512)):r.createCommentVNode("",!0),A[11]||(A[11]=r.createTextVNode()),r.createVNode(wr,{class:"ui-dropdown__contour"})])],42,sx),A[12]||(A[12]=r.createTextVNode()),E.value?(r.openBlock(),r.createElementBlock("div",fx,r.toDisplayString(E.value),1)):y.value&&B.loadingOptionsHelper?(r.openBlock(),r.createElementBlock("div",mx,r.toDisplayString(B.loadingOptionsHelper),1)):B.helper?(r.openBlock(),r.createElementBlock("div",gx,r.toDisplayString(B.helper),1)):r.createCommentVNode("",!0)]))}}),Cx={key:0,class:"ui-progress-bar"},vx={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},wx={class:"ui-progress-bar__message flex-grow-1"},bx={class:"ui-progress-bar__percent"},xx=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,i)=>o.loading?(r.openBlock(),r.createElementBlock("div",Cx,[r.createElementVNode("div",{class:"ui-progress-bar__indicator",style:r.normalizeStyle({width:o.progress+"%"})},null,4),i[1]||(i[1]=r.createTextVNode()),r.createElementVNode("div",vx,[r.createElementVNode("div",wx,r.toDisplayString(n.value),1),i[0]||(i[0]=r.createTextVNode()),r.createElementVNode("div",bx,r.toDisplayString(o.progress+"%"),1)])])):r.createCommentVNode("",!0)}}),kx={class:"mi-number-field__main-wrapper d-flex"},Ex={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},Sx={key:0,class:"text-description"},Tx=["disabled","placeholder"],Nx={class:"mi-number-field__icons d-flex-column"},Vx={key:0,class:"mi-number-field__hint text-description"},Ax=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,i=r.ref(),l=r.useSlots(),c=r.ref();Xn(i);const d=r.ref(!0),p=r.computed({get(){return d.value&&n.modelValue!==void 0?new Number(n.modelValue).toString():""},set(T){var P;T=T.replace(/,/g,""),w(T)?(o("update:modelValue",+T),T.toString()!==((P=n.modelValue)==null?void 0:P.toString())&&+T===n.modelValue&&T[T.length-1]!=="."&&(d.value=!1,r.nextTick(()=>{d.value=!0}))):(T.trim()===""&&o("update:modelValue",void 0),d.value=!1,r.nextTick(()=>{d.value=!0}))}}),h=r.computed(()=>{let T=[];return n.errorMessage&&T.push(n.errorMessage),w(n.modelValue)?(n.minValue!==void 0&&n.modelValue!==void 0&&n.modelValue<n.minValue&&T.push(`Model value must be higher than ${n.minValue}`),n.maxValue!==void 0&&n.modelValue!==void 0&&n.modelValue>n.maxValue&&T.push(`Model value must be less than ${n.maxValue}`)):T.push("Model value is not a number."),T=[...T],T.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 w(T){return T!==void 0?(T=T==null?void 0:T.toString(),!isNaN(+T)&&!isNaN(parseFloat(T))):!1}function b(){if(!m.value){let T=0;n.modelValue===void 0?T=n.minValue?n.minValue:0:T=+(n.modelValue||0)+n.step,p.value=T.toString()}}function E(){if(!y.value){let T=0;n.modelValue===void 0?T=0:T=+(n.modelValue||0)-n.step,p.value=n.minValue?Math.max(n.minValue,T).toString():T.toString()}}function $(T){["ArrowDown","ArrowUp"].includes(T.code)&&T.preventDefault(),T.code==="ArrowUp"?b():T.code==="ArrowDown"&&E()}const O=T=>{T.detail>1&&T.preventDefault()};return(T,P)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:i,class:r.normalizeClass([{error:!!h.value.trim(),disabled:T.disabled},"mi-number-field d-flex-column"]),onMousedown:O,onKeydown:P[1]||(P[1]=R=>$(R))},[r.createElementVNode("div",kx,[r.createVNode(wr,{class:"mi-number-field__contour"}),P[6]||(P[6]=r.createTextVNode()),r.createElementVNode("div",Ex,[T.label?(r.openBlock(),r.createElementBlock("label",Sx,[r.createTextVNode(r.toDisplayString(T.label)+" ",1),r.unref(l).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(T.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),P[2]||(P[2]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:c,"onUpdate:modelValue":P[0]||(P[0]=R=>p.value=R),disabled:T.disabled,placeholder:T.placeholder,class:"text-s flex-grow"},null,8,Tx),[[r.vModelText,p.value]])]),P[7]||(P[7]=r.createTextVNode()),r.createElementVNode("div",Nx,[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:b},P[3]||(P[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),P[5]||(P[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:E},P[4]||(P[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)])]),P[8]||(P[8]=r.createTextVNode()),h.value.trim()?(r.openBlock(),r.createElementBlock("div",Vx,r.toDisplayString(h.value),1)):r.createCommentVNode("",!0)],34))}}),Bx={class:"pl-chip__text"},Zl=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,i)=>(r.openBlock(),r.createBlock(r.unref(Ct),{position:"top",class:"pl-chip-tooltip",delay:500},r.createSlots({default:r.withCtx(()=>[i[4]||(i[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"chip",ref:e,class:r.normalizeClass(["pl-chip",{small:o.small}])},[r.createElementVNode("div",Bx,[r.renderSlot(o.$slots,"default")]),i[3]||(i[3]=r.createTextVNode()),o.closeable?(r.openBlock(),r.createElementBlock("div",{key:0,tabindex:"0",class:"pl-chip__close",onKeydown:i[0]||(i[0]=r.withKeys(l=>o.$emit("close"),["enter"])),onClick:i[1]||(i[1]=r.withModifiers(l=>o.$emit("close"),["stop"]))},i[2]||(i[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))}}),Px={class:"pl-multi-dropdown__envelope"},Rx=["tabindex"],Dx={class:"pl-multi-dropdown__container"},Ix={class:"pl-multi-dropdown__field"},Fx=["disabled","placeholder"],Lx={class:"pl-multi-dropdown__append"},Ox={key:0},Mx={key:0,class:"required-icon"},Gx={class:"pl-multi-dropdown__open-chips-container"},$x={key:0,class:"nothing-found"},zx={key:0,class:"pl-multi-dropdown__error"},Ux={key:1,class:"pl-multi-dropdown__helper"},Zx={name:"PlDropdownMulti"},Wx=r.defineComponent({...Zx,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=v=>n("update:modelValue",v),i=r.useSlots(),l=t,c=r.ref(),d=r.ref(),p=r.useTemplateRef("overlay"),h=r.reactive({search:"",activeOption:-1,open:!1,optionsHeight:0}),m=r.computed(()=>Array.isArray(l.modelValue)?l.modelValue:[]),y=r.computed(()=>h.open&&l.modelValue.length>0?l.placeholder:l.modelValue.length>0?"":l.placeholder),w=r.computed(()=>vr(l.options).filter(v=>Gl(m.value,v.value))),b=r.computed(()=>{const v=r.unref(m),L=vr(l.options);return(h.search?L.filter(U=>{const Q=h.search.toLowerCase();return U.label.toLowerCase().includes(Q)?!0:typeof U.value=="string"?U.value.toLowerCase().includes(Q):U.value===h.search}):[...L]).map(U=>({...U,selected:Gl(v,U.value)}))}),E=r.computed(()=>l.disabled?void 0:"0"),$=()=>{h.activeOption=wi(b.value.findIndex(v=>Gt(v.value,l.modelValue)),v=>v<0?0:v)},O=v=>{var L;const U=r.unref(m);o(Gl(U,v)?U.filter(Q=>!Gt(Q,v)):[...U,v]),h.search="",(L=c==null?void 0:c.value)==null||L.focus()},T=v=>o(r.unref(m).filter(L=>!Gt(L,v))),P=()=>{var v;return(v=d.value)==null?void 0:v.focus()},R=()=>h.open=!h.open,j=v=>{var L,U,Q,M;const Z=v.relatedTarget;console.log(">>>> overlay.value?.$el",(L=p.value)==null?void 0:L.$el),!((U=c.value)!=null&&U.contains(Z))&&!((M=(Q=p.value)==null?void 0:Q.listRef)!=null&&M.contains(Z))&&(h.search="",h.open=!1)},N=v=>{var L;const{open:U,activeOption:Q}=h;if(!U){v.code==="Enter"&&(h.open=!0);return}v.code==="Escape"&&(h.open=!1,(L=c.value)==null||L.focus());const M=r.unref(b),{length:Z}=M;if(!Z)return;["ArrowDown","ArrowUp","Enter"].includes(v.code)&&v.preventDefault(),v.code==="Enter"&&O(M[Q].value);const z=v.code==="ArrowDown"?1:v.code==="ArrowUp"?-1:0;h.activeOption=Math.abs(Q+z+Z)%Z,requestAnimationFrame(()=>{var B;return(B=p.value)==null?void 0:B.scrollIntoActive()})};return Xn(c),r.watch(()=>l.modelValue,()=>$(),{immediate:!0}),r.watchPostEffect(()=>{var v;h.search,h.open&&((v=p.value)==null||v.scrollIntoActive())}),(v,L)=>(r.openBlock(),r.createElementBlock("div",Px,[r.createElementVNode("div",{ref_key:"rootRef",ref:c,tabindex:E.value,class:r.normalizeClass(["pl-multi-dropdown",{open:h.open,error:v.error,disabled:v.disabled}]),onKeydown:N,onFocusout:j},[r.createElementVNode("div",Dx,[r.createElementVNode("div",Ix,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":L[0]||(L[0]=U=>h.search=U),type:"text",tabindex:"-1",disabled:v.disabled,placeholder:y.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:L[1]||(L[1]=U=>h.open=!0)},null,40,Fx),[[r.vModelText,h.search]]),L[3]||(L[3]=r.createTextVNode()),h.open?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"chips-container",onClick:P},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,(U,Q)=>(r.openBlock(),r.createBlock(r.unref(Zl),{key:Q,closeable:"",small:"",onClick:L[2]||(L[2]=r.withModifiers(M=>h.open=!0,["stop"])),onClose:M=>T(U.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(U.label||U.value),1)]),_:2},1032,["onClose"]))),128))])),L[4]||(L[4]=r.createTextVNode()),r.createElementVNode("div",{class:"arrow",onClick:r.withModifiers(R,["stop"])}),L[5]||(L[5]=r.createTextVNode()),r.createElementVNode("div",Lx,[r.renderSlot(v.$slots,"append")])]),L[10]||(L[10]=r.createTextVNode()),v.label?(r.openBlock(),r.createElementBlock("label",Ox,[v.required?(r.openBlock(),r.createElementBlock("i",Mx)):r.createCommentVNode("",!0),L[6]||(L[6]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(v.label),1),L[7]||(L[7]=r.createTextVNode()),r.unref(i).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(v.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),L[11]||(L[11]=r.createTextVNode()),h.open?(r.openBlock(),r.createBlock(Ul,{key:1,ref_key:"overlay",ref:p,root:c.value,class:"pl-multi-dropdown__options",gap:3,tabindex:"-1",onFocusout:j},{default:r.withCtx(()=>[r.createElementVNode("div",Gx,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,(U,Q)=>(r.openBlock(),r.createBlock(r.unref(Zl),{key:Q,closeable:"",small:"",onClose:M=>T(U.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(U.label||U.value),1)]),_:2},1032,["onClose"]))),128))]),L[8]||(L[8]=r.createTextVNode()),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(b.value,(U,Q)=>(r.openBlock(),r.createBlock(vo,{key:Q,option:U,"text-item":"text","is-selected":U.selected,"is-hovered":h.activeOption==Q,size:"medium","use-checkbox":"",onClick:r.withModifiers(M=>O(U.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),L[9]||(L[9]=r.createTextVNode()),b.value.length?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",$x,"Nothing found"))]),_:1},8,["root"])):r.createCommentVNode("",!0),L[12]||(L[12]=r.createTextVNode()),r.createVNode(wr,{class:"pl-multi-dropdown__contour"})])],42,Rx),L[13]||(L[13]=r.createTextVNode()),v.error?(r.openBlock(),r.createElementBlock("div",zx,r.toDisplayString(v.error),1)):v.helper?(r.openBlock(),r.createElementBlock("div",Ux,r.toDisplayString(v.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,i)=>(r.openBlock(),r.createElementBlock("div",{tabindex:"0",class:r.normalizeClass(["pl-checkbox-base",{checked:n.value,disabled:o.disabled}]),onClick:i[0]||(i[0]=l=>o.$emit("update:modelValue",!o.modelValue)),onKeydown:i[1]||(i[1]=r.withKeys(l=>o.$emit("update:modelValue",!o.modelValue),["enter"]))},null,34))}}),jx={name:"PlCheckbox"},Hx=r.defineComponent({...jx,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t){const e=t,n=r.useSlots();return(o,i)=>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":i[0]||(i[0]=l=>o.$emit("update:modelValue",l))}),null,16),i[3]||(i[3]=r.createTextVNode()),r.createElementVNode("label",{onClick:i[1]||(i[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":i[2]||(i[2]=l=>o.$emit("update:modelValue",l))}),null,16))}}),qx={key:0},Kx=["onClick"],Yx={name:"PlCheckboxGroup"},Xx=r.defineComponent({...Yx,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=t,i=c=>o.modelValue.includes(c),l=c=>{const d=o.modelValue??[];n("update:modelValue",i(c)?d.filter(p=>p!==c):[...d,c])};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["ui-checkbox-group",{disabled:c.disabled}])},[c.label?(r.openBlock(),r.createElementBlock("label",qx,r.toDisplayString(c.label),1)):r.createCommentVNode("",!0),d[1]||(d[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,h)=>(r.openBlock(),r.createElementBlock("div",{key:h},[r.createVNode(Wl,{disabled:c.disabled,label:p.label,"model-value":i(p.value),"onUpdate:modelValue":()=>l(p.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),d[0]||(d[0]=r.createTextVNode()),r.createElementVNode("label",{onClick:r.withModifiers(()=>l(p.value),["stop"])},r.toDisplayString(p.label),9,Kx)]))),128))],2))}}),Jx="_component_tupwt_1",Qx={component:Jx},ek={};function tk(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 nk={$style:Qx},wp=Mt(ek,[["render",tk],["__cssModules",nk]]),rk={key:1,class:"pl-dialog-modal__title"},ok={inheritAttrs:!1},jl=r.defineComponent({...ok,__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,i=t,l=r.ref(),c=r.useAttrs();function d(p){l.value&&i.closeOnOutsideClick&&document.contains(p.target)&&!l.value.contains(p.target)&&o("update:modelValue",!1)}return st(document.body,"keyup",p=>{i.modelValue&&p.code==="Escape"&&o("update:modelValue",!1)}),(p,h)=>(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:d},[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(wp,{key:0,class:"close-modal-btn",onClick:h[0]||(h[0]=r.withModifiers(m=>o("update:modelValue",!1),["stop"]))})):r.createCommentVNode("",!0),h[1]||(h[1]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",rk,[r.renderSlot(p.$slots,"title")])):r.createCommentVNode("",!0),h[2]||(h[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),h[3]||(h[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})]))}}),ik=r.defineComponent({__name:"TransitionSlidePanel",setup(t){function e(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(o,i)=>(r.openBlock(),r.createBlock(r.Transition,{name:"slide-panel",onAfterEnter:e,onAfterLeave:n},{default:r.withCtx(()=>[r.renderSlot(o.$slots,"default")]),_:3}))}}),sk={key:0,class:"pl-slide-modal__title"},ak={class:"pl-slide-modal__content"},lk={key:1,class:"pl-slide-modal__actions"},ck={name:"PlSlideModal",inheritAttrs:!1},Ds=r.defineComponent({...ck,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,i=t,l=r.ref(),c=r.useAttrs();return Bs(l,()=>{i.modelValue&&i.closeOnOutsideClick&&o("update:modelValue",!1)}),st(document,"keydown",d=>{d.key==="Escape"&&o("update:modelValue",!1)}),(d,p)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(ik,null,{default:r.withCtx(()=>[d.modelValue?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref_key:"modal",ref:l,style:{width:d.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(h=>o("update:modelValue",!1),["esc"]))}),[r.createElementVNode("div",{class:"close-dialog-btn",onClick:p[0]||(p[0]=h=>o("update:modelValue",!1))}),p[3]||(p[3]=r.createTextVNode()),r.unref(n).title?(r.openBlock(),r.createElementBlock("div",sk,[r.renderSlot(d.$slots,"title")])):r.createCommentVNode("",!0),p[4]||(p[4]=r.createTextVNode()),r.createElementVNode("div",ak,[r.renderSlot(d.$slots,"default")]),p[5]||(p[5]=r.createTextVNode()),r.unref(n).actions?(r.openBlock(),r.createElementBlock("div",lk,[r.renderSlot(d.$slots,"actions")])):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3}),p[6]||(p[6]=r.createTextVNode()),d.modelValue&&d.shadow?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-slide-modal__shadow",onKeyup:p[2]||(p[2]=r.withKeys(h=>o("update:modelValue",!1),["esc"]))},null,32)):r.createCommentVNode("",!0)]))}}),dk={key:0,class:"label"},uk={name:"PlToggleSwitch"},Is=r.defineComponent({...uk,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",dk,r.toDisplayString(e.label),1)):r.createCommentVNode("",!0)],34))}});function bp(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function pk(t){return r.unref(t)}const hk=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function fk(t,e,n={}){const{immediate:o=!0}=n,i=r.ref(!1);let l=null;function c(){l&&(clearTimeout(l),l=null)}function d(){i.value=!1,c()}function p(...h){c(),i.value=!0,l=setTimeout(()=>{i.value=!1,l=null,t(...h)},pk(e))}return o&&(i.value=!0,hk&&p()),bp(d),{isPending:r.readonly(i),start:p,stop:d}}function mk(t,e,n){return r.watch(t,(o,i,l)=>{o&&e(o,i,l)},{...n,once:!1})}function gk(t,e,n){const{start:o}=fk(l,e,{immediate:!1}),i=r.ref(!1);async function l(){i.value&&(await t(),o())}function c(){i.value||(i.value=!0,l())}function d(){i.value=!1}return n!=null&&n.immediate&&c(),bp(d),{isActive:i,pause:d,resume:c}}const yk="[==PROGRESS==]";function _k(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ck(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 d=t.mockPlatforma??window.platforma;if(!d){console.warn("Platforma API is not available");return}for(;;){const p=await d.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 h=t.progressPrefix??yk,m=new TextDecoder().decode(p.data).replace(new RegExp(`${_k(h)}`,"g"),"");if(c=Object.assign(c,{lines:c.lines+m,lastOffset:p.newOffset,finished:!p.live}),p.newOffset>=p.size)break}}const i=gk(()=>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 mk(()=>{var l;return(l=e==null?void 0:e.value)==null?void 0:l.finished},()=>i.pause()),r.watch(()=>t.logHandle,l=>{var c;l===void 0?(e.value=void 0,i.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,i.resume())},{immediate:!0}),e}const vk={key:0},wk={class:"pl-log-view__copy"},bk={key:1,class:"pl-log-view__error"},xk={name:"PlLogView"},xp=r.defineComponent({...xk,props:{value:{},logHandle:{},progressPrefix:{},error:{},output:{},maxRetries:{},mockPlatforma:{},label:{}},setup(t){const e=E=>{if(E&&E.ok===!1)return E.errors.join(`
|
|
53
|
+
`)},n=t,o=Ck(n),i=r.ref(!0),l=r.ref(),c=r.ref(),d=r.computed(()=>{var E;return((E=o.value)==null?void 0:E.error)??n.error??e(n.output)}),p=r.computed(()=>{var E;return((E=o.value)==null?void 0:E.lines)??n.value??tv(n.output)}),h=r.ref(!1);Xn(c);const m=r.computed(()=>h.value?"clipboard-copied":"clipboard"),y=()=>{h.value=!0,setTimeout(()=>{h.value=!1},1200),p.value&&typeof p.value=="string"&&navigator.clipboard.writeText(p.value)},w=()=>{_r(l.value,E=>{i.value&&E.scrollTo(E.scrollLeft,E.scrollHeight)})};r.watch(p,()=>{requestAnimationFrame(()=>{w()})},{immediate:!0});const b=E=>{const $=E.target;i.value=$.scrollTop+20>=$.scrollHeight-$.offsetHeight};return(E,$)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"root",ref:c,class:r.normalizeClass(["pl-log-view",{"has-error":d.value}])},[E.label?(r.openBlock(),r.createElementBlock("label",vk,r.toDisplayString(E.label),1)):r.createCommentVNode("",!0),$[1]||($[1]=r.createTextVNode()),r.createVNode(wr,{class:"pl-log-view__contour"}),$[2]||($[2]=r.createTextVNode()),r.createElementVNode("div",wk,[r.createVNode(r.unref(Ct),{"close-delay":800,position:"top"},{tooltip:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(h.value?"copied":"copy"),1)]),default:r.withCtx(()=>[r.createVNode(r.unref(xt),{title:"Copy content",name:m.value,onClick:y},null,8,["name"]),$[0]||($[0]=r.createTextVNode())]),_:1})]),$[3]||($[3]=r.createTextVNode()),d.value?(r.openBlock(),r.createElementBlock("div",bk,r.toDisplayString(d.value),1)):(r.openBlock(),r.createElementBlock("div",{key:2,ref_key:"contentRef",ref:l,class:"pl-log-view__content",onScroll:b},r.toDisplayString(p.value),545))],2))}}),kk="_component_1ukal_1",Ek="_tab_1ukal_14",Sk="_disabled_1ukal_27",Tk="_active_1ukal_56",Nk="_topLine_1ukal_69",xo={component:kk,tab:Ek,disabled:Sk,active:Tk,topLine:Nk},Vk=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 i=o.$el.querySelector("span");i&&requestAnimationFrame(()=>{i.offsetWidth<i.scrollWidth&&(n.isOverflown=!0)})}),(o,i)=>(r.openBlock(),r.createBlock(r.unref(Ct),{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"),i[0]||(i[0]=r.createTextVNode())]),_:3},8,["hide","data-is-overflown"]))}}),Ak={name:"PlTabs"},Bk=r.defineComponent({...Ak,props:{modelValue:{},options:{},disabled:{type:Boolean},topLine:{type:Boolean},maxTabWidth:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=i=>n("update:modelValue",i);return(i,l)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(xo).component,{[r.unref(xo).disabled]:i.disabled,[r.unref(xo).topLine]:i.topLine}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.options,(c,d)=>(r.openBlock(),r.createBlock(Vk,{key:d,tabindex:i.modelValue===c.value||i.disabled||c.disabled?void 0:0,option:c,class:r.normalizeClass([{[r.unref(xo).active]:i.modelValue===c.value,[r.unref(xo).disabled]:c.disabled},r.unref(xo).tab]),style:r.normalizeStyle({"--pl-tabs-item-max-width":c.maxWidth??i.maxTabWidth}),onKeydown:r.withKeys(p=>o(c.value),["enter"]),onClick:p=>o(c.value)},{default:r.withCtx(()=>[r.renderSlot(i.$slots,c.value,{option:c},()=>[r.createElementVNode("span",null,r.toDisplayString(c.label),1)])]),_:2},1032,["tabindex","option","class","style","onKeydown","onClick"]))),128))],2))}}),Pk=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))}}),Rk="_compact_rhd5u_16",Dk="_content_rhd5u_20",Ik={compact:Rk,content:Dk},Fk={$style:Ik},kp=Mt(Pk,[["__cssModules",Fk]]),Lk=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,i)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.renderSlot(o.$slots,"header"),i[0]||(i[0]=r.createTextVNode()),r.renderSlot(o.$slots,"default")],64))}}),Ok=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,i)=>(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}))}}),Mk=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"),i=Uu(),l=r.computed(()=>!n||n.value.multiple),c=r.computed({get(){return l.value?o.value:e?e.value===i:o.value},set(d){l.value?o.value=d:e&&(e.value=e.value===i?"":i)}});return(d,p)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(r.unref(kp),{class:r.normalizeClass(d.$style.separator),compact:d.compact,onClick:p[0]||(p[0]=h=>c.value=!c.value)},{default:r.withCtx(()=>[r.createVNode(r.unref(At),{name:"chevron-right",class:r.normalizeClass([{[d.$style.down]:c.value},d.$style.chevron])},null,8,["class"]),r.createTextVNode(" "+r.toDisplayString(d.label),1)]),_:1},8,["class","compact"]),p[1]||(p[1]=r.createTextVNode()),r.createVNode(Ok,null,{default:r.withCtx(()=>[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(d.$style.content)},[r.renderSlot(d.$slots,"default")],2)):r.createCommentVNode("",!0)]),_:3})],64))}}),Gk="_content_jmjfk_2",$k="_separator_jmjfk_14",zk="_chevron_jmjfk_19",Uk="_down_jmjfk_23",Zk={content:Gk,separator:$k,chevron:zk,down:Uk},Wk={$style:Zk},jk=Mt(Mk,[["__cssModules",Wk]]),Hk="_component_1ietr_1",qk="_local_1ietr_1",Kk="_supported_1ietr_26",Yk="_remote_1ietr_32",Xk="_search_1ietr_40",Jk="_selected_1ietr_72",Qk="_breadcrumbs_1ietr_86",eE="_cat_1ietr_116",tE="_message_1ietr_122",nE="_isFile_1ietr_197",rE="_isDir_1ietr_201",oE="_canBeSelected_1ietr_207",iE="_spin_1ietr_1",ct={component:Hk,local:qk,supported:Kk,remote:Yk,search:Xk,"ls-container":"_ls-container_1ietr_50","ls-head":"_ls-head_1ietr_57",selected:Jk,breadcrumbs:Qk,"ls-error":"_ls-error_1ietr_108",cat:eE,message:tE,"ls-empty":"_ls-empty_1ietr_131","ls-body":"_ls-body_1ietr_152",isFile:nE,isDir:rE,canBeSelected:oE,"ls-loader":"_ls-loader_1ietr_213","loader-icon":"_loader-icon_1ietr_221",spin:iE},sE=r.defineComponent({__name:"Shortcuts",setup(t){return(e,n)=>(r.openBlock(),r.createBlock(r.unref(Ct),{class:"info",position:"southwest","max-width":"420px"},{tooltip:r.withCtx(()=>[r.createElementVNode("span",{class:r.normalizeClass(e.$style.title)},"Shortcuts",2),n[2]||(n[2]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([e.$style.row,e.$style.head])},n[0]||(n[0]=[r.createElementVNode("div",null,null,-1),r.createTextVNode(),r.createElementVNode("div",null,"MacOS",-1),r.createTextVNode(),r.createElementVNode("div",null,"Windows/Linux",-1)]),2),n[3]||(n[3]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass([e.$style.row,e.$style.body])},n[1]||(n[1]=[r.createElementVNode("div",null,"Single File",-1),r.createTextVNode(),r.createElementVNode("div",null,"Click the file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Click the file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Adjacent multiple files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Shift, click first and last files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Shift, click first and last files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Non-adjacent multiple files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Command (⌘), click each file",-1),r.createTextVNode(),r.createElementVNode("div",null,"Hold Ctrl, click each file",-1),r.createTextVNode(),r.createElementVNode("div",null,"All files",-1),r.createTextVNode(),r.createElementVNode("div",null,"Press Command (⌘) + A",-1),r.createTextVNode(),r.createElementVNode("div",null,"Press Ctrl + A",-1)]),2)]),_:1}))}}),aE="_title_14dct_2",lE="_row_14dct_10",cE="_head_14dct_30",dE="_body_14dct_58",uE={title:aE,row:lE,head:cE,body:dE},pE={$style:uE},hE=Mt(sE,[["__cssModules",pE]]),Ep=()=>({dirPath:"",search:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1});function fE(t){return r.computed(()=>{let e=t.items;if(t.showHiddenItems||(e=e.filter(n=>!n.name.startsWith("."))),t.search){const n=t.search.toLocaleLowerCase();e=e.filter(o=>o.name.toLocaleLowerCase().includes(n))}return e})}const Sp={mounted:t=>{if(t.clientWidth<t.scrollWidth){const e=t.innerText;t.innerText=e.substring(0,57)+"..."+e.substring(e.length-10)}}};function Tp(t){return t?t.map(e=>"."+ov(e,["."])):void 0}function mE(t){const e=t.split("/");e[0]!==""&&e.unshift("");const 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).filter(i=>i!=="").join("/")});return n}const gE=["title","onClick"],yE={key:0,class:"ls-loader"},_E=["onClick"],CE=["title"],vE=["onClick"],wE=["title"],bE=r.defineComponent({__name:"Remote",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0},submit:{}},emits:["update:modelValue","import:files"],setup(t,{expose:e}){const n=N=>N.ctrlKey||N.metaKey,o=t,i=r.reactive(Ep()),l=()=>{i.search="",i.error="",i.lastSelected=void 0},c=r.computed(()=>Tp(o.extensions)),d=fE(i),p=r.computed(()=>{var N;return{modelValue:o.modelValue,dirPath:i.dirPath,storageHandle:(N=i.storageEntry)==null?void 0:N.handle}}),h=(N,v)=>{window.platforma&&i.currentLoadingPath!==v&&(i.currentLoadingPath=v,window.platforma.lsDriver.listFiles(N,v).then(L=>{v===i.dirPath&&(i.items=Ss(L).entries.map(U=>({path:U.fullPath,name:U.name,isDir:U.type==="dir",canBeSelected:U.type==="file"&&(!c.value||c.value.some(Q=>U.fullPath.endsWith(Q))),handle:U.type==="file"?U.handle:void 0,selected:!1})).sort((U,Q)=>U.isDir&&!Q.isDir?-1:!U.isDir&&Q.isDir?1:U.name.localeCompare(Q.name)).map((U,Q)=>({id:Q,...U})),i.lastSelected=void 0)}).catch(L=>i.error=String(L)).finally(()=>{i.currentLoadingPath=void 0}))},m=()=>{l();const{storageHandle:N,dirPath:v,modelValue:L}=p.value;N&&L&&h(N,v)},y=r.computed(()=>mE(i.dirPath)),w=r.computed(()=>i.items.filter(N=>N.canBeSelected&&N.selected&&!N.isDir)),b=r.computed(()=>{var N;return w.value.length>0&&((N=i.storageEntry)==null?void 0:N.handle)}),E=()=>{var N;return{storageHandle:Ss((N=i.storageEntry)==null?void 0:N.handle),files:w.value.map(v=>v.handle)}},$=N=>{i.dirPath=N},O=(N,v)=>{const{shiftKey:L}=N,U=n(N),{lastSelected:Q}=i;if(N.preventDefault(),v.canBeSelected){if(o.multi||i.items.forEach(M=>M.selected=!1),v.selected=!v.selected,!o.multi)return;!U&&!L&&i.items.forEach(M=>{M.id!==v.id&&(M.selected=!1)}),L&&Q!==void 0&&i.items.forEach(M=>{JC(M.id,Q,v.id)&&(M.selected=!0)}),v.selected&&(i.lastSelected=v.id)}},T=N=>{N&&!o.multi||i.items.filter(v=>v.canBeSelected).forEach(v=>{v.selected=N})},P=()=>T(!0),R=()=>T(!1),j=()=>{if(l(),R(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(N=>{N=N.filter(v=>v.name!=="local"&&!v.name.startsWith("local_disk_")),i.storageOptions=N.map(v=>({text:v.name,value:v})),o.autoSelectStorage&&_r(N[0],v=>{i.storageEntry=v})}).catch(N=>i.error=String(N))};return r.watch(r.toRef(i,"storageEntry"),N=>{l(),i.dirPath=(N==null?void 0:N.initialFullPath)??""},{immediate:!0}),r.watch([()=>i.dirPath,()=>i.storageEntry],()=>{m()}),r.watch(()=>o.modelValue,N=>{N?j():Object.assign(i,Ep())},{immediate:!0}),st(document,"keydown",N=>{if(!o.modelValue||N.target!==document.body)return;const v=n(N);v&&N.code==="KeyA"&&(N.preventDefault(),P()),v&&N.shiftKey&&N.code==="Period"&&(N.preventDefault(),i.showHiddenItems=!i.showHiddenItems),N.code==="Enter"&&o.submit()}),e({isReady:b,getFilesToImport:E}),r.onMounted(j),(N,v)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(ct).remote),onClick:r.withModifiers(R,["stop"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).search)},[r.createElementVNode("div",null,[r.createVNode(r.unref(bo),{modelValue:i.storageEntry,"onUpdate:modelValue":v[0]||(v[0]=L=>i.storageEntry=L),label:"Select storage",options:i.storageOptions},null,8,["modelValue","options"])]),v[2]||(v[2]=r.createTextVNode()),r.createElementVNode("div",null,[r.createVNode(r.unref(gp),{modelValue:i.search,"onUpdate:modelValue":v[1]||(v[1]=L=>i.search=L),label:"Search in folder",clearable:""},null,8,["modelValue"])])],2),v[12]||(v[12]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct)["ls-container"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct)["ls-head"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).breadcrumbs)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(L,U)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:U},[r.createElementVNode("div",{title:L.path,onClick:Q=>$(L.path)},r.toDisplayString(L.name),9,gE),v[3]||(v[3]=r.createTextVNode()),L.index!==y.value.length-1?(r.openBlock(),r.createBlock(r.unref(Hr),{key:0,name:"chevron-right"})):r.createCommentVNode("",!0)],64))),128))],2),v[5]||(v[5]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).selected)},[r.createElementVNode("span",null,"Selected: "+r.toDisplayString(w.value.length),1),v[4]||(v[4]=r.createTextVNode()),r.createVNode(hE)],2)],2),v[11]||(v[11]=r.createTextVNode()),i.currentLoadingPath!==void 0?(r.openBlock(),r.createElementBlock("div",yE,v[6]||(v[6]=[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):i.storageEntry?i.error?(r.openBlock(),r.createElementBlock("div",{key:2,class:r.normalizeClass(r.unref(ct)["ls-error"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).cat)},null,2),v[8]||(v[8]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).message)},r.toDisplayString(i.error),3)],2)):(r.openBlock(),r.createElementBlock("div",{key:3,class:r.normalizeClass(r.unref(ct)["ls-body"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d),L=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:L.id},[L.isDir?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(r.unref(ct).isDir),onClick:U=>$(L.path)},[r.createVNode(r.unref(Hr),{name:"chevron-right"}),v[9]||(v[9]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:L.name},[r.createTextVNode(r.toDisplayString(L.name),1)],8,CE)),[[r.unref(Sp)]])],10,_E)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass({[r.unref(ct).canBeSelected]:L.canBeSelected,[r.unref(ct).selected]:L.selected}),onClick:r.withModifiers(U=>O(U,L),["stop"])},[r.createVNode(r.unref(At),{name:"box",class:r.normalizeClass(r.unref(ct).isFile)},null,8,["class"]),v[10]||(v[10]=r.createTextVNode()),r.withDirectives((r.openBlock(),r.createElementBlock("span",{title:L.name},[r.createTextVNode(r.toDisplayString(L.name),1)],8,wE)),[[r.unref(Sp)]])],10,vE))],64))),128))],2)):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(r.unref(ct)["ls-empty"])},[r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).cat)},null,2),v[7]||(v[7]=r.createTextVNode()),r.createElementVNode("div",{class:r.normalizeClass(r.unref(ct).message)},"Select storage to preview",2)],2))],2)],2))}}),xE={key:1,class:"alert-error"},kE=r.defineComponent({__name:"Local",props:{importFiles:{type:Function},multi:{type:Boolean},extensions:{}},setup(t){const e=t,n=r.reactive({error:void 0}),o=r.computed(()=>e.multi?"Drag & Drop files here or click to add":"Drag & Drop file here or click to add"),i=async c=>{var d,p,h;const m=(p=(d=window.platforma)==null?void 0:d.lsDriver)==null?void 0:p.fileToImportHandle;if(!m)return console.error("API platforma.lsDriver.fileToImportHandle is not available");const y=Tp(e.extensions),w=await Promise.all([...((h=c.dataTransfer)==null?void 0:h.files)??[]].filter(b=>!!b).filter(b=>y?y.some(E=>b.name.endsWith(E)):!0).map(b=>m(b)));w.length&&e.importFiles({files:w})},l=async()=>{var c,d;const p=e.extensions?[{name:"All Files",extensions:e.extensions}]:[];e.multi?(c=window.platforma)==null||c.lsDriver.showOpenMultipleFilesDialog({title:"Select files to import",filters:p}).then(({files:h})=>{h&&e.importFiles({files:h})}).catch(h=>n.error=h):(d=window.platforma)==null||d.lsDriver.showOpenSingleFileDialog({title:"Select file to import",filters:p}).then(({file:h})=>{h&&e.importFiles({files:[h]})}).catch(h=>n.error=h)};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(r.unref(ct).local),onDrop:i,onDragover:d[0]||(d[0]=r.withModifiers(()=>{},["prevent"])),onClick:l},[r.createVNode(r.unref(Ps),{name:"cloud-upload"}),d[1]||(d[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(o.value),1),d[2]||(d[2]=r.createTextVNode()),c.extensions?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(r.unref(ct).supported)},"Supported formats: "+r.toDisplayString(c.extensions.join(", ")),3)):r.createCommentVNode("",!0),d[3]||(d[3]=r.createTextVNode()),n.error?(r.openBlock(),r.createElementBlock("span",xE,r.toDisplayString(n.error),1)):r.createCommentVNode("",!0)],34))}}),EE={style:{margin:"0 24px"}},Np=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,i=r.ref("local"),l=r.computed(()=>o.multi?"Select Files to Import":"Select File to Import"),c=[{label:"My Computer",value:"local"},{label:"Remote",value:"remote"}],d=()=>n("update:modelValue",!1),p=r.useTemplateRef("remote"),h=()=>{var y,w;(y=p.value)!=null&&y.isReady&&(n("import:files",Ss((w=p.value)==null?void 0:w.getFilesToImport())),d())},m=y=>{n("import:files",y),d()};return(y,w)=>(r.openBlock(),r.createBlock(r.unref(jl),{"no-content-gutters":!0,"close-on-outside-click":y.closeOnOutsideClick,class:r.normalizeClass(["pl-dialog-modal",r.unref(ct).component]),"model-value":y.modelValue,width:"688px",height:"720px","onUpdate:modelValue":d},r.createSlots({title:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(y.title??l.value),1)]),default:r.withCtx(()=>[w[4]||(w[4]=r.createTextVNode()),r.createElementVNode("div",EE,[r.createVNode(r.unref(dp),{modelValue:i.value,"onUpdate:modelValue":w[0]||(w[0]=b=>i.value=b),options:c},null,8,["modelValue"])]),w[5]||(w[5]=r.createTextVNode()),i.value==="remote"?(r.openBlock(),r.createBlock(bE,r.mergeProps({key:0,ref:"remote"},y.$props,{submit:h}),null,16)):r.createCommentVNode("",!0),w[6]||(w[6]=r.createTextVNode()),i.value==="local"?(r.openBlock(),r.createBlock(kE,r.mergeProps({key:1,"import-files":m},y.$props),null,16)):r.createCommentVNode("",!0),w[7]||(w[7]=r.createTextVNode())]),_:2},[i.value==="remote"?{name:"actions",fn:r.withCtx(()=>{var b;return[r.createVNode(r.unref(As),{style:{"min-width":"160px"},disabled:!((b=r.unref(p))!=null&&b.isReady),onClick:r.withModifiers(h,["stop"])},{default:r.withCtx(()=>w[1]||(w[1]=[r.createTextVNode("Import")])),_:1},8,["disabled"]),w[3]||(w[3]=r.createTextVNode()),r.createVNode(r.unref(wo),{"justify-center":!1,onClick:r.withModifiers(d,["stop"])},{default:r.withCtx(()=>w[2]||(w[2]=[r.createTextVNode("Cancel")])),_:1})]}),key:"0"}:void 0]),1032,["close-on-outside-click","class","model-value"]))}});var $e;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})($e||($e={}));var Hl;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Hl||(Hl={}));const le=$e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),br=t=>{switch(typeof t){case"undefined":return le.undefined;case"string":return le.string;case"number":return isNaN(t)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(t)?le.array:t===null?le.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?le.promise:typeof Map<"u"&&t instanceof Map?le.map:typeof Set<"u"&&t instanceof Set?le.set:typeof Date<"u"&&t instanceof Date?le.date:le.object;default:return le.unknown}},te=$e.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"]),SE=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class jt 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:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof jt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}jt.create=t=>new jt(t);const ko=(t,e)=>{let n;switch(t.code){case te.invalid_type:t.received===le.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,$e.jsonStringifyReplacer)}`;break;case te.unrecognized_keys:n=`Unrecognized key(s) in object: ${$e.joinValues(t.keys,", ")}`;break;case te.invalid_union:n="Invalid input";break;case te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${$e.joinValues(t.options)}`;break;case te.invalid_enum_value:n=`Invalid enum value. Expected ${$e.joinValues(t.options)}, received '${t.received}'`;break;case te.invalid_arguments:n="Invalid function arguments";break;case te.invalid_return_type:n="Invalid function return type";break;case te.invalid_date:n="Invalid date";break;case te.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}"`:$e.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case te.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 te.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 te.custom:n="Invalid input";break;case te.invalid_intersection_types:n="Intersection results could not be merged";break;case te.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case te.not_finite:n="Number must be finite";break;default:n=e.defaultError,$e.assertNever(t)}return{message:n}};let Vp=ko;function TE(t){Vp=t}function Fs(){return Vp}const Ls=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},NE=[];function se(t,e){const n=Fs(),o=Ls({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ko?void 0:ko].filter(i=>!!i)});t.common.issues.push(o)}class kt{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 i of n){if(i.status==="aborted")return xe;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return kt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return xe;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const xe=Object.freeze({status:"aborted"}),Os=t=>({status:"dirty",value:t}),Bt=t=>({status:"valid",value:t}),ql=t=>t.status==="aborted",Kl=t=>t.status==="dirty",bi=t=>t.status==="valid",xi=t=>typeof Promise<"u"&&t instanceof Promise;function Ms(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 Ap(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!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 fe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(fe||(fe={}));var ki,Ei;class Mn{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}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 Bp=(t,e)=>{if(bi(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 jt(t.common.issues);return this._error=n,this._error}}};function Ae(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=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:i}:{errorMap:(l,c)=>{var d,p;const{message:h}=t;return l.code==="invalid_enum_value"?{message:h??c.defaultError}:typeof c.data>"u"?{message:(d=h??o)!==null&&d!==void 0?d:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(p=h??n)!==null&&p!==void 0?p:c.defaultError}},description:i}}class Re{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 br(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:br(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new kt,ctx:{common:e.parent.common,data:e.data,parsedType:br(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(xi(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 i={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:br(e)},l=this._parseSync({data:e,path:i.path,parent:i});return Bp(i,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:br(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(xi(i)?i:Promise.resolve(i));return Bp(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:te.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new yn({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return $n.create(this,this._def)}nullable(){return Tr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gn.create(this,this._def)}promise(){return No.create(this,this._def)}or(e){return Vi.create([this,e],this._def)}and(e){return Ai.create(this,e,this._def)}transform(e){return new yn({...Ae(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ii({...Ae(this._def),innerType:this,defaultValue:n,typeName:we.ZodDefault})}brand(){return new Jl({typeName:we.ZodBranded,type:this,...Ae(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Fi({...Ae(this._def),innerType:this,catchValue:n,typeName:we.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Li.create(this,e)}readonly(){return Oi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const VE=/^c[^\s-]{8,}$/i,AE=/^[0-9a-z]+$/,BE=/^[0-9A-HJKMNP-TV-Z]{26}$/,PE=/^[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,RE=/^[a-z0-9_-]{21}$/i,DE=/^[-+]?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)?)??$/,IE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Yl;const LE=/^(?:(?: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])$/,OE=/^(([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})))$/,ME=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Pp="((\\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])))",GE=new RegExp(`^${Pp}$`);function Rp(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 $E(t){return new RegExp(`^${Rp(t)}$`)}function Dp(t){let e=`${Pp}T${Rp(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 zE(t,e){return!!((e==="v4"||!e)&&LE.test(t)||(e==="v6"||!e)&&OE.test(t))}class mn extends Re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==le.string){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:le.string,received:i.parsedType}),xe}const n=new kt;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const l=e.data.length>i.value,c=e.data.length<i.value;(l||c)&&(o=this._getOrReturnCtx(e,o),l?se(o,{code:te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&se(o,{code:te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")IE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"email",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Yl||(Yl=new RegExp(FE,"u")),Yl.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"emoji",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")PE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"uuid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")RE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"nanoid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")VE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"cuid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")AE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"cuid2",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")BE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"ulid",code:te.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),se(o,{validation:"url",code:te.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"regex",code:te.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Dp(i).test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?GE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?$E(i).test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{code:te.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?DE.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"duration",code:te.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?zE(e.data,i.version)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"ip",code:te.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?ME.test(e.data)||(o=this._getOrReturnCtx(e,o),se(o,{validation:"base64",code:te.invalid_string,message:i.message}),n.dirty()):$e.assertNever(i);return{status:n.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:te.invalid_string,...fe.errToObj(o)})}_addCheck(e){return new mn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...fe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...fe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...fe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...fe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...fe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...fe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...fe.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,...fe.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,...fe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...fe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...fe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...fe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...fe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...fe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...fe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...fe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...fe.errToObj(n)})}nonempty(e){return this.min(1,fe.errToObj(e))}trim(){return new mn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mn({...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}}mn.create=t=>{var e;return new mn({checks:[],typeName:we.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function UE(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class xr extends Re{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)!==le.number){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:le.number,received:i.parsedType}),xe}let n;const o=new kt;for(const i of this._def.checks)i.kind==="int"?$e.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:te.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?UE(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_finite,message:i.message}),o.dirty()):$e.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new xr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new xr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:fe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.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"&&$e.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)}}xr.create=t=>new xr({checks:[],typeName:we.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ae(t)});class kr extends Re{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)!==le.bigint){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:le.bigint,received:i.parsedType}),xe}let n;const o=new kt;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),se(n,{code:te.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):$e.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,fe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,fe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,fe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,fe.toString(n))}setLimit(e,n,o,i){return new kr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:fe.toString(i)}]})}_addCheck(e){return new kr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:fe.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}}kr.create=t=>{var e;return new kr({checks:[],typeName:we.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};class Si extends Re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==le.boolean){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.boolean,received:n.parsedType}),xe}return Bt(e.data)}}Si.create=t=>new Si({typeName:we.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ae(t)});class Kr extends Re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==le.date){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_type,expected:le.date,received:i.parsedType}),xe}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return se(i,{code:te.invalid_date}),xe}const n=new kt;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),se(o,{code:te.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):$e.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Kr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:fe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:fe.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}}Kr.create=t=>new Kr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:we.ZodDate,...Ae(t)});class Gs extends Re{_parse(e){if(this._getType(e)!==le.symbol){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.symbol,received:n.parsedType}),xe}return Bt(e.data)}}Gs.create=t=>new Gs({typeName:we.ZodSymbol,...Ae(t)});class Ti extends Re{_parse(e){if(this._getType(e)!==le.undefined){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.undefined,received:n.parsedType}),xe}return Bt(e.data)}}Ti.create=t=>new Ti({typeName:we.ZodUndefined,...Ae(t)});class Ni extends Re{_parse(e){if(this._getType(e)!==le.null){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.null,received:n.parsedType}),xe}return Bt(e.data)}}Ni.create=t=>new Ni({typeName:we.ZodNull,...Ae(t)});class Eo extends Re{constructor(){super(...arguments),this._any=!0}_parse(e){return Bt(e.data)}}Eo.create=t=>new Eo({typeName:we.ZodAny,...Ae(t)});class Yr extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Bt(e.data)}}Yr.create=t=>new Yr({typeName:we.ZodUnknown,...Ae(t)});class Jn extends Re{_parse(e){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.never,received:n.parsedType}),xe}}Jn.create=t=>new Jn({typeName:we.ZodNever,...Ae(t)});class $s extends Re{_parse(e){if(this._getType(e)!==le.undefined){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.void,received:n.parsedType}),xe}return Bt(e.data)}}$s.create=t=>new $s({typeName:we.ZodVoid,...Ae(t)});class gn extends Re{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==le.array)return se(n,{code:te.invalid_type,expected:le.array,received:n.parsedType}),xe;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(se(n,{code:c?te.too_big:te.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(se(n,{code:te.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(se(n,{code:te.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new Mn(n,c,n.path,d)))).then(c=>kt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new Mn(n,c,n.path,d)));return kt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new gn({...this._def,minLength:{value:e,message:fe.toString(n)}})}max(e,n){return new gn({...this._def,maxLength:{value:e,message:fe.toString(n)}})}length(e,n){return new gn({...this._def,exactLength:{value:e,message:fe.toString(n)}})}nonempty(e){return this.min(1,e)}}gn.create=(t,e)=>new gn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Ae(e)});function So(t){if(t instanceof rt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=$n.create(So(o))}return new rt({...t._def,shape:()=>e})}else return t instanceof gn?new gn({...t._def,type:So(t.element)}):t instanceof $n?$n.create(So(t.unwrap())):t instanceof Tr?Tr.create(So(t.unwrap())):t instanceof Gn?Gn.create(t.items.map(e=>So(e))):t}class rt extends Re{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=$e.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==le.object){const p=this._getOrReturnCtx(e);return se(p,{code:te.invalid_type,expected:le.object,received:p.parsedType}),xe}const{status:n,ctx:o}=this._processInputParams(e),{shape:i,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof Jn&&this._def.unknownKeys==="strip"))for(const p in o.data)l.includes(p)||c.push(p);const d=[];for(const p of l){const h=i[p],m=o.data[p];d.push({key:{status:"valid",value:p},value:h._parse(new Mn(o,m,o.path,p)),alwaysSet:p in o.data})}if(this._def.catchall instanceof Jn){const p=this._def.unknownKeys;if(p==="passthrough")for(const h of c)d.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(p==="strict")c.length>0&&(se(o,{code:te.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 h of c){const m=o.data[h];d.push({key:{status:"valid",value:h},value:p._parse(new Mn(o,m,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const p=[];for(const h of d){const m=await h.key,y=await h.value;p.push({key:m,value:y,alwaysSet:h.alwaysSet})}return p}).then(p=>kt.mergeObjectSync(n,p)):kt.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return fe.errToObj,new rt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=fe.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new rt({...this._def,unknownKeys:"strip"})}passthrough(){return new rt({...this._def,unknownKeys:"passthrough"})}extend(e){return new rt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new rt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:we.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new rt({...this._def,catchall:e})}pick(e){const n={};return $e.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new rt({...this._def,shape:()=>n})}omit(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new rt({...this._def,shape:()=>n})}deepPartial(){return So(this)}partial(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new rt({...this._def,shape:()=>n})}required(e){const n={};return $e.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof $n;)i=i._def.innerType;n[o]=i}}),new rt({...this._def,shape:()=>n})}keyof(){return Ip($e.objectKeys(this.shape))}}rt.create=(t,e)=>new rt({shape:()=>t,unknownKeys:"strip",catchall:Jn.create(),typeName:we.ZodObject,...Ae(e)}),rt.strictCreate=(t,e)=>new rt({shape:()=>t,unknownKeys:"strict",catchall:Jn.create(),typeName:we.ZodObject,...Ae(e)}),rt.lazycreate=(t,e)=>new rt({shape:t,unknownKeys:"strip",catchall:Jn.create(),typeName:we.ZodObject,...Ae(e)});class Vi extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new jt(d.ctx.common.issues));return se(n,{code:te.invalid_union,unionErrors:c}),xe}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(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new jt(p));return se(n,{code:te.invalid_union,unionErrors:d}),xe}}get options(){return this._def.options}}Vi.create=(t,e)=>new Vi({options:t,typeName:we.ZodUnion,...Ae(e)});const Er=t=>t instanceof Pi?Er(t.schema):t instanceof yn?Er(t.innerType()):t instanceof Ri?[t.value]:t instanceof Sr?t.options:t instanceof Di?$e.objectValues(t.enum):t instanceof Ii?Er(t._def.innerType):t instanceof Ti?[void 0]:t instanceof Ni?[null]:t instanceof $n?[void 0,...Er(t.unwrap())]:t instanceof Tr?[null,...Er(t.unwrap())]:t instanceof Jl||t instanceof Oi?Er(t.unwrap()):t instanceof Fi?Er(t._def.innerType):[];class zs extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.object)return se(n,{code:te.invalid_type,expected:le.object,received:n.parsedType}),xe;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);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}):(se(n,{code:te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),xe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=Er(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 d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new zs({typeName:we.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ae(o)})}}function Xl(t,e){const n=br(t),o=br(e);if(t===e)return{valid:!0,data:t};if(n===le.object&&o===le.object){const i=$e.objectKeys(e),l=$e.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=Xl(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===le.array&&o===le.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=Xl(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===le.date&&o===le.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ai extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(ql(l)||ql(c))return xe;const d=Xl(l.value,c.value);return d.valid?((Kl(l)||Kl(c))&&n.dirty(),{status:n.value,value:d.data}):(se(o,{code:te.invalid_intersection_types}),xe)};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])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Ai.create=(t,e,n)=>new Ai({left:t,right:e,typeName:we.ZodIntersection,...Ae(n)});class Gn extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.array)return se(o,{code:te.invalid_type,expected:le.array,received:o.parsedType}),xe;if(o.data.length<this._def.items.length)return se(o,{code:te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xe;!this._def.rest&&o.data.length>this._def.items.length&&(se(o,{code:te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...o.data].map((l,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new Mn(o,l,o.path,c)):null}).filter(l=>!!l);return o.common.async?Promise.all(i).then(l=>kt.mergeArray(n,l)):kt.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Gn({...this._def,rest:e})}}Gn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gn({items:t,typeName:we.ZodTuple,rest:null,...Ae(e)})};class Bi extends Re{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!==le.object)return se(o,{code:te.invalid_type,expected:le.object,received:o.parsedType}),xe;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new Mn(o,d,o.path,d)),value:c._parse(new Mn(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?kt.mergeObjectAsync(n,i):kt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Re?new Bi({keyType:e,valueType:n,typeName:we.ZodRecord,...Ae(o)}):new Bi({keyType:mn.create(),valueType:e,typeName:we.ZodRecord,...Ae(n)})}}class Us extends Re{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!==le.map)return se(o,{code:te.invalid_type,expected:le.map,received:o.parsedType}),xe;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new Mn(o,d,o.path,[h,"key"])),value:l._parse(new Mn(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return xe;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return xe;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}Us.create=(t,e,n)=>new Us({valueType:e,keyType:t,typeName:we.ZodMap,...Ae(n)});class Xr extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==le.set)return se(o,{code:te.invalid_type,expected:le.set,received:o.parsedType}),xe;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(se(o,{code:te.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(se(o,{code:te.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return xe;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new Mn(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Xr({...this._def,minSize:{value:e,message:fe.toString(n)}})}max(e,n){return new Xr({...this._def,maxSize:{value:e,message:fe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Xr.create=(t,e)=>new Xr({valueType:t,minSize:null,maxSize:null,typeName:we.ZodSet,...Ae(e)});class To extends Re{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.function)return se(n,{code:te.invalid_type,expected:le.function,received:n.parsedType}),xe;function o(d,p){return Ls({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Fs(),ko].filter(h=>!!h),issueData:{code:te.invalid_arguments,argumentsError:p}})}function i(d,p){return Ls({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Fs(),ko].filter(h=>!!h),issueData:{code:te.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof No){const d=this;return Bt(async function(...p){const h=new jt([]),m=await d._def.args.parseAsync(p,l).catch(w=>{throw h.addIssue(o(p,w)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(w=>{throw h.addIssue(i(y,w)),h})})}else{const d=this;return Bt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new jt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new jt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new To({...this._def,args:Gn.create(e).rest(Yr.create())})}returns(e){return new To({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new To({args:e||Gn.create([]).rest(Yr.create()),returns:n||Yr.create(),typeName:we.ZodFunction,...Ae(o)})}}class Pi extends Re{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})}}Pi.create=(t,e)=>new Pi({getter:t,typeName:we.ZodLazy,...Ae(e)});class Ri extends Re{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return se(n,{received:n.data,code:te.invalid_literal,expected:this._def.value}),xe}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ri.create=(t,e)=>new Ri({value:t,typeName:we.ZodLiteral,...Ae(e)});function Ip(t,e){return new Sr({values:t,typeName:we.ZodEnum,...Ae(e)})}class Sr extends Re{constructor(){super(...arguments),ki.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{expected:$e.joinValues(o),received:n.parsedType,code:te.invalid_type}),xe}if(Ms(this,ki)||Ap(this,ki,new Set(this._def.values)),!Ms(this,ki).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return se(n,{received:n.data,code:te.invalid_enum_value,options:o}),xe}return Bt(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 Sr.create(e,{...this._def,...n})}exclude(e,n=this._def){return Sr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}ki=new WeakMap,Sr.create=Ip;class Di extends Re{constructor(){super(...arguments),Ei.set(this,void 0)}_parse(e){const n=$e.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==le.string&&o.parsedType!==le.number){const i=$e.objectValues(n);return se(o,{expected:$e.joinValues(i),received:o.parsedType,code:te.invalid_type}),xe}if(Ms(this,Ei)||Ap(this,Ei,new Set($e.getValidEnumValues(this._def.values))),!Ms(this,Ei).has(e.data)){const i=$e.objectValues(n);return se(o,{received:o.data,code:te.invalid_enum_value,options:i}),xe}return Bt(e.data)}get enum(){return this._def.values}}Ei=new WeakMap,Di.create=(t,e)=>new Di({values:t,typeName:we.ZodNativeEnum,...Ae(e)});class No extends Re{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==le.promise&&n.common.async===!1)return se(n,{code:te.invalid_type,expected:le.promise,received:n.parsedType}),xe;const o=n.parsedType===le.promise?n.data:Promise.resolve(n.data);return Bt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}No.create=(t,e)=>new No({type:t,typeName:we.ZodPromise,...Ae(e)});class yn extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{se(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return xe;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?xe:p.status==="dirty"||n.value==="dirty"?Os(p.value):p});{if(n.value==="aborted")return xe;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?xe:d.status==="dirty"||n.value==="dirty"?Os(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,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 d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?xe:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?xe:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!bi(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>bi(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);$e.assertNever(i)}}yn.create=(t,e,n)=>new yn({schema:t,typeName:we.ZodEffects,effect:e,...Ae(n)}),yn.createWithPreprocess=(t,e,n)=>new yn({schema:e,effect:{type:"preprocess",transform:t},typeName:we.ZodEffects,...Ae(n)});class $n extends Re{_parse(e){return this._getType(e)===le.undefined?Bt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$n.create=(t,e)=>new $n({innerType:t,typeName:we.ZodOptional,...Ae(e)});class Tr extends Re{_parse(e){return this._getType(e)===le.null?Bt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Tr.create=(t,e)=>new Tr({innerType:t,typeName:we.ZodNullable,...Ae(e)});class Ii extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===le.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ii.create=(t,e)=>new Ii({innerType:t,typeName:we.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});class Fi extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return xi(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new jt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new jt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Fi.create=(t,e)=>new Fi({innerType:t,typeName:we.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});class Zs extends Re{_parse(e){if(this._getType(e)!==le.nan){const n=this._getOrReturnCtx(e);return se(n,{code:te.invalid_type,expected:le.nan,received:n.parsedType}),xe}return{status:"valid",value:e.data}}}Zs.create=t=>new Zs({typeName:we.ZodNaN,...Ae(t)});const ZE=Symbol("zod_brand");class Jl extends Re{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class Li extends Re{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),Os(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?xe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new Li({in:e,out:n,typeName:we.ZodPipeline})}}class Oi extends Re{_parse(e){const n=this._def.innerType._parse(e),o=i=>(bi(i)&&(i.value=Object.freeze(i.value)),i);return xi(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}Oi.create=(t,e)=>new Oi({innerType:t,typeName:we.ZodReadonly,...Ae(e)});function Fp(t,e={},n){return t?Eo.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):Eo.create()}const WE={object:rt.lazycreate};var we;(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"})(we||(we={}));const jE=(t,e={message:`Input not instance of ${t.name}`})=>Fp(n=>n instanceof t,e),Lp=mn.create,Op=xr.create,HE=Zs.create,qE=kr.create,Mp=Si.create,KE=Kr.create,YE=Gs.create,XE=Ti.create,JE=Ni.create,QE=Eo.create,eS=Yr.create,tS=Jn.create,nS=$s.create,rS=gn.create,oS=rt.create,iS=rt.strictCreate,sS=Vi.create,aS=zs.create,lS=Ai.create,cS=Gn.create,dS=Bi.create,uS=Us.create,pS=Xr.create,hS=To.create,fS=Pi.create,mS=Ri.create,gS=Sr.create,yS=Di.create,_S=No.create,Gp=yn.create,CS=$n.create,vS=Tr.create,wS=yn.createWithPreprocess,bS=Li.create;var zn=Object.freeze({__proto__:null,defaultErrorMap:ko,setErrorMap:TE,getErrorMap:Fs,makeIssue:Ls,EMPTY_PATH:NE,addIssueToContext:se,ParseStatus:kt,INVALID:xe,DIRTY:Os,OK:Bt,isAborted:ql,isDirty:Kl,isValid:bi,isAsync:xi,get util(){return $e},get objectUtil(){return Hl},ZodParsedType:le,getParsedType:br,ZodType:Re,datetimeRegex:Dp,ZodString:mn,ZodNumber:xr,ZodBigInt:kr,ZodBoolean:Si,ZodDate:Kr,ZodSymbol:Gs,ZodUndefined:Ti,ZodNull:Ni,ZodAny:Eo,ZodUnknown:Yr,ZodNever:Jn,ZodVoid:$s,ZodArray:gn,ZodObject:rt,ZodUnion:Vi,ZodDiscriminatedUnion:zs,ZodIntersection:Ai,ZodTuple:Gn,ZodRecord:Bi,ZodMap:Us,ZodSet:Xr,ZodFunction:To,ZodLazy:Pi,ZodLiteral:Ri,ZodEnum:Sr,ZodNativeEnum:Di,ZodPromise:No,ZodEffects:yn,ZodTransformer:yn,ZodOptional:$n,ZodNullable:Tr,ZodDefault:Ii,ZodCatch:Fi,ZodNaN:Zs,BRAND:ZE,ZodBranded:Jl,ZodPipeline:Li,ZodReadonly:Oi,custom:Fp,Schema:Re,ZodSchema:Re,late:WE,get ZodFirstPartyTypeKind(){return we},coerce:{string:t=>mn.create({...t,coerce:!0}),number:t=>xr.create({...t,coerce:!0}),boolean:t=>Si.create({...t,coerce:!0}),bigint:t=>kr.create({...t,coerce:!0}),date:t=>Kr.create({...t,coerce:!0})},any:QE,array:rS,bigint:qE,boolean:Mp,date:KE,discriminatedUnion:aS,effect:Gp,enum:gS,function:hS,instanceof:jE,intersection:lS,lazy:fS,literal:mS,map:uS,nan:HE,nativeEnum:yS,never:tS,null:JE,nullable:vS,number:Op,object:oS,oboolean:()=>Mp().optional(),onumber:()=>Op().optional(),optional:CS,ostring:()=>Lp().optional(),pipeline:bS,preprocess:wS,promise:_S,record:dS,set:pS,strictObject:iS,string:Lp,symbol:YE,transformer:Gp,tuple:cS,undefined:XE,union:sS,unknown:eS,void:nS,NEVER:xe,ZodIssueCode:te,quotelessJson:SE,ZodError:jt});function xS(t){throw new Error("Unexpected object: "+t)}const $p="upload://upload/",zp="index://index/";function kS(t){return t.startsWith($p)}function ES(t){return t.startsWith(zp)}function Up(t){if(ES(t)){const e=t.slice(zp.length);return JSON.parse(decodeURIComponent(e)).path}else if(kS(t)){const e=t.slice($p.length);return JSON.parse(decodeURIComponent(e)).localPath}xS(t)}function SS(t){return t.replace(/^.*[\\/]/,"")}function TS(t){return SS(Up(t))}zn.object({__isRef:zn.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:zn.string().describe("Upstream block id"),name:zn.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();const NS=zn.object({type:zn.string(),importance:zn.number().optional(),id:zn.string().optional(),label:zn.string()});zn.array(NS);const VS={key:0,ref:"label"},AS={key:0,class:"required-icon"},BS=["data-placeholder"],PS={key:5,class:"pl-file-input__stats"},RS={key:0,class:"pl-file-input__error"},DS={key:1,class:"pl-file-input__helper"},Zp=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},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,error:""}),o=r.useSlots(),i=e,l=t,c=(R,j)=>{if(R)try{return j(R)}catch(N){return n.error=N instanceof Error?N.message:String(N),R}},d=r.computed(()=>c(l.modelValue,TS)),p=r.computed(()=>c(l.modelValue,Up)),h=r.computed(()=>l.progress&&!l.progress.done),m=r.computed(()=>l.progress&&l.progress.done),y=r.computed(()=>n.error??l.error),w=r.computed(()=>!!y.value),b=r.computed(()=>{const{status:R,done:j}=l.progress??{};return!R||!R.bytesTotal?"":R.bytesProcessed&&!j?Sl(R.bytesProcessed,{})+" / "+Sl(R.bytesTotal,{}):Sl(R.bytesTotal,{})}),E=r.computed(()=>{var R;const{progress:j}=l;return j?{width:j.done?"100%":Math.round((((R=j.status)==null?void 0:R.progress)??0)*100)+"%"}:{}}),$=()=>{n.fileDialogOpen=!0},O=R=>{R.files.length&&i("update:modelValue",R.files[0])},T=()=>i("update:modelValue",void 0);r.watch(()=>l.modelValue,()=>{n.error=""},{immediate:!0});const P=r.ref();return l.cellStyle||Xn(P),(R,j)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"pl-file-input__cell-style":!!R.cellStyle,"has-file":!!d.value},"pl-file-input__envelope"])},[r.createElementVNode("div",{ref_key:"rootRef",ref:P,class:r.normalizeClass(["pl-file-input",{dashed:R.dashed,error:w.value}]),tabindex:"0",onKeyup:r.withKeys($,["enter"]),onClick:r.withModifiers($,["stop"])},[r.createElementVNode("div",{class:"pl-file-input__progress",style:r.normalizeStyle(E.value)},null,4),j[3]||(j[3]=r.createTextVNode()),!R.cellStyle&&R.label?(r.openBlock(),r.createElementBlock("label",VS,[R.required?(r.openBlock(),r.createElementBlock("i",AS)):r.createCommentVNode("",!0),j[1]||(j[1]=r.createTextVNode()),r.createElementVNode("span",null,r.toDisplayString(R.label),1),j[2]||(j[2]=r.createTextVNode()),r.unref(o).tooltip||p.value?(r.openBlock(),r.createBlock(r.unref(Ct),{key:1,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.unref(o).tooltip?r.renderSlot(R.$slots,"tooltip",{key:0}):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(p.value),1)],64))]),_:3})):r.createCommentVNode("",!0)],512)):r.createCommentVNode("",!0),j[4]||(j[4]=r.createTextVNode()),w.value?(r.openBlock(),r.createBlock(r.unref(xt),{key:1,name:"restart"})):h.value?(r.openBlock(),r.createBlock(r.unref(xt),{key:2,name:"cloud-upload"})):m.value?(r.openBlock(),r.createBlock(r.unref(xt),{key:3,name:"success"})):(r.openBlock(),r.createBlock(r.unref(xt),{key:4,name:"paper-clip"})),j[5]||(j[5]=r.createTextVNode()),r.createElementVNode("div",{"data-placeholder":R.placeholder??"Choose file",class:"pl-file-input__filename"},r.toDisplayString(d.value),9,BS),j[6]||(j[6]=r.createTextVNode()),b.value?(r.openBlock(),r.createElementBlock("div",PS,r.toDisplayString(b.value),1)):r.createCommentVNode("",!0),j[7]||(j[7]=r.createTextVNode()),R.modelValue?(r.openBlock(),r.createBlock(r.unref(xt),{key:6,name:"close",onClick:r.withModifiers(T,["stop"])})):r.createCommentVNode("",!0),j[8]||(j[8]=r.createTextVNode()),r.createVNode(wr,{class:"pl-file-input__contour"})],34),j[9]||(j[9]=r.createTextVNode()),w.value?(r.openBlock(),r.createElementBlock("div",RS,r.toDisplayString(y.value),1)):R.helper?(r.openBlock(),r.createElementBlock("div",DS,r.toDisplayString(R.helper),1)):r.createCommentVNode("",!0)],2),j[10]||(j[10]=r.createTextVNode()),r.createVNode(r.unref(Np),{modelValue:n.fileDialogOpen,"onUpdate:modelValue":j[0]||(j[0]=N=>n.fileDialogOpen=N),extensions:R.extensions,title:R.fileDialogTitle,"close-on-outside-click":R.fileDialogCloseOnOutsideClick,"onImport:files":O},null,8,["modelValue","extensions","title","close-on-outside-click"])],64))}}),IS={class:"pl-notification-alert__wrapper d-flex text-s"},FS={class:"pl-notification-alert__content flex-grow-1"},LS={key:0,class:"pl-notification-alert__close"},OS={key:0,class:"pl-notification-alert__actions d-flex"},Wp=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(i,l)=>n.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([i.type,"pl-notification-alert d-flex flex-column gap-16"]),style:r.normalizeStyle({width:`${i.width}`})},[r.createElementVNode("div",IS,[r.createElementVNode("div",FS,[r.renderSlot(i.$slots,"default")]),l[0]||(l[0]=r.createTextVNode()),i.closable?(r.openBlock(),r.createElementBlock("div",LS,[r.createVNode(r.unref(wo),{icon:"close",onClick:o})])):r.createCommentVNode("",!0)]),l[1]||(l[1]=r.createTextVNode()),i.$slots.actions?(r.openBlock(),r.createElementBlock("div",OS,[r.renderSlot(i.$slots,"actions")])):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0)}}),MS=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 Et(t,e,n){return e>t?e:t>n?n:t}const Ql=t=>r.computed(()=>{const e=[100],{min:n,max:o,step:i}=t.value;let l=n;for(;l<o;){l+=i;const c=(1-(Et(l,n,o)-n)/(o-n))*100;e.push(c)}return e}),GS={class:"ui-slider__wrapper"},$S={class:"ui-slider__label-section"},zS={key:0,class:"text-s"},US={key:1,class:"ui-slider__value-static text-s"},ZS={class:"ui-slider__base"},WS={class:"ui-slider__container"},jS={class:"ui-slider__container ui-slider__container-thumb"},HS={class:"ui-slider__input-wrapper d-flex"},qS=["value"],KS={key:0,class:"ui-slider__error"},jp=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,i=t,l=r.reactive({deltaValue:0}),c=r.computed(()=>i.max-i.min),d=r.computed(()=>Et((i.modelValue??0)+l.deltaValue,i.min,i.max)),p=r.ref(i.modelValue),h=r.computed(()=>{const N=i.modelValue;return Number.isFinite(N)?N<i.min?`Min value: ${i.min}`:N>i.max?`Max value: ${i.max}`:i.error:"Not a number"}),m=r.computed(()=>i),y=Ql(m),w=r.computed(()=>(d.value-i.min)/c.value),b=r.computed(()=>({right:Math.ceil((1-w.value)*100)+"%"})),E=r.computed(()=>({right:`calc(${Math.ceil((1-w.value)*100)}%) `})),$=r.ref(),O=r.ref();r.watch(()=>i.modelValue,N=>{p.value=N});function T(N){const v=Et(N,i.min,i.max);return Math.round((v+Number.EPSILON)*(1/i.step))/(1/i.step)}Cr(O,N=>{var v;_t((v=r.unref($))==null?void 0:v.getBoundingClientRect(),L=>{const{dx:U}=N;l.deltaValue=U/L.width*c.value,p.value=T(Et((i.modelValue??0)+l.deltaValue,i.min,i.max)),N.stop&&(o("update:modelValue",T(d.value)),l.deltaValue=0)})});function P(N){o("update:modelValue",T(N))}function R(N){P(+N.target.value)}function j(N){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(N.code)&&N.preventDefault();const v=N.code==="ArrowUp"||N.code==="ArrowRight"?i.step*1:N.code==="ArrowDown"||N.code==="ArrowLeft"?i.step*-1:0;P(i.modelValue+v)}return(N,v)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",GS,[r.createElementVNode("div",$S,[N.label?(r.openBlock(),r.createElementBlock("label",zS,[r.createElementVNode("span",null,r.toDisplayString(N.label),1),v[1]||(v[1]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(N.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),v[2]||(v[2]=r.createTextVNode()),i.mode==="text"?(r.openBlock(),r.createElementBlock("div",US,r.toDisplayString(p.value)+r.toDisplayString(N.measure),1)):r.createCommentVNode("",!0)]),v[6]||(v[6]=r.createTextVNode()),r.createElementVNode("div",ZS,[r.createElementVNode("div",WS,[r.createElementVNode("div",{ref_key:"barRef",ref:$,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(b.value)},null,4)],512)]),v[5]||(v[5]=r.createTextVNode()),r.createElementVNode("div",jS,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(y),(L,U)=>(r.openBlock(),r.createElementBlock("div",{key:U,style:r.normalizeStyle({right:`${L}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),v[4]||(v[4]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef",ref:O,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:r.normalizeStyle(E.value),onKeydown:j},v[3]||(v[3]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),v[7]||(v[7]=r.createTextVNode()),r.createElementVNode("div",HS,[i.mode==="input"?(r.openBlock(),r.createElementBlock("input",{key:0,value:p.value,class:"ui-slider__value text-s",onChange:v[0]||(v[0]=L=>R(L))},null,40,qS)):r.createCommentVNode("",!0)])],2),v[8]||(v[8]=r.createTextVNode()),h.value?(r.openBlock(),r.createElementBlock("div",KS,r.toDisplayString(h.value),1)):r.createCommentVNode("",!0)],2))}});function YS(t,e=null,n=null){function o(d){const{scrollTop:p,scrollHeight:h,clientHeight:m}=d;if(!(h>m)||!e)return null;const y=h-p-m,w=p>e?e:0,b=y>e?m-e-w:m;return`linear-gradient(
|
|
54
54
|
to bottom,
|
|
55
55
|
transparent,
|
|
56
56
|
black ${w}px,
|
|
57
|
-
black ${
|
|
57
|
+
black ${b}px,
|
|
58
58
|
transparent 100%
|
|
59
|
-
)`}function i(d){const{scrollLeft:p,scrollWidth:h,clientWidth:m}=d;if(!(h>m)||!n)return null;const y=h-p-m,w=p>n?n:0,
|
|
59
|
+
)`}function i(d){const{scrollLeft:p,scrollWidth:h,clientWidth:m}=d;if(!(h>m)||!n)return null;const y=h-p-m,w=p>n?n:0,b=y>n?m-n-w:m;return`linear-gradient(
|
|
60
60
|
to right,
|
|
61
61
|
transparent,
|
|
62
62
|
black ${w}px,
|
|
63
|
-
black ${
|
|
63
|
+
black ${b}px,
|
|
64
64
|
transparent 100%
|
|
65
|
-
)`}function l(){const d=t.value;if(!d)return;const p=[o(d),i(d)].filter(h=>h!==null);d.style.setProperty("-webkit-mask-image",p.join(",")),d.style.setProperty("mask-image",p.join(",")),p.length>1&&(d.style.setProperty("-webkit-mask-composite","source-in"),d.style.setProperty("mask-composite","source-in"))}const c=Al(l);r.onMounted(l),st(window,"scroll",c,!0),st(window,"resize",c,!0)}function Hp(t,e){up(()=>{_t(r.unref(t),n=>{pp(n,()=>e(n))})}),r.onUnmounted(()=>{_t(r.unref(t),n=>{hp(n)})})}const Tr={item:"sortable__item",animate:"sortable__animate"},Mi=t=>t.getBoundingClientRect().y,qp=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},HE=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function Kp(t,e){const n={item:void 0,options(){var v;return[...((v=t.value)==null?void 0:v.children)??[]]}},o=r.computed(()=>n.options()),i=e.shakeBuffer??10,l=e.reorderDelay??100;function c(v){const E=e.handle?this.querySelector(e.handle):null;E&&(E&&!E.contains(v.target)||(this.classList.remove(Tr.animate),this.classList.add(Tr.item),n.item={el:this,y:v.y,dy:0,orderChanged:!1}))}function d(v){const E=n.options();return E.slice(0,E.indexOf(v))}function p(v){const E=n.options();return E.slice(E.indexOf(v)+1)}function h(v,E){const z=n.options().filter(S=>S!==E),$=z.indexOf(v);return z.splice($,0,E),z}function m(v,E){const z=n.options().filter(S=>S!==E),$=z.indexOf(v);return z.splice($+1,0,E),z}function y(v,E){v.dy=E-v.y,v.el.style.setProperty("transform",`translateY(${v.dy}px)`)}function w(v){var E;if(!n.item)return;const{el:z}=n.item;if(!z.isConnected){n.item=void 0;return}const $=v.map(N=>Mi(N)),S=Mi(z);(E=t.value)==null||E.replaceChildren(...v);const B=Mi(z),D=v.map(N=>Mi(N)),H=[];for(let N=0;N<D.length;N++){const j=v[N];if(j===n.item.el)continue;const J=D[N],Z=$[N]-J;j.style.transform=`translateY(${Z}px)`,H.push(j)}const A=B-S;n.item.y=n.item.y+A,n.item.dy=n.item.dy-A,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),H.forEach(N=>N.classList.remove(Tr.animate)),requestAnimationFrame(function(){H.forEach(N=>{N.classList.add(Tr.animate),N.style.transform="",N.addEventListener("transitionend",()=>{N.classList.remove(Tr.animate)})})})}st(window,"mousemove",v=>{if(!n.item)return;const{el:E}=n.item;y(n.item,v.y);const z=Mi(n.item.el),$=HE(n.item.el),S=d(E),B=p(E);S.forEach(D=>{const H=qp(D);z+i<H&&w(h(D,E))}),B.forEach(D=>{const H=qp(D);$-i>H&&w(m(D,E))})}),st(window,"mouseup",()=>{if(!n.item)return;const{el:v,orderChanged:E}=n.item;v.classList.add(Tr.animate),v.style.removeProperty("transform"),v.addEventListener("transitionend",()=>{v.classList.remove(Tr.animate,Tr.item)}),setTimeout(()=>{if(!E)return;const z=n.options().map(S=>Number(S.getAttribute("data-index"))),$=t.value;if($){for(const S of n.options())$.removeChild(S);o.value.forEach(S=>{$.appendChild(S)})}e.onChange(z)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((v,E)=>{v.removeEventListener("mousedown",c),v.addEventListener("mousedown",c),v.setAttribute("data-index",String(E))})})}function qE(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function KE(t,e,n){const o=r.reactive({data:kl.deepClone(e(t.value)),changed:!1});return r.watch(()=>o.data,i=>{o.changed?n(kl.deepClone(i)):o.changed=!0},{deep:!0}),r.watch(t,i=>{Object.assign(o,{data:kl.deepClone(e(i)),changed:!1})},{deep:!0,immediate:!0}),o}function YE(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 hv(()=>{const i=n();this.run(...i).catch(console.error)},o)}});return e.run=e.run.bind(e),e}function XE(t,e){function n(c,d){const p=r.unref(t);if(!p)return;const h=`translate(${d.x-c.x}px, ${d.y-c.y}px)`;p.style.setProperty("transform",h),e(d)}function o(c){const d=p=>n(c,p);document.addEventListener("mousemove",d),document.addEventListener("mouseup",()=>{const p=r.unref(t);document.removeEventListener("mousemove",d),p&&(p.style.setProperty("transition","all .3s ease-in-out"),p.style.removeProperty("transform"),p.addEventListener("transitionend",()=>{p.style.removeProperty("transition")}))},{once:!0})}function i(){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(i),r.onUnmounted(l)}const JE={class:"ui-slider__wrapper"},QE={class:"ui-slider__label-section"},e1={key:0,class:"text-s"},t1={class:"ui-slider__base"},n1={class:"ui-slider__container"},r1={class:"ui-slider__container ui-slider__container-thumb"},o1=["data-percent"],i1=["data-percent"],s1=["data-percent"],a1={key:0,class:"ui-slider__error"},l1=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,i=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),c=r.ref(),d=r.ref(),p=r.ref(),h=r.ref(),m=r.computed(()=>i.max-i.min),y=r.computed(()=>i),w=Jl(y),v=r.computed(()=>St((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),E=r.computed(()=>St((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),z=r.computed(()=>St((i.modelValue[2]??0)+l.deltaValue3,i.min,i.max)),$=r.computed(()=>{const M=i.modelValue;if(!(Array.isArray(M)&&M.length===3&&M.every(X=>Number.isFinite(X))))return"Expected model [number, number, number]";const U=[];return[...i.modelValue].forEach(X=>{X>i.max&&U.push(`Max model value must be lower than max props ${i.max}.`),X<i.min&&U.push("Min model value must be greater than max props.")}),U.length>0?U.join(" "):i.error}),S=r.computed(()=>(v.value-i.min)/m.value),B=r.computed(()=>(E.value-i.min)/m.value),D=r.computed(()=>(z.value-i.min)/m.value),H=r.computed(()=>R()),A=r.computed(()=>({right:H.value[0]+"%",left:100-H.value[2]+"%"})),N=r.computed(()=>({right:Math.ceil((1-S.value)*100)+"%"})),j=r.computed(()=>({right:Math.ceil((1-B.value)*100)+"%"})),J=r.computed(()=>({right:Math.ceil((1-D.value)*100)+"%"}));_r(d,M=>{var U;_t((U=r.unref(c))==null?void 0:U.getBoundingClientRect(),X=>{const{dx:ne}=M;l.deltaValue1=ne/X.width*m.value,d.value&&Z(d.value,i.modelValue[0],l.deltaValue1),M.stop&&(G([O(v.value),O(E.value),O(z.value)]),l.deltaValue1=0)})}),_r(p,M=>{var U;_t((U=r.unref(c))==null?void 0:U.getBoundingClientRect(),X=>{const{dx:ne}=M;l.deltaValue2=ne/X.width*m.value,p.value&&Z(p.value,i.modelValue[1],l.deltaValue2),M.stop&&(G([O(v.value),O(E.value),O(z.value)]),l.deltaValue2=0)})}),_r(h,M=>{var U;_t((U=r.unref(c))==null?void 0:U.getBoundingClientRect(),X=>{const{dx:ne}=M;l.deltaValue3=ne/X.width*m.value,h.value&&Z(h.value,i.modelValue[2],l.deltaValue3),M.stop&&(G([O(v.value),O(E.value),O(z.value)]),l.deltaValue3=0)})});function Z(M,U,X){const ne=O(St((U??0)+X,i.min,i.max));M.dataset.percent=`${ne}${i.measure}`,P()}function R(){const M=Math.ceil((1-S.value)*100),U=Math.ceil((1-B.value)*100),X=Math.ceil((1-D.value)*100);return[M,U,X].sort((ne,de)=>ne-de)}function O(M){const U=St(M,i.min,i.max);return Math.round((U+Number.EPSILON)*(1/i.step))/(1/i.step)}function G(M){o("update:modelValue",M)}function P(){const M=Number(N.value.right.substring(0,N.value.right.length-1)),U=Number(j.value.right.substring(0,j.value.right.length-1)),X=Number(J.value.right.substring(0,J.value.right.length-1)),ne=[{r:M,th:d},{r:U,th:p},{r:X,th:h}].sort((de,me)=>de.r-me.r);ne[0].th.value&&(ne[0].th.value.dataset.hint="high"),ne[1].th.value&&(ne[1].th.value.dataset.hint="mid"),ne[2].th.value&&(ne[2].th.value.dataset.hint="low")}function T(M,U){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(M.code)&&M.preventDefault();const X=M.code==="ArrowUp"||M.code==="ArrowRight"?i.step*1:M.code==="ArrowDown"||M.code==="ArrowLeft"?i.step*-1:0,ne=[...i.modelValue];ne[U]=St(ne[U]+X,i.min,i.max),G(ne),P()}return r.onMounted(()=>{P()}),(M,U)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",JE,[r.createElementVNode("div",QE,[M.label?(r.openBlock(),r.createElementBlock("label",e1,[r.createElementVNode("span",null,r.toDisplayString(M.label),1),U[3]||(U[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(M.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),U[11]||(U[11]=r.createTextVNode()),r.createElementVNode("div",t1,[r.createElementVNode("div",n1,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(A.value)},null,4)],512)]),U[10]||(U[10]=r.createTextVNode()),r.createElementVNode("div",r1,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(w),(X,ne)=>(r.openBlock(),r.createElementBlock("div",{key:ne,style:r.normalizeStyle({right:`${X}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),U[7]||(U[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:d,style:r.normalizeStyle(N.value),"data-percent":i.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:U[0]||(U[0]=X=>T(X,0))},U[4]||(U[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,o1),U[8]||(U[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(j.value),"data-percent":i.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:U[1]||(U[1]=X=>T(X,1))},U[5]||(U[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,i1),U[9]||(U[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:h,style:r.normalizeStyle(J.value),"data-percent":i.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:U[2]||(U[2]=X=>T(X,2))},U[6]||(U[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,s1)])])]),U[12]||(U[12]=r.createTextVNode()),U[13]||(U[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),U[14]||(U[14]=r.createTextVNode()),$.value?(r.openBlock(),r.createElementBlock("div",a1,r.toDisplayString($.value),1)):r.createCommentVNode("",!0)],2))}}),c1={class:"ui-input-range__separator"},d1=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),c=r.computed(()=>(l.value,"ui-input-range-focused")),d=r.computed({get(){return{left:Math.min(...n.modelValue),right:Math.max(...n.modelValue)}},set(){}});r.watch(()=>d.value,m=>(i.left=m.left)&&(i.right=m.right));function p(){o("update:modelValue",[+i.left,+i.right]),o("change",[+i.left,+i.right])}function h(m,y){const w=y.target.value;/^[0-9]{0,2}$/.test(w)?m?i.left=+w:i.right=+w:m?i.left=+w.slice(0,w.length-1):i.right=+w.slice(0,w.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]=w=>d.value.left=w),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=w=>l.value=!0),onFocusout:y[2]||(y[2]=w=>l.value=!1),onInput:y[3]||(y[3]=w=>h(!0,w))},null,544),[[r.vModelText,d.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",c1,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=w=>d.value.right=w),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=w=>l.value=!0),onFocusout:y[6]||(y[6]=w=>l.value=!1),onInput:y[7]||(y[7]=w=>h(!1,w))},null,544),[[r.vModelText,d.value.right]])],16))}}),u1={class:"ui-slider__wrapper"},p1={class:"ui-slider__label-section"},h1={key:0,class:"text-s"},f1={key:1,class:"ui-slider__value-static text-s"},m1={class:"ui-slider__base"},g1={class:"ui-slider__container"},y1={class:"ui-slider__container ui-slider__container-thumb"},_1={class:"ui-slider__input-wrapper d-flex"},C1={key:0,class:"ui-slider__error"},v1=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,i=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),c=r.ref(),d=r.ref(),p=r.ref(),h=r.ref(i.modelValue),m=r.ref(i.modelValue[0]),y=r.ref(i.modelValue[1]),w=r.computed(()=>i),v=Jl(w),E=r.computed(()=>[m.value,y.value].sort((P,T)=>P-T).join("-")),z=r.computed(()=>i.max-i.min),$=r.computed(()=>St((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),S=r.computed(()=>St((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),B=r.computed(()=>{const P=i.modelValue;return Array.isArray(P)&&P.length===2&&P.every(T=>Number.isFinite(T))?i.error:"Expected model [number, number]"}),D=r.computed(()=>($.value-i.min)/z.value),H=r.computed(()=>(S.value-i.min)/z.value),A=r.computed(()=>Z()),N=r.computed(()=>({right:A.value[0]+"%",left:100-A.value[1]+"%"})),j=r.computed(()=>({right:Math.ceil((1-D.value)*100)+"%"})),J=r.computed(()=>({right:Math.ceil((1-H.value)*100)+"%"}));r.watch(()=>i.modelValue,P=>{h.value=P,m.value=+P[0],y.value=+P[1]},{immediate:!0}),_r(d,P=>{var T;_t((T=r.unref(c))==null?void 0:T.getBoundingClientRect(),M=>{const{dx:U}=P;l.deltaValue1=U/M.width*z.value,m.value=R(St((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),h.value=[m.value,y.value].sort((X,ne)=>X-ne),P.stop&&(O([R($.value),R(S.value)]),l.deltaValue1=0)})}),_r(p,P=>{var T;_t((T=r.unref(c))==null?void 0:T.getBoundingClientRect(),M=>{const{dx:U}=P;l.deltaValue2=U/M.width*z.value,y.value=R(St((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),h.value=[m.value,y.value].sort((X,ne)=>X-ne),P.stop&&(O([R($.value),R(S.value)]),l.deltaValue2=0)})});function Z(){const P=Math.ceil((1-D.value)*100),T=Math.ceil((1-H.value)*100);return[P,T].sort((M,U)=>M-U)}function R(P){const T=St(P,i.min,i.max);return Math.round((T+Number.EPSILON)*(1/i.step))/(1/i.step)}function O(P){o("update:modelValue",P)}function G(P,T){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(P.code)&&P.preventDefault();const M=P.code==="ArrowUp"||P.code==="ArrowRight"?i.step*1:P.code==="ArrowDown"||P.code==="ArrowLeft"?i.step*-1:0,U=[...i.modelValue];U[T]=St(U[T]+M,i.min,i.max),O(U)}return(P,T)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",u1,[r.createElementVNode("div",p1,[P.label?(r.openBlock(),r.createElementBlock("label",h1,[r.createElementVNode("span",null,r.toDisplayString(P.label),1),T[3]||(T[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(P.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),T[4]||(T[4]=r.createTextVNode()),i.mode==="text"?(r.openBlock(),r.createElementBlock("div",f1,r.toDisplayString(E.value),1)):r.createCommentVNode("",!0)]),T[10]||(T[10]=r.createTextVNode()),r.createElementVNode("div",m1,[r.createElementVNode("div",g1,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(N.value)},null,4)],512)]),T[9]||(T[9]=r.createTextVNode()),r.createElementVNode("div",y1,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(v),(M,U)=>(r.openBlock(),r.createElementBlock("div",{key:U,style:r.normalizeStyle({right:`${M}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),T[7]||(T[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:d,style:r.normalizeStyle(j.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:T[0]||(T[0]=M=>G(M,0))},T[5]||(T[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),T[8]||(T[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(J.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:T[1]||(T[1]=M=>G(M,1))},T[6]||(T[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),T[11]||(T[11]=r.createTextVNode()),r.createElementVNode("div",_1,[i.mode==="input"?(r.openBlock(),r.createBlock(d1,{key:0,modelValue:h.value,"onUpdate:modelValue":T[2]||(T[2]=M=>h.value=M),class:"ui-focused-border",onChange:O},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),T[12]||(T[12]=r.createTextVNode()),B.value?(r.openBlock(),r.createElementBlock("div",C1,r.toDisplayString(B.value),1)):r.createCommentVNode("",!0)],2))}}),w1=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.clientHeight/(o.scrollHeight||1)),c=r.computed(()=>l.value<1),d=r.computed(()=>{const p=r.unref(l);return{top:o.scrollTop*p+"px",height:Math.floor(o.clientHeight*p)+"px"}});return st(i,"pointerdown",p=>{const h={clientY:p.clientY},m=$l(document,"mousemove",y=>{const w=(y.clientY-h.clientY)/l.value;n("update:scrollTop",o.scrollTop+w),h.clientY=y.clientY});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,h)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:i,class:"v-scroll"},[r.createElementVNode("div",{class:"v-scroll__scrollbar",style:r.normalizeStyle(d.value)},null,4)],512)):r.createCommentVNode("",!0)}}),b1=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.clientWidth/(o.scrollWidth||1)),c=r.computed(()=>l.value<1),d=r.computed(()=>{const p=r.unref(l);return{left:o.scrollLeft*p+"px",width:Math.floor(o.clientWidth*p)+"px"}});return st(i,"pointerdown",p=>{const h={clientX:p.clientX},m=$l(document,"mousemove",y=>{const w=(y.clientX-h.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+w),h.clientX=y.clientX});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,h)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:i,class:"h-scroll"},[r.createElementVNode("div",{class:"h-scroll__scrollbar",style:r.normalizeStyle(d.value)},null,4)],512)):r.createCommentVNode("",!0)}}),x1={class:"ui-scrollable"},k1=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(d){Cw(n,d,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const i=d=>{d.preventDefault();const p=d.currentTarget;p.scrollTop+=d.deltaY,p.scrollLeft+=d.deltaX,o(p)};function l(d){_t(r.unref(e),p=>{p.scrollTop=d,o(p)})}function c(d){_t(r.unref(e),p=>{p.scrollLeft=d,o(p)})}return Hp(e,d=>{_t(d,p=>o(p))}),r.onMounted(()=>{_t(r.unref(e),d=>{o(d),d.addEventListener("wheel",i)})}),r.onUnmounted(()=>{_t(r.unref(e),d=>d.removeEventListener("wheel",i))}),(d,p)=>(r.openBlock(),r.createElementBlock("div",x1,[r.createElementVNode("div",{ref_key:"containerRef",ref:e,class:"ui-scrollable__container",onWheel:i},[r.renderSlot(d.$slots,"default")],544),p[2]||(p[2]=r.createTextVNode()),r.createVNode(w1,{"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(b1,{"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"])]))}}),S1="add.svg",E1="box.svg",T1="calendar.svg",N1="checkmark.svg",V1="clipboard.svg",A1="close.svg",B1="copy.svg",P1="download.svg",R1="duplicate.svg",D1="edit.svg",I1="error.svg",F1="filter.svg",L1="help.svg",O1="info.svg",M1="link.svg",G1="loading.svg",$1="lock.svg",z1="maximize.svg",U1="minimize.svg",Z1="minus.svg",W1="more.svg",j1="open.svg",H1="pause.svg",q1="play.svg",K1="renew.svg",Y1="restart.svg",X1="reverse.svg",J1="settings.svg",Q1="sort.svg",eT="stop.svg",tT="success.svg",nT="time.svg",rT="tune.svg",oT="warning.svg",iT="zip.svg",sT={add:S1,"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:E1,calendar:T1,"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:N1,"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:V1,close:A1,copy:B1,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:P1,"drag-dots":"drag-dots.svg",duplicate:R1,edit:D1,error:I1,export:"export.svg","filter-on":"filter-on.svg",filter:F1,"help-outline":"help-outline.svg",help:L1,"info-outline":"info-outline.svg",info:O1,"jump-link":"jump-link.svg",link:M1,loading:G1,lock:$1,maximize:z1,minimize:U1,minus:Z1,more:W1,open:j1,"paper-clip":"paper-clip.svg",pause:H1,play:q1,renew:K1,restart:Y1,reverse:X1,settings:J1,sort:Q1,stop:eT,success:tT,time:nT,tune:rT,warning:oT,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:iT},aT="add.svg",lT="annotate.svg",cT="annotation.svg",dT="area.svg",uT="axes.svg",pT="bar.svg",hT="bindot.svg",fT="box.svg",mT="boxplot.svg",gT="bubble.svg",yT="calendar.svg",_T="canvas.svg",CT="checkbox.svg",vT="checkmark.svg",wT="clipboard.svg",bT="close.svg",xT="cluster.svg",kT="code.svg",ST="color.svg",ET="columns.svg",TT="container.svg",NT="cookie.svg",VT="copy.svg",AT="cpu.svg",BT="debug.svg",PT="dna.svg",RT="download.svg",DT="duplicate.svg",IT="edit.svg",FT="error.svg",LT="filter.svg",OT="generate.svg",MT="graph.svg",GT="heatmap.svg",$T="help.svg",zT="info.svg",UT="jitter.svg",ZT="lasso.svg",WT="layers.svg",jT="learn.svg",HT="legend.svg",qT="line.svg",KT="link.svg",YT="loading.svg",XT="lock.svg",JT="maximize.svg",QT="menu.svg",eN="minimize.svg",tN="minus.svg",nN="more.svg",rN="pause.svg",oN="pin.svg",iN="play.svg",sN="product.svg",aN="publications.svg",lN="renew.svg",cN="restart.svg",dN="reverse.svg",uN="search.svg",pN="server.svg",hN="settings.svg",fN="sina.svg",mN="skatterplot.svg",gN="slice.svg",yN="sort.svg",_N="statistics.svg",CN="stop.svg",vN="success.svg",wN="table.svg",bN="template.svg",xN="terminal.svg",kN="time.svg",SN="tune.svg",EN="venn.svg",TN="violin.svg",NN="warning.svg",VN="wetlab.svg",AN="zip.svg",BN={"add-layer":"add-layer.svg",add:aT,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:lT,annotation:cT,area:dT,"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:uT,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:pT,bindot:hT,box:fT,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:mT,bubble:gT,calendar:yT,canvas:_T,"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:CT,checkmark:vT,"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:wT,close:bT,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:xT,code:kT,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:ST,columns:ET,"connected-points":"connected-points.svg",container:TT,cookie:NT,copy:VT,cpu:AT,"data-dimentions":"data-dimentions.svg",debug:BT,"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:PT,download:RT,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:DT,edit:IT,"error-bar":"error-bar.svg",error:FT,"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:LT,"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:OT,graph:MT,heatmap:GT,"help-outline":"help-outline.svg",help:$T,"info-outline":"info-outline.svg",info:zT,jitter:UT,"jump-link":"jump-link.svg",lasso:ZT,layers:WT,learn:jT,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:HT,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:qT,"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:KT,loading:YT,lock:XT,maximize:JT,menu:QT,minimize:eN,minus:tN,more:nN,"paper-clip":"paper-clip.svg",pause:rN,pin:oN,play:iN,"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:sN,publications:aN,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:lN,restart:cN,reverse:dN,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:uN,"server-on":"server-on.svg",server:pN,settings:hN,sina:fN,skatterplot:mN,slice:gN,"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:yN,statistics:_N,stop:CN,"strip-plot":"strip-plot.svg",success:vN,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:wN,template:bN,terminal:xN,"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:kN,tune:SN,venn:EN,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:TN,warning:NN,wetlab:VN,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:AN,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function PN(){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 RN=["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"],DN=["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"],IN={allCssVariables:PN(),icons16:sT,icons24:BN},FN={class:"block__not-found"},LN=r.defineComponent({__name:"NotFound",setup(t){const n=wl().useApp(),o=()=>{n.updateNavigationState(i=>{i.href="/"})};return(i,l)=>(r.openBlock(),r.createElementBlock("div",FN,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(Dl),{onClick:r.withModifiers(o,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),Ql=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},ON={},MN={class:"block__loader-page"};function GN(t,e){return r.openBlock(),r.createElementBlock("div",MN,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const $N=Ql(ON,[["render",GN]]),zN={class:"pl-app-notification-alert"},UN={class:"pl-app-notification-alert__content"},ZN={class:"pl-app-notification-alert__title"},WN=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),o=r.ref(!0),i=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(d=>!!d)},{immediate:!0,deep:!0}),(c,d)=>(r.openBlock(),r.createElementBlock("div",zN,[r.createVNode(r.unref(Wl),{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=p=>n.value=p),width:"720px",style:{"max-height":"100vh"}},{title:r.withCtx(()=>d[2]||(d[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",UN,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,p=>{var h;return r.openBlock(),r.createElementBlock("div",{key:p[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",ZN,r.toDisplayString(p[0]),1),r.createVNode(r.unref(xp),{value:(h=p[1])==null?void 0:h.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(Wp),{modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=p=>o.value=p),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(Vs),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>d[3]||(d[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(lp))]),default:r.withCtx(()=>[d[4]||(d[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),jN={key:0,class:"block__loader"},HN=r.defineComponent({__name:"BlockLoader",props:{value:{type:[Boolean,Number]}},setup(t){const e=t,n=r.computed(()=>typeof e.value=="boolean"&&e.value),o=r.computed(()=>{const i=e.value;if(typeof i=="number")return i>=1?void 0:(i*100).toFixed(2)+"%"});return(i,l)=>n.value?(r.openBlock(),r.createElementBlock("div",jN)):o.value!==void 0?(r.openBlock(),r.createElementBlock("div",{key:1,class:"block__progress",style:r.normalizeStyle({"--progress-width":o.value})},null,4)):r.createCommentVNode("",!0)}}),qN={class:"block block__layout"},KN={key:0},YN=r.defineComponent({__name:"BlockLayout",setup(t){const e=wl(),n=h=>{try{return new URL(h,"http://dummy").pathname}catch{console.error("Invalid href",h);return}},o=r.computed(()=>e.loaded?e.useApp().href:void 0),i=r.computed(()=>{if(e.loaded){const h=e.useApp(),m=n(h.snapshot.navigationState.href);return m?h.getRoute(m):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),c=r.computed(()=>l.value?l.value.model.outputErrors:{}),d=r.computed(()=>{var h;return((h=l.value)==null?void 0:h.showErrorsNotification)??!0}),p=r.computed(()=>{var h,m;return(m=(h=l.value)==null?void 0:h.progress)==null?void 0:m.call(h)});return(h,m)=>(r.openBlock(),r.createElementBlock("div",qN,[r.createVNode(HN,{value:p.value},null,8,["value"]),r.unref(e).error?(r.openBlock(),r.createElementBlock("div",KN,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?i.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.value),{key:o.value})):(r.openBlock(),r.createBlock(LN,{key:3})):(r.openBlock(),r.createBlock($N,{key:1},{default:r.withCtx(()=>m[0]||(m[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&d.value?(r.openBlock(),r.createBlock(r.unref(WN),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var Zs={exports:{}};/**
|
|
65
|
+
)`}function l(){const d=t.value;if(!d)return;const p=[o(d),i(d)].filter(h=>h!==null);d.style.setProperty("-webkit-mask-image",p.join(",")),d.style.setProperty("mask-image",p.join(",")),p.length>1&&(d.style.setProperty("-webkit-mask-composite","source-in"),d.style.setProperty("mask-composite","source-in"))}const c=Bl(l);r.onMounted(l),st(window,"scroll",c,!0),st(window,"resize",c,!0)}function Hp(t,e){up(()=>{_t(r.unref(t),n=>{pp(n,()=>e(n))})}),r.onUnmounted(()=>{_t(r.unref(t),n=>{hp(n)})})}const Nr={item:"sortable__item",animate:"sortable__animate"},Mi=t=>t.getBoundingClientRect().y,qp=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+Math.ceil(n/2)},XS=t=>{const{y:e,height:n}=t.getBoundingClientRect();return e+n};function Kp(t,e){const n={item:void 0,options(){var b;return[...((b=t.value)==null?void 0:b.children)??[]]}},o=r.computed(()=>n.options()),i=e.shakeBuffer??10,l=e.reorderDelay??100;function c(b){const E=e.handle?this.querySelector(e.handle):null;E&&(E&&!E.contains(b.target)||(this.classList.remove(Nr.animate),this.classList.add(Nr.item),n.item={el:this,y:b.y,dy:0,orderChanged:!1}))}function d(b){const E=n.options();return E.slice(0,E.indexOf(b))}function p(b){const E=n.options();return E.slice(E.indexOf(b)+1)}function h(b,E){const $=n.options().filter(T=>T!==E),O=$.indexOf(b);return $.splice(O,0,E),$}function m(b,E){const $=n.options().filter(T=>T!==E),O=$.indexOf(b);return $.splice(O+1,0,E),$}function y(b,E){b.dy=E-b.y,b.el.style.setProperty("transform",`translateY(${b.dy}px)`)}function w(b){var E;if(!n.item)return;const{el:$}=n.item;if(!$.isConnected){n.item=void 0;return}const O=b.map(v=>Mi(v)),T=Mi($);(E=t.value)==null||E.replaceChildren(...b);const P=Mi($),R=b.map(v=>Mi(v)),j=[];for(let v=0;v<R.length;v++){const L=b[v];if(L===n.item.el)continue;const U=R[v],Q=O[v]-U;L.style.transform=`translateY(${Q}px)`,j.push(L)}const N=P-T;n.item.y=n.item.y+N,n.item.dy=n.item.dy-N,n.item.orderChanged=!0,n.item.el.style.setProperty("transform",`translateY(${n.item.dy}px)`),j.forEach(v=>v.classList.remove(Nr.animate)),requestAnimationFrame(function(){j.forEach(v=>{v.classList.add(Nr.animate),v.style.transform="",v.addEventListener("transitionend",()=>{v.classList.remove(Nr.animate)})})})}st(window,"mousemove",b=>{if(!n.item)return;const{el:E}=n.item;y(n.item,b.y);const $=Mi(n.item.el),O=XS(n.item.el),T=d(E),P=p(E);T.forEach(R=>{const j=qp(R);$+i<j&&w(h(R,E))}),P.forEach(R=>{const j=qp(R);O-i>j&&w(m(R,E))})}),st(window,"mouseup",()=>{if(!n.item)return;const{el:b,orderChanged:E}=n.item;b.classList.add(Nr.animate),b.style.removeProperty("transform"),b.addEventListener("transitionend",()=>{b.classList.remove(Nr.animate,Nr.item)}),setTimeout(()=>{if(!E)return;const $=n.options().map(T=>Number(T.getAttribute("data-index"))),O=t.value;if(O){for(const T of n.options())O.removeChild(T);o.value.forEach(T=>{O.appendChild(T)})}e.onChange($)},l),n.item=void 0}),r.watchEffect(()=>{o.value.forEach((b,E)=>{b.removeEventListener("mousedown",c),b.addEventListener("mousedown",c),b.setAttribute("data-index",String(E))})})}function JS(t,e){let n;r.onMounted(()=>{n=setInterval(t,e)}),r.onUnmounted(()=>clearInterval(n))}function QS(t,e,n){const o=r.reactive({data:El.deepClone(e(t.value)),changed:!1});return r.watch(()=>o.data,i=>{o.changed?n(El.deepClone(i)):o.changed=!0},{deep:!0}),r.watch(t,i=>{Object.assign(o,{data:El.deepClone(e(i)),changed:!1})},{deep:!0,immediate:!0}),o}function e1(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 yv(()=>{const i=n();this.run(...i).catch(console.error)},o)}});return e.run=e.run.bind(e),e}function t1(t,e){function n(c,d){const p=r.unref(t);if(!p)return;const h=`translate(${d.x-c.x}px, ${d.y-c.y}px)`;p.style.setProperty("transform",h),e(d)}function o(c){const d=p=>n(c,p);document.addEventListener("mousemove",d),document.addEventListener("mouseup",()=>{const p=r.unref(t);document.removeEventListener("mousemove",d),p&&(p.style.setProperty("transition","all .3s ease-in-out"),p.style.removeProperty("transform"),p.addEventListener("transitionend",()=>{p.style.removeProperty("transition")}))},{once:!0})}function i(){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(i),r.onUnmounted(l)}const n1={class:"ui-slider__wrapper"},r1={class:"ui-slider__label-section"},o1={key:0,class:"text-s"},i1={class:"ui-slider__base"},s1={class:"ui-slider__container"},a1={class:"ui-slider__container ui-slider__container-thumb"},l1=["data-percent"],c1=["data-percent"],d1=["data-percent"],u1={key:0,class:"ui-slider__error"},p1=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,i=t,l=r.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),c=r.ref(),d=r.ref(),p=r.ref(),h=r.ref(),m=r.computed(()=>i.max-i.min),y=r.computed(()=>i),w=Ql(y),b=r.computed(()=>Et((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),E=r.computed(()=>Et((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),$=r.computed(()=>Et((i.modelValue[2]??0)+l.deltaValue3,i.min,i.max)),O=r.computed(()=>{const G=i.modelValue;if(!(Array.isArray(G)&&G.length===3&&G.every(X=>Number.isFinite(X))))return"Expected model [number, number, number]";const H=[];return[...i.modelValue].forEach(X=>{X>i.max&&H.push(`Max model value must be lower than max props ${i.max}.`),X<i.min&&H.push("Min model value must be greater than max props.")}),H.length>0?H.join(" "):i.error}),T=r.computed(()=>(b.value-i.min)/m.value),P=r.computed(()=>(E.value-i.min)/m.value),R=r.computed(()=>($.value-i.min)/m.value),j=r.computed(()=>M()),N=r.computed(()=>({right:j.value[0]+"%",left:100-j.value[2]+"%"})),v=r.computed(()=>({right:Math.ceil((1-T.value)*100)+"%"})),L=r.computed(()=>({right:Math.ceil((1-P.value)*100)+"%"})),U=r.computed(()=>({right:Math.ceil((1-R.value)*100)+"%"}));Cr(d,G=>{var H;_t((H=r.unref(c))==null?void 0:H.getBoundingClientRect(),X=>{const{dx:ne}=G;l.deltaValue1=ne/X.width*m.value,d.value&&Q(d.value,i.modelValue[0],l.deltaValue1),G.stop&&(z([Z(b.value),Z(E.value),Z($.value)]),l.deltaValue1=0)})}),Cr(p,G=>{var H;_t((H=r.unref(c))==null?void 0:H.getBoundingClientRect(),X=>{const{dx:ne}=G;l.deltaValue2=ne/X.width*m.value,p.value&&Q(p.value,i.modelValue[1],l.deltaValue2),G.stop&&(z([Z(b.value),Z(E.value),Z($.value)]),l.deltaValue2=0)})}),Cr(h,G=>{var H;_t((H=r.unref(c))==null?void 0:H.getBoundingClientRect(),X=>{const{dx:ne}=G;l.deltaValue3=ne/X.width*m.value,h.value&&Q(h.value,i.modelValue[2],l.deltaValue3),G.stop&&(z([Z(b.value),Z(E.value),Z($.value)]),l.deltaValue3=0)})});function Q(G,H,X){const ne=Z(Et((H??0)+X,i.min,i.max));G.dataset.percent=`${ne}${i.measure}`,B()}function M(){const G=Math.ceil((1-T.value)*100),H=Math.ceil((1-P.value)*100),X=Math.ceil((1-R.value)*100);return[G,H,X].sort((ne,de)=>ne-de)}function Z(G){const H=Et(G,i.min,i.max);return Math.round((H+Number.EPSILON)*(1/i.step))/(1/i.step)}function z(G){o("update:modelValue",G)}function B(){const G=Number(v.value.right.substring(0,v.value.right.length-1)),H=Number(L.value.right.substring(0,L.value.right.length-1)),X=Number(U.value.right.substring(0,U.value.right.length-1)),ne=[{r:G,th:d},{r:H,th:p},{r:X,th:h}].sort((de,me)=>de.r-me.r);ne[0].th.value&&(ne[0].th.value.dataset.hint="high"),ne[1].th.value&&(ne[1].th.value.dataset.hint="mid"),ne[2].th.value&&(ne[2].th.value.dataset.hint="low")}function A(G,H){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(G.code)&&G.preventDefault();const X=G.code==="ArrowUp"||G.code==="ArrowRight"?i.step*1:G.code==="ArrowDown"||G.code==="ArrowLeft"?i.step*-1:0,ne=[...i.modelValue];ne[H]=Et(ne[H]+X,i.min,i.max),z(ne),B()}return r.onMounted(()=>{B()}),(G,H)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",n1,[r.createElementVNode("div",r1,[G.label?(r.openBlock(),r.createElementBlock("label",o1,[r.createElementVNode("span",null,r.toDisplayString(G.label),1),H[3]||(H[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(G.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),H[11]||(H[11]=r.createTextVNode()),r.createElementVNode("div",i1,[r.createElementVNode("div",s1,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(N.value)},null,4)],512)]),H[10]||(H[10]=r.createTextVNode()),r.createElementVNode("div",a1,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(w),(X,ne)=>(r.openBlock(),r.createElementBlock("div",{key:ne,style:r.normalizeStyle({right:`${X}%`}),class:"ui-slider__thumb-step"},null,4))),128)):r.createCommentVNode("",!0),H[7]||(H[7]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef1",ref:d,style:r.normalizeStyle(v.value),"data-percent":i.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:H[0]||(H[0]=X=>A(X,0))},H[4]||(H[4]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,l1),H[8]||(H[8]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef2",ref:p,style:r.normalizeStyle(L.value),"data-percent":i.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:H[1]||(H[1]=X=>A(X,1))},H[5]||(H[5]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,c1),H[9]||(H[9]=r.createTextVNode()),r.createElementVNode("div",{ref_key:"thumbRef3",ref:h,style:r.normalizeStyle(U.value),"data-percent":i.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:H[2]||(H[2]=X=>A(X,2))},H[6]||(H[6]=[r.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,d1)])])]),H[12]||(H[12]=r.createTextVNode()),H[13]||(H[13]=r.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),H[14]||(H[14]=r.createTextVNode()),O.value?(r.openBlock(),r.createElementBlock("div",u1,r.toDisplayString(O.value),1)):r.createCommentVNode("",!0)],2))}}),h1={class:"ui-input-range__separator"},f1=r.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.reactive({left:n.modelValue[0],right:n.modelValue[1]}),l=r.ref(!1),c=r.computed(()=>(l.value,"ui-input-range-focused")),d=r.computed({get(){return{left:Math.min(...n.modelValue),right:Math.max(...n.modelValue)}},set(){}});r.watch(()=>d.value,m=>(i.left=m.left)&&(i.right=m.right));function p(){o("update:modelValue",[+i.left,+i.right]),o("change",[+i.left,+i.right])}function h(m,y){const w=y.target.value;/^[0-9]{0,2}$/.test(w)?m?i.left=+w:i.right=+w:m?i.left=+w.slice(0,w.length-1):i.right=+w.slice(0,w.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]=w=>d.value.left=w),class:"text-s",type:"text",onChange:p,onFocus:y[1]||(y[1]=w=>l.value=!0),onFocusout:y[2]||(y[2]=w=>l.value=!1),onInput:y[3]||(y[3]=w=>h(!0,w))},null,544),[[r.vModelText,d.value.left]]),y[8]||(y[8]=r.createTextVNode()),r.createElementVNode("div",h1,r.toDisplayString(n.separator),1),y[9]||(y[9]=r.createTextVNode()),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":y[4]||(y[4]=w=>d.value.right=w),class:"text-s",type:"text",onChange:p,onFocus:y[5]||(y[5]=w=>l.value=!0),onFocusout:y[6]||(y[6]=w=>l.value=!1),onInput:y[7]||(y[7]=w=>h(!1,w))},null,544),[[r.vModelText,d.value.right]])],16))}}),m1={class:"ui-slider__wrapper"},g1={class:"ui-slider__label-section"},y1={key:0,class:"text-s"},_1={key:1,class:"ui-slider__value-static text-s"},C1={class:"ui-slider__base"},v1={class:"ui-slider__container"},w1={class:"ui-slider__container ui-slider__container-thumb"},b1={class:"ui-slider__input-wrapper d-flex"},x1={key:0,class:"ui-slider__error"},k1=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,i=t,l=r.reactive({deltaValue1:0,deltaValue2:0}),c=r.ref(),d=r.ref(),p=r.ref(),h=r.ref(i.modelValue),m=r.ref(i.modelValue[0]),y=r.ref(i.modelValue[1]),w=r.computed(()=>i),b=Ql(w),E=r.computed(()=>[m.value,y.value].sort((B,A)=>B-A).join("-")),$=r.computed(()=>i.max-i.min),O=r.computed(()=>Et((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),T=r.computed(()=>Et((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),P=r.computed(()=>{const B=i.modelValue;return Array.isArray(B)&&B.length===2&&B.every(A=>Number.isFinite(A))?i.error:"Expected model [number, number]"}),R=r.computed(()=>(O.value-i.min)/$.value),j=r.computed(()=>(T.value-i.min)/$.value),N=r.computed(()=>Q()),v=r.computed(()=>({right:N.value[0]+"%",left:100-N.value[1]+"%"})),L=r.computed(()=>({right:Math.ceil((1-R.value)*100)+"%"})),U=r.computed(()=>({right:Math.ceil((1-j.value)*100)+"%"}));r.watch(()=>i.modelValue,B=>{h.value=B,m.value=+B[0],y.value=+B[1]},{immediate:!0}),Cr(d,B=>{var A;_t((A=r.unref(c))==null?void 0:A.getBoundingClientRect(),G=>{const{dx:H}=B;l.deltaValue1=H/G.width*$.value,m.value=M(Et((i.modelValue[0]??0)+l.deltaValue1,i.min,i.max)),h.value=[m.value,y.value].sort((X,ne)=>X-ne),B.stop&&(Z([M(O.value),M(T.value)]),l.deltaValue1=0)})}),Cr(p,B=>{var A;_t((A=r.unref(c))==null?void 0:A.getBoundingClientRect(),G=>{const{dx:H}=B;l.deltaValue2=H/G.width*$.value,y.value=M(Et((i.modelValue[1]??0)+l.deltaValue2,i.min,i.max)),h.value=[m.value,y.value].sort((X,ne)=>X-ne),B.stop&&(Z([M(O.value),M(T.value)]),l.deltaValue2=0)})});function Q(){const B=Math.ceil((1-R.value)*100),A=Math.ceil((1-j.value)*100);return[B,A].sort((G,H)=>G-H)}function M(B){const A=Et(B,i.min,i.max);return Math.round((A+Number.EPSILON)*(1/i.step))/(1/i.step)}function Z(B){o("update:modelValue",B)}function z(B,A){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(B.code)&&B.preventDefault();const G=B.code==="ArrowUp"||B.code==="ArrowRight"?i.step*1:B.code==="ArrowDown"||B.code==="ArrowLeft"?i.step*-1:0,H=[...i.modelValue];H[A]=Et(H[A]+G,i.min,i.max),Z(H)}return(B,A)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([i.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[r.createElementVNode("div",{class:r.normalizeClass([`ui-slider__mode-${i.mode}`,"ui-slider"])},[r.createElementVNode("div",m1,[r.createElementVNode("div",g1,[B.label?(r.openBlock(),r.createElementBlock("label",y1,[r.createElementVNode("span",null,r.toDisplayString(B.label),1),A[3]||(A[3]=r.createTextVNode()),r.unref(n).tooltip?(r.openBlock(),r.createBlock(r.unref(Ct),{key:0,class:"info",position:"top"},{tooltip:r.withCtx(()=>[r.renderSlot(B.$slots,"tooltip")]),_:3})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),A[4]||(A[4]=r.createTextVNode()),i.mode==="text"?(r.openBlock(),r.createElementBlock("div",_1,r.toDisplayString(E.value),1)):r.createCommentVNode("",!0)]),A[10]||(A[10]=r.createTextVNode()),r.createElementVNode("div",C1,[r.createElementVNode("div",v1,[r.createElementVNode("div",{ref_key:"barRef",ref:c,class:"ui-slider__bar"},[r.createElementVNode("div",{class:"ui-slider__progress",style:r.normalizeStyle(v.value)},null,4)],512)]),A[9]||(A[9]=r.createTextVNode()),r.createElementVNode("div",w1,[i.breakpoints?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(b),(G,H)=>(r.openBlock(),r.createElementBlock("div",{key:H,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:d,style:r.normalizeStyle(L.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(U.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",b1,[i.mode==="input"?(r.openBlock(),r.createBlock(f1,{key:0,modelValue:h.value,"onUpdate:modelValue":A[2]||(A[2]=G=>h.value=G),class:"ui-focused-border",onChange:Z},null,8,["modelValue"])):r.createCommentVNode("",!0)])],2),A[12]||(A[12]=r.createTextVNode()),P.value?(r.openBlock(),r.createElementBlock("div",x1,r.toDisplayString(P.value),1)):r.createCommentVNode("",!0)],2))}}),E1=r.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.clientHeight/(o.scrollHeight||1)),c=r.computed(()=>l.value<1),d=r.computed(()=>{const p=r.unref(l);return{top:o.scrollTop*p+"px",height:Math.floor(o.clientHeight*p)+"px"}});return st(i,"pointerdown",p=>{const h={clientY:p.clientY},m=zl(document,"mousemove",y=>{const w=(y.clientY-h.clientY)/l.value;n("update:scrollTop",o.scrollTop+w),h.clientY=y.clientY});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,h)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:i,class:"v-scroll"},[r.createElementVNode("div",{class:"v-scroll__scrollbar",style:r.normalizeStyle(d.value)},null,4)],512)):r.createCommentVNode("",!0)}}),S1=r.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(t,{emit:e}){const n=e,o=t,i=r.ref(),l=r.computed(()=>o.clientWidth/(o.scrollWidth||1)),c=r.computed(()=>l.value<1),d=r.computed(()=>{const p=r.unref(l);return{left:o.scrollLeft*p+"px",width:Math.floor(o.clientWidth*p)+"px"}});return st(i,"pointerdown",p=>{const h={clientX:p.clientX},m=zl(document,"mousemove",y=>{const w=(y.clientX-h.clientX)/l.value;n("update:scrollLeft",o.scrollLeft+w),h.clientX=y.clientX});["mouseup","pointercancel"].forEach(y=>{document.addEventListener(y,m,{once:!0})})}),(p,h)=>c.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:i,class:"h-scroll"},[r.createElementVNode("div",{class:"h-scroll__scrollbar",style:r.normalizeStyle(d.value)},null,4)],512)):r.createCommentVNode("",!0)}}),T1={class:"ui-scrollable"},N1=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(d){xw(n,d,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const i=d=>{d.preventDefault();const p=d.currentTarget;p.scrollTop+=d.deltaY,p.scrollLeft+=d.deltaX,o(p)};function l(d){_t(r.unref(e),p=>{p.scrollTop=d,o(p)})}function c(d){_t(r.unref(e),p=>{p.scrollLeft=d,o(p)})}return Hp(e,d=>{_t(d,p=>o(p))}),r.onMounted(()=>{_t(r.unref(e),d=>{o(d),d.addEventListener("wheel",i)})}),r.onUnmounted(()=>{_t(r.unref(e),d=>d.removeEventListener("wheel",i))}),(d,p)=>(r.openBlock(),r.createElementBlock("div",T1,[r.createElementVNode("div",{ref_key:"containerRef",ref:e,class:"ui-scrollable__container",onWheel:i},[r.renderSlot(d.$slots,"default")],544),p[2]||(p[2]=r.createTextVNode()),r.createVNode(E1,{"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(S1,{"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"])]))}}),V1="add.svg",A1="box.svg",B1="calendar.svg",P1="checkmark.svg",R1="clipboard.svg",D1="close.svg",I1="copy.svg",F1="download.svg",L1="duplicate.svg",O1="edit.svg",M1="error.svg",G1="filter.svg",$1="help.svg",z1="info.svg",U1="link.svg",Z1="loading.svg",W1="lock.svg",j1="maximize.svg",H1="minimize.svg",q1="minus.svg",K1="more.svg",Y1="open.svg",X1="pause.svg",J1="play.svg",Q1="renew.svg",eT="restart.svg",tT="reverse.svg",nT="settings.svg",rT="sort.svg",oT="stop.svg",iT="success.svg",sT="time.svg",aT="tune.svg",lT="warning.svg",cT="zip.svg",dT={add:V1,"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:A1,calendar:B1,"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:P1,"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:R1,close:D1,copy:I1,"data-dimentions":"data-dimentions.svg","delete-bin":"delete-bin.svg","delete-circle":"delete-circle.svg","delete-clear":"delete-clear.svg",download:F1,"drag-dots":"drag-dots.svg",duplicate:L1,edit:O1,error:M1,export:"export.svg","filter-on":"filter-on.svg",filter:G1,"help-outline":"help-outline.svg",help:$1,"info-outline":"info-outline.svg",info:z1,"jump-link":"jump-link.svg",link:U1,loading:Z1,lock:W1,maximize:j1,minimize:H1,minus:q1,more:K1,open:Y1,"paper-clip":"paper-clip.svg",pause:X1,play:J1,renew:Q1,restart:eT,reverse:tT,settings:nT,sort:rT,stop:oT,success:iT,time:sT,tune:aT,warning:lT,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:cT},uT="add.svg",pT="annotate.svg",hT="annotation.svg",fT="area.svg",mT="axes.svg",gT="bar.svg",yT="bindot.svg",_T="box.svg",CT="boxplot.svg",vT="bubble.svg",wT="calendar.svg",bT="canvas.svg",xT="checkbox.svg",kT="checkmark.svg",ET="clipboard.svg",ST="close.svg",TT="cluster.svg",NT="code.svg",VT="color.svg",AT="columns.svg",BT="container.svg",PT="cookie.svg",RT="copy.svg",DT="cpu.svg",IT="debug.svg",FT="dna.svg",LT="download.svg",OT="duplicate.svg",MT="edit.svg",GT="error.svg",$T="filter.svg",zT="generate.svg",UT="graph.svg",ZT="heatmap.svg",WT="help.svg",jT="info.svg",HT="jitter.svg",qT="lasso.svg",KT="layers.svg",YT="learn.svg",XT="legend.svg",JT="line.svg",QT="link.svg",eN="loading.svg",tN="lock.svg",nN="maximize.svg",rN="menu.svg",oN="minimize.svg",iN="minus.svg",sN="more.svg",aN="pause.svg",lN="pin.svg",cN="play.svg",dN="product.svg",uN="publications.svg",pN="renew.svg",hN="restart.svg",fN="reverse.svg",mN="search.svg",gN="server.svg",yN="settings.svg",_N="sina.svg",CN="skatterplot.svg",vN="slice.svg",wN="sort.svg",bN="statistics.svg",xN="stop.svg",kN="success.svg",EN="table.svg",SN="template.svg",TN="terminal.svg",NN="time.svg",VN="tune.svg",AN="venn.svg",BN="violin.svg",PN="warning.svg",RN="wetlab.svg",DN="zip.svg",IN={"add-layer":"add-layer.svg",add:uT,"align-center":"align-center.svg","align-left":"align-left.svg","align-right":"align-right.svg",annotate:pT,annotation:hT,area:fT,"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:mT,"bar-cross":"bar-cross.svg","bar-error":"bar-error.svg","bar-stacked":"bar-stacked.svg","bar-trend":"bar-trend.svg",bar:gT,bindot:yT,box:_T,"boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:CT,bubble:vT,calendar:wT,canvas:bT,"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:xT,checkmark:kT,"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:ET,close:ST,"cloud-download":"cloud-download.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-upload":"cloud-upload.svg",cluster:TT,code:NT,"color-fill":"color-fill.svg","color-none":"color-none.svg","color-stroke":"color-stroke.svg",color:VT,columns:AT,"connected-points":"connected-points.svg",container:BT,cookie:PT,copy:RT,cpu:DT,"data-dimentions":"data-dimentions.svg",debug:IT,"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:FT,download:LT,"drag-dots":"drag-dots.svg","drag-horizontal":"drag-horizontal.svg","drag-vertical":"drag-vertical.svg",duplicate:OT,edit:MT,"error-bar":"error-bar.svg",error:GT,"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:$T,"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:zT,graph:UT,heatmap:ZT,"help-outline":"help-outline.svg",help:WT,"info-outline":"info-outline.svg",info:jT,jitter:HT,"jump-link":"jump-link.svg",lasso:qT,layers:KT,learn:YT,"legend-box-dot":"legend-box-dot.svg","legend-box":"legend-box.svg",legend:XT,"line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:JT,"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:QT,loading:eN,lock:tN,maximize:nN,menu:rN,minimize:oN,minus:iN,more:sN,"paper-clip":"paper-clip.svg",pause:aN,pin:lN,play:cN,"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:dN,publications:uN,"radio-button-checked":"radio-button-checked.svg","radio-button":"radio-button.svg",renew:pN,restart:hN,reverse:fN,"rotation-0":"rotation-0.svg","rotation-45":"rotation-45.svg","rotation-90":"rotation-90.svg",search:mN,"server-on":"server-on.svg",server:gN,settings:yN,sina:_N,skatterplot:CN,slice:vN,"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:wN,statistics:bN,stop:xN,"strip-plot":"strip-plot.svg",success:kN,"table-add":"table-add.svg","table-alias":"table-alias.svg","table-import":"table-import.svg",table:EN,template:SN,terminal:TN,"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:NN,tune:VN,venn:AN,"view-hide":"view-hide.svg","view-show":"view-show.svg","violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:BN,warning:PN,wetlab:RN,"windows-collapse":"windows-collapse.svg","windows-expand":"windows-expand.svg","x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:DN,"zoom-in":"zoom-in.svg","zoom-out":"zoom-out.svg"};function FN(){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 LN=["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"],ON=["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"],MN={allCssVariables:FN(),icons16:dT,icons24:IN},GN={class:"block__not-found"},$N=r.defineComponent({__name:"NotFound",setup(t){const n=bl().useApp(),o=()=>{n.updateNavigationState(i=>{i.href="/"})};return(i,l)=>(r.openBlock(),r.createElementBlock("div",GN,[r.createElementVNode("h1",null,"Not found route: "+r.toDisplayString(r.unref(n).snapshot.navigationState.href),1),r.createVNode(r.unref(Il),{onClick:r.withModifiers(o,["stop"])},{default:r.withCtx(()=>l[0]||(l[0]=[r.createTextVNode("Return to main page")])),_:1})]))}}),ec=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},zN={},UN={class:"block__loader-page"};function ZN(t,e){return r.openBlock(),r.createElementBlock("div",UN,e[0]||(e[0]=[r.createElementVNode("div",{class:"loader-container"},[r.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const WN=ec(zN,[["render",ZN]]),jN={class:"pl-app-notification-alert"},HN={class:"pl-app-notification-alert__content"},qN={class:"pl-app-notification-alert__title"},KN=r.defineComponent({__name:"PlAppErrorNotificationAlert",props:{errors:{}},setup(t){const e=t,n=r.ref(!1),o=r.ref(!0),i=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(d=>!!d)},{immediate:!0,deep:!0}),(c,d)=>(r.openBlock(),r.createElementBlock("div",jN,[r.createVNode(r.unref(jl),{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=p=>n.value=p),width:"720px",style:{"max-height":"100vh"}},{title:r.withCtx(()=>d[2]||(d[2]=[r.createTextVNode(" Errors ")])),default:r.withCtx(()=>[r.createElementVNode("div",HN,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,p=>{var h;return r.openBlock(),r.createElementBlock("div",{key:p[0],class:"pl-app-notification-alert__item"},[r.createElementVNode("div",qN,r.toDisplayString(p[0]),1),r.createVNode(r.unref(xp),{value:(h=p[1])==null?void 0:h.message},null,8,["value"])])}),128))])]),_:1},8,["modelValue"]),r.createVNode(r.unref(Wp),{modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=p=>o.value=p),type:"error",closable:""},{actions:r.withCtx(()=>[r.createVNode(r.unref(As),{icon:"arrow-right",onClick:l},{default:r.withCtx(()=>d[3]||(d[3]=[r.createTextVNode("See errors")])),_:1}),r.createVNode(r.unref(lp))]),default:r.withCtx(()=>[d[4]||(d[4]=r.createTextVNode(" Some outputs have errors. "))]),_:1},8,["modelValue"])]))}}),YN={key:0,class:"block__loader"},XN=r.defineComponent({__name:"BlockLoader",props:{value:{type:[Boolean,Number]}},setup(t){const e=t,n=r.computed(()=>typeof e.value=="boolean"&&e.value),o=r.computed(()=>{const i=e.value;if(typeof i=="number")return i>=1?void 0:(i*100).toFixed(2)+"%"});return(i,l)=>n.value?(r.openBlock(),r.createElementBlock("div",YN)):o.value!==void 0?(r.openBlock(),r.createElementBlock("div",{key:1,class:"block__progress",style:r.normalizeStyle({"--progress-width":o.value})},null,4)):r.createCommentVNode("",!0)}}),JN={class:"block block__layout"},QN={key:0},eV=r.defineComponent({__name:"BlockLayout",setup(t){const e=bl(),n=h=>{try{return new URL(h,"http://dummy").pathname}catch{console.error("Invalid href",h);return}},o=r.computed(()=>e.loaded?e.useApp().href:void 0),i=r.computed(()=>{if(e.loaded){const h=e.useApp(),m=n(h.snapshot.navigationState.href);return m?h.getRoute(m):void 0}}),l=r.computed(()=>e.loaded?e.useApp():void 0),c=r.computed(()=>l.value?l.value.model.outputErrors:{}),d=r.computed(()=>{var h;return((h=l.value)==null?void 0:h.showErrorsNotification)??!0}),p=r.computed(()=>{var h,m;return(m=(h=l.value)==null?void 0:h.progress)==null?void 0:m.call(h)});return(h,m)=>(r.openBlock(),r.createElementBlock("div",JN,[r.createVNode(XN,{value:p.value},null,8,["value"]),r.unref(e).error?(r.openBlock(),r.createElementBlock("div",QN,r.toDisplayString(r.unref(e).error),1)):r.unref(e).loaded?i.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.value),{key:o.value})):(r.openBlock(),r.createBlock($N,{key:3})):(r.openBlock(),r.createBlock(WN,{key:1},{default:r.withCtx(()=>m[0]||(m[0]=[r.createTextVNode("Loading...")])),_:1})),r.unref(e).loaded&&d.value?(r.openBlock(),r.createBlock(r.unref(KN),{key:4,errors:c.value},null,8,["errors"])):r.createCommentVNode("",!0)]))}});var Ws={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
|
-
*/Zs.exports,function(t,e){(function(){var n,o="4.17.21",i=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",d="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",y=1,w=2,v=4,E=1,z=2,$=1,S=2,B=4,D=8,H=16,A=32,N=64,j=128,J=256,Z=512,R=30,O="...",G=800,P=16,T=1,M=2,U=3,X=1/0,ne=9007199254740991,de=17976931348623157e292,me=NaN,Te=4294967295,Se=Te-1,je=Te>>>1,It=[["ary",j],["bind",$],["bindKey",S],["curry",D],["curryRight",H],["flip",Z],["partial",A],["partialRight",N],["rearg",J]],qe="[object Arguments]",Zn="[object Array]",rP="[object AsyncFunction]",Zi="[object Boolean]",Wi="[object Date]",oP="[object DOMException]",oa="[object Error]",ia="[object Function]",jh="[object GeneratorFunction]",Nn="[object Map]",ji="[object Number]",iP="[object Null]",er="[object Object]",Hh="[object Promise]",sP="[object Proxy]",Hi="[object RegExp]",Vn="[object Set]",qi="[object String]",sa="[object Symbol]",aP="[object Undefined]",Ki="[object WeakMap]",lP="[object WeakSet]",Yi="[object ArrayBuffer]",Fo="[object DataView]",wc="[object Float32Array]",bc="[object Float64Array]",xc="[object Int8Array]",kc="[object Int16Array]",Sc="[object Int32Array]",Ec="[object Uint8Array]",Tc="[object Uint8ClampedArray]",Nc="[object Uint16Array]",Vc="[object Uint32Array]",cP=/\b__p \+= '';/g,dP=/\b(__p \+=) '' \+/g,uP=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qh=/&(?:amp|lt|gt|quot|#39);/g,Kh=/[&<>"']/g,pP=RegExp(qh.source),hP=RegExp(Kh.source),fP=/<%-([\s\S]+?)%>/g,mP=/<%([\s\S]+?)%>/g,Yh=/<%=([\s\S]+?)%>/g,gP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yP=/^\w*$/,_P=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ac=/[\\^$.*+?()[\]{}|]/g,CP=RegExp(Ac.source),Bc=/^\s+/,vP=/\s/,wP=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bP=/\{\n\/\* \[wrapped with (.+)\] \*/,xP=/,? & /,kP=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,SP=/[()=,{}\[\]\/\s]/,EP=/\\(\\)?/g,TP=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Xh=/\w*$/,NP=/^[-+]0x[0-9a-f]+$/i,VP=/^0b[01]+$/i,AP=/^\[object .+?Constructor\]$/,BP=/^0o[0-7]+$/i,PP=/^(?:0|[1-9]\d*)$/,RP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,aa=/($^)/,DP=/['\n\r\u2028\u2029\\]/g,la="\\ud800-\\udfff",IP="\\u0300-\\u036f",FP="\\ufe20-\\ufe2f",LP="\\u20d0-\\u20ff",Jh=IP+FP+LP,Qh="\\u2700-\\u27bf",ef="a-z\\xdf-\\xf6\\xf8-\\xff",OP="\\xac\\xb1\\xd7\\xf7",MP="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",GP="\\u2000-\\u206f",$P=" \\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",tf="A-Z\\xc0-\\xd6\\xd8-\\xde",nf="\\ufe0e\\ufe0f",rf=OP+MP+GP+$P,Pc="['’]",zP="["+la+"]",of="["+rf+"]",ca="["+Jh+"]",sf="\\d+",UP="["+Qh+"]",af="["+ef+"]",lf="[^"+la+rf+sf+Qh+ef+tf+"]",Rc="\\ud83c[\\udffb-\\udfff]",ZP="(?:"+ca+"|"+Rc+")",cf="[^"+la+"]",Dc="(?:\\ud83c[\\udde6-\\uddff]){2}",Ic="[\\ud800-\\udbff][\\udc00-\\udfff]",Lo="["+tf+"]",df="\\u200d",uf="(?:"+af+"|"+lf+")",WP="(?:"+Lo+"|"+lf+")",pf="(?:"+Pc+"(?:d|ll|m|re|s|t|ve))?",hf="(?:"+Pc+"(?:D|LL|M|RE|S|T|VE))?",ff=ZP+"?",mf="["+nf+"]?",jP="(?:"+df+"(?:"+[cf,Dc,Ic].join("|")+")"+mf+ff+")*",HP="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qP="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gf=mf+ff+jP,KP="(?:"+[UP,Dc,Ic].join("|")+")"+gf,YP="(?:"+[cf+ca+"?",ca,Dc,Ic,zP].join("|")+")",XP=RegExp(Pc,"g"),JP=RegExp(ca,"g"),Fc=RegExp(Rc+"(?="+Rc+")|"+YP+gf,"g"),QP=RegExp([Lo+"?"+af+"+"+pf+"(?="+[of,Lo,"$"].join("|")+")",WP+"+"+hf+"(?="+[of,Lo+uf,"$"].join("|")+")",Lo+"?"+uf+"+"+pf,Lo+"+"+hf,qP,HP,sf,KP].join("|"),"g"),eR=RegExp("["+df+la+Jh+nf+"]"),tR=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nR=["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"],rR=-1,Qe={};Qe[wc]=Qe[bc]=Qe[xc]=Qe[kc]=Qe[Sc]=Qe[Ec]=Qe[Tc]=Qe[Nc]=Qe[Vc]=!0,Qe[qe]=Qe[Zn]=Qe[Yi]=Qe[Zi]=Qe[Fo]=Qe[Wi]=Qe[oa]=Qe[ia]=Qe[Nn]=Qe[ji]=Qe[er]=Qe[Hi]=Qe[Vn]=Qe[qi]=Qe[Ki]=!1;var Xe={};Xe[qe]=Xe[Zn]=Xe[Yi]=Xe[Fo]=Xe[Zi]=Xe[Wi]=Xe[wc]=Xe[bc]=Xe[xc]=Xe[kc]=Xe[Sc]=Xe[Nn]=Xe[ji]=Xe[er]=Xe[Hi]=Xe[Vn]=Xe[qi]=Xe[sa]=Xe[Ec]=Xe[Tc]=Xe[Nc]=Xe[Vc]=!0,Xe[oa]=Xe[ia]=Xe[Ki]=!1;var oR={À:"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"},iR={"&":"&","<":"<",">":">",'"':""","'":"'"},sR={"&":"&","<":"<",">":">",""":'"',"'":"'"},aR={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},lR=parseFloat,cR=parseInt,yf=typeof Xo=="object"&&Xo&&Xo.Object===Object&&Xo,dR=typeof self=="object"&&self&&self.Object===Object&&self,vt=yf||dR||Function("return this")(),Lc=e&&!e.nodeType&&e,no=Lc&&!0&&t&&!t.nodeType&&t,_f=no&&no.exports===Lc,Oc=_f&&yf.process,rn=function(){try{var I=no&&no.require&&no.require("util").types;return I||Oc&&Oc.binding&&Oc.binding("util")}catch{}}(),Cf=rn&&rn.isArrayBuffer,vf=rn&&rn.isDate,wf=rn&&rn.isMap,bf=rn&&rn.isRegExp,xf=rn&&rn.isSet,kf=rn&&rn.isTypedArray;function Xt(I,q,W){switch(W.length){case 0:return I.call(q);case 1:return I.call(q,W[0]);case 2:return I.call(q,W[0],W[1]);case 3:return I.call(q,W[0],W[1],W[2])}return I.apply(q,W)}function uR(I,q,W,ce){for(var Ee=-1,Ue=I==null?0:I.length;++Ee<Ue;){var pt=I[Ee];q(ce,pt,W(pt),I)}return ce}function on(I,q){for(var W=-1,ce=I==null?0:I.length;++W<ce&&q(I[W],W,I)!==!1;);return I}function pR(I,q){for(var W=I==null?0:I.length;W--&&q(I[W],W,I)!==!1;);return I}function Sf(I,q){for(var W=-1,ce=I==null?0:I.length;++W<ce;)if(!q(I[W],W,I))return!1;return!0}function Ar(I,q){for(var W=-1,ce=I==null?0:I.length,Ee=0,Ue=[];++W<ce;){var pt=I[W];q(pt,W,I)&&(Ue[Ee++]=pt)}return Ue}function da(I,q){var W=I==null?0:I.length;return!!W&&Oo(I,q,0)>-1}function Mc(I,q,W){for(var ce=-1,Ee=I==null?0:I.length;++ce<Ee;)if(W(q,I[ce]))return!0;return!1}function tt(I,q){for(var W=-1,ce=I==null?0:I.length,Ee=Array(ce);++W<ce;)Ee[W]=q(I[W],W,I);return Ee}function Br(I,q){for(var W=-1,ce=q.length,Ee=I.length;++W<ce;)I[Ee+W]=q[W];return I}function Gc(I,q,W,ce){var Ee=-1,Ue=I==null?0:I.length;for(ce&&Ue&&(W=I[++Ee]);++Ee<Ue;)W=q(W,I[Ee],Ee,I);return W}function hR(I,q,W,ce){var Ee=I==null?0:I.length;for(ce&&Ee&&(W=I[--Ee]);Ee--;)W=q(W,I[Ee],Ee,I);return W}function $c(I,q){for(var W=-1,ce=I==null?0:I.length;++W<ce;)if(q(I[W],W,I))return!0;return!1}var fR=zc("length");function mR(I){return I.split("")}function gR(I){return I.match(kP)||[]}function Ef(I,q,W){var ce;return W(I,function(Ee,Ue,pt){if(q(Ee,Ue,pt))return ce=Ue,!1}),ce}function ua(I,q,W,ce){for(var Ee=I.length,Ue=W+(ce?1:-1);ce?Ue--:++Ue<Ee;)if(q(I[Ue],Ue,I))return Ue;return-1}function Oo(I,q,W){return q===q?NR(I,q,W):ua(I,Tf,W)}function yR(I,q,W,ce){for(var Ee=W-1,Ue=I.length;++Ee<Ue;)if(ce(I[Ee],q))return Ee;return-1}function Tf(I){return I!==I}function Nf(I,q){var W=I==null?0:I.length;return W?Zc(I,q)/W:me}function zc(I){return function(q){return q==null?n:q[I]}}function Uc(I){return function(q){return I==null?n:I[q]}}function Vf(I,q,W,ce,Ee){return Ee(I,function(Ue,pt,Ke){W=ce?(ce=!1,Ue):q(W,Ue,pt,Ke)}),W}function _R(I,q){var W=I.length;for(I.sort(q);W--;)I[W]=I[W].value;return I}function Zc(I,q){for(var W,ce=-1,Ee=I.length;++ce<Ee;){var Ue=q(I[ce]);Ue!==n&&(W=W===n?Ue:W+Ue)}return W}function Wc(I,q){for(var W=-1,ce=Array(I);++W<I;)ce[W]=q(W);return ce}function CR(I,q){return tt(q,function(W){return[W,I[W]]})}function Af(I){return I&&I.slice(0,Df(I)+1).replace(Bc,"")}function Jt(I){return function(q){return I(q)}}function jc(I,q){return tt(q,function(W){return I[W]})}function Xi(I,q){return I.has(q)}function Bf(I,q){for(var W=-1,ce=I.length;++W<ce&&Oo(q,I[W],0)>-1;);return W}function Pf(I,q){for(var W=I.length;W--&&Oo(q,I[W],0)>-1;);return W}function vR(I,q){for(var W=I.length,ce=0;W--;)I[W]===q&&++ce;return ce}var wR=Uc(oR),bR=Uc(iR);function xR(I){return"\\"+aR[I]}function kR(I,q){return I==null?n:I[q]}function Mo(I){return eR.test(I)}function SR(I){return tR.test(I)}function ER(I){for(var q,W=[];!(q=I.next()).done;)W.push(q.value);return W}function Hc(I){var q=-1,W=Array(I.size);return I.forEach(function(ce,Ee){W[++q]=[Ee,ce]}),W}function Rf(I,q){return function(W){return I(q(W))}}function Pr(I,q){for(var W=-1,ce=I.length,Ee=0,Ue=[];++W<ce;){var pt=I[W];(pt===q||pt===m)&&(I[W]=m,Ue[Ee++]=W)}return Ue}function pa(I){var q=-1,W=Array(I.size);return I.forEach(function(ce){W[++q]=ce}),W}function TR(I){var q=-1,W=Array(I.size);return I.forEach(function(ce){W[++q]=[ce,ce]}),W}function NR(I,q,W){for(var ce=W-1,Ee=I.length;++ce<Ee;)if(I[ce]===q)return ce;return-1}function VR(I,q,W){for(var ce=W+1;ce--;)if(I[ce]===q)return ce;return ce}function Go(I){return Mo(I)?BR(I):fR(I)}function An(I){return Mo(I)?PR(I):mR(I)}function Df(I){for(var q=I.length;q--&&vP.test(I.charAt(q)););return q}var AR=Uc(sR);function BR(I){for(var q=Fc.lastIndex=0;Fc.test(I);)++q;return q}function PR(I){return I.match(Fc)||[]}function RR(I){return I.match(QP)||[]}var DR=function I(q){q=q==null?vt:$o.defaults(vt.Object(),q,$o.pick(vt,nR));var W=q.Array,ce=q.Date,Ee=q.Error,Ue=q.Function,pt=q.Math,Ke=q.Object,qc=q.RegExp,IR=q.String,sn=q.TypeError,ha=W.prototype,FR=Ue.prototype,zo=Ke.prototype,fa=q["__core-js_shared__"],ma=FR.toString,He=zo.hasOwnProperty,LR=0,If=function(){var s=/[^.]+$/.exec(fa&&fa.keys&&fa.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),ga=zo.toString,OR=ma.call(Ke),MR=vt._,GR=qc("^"+ma.call(He).replace(Ac,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ya=_f?q.Buffer:n,Rr=q.Symbol,_a=q.Uint8Array,Ff=ya?ya.allocUnsafe:n,Ca=Rf(Ke.getPrototypeOf,Ke),Lf=Ke.create,Of=zo.propertyIsEnumerable,va=ha.splice,Mf=Rr?Rr.isConcatSpreadable:n,Ji=Rr?Rr.iterator:n,ro=Rr?Rr.toStringTag:n,wa=function(){try{var s=lo(Ke,"defineProperty");return s({},"",{}),s}catch{}}(),$R=q.clearTimeout!==vt.clearTimeout&&q.clearTimeout,zR=ce&&ce.now!==vt.Date.now&&ce.now,UR=q.setTimeout!==vt.setTimeout&&q.setTimeout,ba=pt.ceil,xa=pt.floor,Kc=Ke.getOwnPropertySymbols,ZR=ya?ya.isBuffer:n,Gf=q.isFinite,WR=ha.join,jR=Rf(Ke.keys,Ke),ht=pt.max,Tt=pt.min,HR=ce.now,qR=q.parseInt,$f=pt.random,KR=ha.reverse,Yc=lo(q,"DataView"),Qi=lo(q,"Map"),Xc=lo(q,"Promise"),Uo=lo(q,"Set"),es=lo(q,"WeakMap"),ts=lo(Ke,"create"),ka=es&&new es,Zo={},YR=co(Yc),XR=co(Qi),JR=co(Xc),QR=co(Uo),eD=co(es),Sa=Rr?Rr.prototype:n,ns=Sa?Sa.valueOf:n,zf=Sa?Sa.toString:n;function _(s){if(it(s)&&!Ne(s)&&!(s instanceof Le)){if(s instanceof an)return s;if(He.call(s,"__wrapped__"))return Um(s)}return new an(s)}var Wo=function(){function s(){}return function(a){if(!ot(a))return{};if(Lf)return Lf(a);s.prototype=a;var u=new s;return s.prototype=n,u}}();function Ea(){}function an(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}_.templateSettings={escape:fP,evaluate:mP,interpolate:Yh,variable:"",imports:{_}},_.prototype=Ea.prototype,_.prototype.constructor=_,an.prototype=Wo(Ea.prototype),an.prototype.constructor=an;function Le(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Te,this.__views__=[]}function tD(){var s=new Le(this.__wrapped__);return s.__actions__=$t(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=$t(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=$t(this.__views__),s}function nD(){if(this.__filtered__){var s=new Le(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function rD(){var s=this.__wrapped__.value(),a=this.__dir__,u=Ne(s),f=a<0,g=u?s.length:0,C=mI(0,g,this.__views__),k=C.start,V=C.end,L=V-k,K=f?V:k-1,Y=this.__iteratees__,Q=Y.length,oe=0,pe=Tt(L,this.__takeCount__);if(!u||!f&&g==L&&pe==L)return pm(s,this.__actions__);var _e=[];e:for(;L--&&oe<pe;){K+=a;for(var De=-1,Ce=s[K];++De<Q;){var Fe=Y[De],Oe=Fe.iteratee,tn=Fe.type,Ot=Oe(Ce);if(tn==M)Ce=Ot;else if(!Ot){if(tn==T)continue e;break e}}_e[oe++]=Ce}return _e}Le.prototype=Wo(Ea.prototype),Le.prototype.constructor=Le;function oo(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function oD(){this.__data__=ts?ts(null):{},this.size=0}function iD(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function sD(s){var a=this.__data__;if(ts){var u=a[s];return u===p?n:u}return He.call(a,s)?a[s]:n}function aD(s){var a=this.__data__;return ts?a[s]!==n:He.call(a,s)}function lD(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=ts&&a===n?p:a,this}oo.prototype.clear=oD,oo.prototype.delete=iD,oo.prototype.get=sD,oo.prototype.has=aD,oo.prototype.set=lD;function tr(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function cD(){this.__data__=[],this.size=0}function dD(s){var a=this.__data__,u=Ta(a,s);if(u<0)return!1;var f=a.length-1;return u==f?a.pop():va.call(a,u,1),--this.size,!0}function uD(s){var a=this.__data__,u=Ta(a,s);return u<0?n:a[u][1]}function pD(s){return Ta(this.__data__,s)>-1}function hD(s,a){var u=this.__data__,f=Ta(u,s);return f<0?(++this.size,u.push([s,a])):u[f][1]=a,this}tr.prototype.clear=cD,tr.prototype.delete=dD,tr.prototype.get=uD,tr.prototype.has=pD,tr.prototype.set=hD;function nr(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function fD(){this.size=0,this.__data__={hash:new oo,map:new(Qi||tr),string:new oo}}function mD(s){var a=Ma(this,s).delete(s);return this.size-=a?1:0,a}function gD(s){return Ma(this,s).get(s)}function yD(s){return Ma(this,s).has(s)}function _D(s,a){var u=Ma(this,s),f=u.size;return u.set(s,a),this.size+=u.size==f?0:1,this}nr.prototype.clear=fD,nr.prototype.delete=mD,nr.prototype.get=gD,nr.prototype.has=yD,nr.prototype.set=_D;function io(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new nr;++a<u;)this.add(s[a])}function CD(s){return this.__data__.set(s,p),this}function vD(s){return this.__data__.has(s)}io.prototype.add=io.prototype.push=CD,io.prototype.has=vD;function Bn(s){var a=this.__data__=new tr(s);this.size=a.size}function wD(){this.__data__=new tr,this.size=0}function bD(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function xD(s){return this.__data__.get(s)}function kD(s){return this.__data__.has(s)}function SD(s,a){var u=this.__data__;if(u instanceof tr){var f=u.__data__;if(!Qi||f.length<i-1)return f.push([s,a]),this.size=++u.size,this;u=this.__data__=new nr(f)}return u.set(s,a),this.size=u.size,this}Bn.prototype.clear=wD,Bn.prototype.delete=bD,Bn.prototype.get=xD,Bn.prototype.has=kD,Bn.prototype.set=SD;function Uf(s,a){var u=Ne(s),f=!u&&uo(s),g=!u&&!f&&Or(s),C=!u&&!f&&!g&&Ko(s),k=u||f||g||C,V=k?Wc(s.length,IR):[],L=V.length;for(var K in s)(a||He.call(s,K))&&!(k&&(K=="length"||g&&(K=="offset"||K=="parent")||C&&(K=="buffer"||K=="byteLength"||K=="byteOffset")||sr(K,L)))&&V.push(K);return V}function Zf(s){var a=s.length;return a?s[ld(0,a-1)]:n}function ED(s,a){return Ga($t(s),so(a,0,s.length))}function TD(s){return Ga($t(s))}function Jc(s,a,u){(u!==n&&!Pn(s[a],u)||u===n&&!(a in s))&&rr(s,a,u)}function rs(s,a,u){var f=s[a];(!(He.call(s,a)&&Pn(f,u))||u===n&&!(a in s))&&rr(s,a,u)}function Ta(s,a){for(var u=s.length;u--;)if(Pn(s[u][0],a))return u;return-1}function ND(s,a,u,f){return Dr(s,function(g,C,k){a(f,g,u(g),k)}),f}function Wf(s,a){return s&&jn(a,yt(a),s)}function VD(s,a){return s&&jn(a,Ut(a),s)}function rr(s,a,u){a=="__proto__"&&wa?wa(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function Qc(s,a){for(var u=-1,f=a.length,g=W(f),C=s==null;++u<f;)g[u]=C?n:Rd(s,a[u]);return g}function so(s,a,u){return s===s&&(u!==n&&(s=s<=u?s:u),a!==n&&(s=s>=a?s:a)),s}function ln(s,a,u,f,g,C){var k,V=a&y,L=a&w,K=a&v;if(u&&(k=g?u(s,f,g,C):u(s)),k!==n)return k;if(!ot(s))return s;var Y=Ne(s);if(Y){if(k=yI(s),!V)return $t(s,k)}else{var Q=Nt(s),oe=Q==ia||Q==jh;if(Or(s))return mm(s,V);if(Q==er||Q==qe||oe&&!g){if(k=L||oe?{}:Dm(s),!V)return L?sI(s,VD(k,s)):iI(s,Wf(k,s))}else{if(!Xe[Q])return g?s:{};k=_I(s,Q,V)}}C||(C=new Bn);var pe=C.get(s);if(pe)return pe;C.set(s,k),cg(s)?s.forEach(function(Ce){k.add(ln(Ce,a,u,Ce,s,C))}):ag(s)&&s.forEach(function(Ce,Fe){k.set(Fe,ln(Ce,a,u,Fe,s,C))});var _e=K?L?Cd:_d:L?Ut:yt,De=Y?n:_e(s);return on(De||s,function(Ce,Fe){De&&(Fe=Ce,Ce=s[Fe]),rs(k,Fe,ln(Ce,a,u,Fe,s,C))}),k}function AD(s){var a=yt(s);return function(u){return jf(u,s,a)}}function jf(s,a,u){var f=u.length;if(s==null)return!f;for(s=Ke(s);f--;){var g=u[f],C=a[g],k=s[g];if(k===n&&!(g in s)||!C(k))return!1}return!0}function Hf(s,a,u){if(typeof s!="function")throw new sn(c);return ds(function(){s.apply(n,u)},a)}function os(s,a,u,f){var g=-1,C=da,k=!0,V=s.length,L=[],K=a.length;if(!V)return L;u&&(a=tt(a,Jt(u))),f?(C=Mc,k=!1):a.length>=i&&(C=Xi,k=!1,a=new io(a));e:for(;++g<V;){var Y=s[g],Q=u==null?Y:u(Y);if(Y=f||Y!==0?Y:0,k&&Q===Q){for(var oe=K;oe--;)if(a[oe]===Q)continue e;L.push(Y)}else C(a,Q,f)||L.push(Y)}return L}var Dr=vm(Wn),qf=vm(td,!0);function BD(s,a){var u=!0;return Dr(s,function(f,g,C){return u=!!a(f,g,C),u}),u}function Na(s,a,u){for(var f=-1,g=s.length;++f<g;){var C=s[f],k=a(C);if(k!=null&&(V===n?k===k&&!en(k):u(k,V)))var V=k,L=C}return L}function PD(s,a,u,f){var g=s.length;for(u=Be(u),u<0&&(u=-u>g?0:g+u),f=f===n||f>g?g:Be(f),f<0&&(f+=g),f=u>f?0:ug(f);u<f;)s[u++]=a;return s}function Kf(s,a){var u=[];return Dr(s,function(f,g,C){a(f,g,C)&&u.push(f)}),u}function wt(s,a,u,f,g){var C=-1,k=s.length;for(u||(u=vI),g||(g=[]);++C<k;){var V=s[C];a>0&&u(V)?a>1?wt(V,a-1,u,f,g):Br(g,V):f||(g[g.length]=V)}return g}var ed=wm(),Yf=wm(!0);function Wn(s,a){return s&&ed(s,a,yt)}function td(s,a){return s&&Yf(s,a,yt)}function Va(s,a){return Ar(a,function(u){return ar(s[u])})}function ao(s,a){a=Fr(a,s);for(var u=0,f=a.length;s!=null&&u<f;)s=s[Hn(a[u++])];return u&&u==f?s:n}function Xf(s,a,u){var f=a(s);return Ne(s)?f:Br(f,u(s))}function Ft(s){return s==null?s===n?aP:iP:ro&&ro in Ke(s)?fI(s):TI(s)}function nd(s,a){return s>a}function RD(s,a){return s!=null&&He.call(s,a)}function DD(s,a){return s!=null&&a in Ke(s)}function ID(s,a,u){return s>=Tt(a,u)&&s<ht(a,u)}function rd(s,a,u){for(var f=u?Mc:da,g=s[0].length,C=s.length,k=C,V=W(C),L=1/0,K=[];k--;){var Y=s[k];k&&a&&(Y=tt(Y,Jt(a))),L=Tt(Y.length,L),V[k]=!u&&(a||g>=120&&Y.length>=120)?new io(k&&Y):n}Y=s[0];var Q=-1,oe=V[0];e:for(;++Q<g&&K.length<L;){var pe=Y[Q],_e=a?a(pe):pe;if(pe=u||pe!==0?pe:0,!(oe?Xi(oe,_e):f(K,_e,u))){for(k=C;--k;){var De=V[k];if(!(De?Xi(De,_e):f(s[k],_e,u)))continue e}oe&&oe.push(_e),K.push(pe)}}return K}function FD(s,a,u,f){return Wn(s,function(g,C,k){a(f,u(g),C,k)}),f}function is(s,a,u){a=Fr(a,s),s=Om(s,a);var f=s==null?s:s[Hn(dn(a))];return f==null?n:Xt(f,s,u)}function Jf(s){return it(s)&&Ft(s)==qe}function LD(s){return it(s)&&Ft(s)==Yi}function OD(s){return it(s)&&Ft(s)==Wi}function ss(s,a,u,f,g){return s===a?!0:s==null||a==null||!it(s)&&!it(a)?s!==s&&a!==a:MD(s,a,u,f,ss,g)}function MD(s,a,u,f,g,C){var k=Ne(s),V=Ne(a),L=k?Zn:Nt(s),K=V?Zn:Nt(a);L=L==qe?er:L,K=K==qe?er:K;var Y=L==er,Q=K==er,oe=L==K;if(oe&&Or(s)){if(!Or(a))return!1;k=!0,Y=!1}if(oe&&!Y)return C||(C=new Bn),k||Ko(s)?Bm(s,a,u,f,g,C):pI(s,a,L,u,f,g,C);if(!(u&E)){var pe=Y&&He.call(s,"__wrapped__"),_e=Q&&He.call(a,"__wrapped__");if(pe||_e){var De=pe?s.value():s,Ce=_e?a.value():a;return C||(C=new Bn),g(De,Ce,u,f,C)}}return oe?(C||(C=new Bn),hI(s,a,u,f,g,C)):!1}function GD(s){return it(s)&&Nt(s)==Nn}function od(s,a,u,f){var g=u.length,C=g,k=!f;if(s==null)return!C;for(s=Ke(s);g--;){var V=u[g];if(k&&V[2]?V[1]!==s[V[0]]:!(V[0]in s))return!1}for(;++g<C;){V=u[g];var L=V[0],K=s[L],Y=V[1];if(k&&V[2]){if(K===n&&!(L in s))return!1}else{var Q=new Bn;if(f)var oe=f(K,Y,L,s,a,Q);if(!(oe===n?ss(Y,K,E|z,f,Q):oe))return!1}}return!0}function Qf(s){if(!ot(s)||bI(s))return!1;var a=ar(s)?GR:AP;return a.test(co(s))}function $D(s){return it(s)&&Ft(s)==Hi}function zD(s){return it(s)&&Nt(s)==Vn}function UD(s){return it(s)&&ja(s.length)&&!!Qe[Ft(s)]}function em(s){return typeof s=="function"?s:s==null?Zt:typeof s=="object"?Ne(s)?rm(s[0],s[1]):nm(s):bg(s)}function id(s){if(!cs(s))return jR(s);var a=[];for(var u in Ke(s))He.call(s,u)&&u!="constructor"&&a.push(u);return a}function ZD(s){if(!ot(s))return EI(s);var a=cs(s),u=[];for(var f in s)f=="constructor"&&(a||!He.call(s,f))||u.push(f);return u}function sd(s,a){return s<a}function tm(s,a){var u=-1,f=zt(s)?W(s.length):[];return Dr(s,function(g,C,k){f[++u]=a(g,C,k)}),f}function nm(s){var a=wd(s);return a.length==1&&a[0][2]?Fm(a[0][0],a[0][1]):function(u){return u===s||od(u,s,a)}}function rm(s,a){return xd(s)&&Im(a)?Fm(Hn(s),a):function(u){var f=Rd(u,s);return f===n&&f===a?Dd(u,s):ss(a,f,E|z)}}function Aa(s,a,u,f,g){s!==a&&ed(a,function(C,k){if(g||(g=new Bn),ot(C))WD(s,a,k,u,Aa,f,g);else{var V=f?f(Sd(s,k),C,k+"",s,a,g):n;V===n&&(V=C),Jc(s,k,V)}},Ut)}function WD(s,a,u,f,g,C,k){var V=Sd(s,u),L=Sd(a,u),K=k.get(L);if(K){Jc(s,u,K);return}var Y=C?C(V,L,u+"",s,a,k):n,Q=Y===n;if(Q){var oe=Ne(L),pe=!oe&&Or(L),_e=!oe&&!pe&&Ko(L);Y=L,oe||pe||_e?Ne(V)?Y=V:at(V)?Y=$t(V):pe?(Q=!1,Y=mm(L,!0)):_e?(Q=!1,Y=gm(L,!0)):Y=[]:us(L)||uo(L)?(Y=V,uo(V)?Y=pg(V):(!ot(V)||ar(V))&&(Y=Dm(L))):Q=!1}Q&&(k.set(L,Y),g(Y,L,f,C,k),k.delete(L)),Jc(s,u,Y)}function om(s,a){var u=s.length;if(u)return a+=a<0?u:0,sr(a,u)?s[a]:n}function im(s,a,u){a.length?a=tt(a,function(C){return Ne(C)?function(k){return ao(k,C.length===1?C[0]:C)}:C}):a=[Zt];var f=-1;a=tt(a,Jt(ge()));var g=tm(s,function(C,k,V){var L=tt(a,function(K){return K(C)});return{criteria:L,index:++f,value:C}});return _R(g,function(C,k){return oI(C,k,u)})}function jD(s,a){return sm(s,a,function(u,f){return Dd(s,f)})}function sm(s,a,u){for(var f=-1,g=a.length,C={};++f<g;){var k=a[f],V=ao(s,k);u(V,k)&&as(C,Fr(k,s),V)}return C}function HD(s){return function(a){return ao(a,s)}}function ad(s,a,u,f){var g=f?yR:Oo,C=-1,k=a.length,V=s;for(s===a&&(a=$t(a)),u&&(V=tt(s,Jt(u)));++C<k;)for(var L=0,K=a[C],Y=u?u(K):K;(L=g(V,Y,L,f))>-1;)V!==s&&va.call(V,L,1),va.call(s,L,1);return s}function am(s,a){for(var u=s?a.length:0,f=u-1;u--;){var g=a[u];if(u==f||g!==C){var C=g;sr(g)?va.call(s,g,1):ud(s,g)}}return s}function ld(s,a){return s+xa($f()*(a-s+1))}function qD(s,a,u,f){for(var g=-1,C=ht(ba((a-s)/(u||1)),0),k=W(C);C--;)k[f?C:++g]=s,s+=u;return k}function cd(s,a){var u="";if(!s||a<1||a>ne)return u;do a%2&&(u+=s),a=xa(a/2),a&&(s+=s);while(a);return u}function Ie(s,a){return Ed(Lm(s,a,Zt),s+"")}function KD(s){return Zf(Yo(s))}function YD(s,a){var u=Yo(s);return Ga(u,so(a,0,u.length))}function as(s,a,u,f){if(!ot(s))return s;a=Fr(a,s);for(var g=-1,C=a.length,k=C-1,V=s;V!=null&&++g<C;){var L=Hn(a[g]),K=u;if(L==="__proto__"||L==="constructor"||L==="prototype")return s;if(g!=k){var Y=V[L];K=f?f(Y,L,V):n,K===n&&(K=ot(Y)?Y:sr(a[g+1])?[]:{})}rs(V,L,K),V=V[L]}return s}var lm=ka?function(s,a){return ka.set(s,a),s}:Zt,XD=wa?function(s,a){return wa(s,"toString",{configurable:!0,enumerable:!1,value:Fd(a),writable:!0})}:Zt;function JD(s){return Ga(Yo(s))}function cn(s,a,u){var f=-1,g=s.length;a<0&&(a=-a>g?0:g+a),u=u>g?g:u,u<0&&(u+=g),g=a>u?0:u-a>>>0,a>>>=0;for(var C=W(g);++f<g;)C[f]=s[f+a];return C}function QD(s,a){var u;return Dr(s,function(f,g,C){return u=a(f,g,C),!u}),!!u}function Ba(s,a,u){var f=0,g=s==null?f:s.length;if(typeof a=="number"&&a===a&&g<=je){for(;f<g;){var C=f+g>>>1,k=s[C];k!==null&&!en(k)&&(u?k<=a:k<a)?f=C+1:g=C}return g}return dd(s,a,Zt,u)}function dd(s,a,u,f){var g=0,C=s==null?0:s.length;if(C===0)return 0;a=u(a);for(var k=a!==a,V=a===null,L=en(a),K=a===n;g<C;){var Y=xa((g+C)/2),Q=u(s[Y]),oe=Q!==n,pe=Q===null,_e=Q===Q,De=en(Q);if(k)var Ce=f||_e;else K?Ce=_e&&(f||oe):V?Ce=_e&&oe&&(f||!pe):L?Ce=_e&&oe&&!pe&&(f||!De):pe||De?Ce=!1:Ce=f?Q<=a:Q<a;Ce?g=Y+1:C=Y}return Tt(C,Se)}function cm(s,a){for(var u=-1,f=s.length,g=0,C=[];++u<f;){var k=s[u],V=a?a(k):k;if(!u||!Pn(V,L)){var L=V;C[g++]=k===0?0:k}}return C}function dm(s){return typeof s=="number"?s:en(s)?me:+s}function Qt(s){if(typeof s=="string")return s;if(Ne(s))return tt(s,Qt)+"";if(en(s))return zf?zf.call(s):"";var a=s+"";return a=="0"&&1/s==-X?"-0":a}function Ir(s,a,u){var f=-1,g=da,C=s.length,k=!0,V=[],L=V;if(u)k=!1,g=Mc;else if(C>=i){var K=a?null:dI(s);if(K)return pa(K);k=!1,g=Xi,L=new io}else L=a?[]:V;e:for(;++f<C;){var Y=s[f],Q=a?a(Y):Y;if(Y=u||Y!==0?Y:0,k&&Q===Q){for(var oe=L.length;oe--;)if(L[oe]===Q)continue e;a&&L.push(Q),V.push(Y)}else g(L,Q,u)||(L!==V&&L.push(Q),V.push(Y))}return V}function ud(s,a){return a=Fr(a,s),s=Om(s,a),s==null||delete s[Hn(dn(a))]}function um(s,a,u,f){return as(s,a,u(ao(s,a)),f)}function Pa(s,a,u,f){for(var g=s.length,C=f?g:-1;(f?C--:++C<g)&&a(s[C],C,s););return u?cn(s,f?0:C,f?C+1:g):cn(s,f?C+1:0,f?g:C)}function pm(s,a){var u=s;return u instanceof Le&&(u=u.value()),Gc(a,function(f,g){return g.func.apply(g.thisArg,Br([f],g.args))},u)}function pd(s,a,u){var f=s.length;if(f<2)return f?Ir(s[0]):[];for(var g=-1,C=W(f);++g<f;)for(var k=s[g],V=-1;++V<f;)V!=g&&(C[g]=os(C[g]||k,s[V],a,u));return Ir(wt(C,1),a,u)}function hm(s,a,u){for(var f=-1,g=s.length,C=a.length,k={};++f<g;){var V=f<C?a[f]:n;u(k,s[f],V)}return k}function hd(s){return at(s)?s:[]}function fd(s){return typeof s=="function"?s:Zt}function Fr(s,a){return Ne(s)?s:xd(s,a)?[s]:zm(We(s))}var eI=Ie;function Lr(s,a,u){var f=s.length;return u=u===n?f:u,!a&&u>=f?s:cn(s,a,u)}var fm=$R||function(s){return vt.clearTimeout(s)};function mm(s,a){if(a)return s.slice();var u=s.length,f=Ff?Ff(u):new s.constructor(u);return s.copy(f),f}function md(s){var a=new s.constructor(s.byteLength);return new _a(a).set(new _a(s)),a}function tI(s,a){var u=a?md(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function nI(s){var a=new s.constructor(s.source,Xh.exec(s));return a.lastIndex=s.lastIndex,a}function rI(s){return ns?Ke(ns.call(s)):{}}function gm(s,a){var u=a?md(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function ym(s,a){if(s!==a){var u=s!==n,f=s===null,g=s===s,C=en(s),k=a!==n,V=a===null,L=a===a,K=en(a);if(!V&&!K&&!C&&s>a||C&&k&&L&&!V&&!K||f&&k&&L||!u&&L||!g)return 1;if(!f&&!C&&!K&&s<a||K&&u&&g&&!f&&!C||V&&u&&g||!k&&g||!L)return-1}return 0}function oI(s,a,u){for(var f=-1,g=s.criteria,C=a.criteria,k=g.length,V=u.length;++f<k;){var L=ym(g[f],C[f]);if(L){if(f>=V)return L;var K=u[f];return L*(K=="desc"?-1:1)}}return s.index-a.index}function _m(s,a,u,f){for(var g=-1,C=s.length,k=u.length,V=-1,L=a.length,K=ht(C-k,0),Y=W(L+K),Q=!f;++V<L;)Y[V]=a[V];for(;++g<k;)(Q||g<C)&&(Y[u[g]]=s[g]);for(;K--;)Y[V++]=s[g++];return Y}function Cm(s,a,u,f){for(var g=-1,C=s.length,k=-1,V=u.length,L=-1,K=a.length,Y=ht(C-V,0),Q=W(Y+K),oe=!f;++g<Y;)Q[g]=s[g];for(var pe=g;++L<K;)Q[pe+L]=a[L];for(;++k<V;)(oe||g<C)&&(Q[pe+u[k]]=s[g++]);return Q}function $t(s,a){var u=-1,f=s.length;for(a||(a=W(f));++u<f;)a[u]=s[u];return a}function jn(s,a,u,f){var g=!u;u||(u={});for(var C=-1,k=a.length;++C<k;){var V=a[C],L=f?f(u[V],s[V],V,u,s):n;L===n&&(L=s[V]),g?rr(u,V,L):rs(u,V,L)}return u}function iI(s,a){return jn(s,bd(s),a)}function sI(s,a){return jn(s,Pm(s),a)}function Ra(s,a){return function(u,f){var g=Ne(u)?uR:ND,C=a?a():{};return g(u,s,ge(f,2),C)}}function jo(s){return Ie(function(a,u){var f=-1,g=u.length,C=g>1?u[g-1]:n,k=g>2?u[2]:n;for(C=s.length>3&&typeof C=="function"?(g--,C):n,k&&Lt(u[0],u[1],k)&&(C=g<3?n:C,g=1),a=Ke(a);++f<g;){var V=u[f];V&&s(a,V,f,C)}return a})}function vm(s,a){return function(u,f){if(u==null)return u;if(!zt(u))return s(u,f);for(var g=u.length,C=a?g:-1,k=Ke(u);(a?C--:++C<g)&&f(k[C],C,k)!==!1;);return u}}function wm(s){return function(a,u,f){for(var g=-1,C=Ke(a),k=f(a),V=k.length;V--;){var L=k[s?V:++g];if(u(C[L],L,C)===!1)break}return a}}function aI(s,a,u){var f=a&$,g=ls(s);function C(){var k=this&&this!==vt&&this instanceof C?g:s;return k.apply(f?u:this,arguments)}return C}function bm(s){return function(a){a=We(a);var u=Mo(a)?An(a):n,f=u?u[0]:a.charAt(0),g=u?Lr(u,1).join(""):a.slice(1);return f[s]()+g}}function Ho(s){return function(a){return Gc(vg(Cg(a).replace(XP,"")),s,"")}}function ls(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=Wo(s.prototype),f=s.apply(u,a);return ot(f)?f:u}}function lI(s,a,u){var f=ls(s);function g(){for(var C=arguments.length,k=W(C),V=C,L=qo(g);V--;)k[V]=arguments[V];var K=C<3&&k[0]!==L&&k[C-1]!==L?[]:Pr(k,L);if(C-=K.length,C<u)return Tm(s,a,Da,g.placeholder,n,k,K,n,n,u-C);var Y=this&&this!==vt&&this instanceof g?f:s;return Xt(Y,this,k)}return g}function xm(s){return function(a,u,f){var g=Ke(a);if(!zt(a)){var C=ge(u,3);a=yt(a),u=function(V){return C(g[V],V,g)}}var k=s(a,u,f);return k>-1?g[C?a[k]:k]:n}}function km(s){return ir(function(a){var u=a.length,f=u,g=an.prototype.thru;for(s&&a.reverse();f--;){var C=a[f];if(typeof C!="function")throw new sn(c);if(g&&!k&&Oa(C)=="wrapper")var k=new an([],!0)}for(f=k?f:u;++f<u;){C=a[f];var V=Oa(C),L=V=="wrapper"?vd(C):n;L&&kd(L[0])&&L[1]==(j|D|A|J)&&!L[4].length&&L[9]==1?k=k[Oa(L[0])].apply(k,L[3]):k=C.length==1&&kd(C)?k[V]():k.thru(C)}return function(){var K=arguments,Y=K[0];if(k&&K.length==1&&Ne(Y))return k.plant(Y).value();for(var Q=0,oe=u?a[Q].apply(this,K):Y;++Q<u;)oe=a[Q].call(this,oe);return oe}})}function Da(s,a,u,f,g,C,k,V,L,K){var Y=a&j,Q=a&$,oe=a&S,pe=a&(D|H),_e=a&Z,De=oe?n:ls(s);function Ce(){for(var Fe=arguments.length,Oe=W(Fe),tn=Fe;tn--;)Oe[tn]=arguments[tn];if(pe)var Ot=qo(Ce),nn=vR(Oe,Ot);if(f&&(Oe=_m(Oe,f,g,pe)),C&&(Oe=Cm(Oe,C,k,pe)),Fe-=nn,pe&&Fe<K){var lt=Pr(Oe,Ot);return Tm(s,a,Da,Ce.placeholder,u,Oe,lt,V,L,K-Fe)}var Rn=Q?u:this,cr=oe?Rn[s]:s;return Fe=Oe.length,V?Oe=NI(Oe,V):_e&&Fe>1&&Oe.reverse(),Y&&L<Fe&&(Oe.length=L),this&&this!==vt&&this instanceof Ce&&(cr=De||ls(cr)),cr.apply(Rn,Oe)}return Ce}function Sm(s,a){return function(u,f){return FD(u,s,a(f),{})}}function Ia(s,a){return function(u,f){var g;if(u===n&&f===n)return a;if(u!==n&&(g=u),f!==n){if(g===n)return f;typeof u=="string"||typeof f=="string"?(u=Qt(u),f=Qt(f)):(u=dm(u),f=dm(f)),g=s(u,f)}return g}}function gd(s){return ir(function(a){return a=tt(a,Jt(ge())),Ie(function(u){var f=this;return s(a,function(g){return Xt(g,f,u)})})})}function Fa(s,a){a=a===n?" ":Qt(a);var u=a.length;if(u<2)return u?cd(a,s):a;var f=cd(a,ba(s/Go(a)));return Mo(a)?Lr(An(f),0,s).join(""):f.slice(0,s)}function cI(s,a,u,f){var g=a&$,C=ls(s);function k(){for(var V=-1,L=arguments.length,K=-1,Y=f.length,Q=W(Y+L),oe=this&&this!==vt&&this instanceof k?C:s;++K<Y;)Q[K]=f[K];for(;L--;)Q[K++]=arguments[++V];return Xt(oe,g?u:this,Q)}return k}function Em(s){return function(a,u,f){return f&&typeof f!="number"&&Lt(a,u,f)&&(u=f=n),a=lr(a),u===n?(u=a,a=0):u=lr(u),f=f===n?a<u?1:-1:lr(f),qD(a,u,f,s)}}function La(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=un(a),u=un(u)),s(a,u)}}function Tm(s,a,u,f,g,C,k,V,L,K){var Y=a&D,Q=Y?k:n,oe=Y?n:k,pe=Y?C:n,_e=Y?n:C;a|=Y?A:N,a&=~(Y?N:A),a&B||(a&=~($|S));var De=[s,a,g,pe,Q,_e,oe,V,L,K],Ce=u.apply(n,De);return kd(s)&&Mm(Ce,De),Ce.placeholder=f,Gm(Ce,s,a)}function yd(s){var a=pt[s];return function(u,f){if(u=un(u),f=f==null?0:Tt(Be(f),292),f&&Gf(u)){var g=(We(u)+"e").split("e"),C=a(g[0]+"e"+(+g[1]+f));return g=(We(C)+"e").split("e"),+(g[0]+"e"+(+g[1]-f))}return a(u)}}var dI=Uo&&1/pa(new Uo([,-0]))[1]==X?function(s){return new Uo(s)}:Md;function Nm(s){return function(a){var u=Nt(a);return u==Nn?Hc(a):u==Vn?TR(a):CR(a,s(a))}}function or(s,a,u,f,g,C,k,V){var L=a&S;if(!L&&typeof s!="function")throw new sn(c);var K=f?f.length:0;if(K||(a&=~(A|N),f=g=n),k=k===n?k:ht(Be(k),0),V=V===n?V:Be(V),K-=g?g.length:0,a&N){var Y=f,Q=g;f=g=n}var oe=L?n:vd(s),pe=[s,a,u,f,g,Y,Q,C,k,V];if(oe&&SI(pe,oe),s=pe[0],a=pe[1],u=pe[2],f=pe[3],g=pe[4],V=pe[9]=pe[9]===n?L?0:s.length:ht(pe[9]-K,0),!V&&a&(D|H)&&(a&=~(D|H)),!a||a==$)var _e=aI(s,a,u);else a==D||a==H?_e=lI(s,a,V):(a==A||a==($|A))&&!g.length?_e=cI(s,a,u,f):_e=Da.apply(n,pe);var De=oe?lm:Mm;return Gm(De(_e,pe),s,a)}function Vm(s,a,u,f){return s===n||Pn(s,zo[u])&&!He.call(f,u)?a:s}function Am(s,a,u,f,g,C){return ot(s)&&ot(a)&&(C.set(a,s),Aa(s,a,n,Am,C),C.delete(a)),s}function uI(s){return us(s)?n:s}function Bm(s,a,u,f,g,C){var k=u&E,V=s.length,L=a.length;if(V!=L&&!(k&&L>V))return!1;var K=C.get(s),Y=C.get(a);if(K&&Y)return K==a&&Y==s;var Q=-1,oe=!0,pe=u&z?new io:n;for(C.set(s,a),C.set(a,s);++Q<V;){var _e=s[Q],De=a[Q];if(f)var Ce=k?f(De,_e,Q,a,s,C):f(_e,De,Q,s,a,C);if(Ce!==n){if(Ce)continue;oe=!1;break}if(pe){if(!$c(a,function(Fe,Oe){if(!Xi(pe,Oe)&&(_e===Fe||g(_e,Fe,u,f,C)))return pe.push(Oe)})){oe=!1;break}}else if(!(_e===De||g(_e,De,u,f,C))){oe=!1;break}}return C.delete(s),C.delete(a),oe}function pI(s,a,u,f,g,C,k){switch(u){case Fo:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Yi:return!(s.byteLength!=a.byteLength||!C(new _a(s),new _a(a)));case Zi:case Wi:case ji:return Pn(+s,+a);case oa:return s.name==a.name&&s.message==a.message;case Hi:case qi:return s==a+"";case Nn:var V=Hc;case Vn:var L=f&E;if(V||(V=pa),s.size!=a.size&&!L)return!1;var K=k.get(s);if(K)return K==a;f|=z,k.set(s,a);var Y=Bm(V(s),V(a),f,g,C,k);return k.delete(s),Y;case sa:if(ns)return ns.call(s)==ns.call(a)}return!1}function hI(s,a,u,f,g,C){var k=u&E,V=_d(s),L=V.length,K=_d(a),Y=K.length;if(L!=Y&&!k)return!1;for(var Q=L;Q--;){var oe=V[Q];if(!(k?oe in a:He.call(a,oe)))return!1}var pe=C.get(s),_e=C.get(a);if(pe&&_e)return pe==a&&_e==s;var De=!0;C.set(s,a),C.set(a,s);for(var Ce=k;++Q<L;){oe=V[Q];var Fe=s[oe],Oe=a[oe];if(f)var tn=k?f(Oe,Fe,oe,a,s,C):f(Fe,Oe,oe,s,a,C);if(!(tn===n?Fe===Oe||g(Fe,Oe,u,f,C):tn)){De=!1;break}Ce||(Ce=oe=="constructor")}if(De&&!Ce){var Ot=s.constructor,nn=a.constructor;Ot!=nn&&"constructor"in s&&"constructor"in a&&!(typeof Ot=="function"&&Ot instanceof Ot&&typeof nn=="function"&&nn instanceof nn)&&(De=!1)}return C.delete(s),C.delete(a),De}function ir(s){return Ed(Lm(s,n,jm),s+"")}function _d(s){return Xf(s,yt,bd)}function Cd(s){return Xf(s,Ut,Pm)}var vd=ka?function(s){return ka.get(s)}:Md;function Oa(s){for(var a=s.name+"",u=Zo[a],f=He.call(Zo,a)?u.length:0;f--;){var g=u[f],C=g.func;if(C==null||C==s)return g.name}return a}function qo(s){var a=He.call(_,"placeholder")?_:s;return a.placeholder}function ge(){var s=_.iteratee||Ld;return s=s===Ld?em:s,arguments.length?s(arguments[0],arguments[1]):s}function Ma(s,a){var u=s.__data__;return wI(a)?u[typeof a=="string"?"string":"hash"]:u.map}function wd(s){for(var a=yt(s),u=a.length;u--;){var f=a[u],g=s[f];a[u]=[f,g,Im(g)]}return a}function lo(s,a){var u=kR(s,a);return Qf(u)?u:n}function fI(s){var a=He.call(s,ro),u=s[ro];try{s[ro]=n;var f=!0}catch{}var g=ga.call(s);return f&&(a?s[ro]=u:delete s[ro]),g}var bd=Kc?function(s){return s==null?[]:(s=Ke(s),Ar(Kc(s),function(a){return Of.call(s,a)}))}:Gd,Pm=Kc?function(s){for(var a=[];s;)Br(a,bd(s)),s=Ca(s);return a}:Gd,Nt=Ft;(Yc&&Nt(new Yc(new ArrayBuffer(1)))!=Fo||Qi&&Nt(new Qi)!=Nn||Xc&&Nt(Xc.resolve())!=Hh||Uo&&Nt(new Uo)!=Vn||es&&Nt(new es)!=Ki)&&(Nt=function(s){var a=Ft(s),u=a==er?s.constructor:n,f=u?co(u):"";if(f)switch(f){case YR:return Fo;case XR:return Nn;case JR:return Hh;case QR:return Vn;case eD:return Ki}return a});function mI(s,a,u){for(var f=-1,g=u.length;++f<g;){var C=u[f],k=C.size;switch(C.type){case"drop":s+=k;break;case"dropRight":a-=k;break;case"take":a=Tt(a,s+k);break;case"takeRight":s=ht(s,a-k);break}}return{start:s,end:a}}function gI(s){var a=s.match(bP);return a?a[1].split(xP):[]}function Rm(s,a,u){a=Fr(a,s);for(var f=-1,g=a.length,C=!1;++f<g;){var k=Hn(a[f]);if(!(C=s!=null&&u(s,k)))break;s=s[k]}return C||++f!=g?C:(g=s==null?0:s.length,!!g&&ja(g)&&sr(k,g)&&(Ne(s)||uo(s)))}function yI(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&He.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function Dm(s){return typeof s.constructor=="function"&&!cs(s)?Wo(Ca(s)):{}}function _I(s,a,u){var f=s.constructor;switch(a){case Yi:return md(s);case Zi:case Wi:return new f(+s);case Fo:return tI(s,u);case wc:case bc:case xc:case kc:case Sc:case Ec:case Tc:case Nc:case Vc:return gm(s,u);case Nn:return new f;case ji:case qi:return new f(s);case Hi:return nI(s);case Vn:return new f;case sa:return rI(s)}}function CI(s,a){var u=a.length;if(!u)return s;var f=u-1;return a[f]=(u>1?"& ":"")+a[f],a=a.join(u>2?", ":" "),s.replace(wP,`{
|
|
72
|
+
*/Ws.exports,function(t,e){(function(){var n,o="4.17.21",i=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",d="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",y=1,w=2,b=4,E=1,$=2,O=1,T=2,P=4,R=8,j=16,N=32,v=64,L=128,U=256,Q=512,M=30,Z="...",z=800,B=16,A=1,G=2,H=3,X=1/0,ne=9007199254740991,de=17976931348623157e292,me=NaN,Te=4294967295,Ee=Te-1,je=Te>>>1,It=[["ary",L],["bind",O],["bindKey",T],["curry",R],["curryRight",j],["flip",Q],["partial",N],["partialRight",v],["rearg",U]],qe="[object Arguments]",Zn="[object Array]",hP="[object AsyncFunction]",Wi="[object Boolean]",ji="[object Date]",fP="[object DOMException]",oa="[object Error]",ia="[object Function]",Hh="[object GeneratorFunction]",Nn="[object Map]",Hi="[object Number]",mP="[object Null]",er="[object Object]",qh="[object Promise]",gP="[object Proxy]",qi="[object RegExp]",Vn="[object Set]",Ki="[object String]",sa="[object Symbol]",yP="[object Undefined]",Yi="[object WeakMap]",_P="[object WeakSet]",Xi="[object ArrayBuffer]",Fo="[object DataView]",bc="[object Float32Array]",xc="[object Float64Array]",kc="[object Int8Array]",Ec="[object Int16Array]",Sc="[object Int32Array]",Tc="[object Uint8Array]",Nc="[object Uint8ClampedArray]",Vc="[object Uint16Array]",Ac="[object Uint32Array]",CP=/\b__p \+= '';/g,vP=/\b(__p \+=) '' \+/g,wP=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Kh=/&(?:amp|lt|gt|quot|#39);/g,Yh=/[&<>"']/g,bP=RegExp(Kh.source),xP=RegExp(Yh.source),kP=/<%-([\s\S]+?)%>/g,EP=/<%([\s\S]+?)%>/g,Xh=/<%=([\s\S]+?)%>/g,SP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TP=/^\w*$/,NP=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bc=/[\\^$.*+?()[\]{}|]/g,VP=RegExp(Bc.source),Pc=/^\s+/,AP=/\s/,BP=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,PP=/\{\n\/\* \[wrapped with (.+)\] \*/,RP=/,? & /,DP=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,IP=/[()=,{}\[\]\/\s]/,FP=/\\(\\)?/g,LP=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Jh=/\w*$/,OP=/^[-+]0x[0-9a-f]+$/i,MP=/^0b[01]+$/i,GP=/^\[object .+?Constructor\]$/,$P=/^0o[0-7]+$/i,zP=/^(?:0|[1-9]\d*)$/,UP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,aa=/($^)/,ZP=/['\n\r\u2028\u2029\\]/g,la="\\ud800-\\udfff",WP="\\u0300-\\u036f",jP="\\ufe20-\\ufe2f",HP="\\u20d0-\\u20ff",Qh=WP+jP+HP,ef="\\u2700-\\u27bf",tf="a-z\\xdf-\\xf6\\xf8-\\xff",qP="\\xac\\xb1\\xd7\\xf7",KP="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",YP="\\u2000-\\u206f",XP=" \\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",nf="A-Z\\xc0-\\xd6\\xd8-\\xde",rf="\\ufe0e\\ufe0f",of=qP+KP+YP+XP,Rc="['’]",JP="["+la+"]",sf="["+of+"]",ca="["+Qh+"]",af="\\d+",QP="["+ef+"]",lf="["+tf+"]",cf="[^"+la+of+af+ef+tf+nf+"]",Dc="\\ud83c[\\udffb-\\udfff]",eR="(?:"+ca+"|"+Dc+")",df="[^"+la+"]",Ic="(?:\\ud83c[\\udde6-\\uddff]){2}",Fc="[\\ud800-\\udbff][\\udc00-\\udfff]",Lo="["+nf+"]",uf="\\u200d",pf="(?:"+lf+"|"+cf+")",tR="(?:"+Lo+"|"+cf+")",hf="(?:"+Rc+"(?:d|ll|m|re|s|t|ve))?",ff="(?:"+Rc+"(?:D|LL|M|RE|S|T|VE))?",mf=eR+"?",gf="["+rf+"]?",nR="(?:"+uf+"(?:"+[df,Ic,Fc].join("|")+")"+gf+mf+")*",rR="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oR="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",yf=gf+mf+nR,iR="(?:"+[QP,Ic,Fc].join("|")+")"+yf,sR="(?:"+[df+ca+"?",ca,Ic,Fc,JP].join("|")+")",aR=RegExp(Rc,"g"),lR=RegExp(ca,"g"),Lc=RegExp(Dc+"(?="+Dc+")|"+sR+yf,"g"),cR=RegExp([Lo+"?"+lf+"+"+hf+"(?="+[sf,Lo,"$"].join("|")+")",tR+"+"+ff+"(?="+[sf,Lo+pf,"$"].join("|")+")",Lo+"?"+pf+"+"+hf,Lo+"+"+ff,oR,rR,af,iR].join("|"),"g"),dR=RegExp("["+uf+la+Qh+rf+"]"),uR=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,pR=["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"],hR=-1,Qe={};Qe[bc]=Qe[xc]=Qe[kc]=Qe[Ec]=Qe[Sc]=Qe[Tc]=Qe[Nc]=Qe[Vc]=Qe[Ac]=!0,Qe[qe]=Qe[Zn]=Qe[Xi]=Qe[Wi]=Qe[Fo]=Qe[ji]=Qe[oa]=Qe[ia]=Qe[Nn]=Qe[Hi]=Qe[er]=Qe[qi]=Qe[Vn]=Qe[Ki]=Qe[Yi]=!1;var Xe={};Xe[qe]=Xe[Zn]=Xe[Xi]=Xe[Fo]=Xe[Wi]=Xe[ji]=Xe[bc]=Xe[xc]=Xe[kc]=Xe[Ec]=Xe[Sc]=Xe[Nn]=Xe[Hi]=Xe[er]=Xe[qi]=Xe[Vn]=Xe[Ki]=Xe[sa]=Xe[Tc]=Xe[Nc]=Xe[Vc]=Xe[Ac]=!0,Xe[oa]=Xe[ia]=Xe[Yi]=!1;var fR={À:"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"},mR={"&":"&","<":"<",">":">",'"':""","'":"'"},gR={"&":"&","<":"<",">":">",""":'"',"'":"'"},yR={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_R=parseFloat,CR=parseInt,_f=typeof Xo=="object"&&Xo&&Xo.Object===Object&&Xo,vR=typeof self=="object"&&self&&self.Object===Object&&self,vt=_f||vR||Function("return this")(),Oc=e&&!e.nodeType&&e,no=Oc&&!0&&t&&!t.nodeType&&t,Cf=no&&no.exports===Oc,Mc=Cf&&_f.process,rn=function(){try{var D=no&&no.require&&no.require("util").types;return D||Mc&&Mc.binding&&Mc.binding("util")}catch{}}(),vf=rn&&rn.isArrayBuffer,wf=rn&&rn.isDate,bf=rn&&rn.isMap,xf=rn&&rn.isRegExp,kf=rn&&rn.isSet,Ef=rn&&rn.isTypedArray;function Xt(D,q,W){switch(W.length){case 0:return D.call(q);case 1:return D.call(q,W[0]);case 2:return D.call(q,W[0],W[1]);case 3:return D.call(q,W[0],W[1],W[2])}return D.apply(q,W)}function wR(D,q,W,ce){for(var Se=-1,Ue=D==null?0:D.length;++Se<Ue;){var pt=D[Se];q(ce,pt,W(pt),D)}return ce}function on(D,q){for(var W=-1,ce=D==null?0:D.length;++W<ce&&q(D[W],W,D)!==!1;);return D}function bR(D,q){for(var W=D==null?0:D.length;W--&&q(D[W],W,D)!==!1;);return D}function Sf(D,q){for(var W=-1,ce=D==null?0:D.length;++W<ce;)if(!q(D[W],W,D))return!1;return!0}function Br(D,q){for(var W=-1,ce=D==null?0:D.length,Se=0,Ue=[];++W<ce;){var pt=D[W];q(pt,W,D)&&(Ue[Se++]=pt)}return Ue}function da(D,q){var W=D==null?0:D.length;return!!W&&Oo(D,q,0)>-1}function Gc(D,q,W){for(var ce=-1,Se=D==null?0:D.length;++ce<Se;)if(W(q,D[ce]))return!0;return!1}function tt(D,q){for(var W=-1,ce=D==null?0:D.length,Se=Array(ce);++W<ce;)Se[W]=q(D[W],W,D);return Se}function Pr(D,q){for(var W=-1,ce=q.length,Se=D.length;++W<ce;)D[Se+W]=q[W];return D}function $c(D,q,W,ce){var Se=-1,Ue=D==null?0:D.length;for(ce&&Ue&&(W=D[++Se]);++Se<Ue;)W=q(W,D[Se],Se,D);return W}function xR(D,q,W,ce){var Se=D==null?0:D.length;for(ce&&Se&&(W=D[--Se]);Se--;)W=q(W,D[Se],Se,D);return W}function zc(D,q){for(var W=-1,ce=D==null?0:D.length;++W<ce;)if(q(D[W],W,D))return!0;return!1}var kR=Uc("length");function ER(D){return D.split("")}function SR(D){return D.match(DP)||[]}function Tf(D,q,W){var ce;return W(D,function(Se,Ue,pt){if(q(Se,Ue,pt))return ce=Ue,!1}),ce}function ua(D,q,W,ce){for(var Se=D.length,Ue=W+(ce?1:-1);ce?Ue--:++Ue<Se;)if(q(D[Ue],Ue,D))return Ue;return-1}function Oo(D,q,W){return q===q?OR(D,q,W):ua(D,Nf,W)}function TR(D,q,W,ce){for(var Se=W-1,Ue=D.length;++Se<Ue;)if(ce(D[Se],q))return Se;return-1}function Nf(D){return D!==D}function Vf(D,q){var W=D==null?0:D.length;return W?Wc(D,q)/W:me}function Uc(D){return function(q){return q==null?n:q[D]}}function Zc(D){return function(q){return D==null?n:D[q]}}function Af(D,q,W,ce,Se){return Se(D,function(Ue,pt,Ke){W=ce?(ce=!1,Ue):q(W,Ue,pt,Ke)}),W}function NR(D,q){var W=D.length;for(D.sort(q);W--;)D[W]=D[W].value;return D}function Wc(D,q){for(var W,ce=-1,Se=D.length;++ce<Se;){var Ue=q(D[ce]);Ue!==n&&(W=W===n?Ue:W+Ue)}return W}function jc(D,q){for(var W=-1,ce=Array(D);++W<D;)ce[W]=q(W);return ce}function VR(D,q){return tt(q,function(W){return[W,D[W]]})}function Bf(D){return D&&D.slice(0,If(D)+1).replace(Pc,"")}function Jt(D){return function(q){return D(q)}}function Hc(D,q){return tt(q,function(W){return D[W]})}function Ji(D,q){return D.has(q)}function Pf(D,q){for(var W=-1,ce=D.length;++W<ce&&Oo(q,D[W],0)>-1;);return W}function Rf(D,q){for(var W=D.length;W--&&Oo(q,D[W],0)>-1;);return W}function AR(D,q){for(var W=D.length,ce=0;W--;)D[W]===q&&++ce;return ce}var BR=Zc(fR),PR=Zc(mR);function RR(D){return"\\"+yR[D]}function DR(D,q){return D==null?n:D[q]}function Mo(D){return dR.test(D)}function IR(D){return uR.test(D)}function FR(D){for(var q,W=[];!(q=D.next()).done;)W.push(q.value);return W}function qc(D){var q=-1,W=Array(D.size);return D.forEach(function(ce,Se){W[++q]=[Se,ce]}),W}function Df(D,q){return function(W){return D(q(W))}}function Rr(D,q){for(var W=-1,ce=D.length,Se=0,Ue=[];++W<ce;){var pt=D[W];(pt===q||pt===m)&&(D[W]=m,Ue[Se++]=W)}return Ue}function pa(D){var q=-1,W=Array(D.size);return D.forEach(function(ce){W[++q]=ce}),W}function LR(D){var q=-1,W=Array(D.size);return D.forEach(function(ce){W[++q]=[ce,ce]}),W}function OR(D,q,W){for(var ce=W-1,Se=D.length;++ce<Se;)if(D[ce]===q)return ce;return-1}function MR(D,q,W){for(var ce=W+1;ce--;)if(D[ce]===q)return ce;return ce}function Go(D){return Mo(D)?$R(D):kR(D)}function An(D){return Mo(D)?zR(D):ER(D)}function If(D){for(var q=D.length;q--&&AP.test(D.charAt(q)););return q}var GR=Zc(gR);function $R(D){for(var q=Lc.lastIndex=0;Lc.test(D);)++q;return q}function zR(D){return D.match(Lc)||[]}function UR(D){return D.match(cR)||[]}var ZR=function D(q){q=q==null?vt:$o.defaults(vt.Object(),q,$o.pick(vt,pR));var W=q.Array,ce=q.Date,Se=q.Error,Ue=q.Function,pt=q.Math,Ke=q.Object,Kc=q.RegExp,WR=q.String,sn=q.TypeError,ha=W.prototype,jR=Ue.prototype,zo=Ke.prototype,fa=q["__core-js_shared__"],ma=jR.toString,He=zo.hasOwnProperty,HR=0,Ff=function(){var s=/[^.]+$/.exec(fa&&fa.keys&&fa.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),ga=zo.toString,qR=ma.call(Ke),KR=vt._,YR=Kc("^"+ma.call(He).replace(Bc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ya=Cf?q.Buffer:n,Dr=q.Symbol,_a=q.Uint8Array,Lf=ya?ya.allocUnsafe:n,Ca=Df(Ke.getPrototypeOf,Ke),Of=Ke.create,Mf=zo.propertyIsEnumerable,va=ha.splice,Gf=Dr?Dr.isConcatSpreadable:n,Qi=Dr?Dr.iterator:n,ro=Dr?Dr.toStringTag:n,wa=function(){try{var s=lo(Ke,"defineProperty");return s({},"",{}),s}catch{}}(),XR=q.clearTimeout!==vt.clearTimeout&&q.clearTimeout,JR=ce&&ce.now!==vt.Date.now&&ce.now,QR=q.setTimeout!==vt.setTimeout&&q.setTimeout,ba=pt.ceil,xa=pt.floor,Yc=Ke.getOwnPropertySymbols,eD=ya?ya.isBuffer:n,$f=q.isFinite,tD=ha.join,nD=Df(Ke.keys,Ke),ht=pt.max,Tt=pt.min,rD=ce.now,oD=q.parseInt,zf=pt.random,iD=ha.reverse,Xc=lo(q,"DataView"),es=lo(q,"Map"),Jc=lo(q,"Promise"),Uo=lo(q,"Set"),ts=lo(q,"WeakMap"),ns=lo(Ke,"create"),ka=ts&&new ts,Zo={},sD=co(Xc),aD=co(es),lD=co(Jc),cD=co(Uo),dD=co(ts),Ea=Dr?Dr.prototype:n,rs=Ea?Ea.valueOf:n,Uf=Ea?Ea.toString:n;function _(s){if(it(s)&&!Ne(s)&&!(s instanceof Le)){if(s instanceof an)return s;if(He.call(s,"__wrapped__"))return Zm(s)}return new an(s)}var Wo=function(){function s(){}return function(a){if(!ot(a))return{};if(Of)return Of(a);s.prototype=a;var u=new s;return s.prototype=n,u}}();function Sa(){}function an(s,a){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!a,this.__index__=0,this.__values__=n}_.templateSettings={escape:kP,evaluate:EP,interpolate:Xh,variable:"",imports:{_}},_.prototype=Sa.prototype,_.prototype.constructor=_,an.prototype=Wo(Sa.prototype),an.prototype.constructor=an;function Le(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Te,this.__views__=[]}function uD(){var s=new Le(this.__wrapped__);return s.__actions__=$t(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=$t(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=$t(this.__views__),s}function pD(){if(this.__filtered__){var s=new Le(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function hD(){var s=this.__wrapped__.value(),a=this.__dir__,u=Ne(s),f=a<0,g=u?s.length:0,C=EI(0,g,this.__views__),S=C.start,V=C.end,F=V-S,K=f?V:S-1,Y=this.__iteratees__,J=Y.length,oe=0,pe=Tt(F,this.__takeCount__);if(!u||!f&&g==F&&pe==F)return hm(s,this.__actions__);var _e=[];e:for(;F--&&oe<pe;){K+=a;for(var De=-1,Ce=s[K];++De<J;){var Fe=Y[De],Oe=Fe.iteratee,tn=Fe.type,Ot=Oe(Ce);if(tn==G)Ce=Ot;else if(!Ot){if(tn==A)continue e;break e}}_e[oe++]=Ce}return _e}Le.prototype=Wo(Sa.prototype),Le.prototype.constructor=Le;function oo(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function fD(){this.__data__=ns?ns(null):{},this.size=0}function mD(s){var a=this.has(s)&&delete this.__data__[s];return this.size-=a?1:0,a}function gD(s){var a=this.__data__;if(ns){var u=a[s];return u===p?n:u}return He.call(a,s)?a[s]:n}function yD(s){var a=this.__data__;return ns?a[s]!==n:He.call(a,s)}function _D(s,a){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=ns&&a===n?p:a,this}oo.prototype.clear=fD,oo.prototype.delete=mD,oo.prototype.get=gD,oo.prototype.has=yD,oo.prototype.set=_D;function tr(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function CD(){this.__data__=[],this.size=0}function vD(s){var a=this.__data__,u=Ta(a,s);if(u<0)return!1;var f=a.length-1;return u==f?a.pop():va.call(a,u,1),--this.size,!0}function wD(s){var a=this.__data__,u=Ta(a,s);return u<0?n:a[u][1]}function bD(s){return Ta(this.__data__,s)>-1}function xD(s,a){var u=this.__data__,f=Ta(u,s);return f<0?(++this.size,u.push([s,a])):u[f][1]=a,this}tr.prototype.clear=CD,tr.prototype.delete=vD,tr.prototype.get=wD,tr.prototype.has=bD,tr.prototype.set=xD;function nr(s){var a=-1,u=s==null?0:s.length;for(this.clear();++a<u;){var f=s[a];this.set(f[0],f[1])}}function kD(){this.size=0,this.__data__={hash:new oo,map:new(es||tr),string:new oo}}function ED(s){var a=Ma(this,s).delete(s);return this.size-=a?1:0,a}function SD(s){return Ma(this,s).get(s)}function TD(s){return Ma(this,s).has(s)}function ND(s,a){var u=Ma(this,s),f=u.size;return u.set(s,a),this.size+=u.size==f?0:1,this}nr.prototype.clear=kD,nr.prototype.delete=ED,nr.prototype.get=SD,nr.prototype.has=TD,nr.prototype.set=ND;function io(s){var a=-1,u=s==null?0:s.length;for(this.__data__=new nr;++a<u;)this.add(s[a])}function VD(s){return this.__data__.set(s,p),this}function AD(s){return this.__data__.has(s)}io.prototype.add=io.prototype.push=VD,io.prototype.has=AD;function Bn(s){var a=this.__data__=new tr(s);this.size=a.size}function BD(){this.__data__=new tr,this.size=0}function PD(s){var a=this.__data__,u=a.delete(s);return this.size=a.size,u}function RD(s){return this.__data__.get(s)}function DD(s){return this.__data__.has(s)}function ID(s,a){var u=this.__data__;if(u instanceof tr){var f=u.__data__;if(!es||f.length<i-1)return f.push([s,a]),this.size=++u.size,this;u=this.__data__=new nr(f)}return u.set(s,a),this.size=u.size,this}Bn.prototype.clear=BD,Bn.prototype.delete=PD,Bn.prototype.get=RD,Bn.prototype.has=DD,Bn.prototype.set=ID;function Zf(s,a){var u=Ne(s),f=!u&&uo(s),g=!u&&!f&&Mr(s),C=!u&&!f&&!g&&Ko(s),S=u||f||g||C,V=S?jc(s.length,WR):[],F=V.length;for(var K in s)(a||He.call(s,K))&&!(S&&(K=="length"||g&&(K=="offset"||K=="parent")||C&&(K=="buffer"||K=="byteLength"||K=="byteOffset")||sr(K,F)))&&V.push(K);return V}function Wf(s){var a=s.length;return a?s[cd(0,a-1)]:n}function FD(s,a){return Ga($t(s),so(a,0,s.length))}function LD(s){return Ga($t(s))}function Qc(s,a,u){(u!==n&&!Pn(s[a],u)||u===n&&!(a in s))&&rr(s,a,u)}function os(s,a,u){var f=s[a];(!(He.call(s,a)&&Pn(f,u))||u===n&&!(a in s))&&rr(s,a,u)}function Ta(s,a){for(var u=s.length;u--;)if(Pn(s[u][0],a))return u;return-1}function OD(s,a,u,f){return Ir(s,function(g,C,S){a(f,g,u(g),S)}),f}function jf(s,a){return s&&jn(a,yt(a),s)}function MD(s,a){return s&&jn(a,Ut(a),s)}function rr(s,a,u){a=="__proto__"&&wa?wa(s,a,{configurable:!0,enumerable:!0,value:u,writable:!0}):s[a]=u}function ed(s,a){for(var u=-1,f=a.length,g=W(f),C=s==null;++u<f;)g[u]=C?n:Dd(s,a[u]);return g}function so(s,a,u){return s===s&&(u!==n&&(s=s<=u?s:u),a!==n&&(s=s>=a?s:a)),s}function ln(s,a,u,f,g,C){var S,V=a&y,F=a&w,K=a&b;if(u&&(S=g?u(s,f,g,C):u(s)),S!==n)return S;if(!ot(s))return s;var Y=Ne(s);if(Y){if(S=TI(s),!V)return $t(s,S)}else{var J=Nt(s),oe=J==ia||J==Hh;if(Mr(s))return gm(s,V);if(J==er||J==qe||oe&&!g){if(S=F||oe?{}:Im(s),!V)return F?gI(s,MD(S,s)):mI(s,jf(S,s))}else{if(!Xe[J])return g?s:{};S=NI(s,J,V)}}C||(C=new Bn);var pe=C.get(s);if(pe)return pe;C.set(s,S),dg(s)?s.forEach(function(Ce){S.add(ln(Ce,a,u,Ce,s,C))}):lg(s)&&s.forEach(function(Ce,Fe){S.set(Fe,ln(Ce,a,u,Fe,s,C))});var _e=K?F?vd:Cd:F?Ut:yt,De=Y?n:_e(s);return on(De||s,function(Ce,Fe){De&&(Fe=Ce,Ce=s[Fe]),os(S,Fe,ln(Ce,a,u,Fe,s,C))}),S}function GD(s){var a=yt(s);return function(u){return Hf(u,s,a)}}function Hf(s,a,u){var f=u.length;if(s==null)return!f;for(s=Ke(s);f--;){var g=u[f],C=a[g],S=s[g];if(S===n&&!(g in s)||!C(S))return!1}return!0}function qf(s,a,u){if(typeof s!="function")throw new sn(c);return us(function(){s.apply(n,u)},a)}function is(s,a,u,f){var g=-1,C=da,S=!0,V=s.length,F=[],K=a.length;if(!V)return F;u&&(a=tt(a,Jt(u))),f?(C=Gc,S=!1):a.length>=i&&(C=Ji,S=!1,a=new io(a));e:for(;++g<V;){var Y=s[g],J=u==null?Y:u(Y);if(Y=f||Y!==0?Y:0,S&&J===J){for(var oe=K;oe--;)if(a[oe]===J)continue e;F.push(Y)}else C(a,J,f)||F.push(Y)}return F}var Ir=wm(Wn),Kf=wm(nd,!0);function $D(s,a){var u=!0;return Ir(s,function(f,g,C){return u=!!a(f,g,C),u}),u}function Na(s,a,u){for(var f=-1,g=s.length;++f<g;){var C=s[f],S=a(C);if(S!=null&&(V===n?S===S&&!en(S):u(S,V)))var V=S,F=C}return F}function zD(s,a,u,f){var g=s.length;for(u=Be(u),u<0&&(u=-u>g?0:g+u),f=f===n||f>g?g:Be(f),f<0&&(f+=g),f=u>f?0:pg(f);u<f;)s[u++]=a;return s}function Yf(s,a){var u=[];return Ir(s,function(f,g,C){a(f,g,C)&&u.push(f)}),u}function wt(s,a,u,f,g){var C=-1,S=s.length;for(u||(u=AI),g||(g=[]);++C<S;){var V=s[C];a>0&&u(V)?a>1?wt(V,a-1,u,f,g):Pr(g,V):f||(g[g.length]=V)}return g}var td=bm(),Xf=bm(!0);function Wn(s,a){return s&&td(s,a,yt)}function nd(s,a){return s&&Xf(s,a,yt)}function Va(s,a){return Br(a,function(u){return ar(s[u])})}function ao(s,a){a=Lr(a,s);for(var u=0,f=a.length;s!=null&&u<f;)s=s[Hn(a[u++])];return u&&u==f?s:n}function Jf(s,a,u){var f=a(s);return Ne(s)?f:Pr(f,u(s))}function Ft(s){return s==null?s===n?yP:mP:ro&&ro in Ke(s)?kI(s):LI(s)}function rd(s,a){return s>a}function UD(s,a){return s!=null&&He.call(s,a)}function ZD(s,a){return s!=null&&a in Ke(s)}function WD(s,a,u){return s>=Tt(a,u)&&s<ht(a,u)}function od(s,a,u){for(var f=u?Gc:da,g=s[0].length,C=s.length,S=C,V=W(C),F=1/0,K=[];S--;){var Y=s[S];S&&a&&(Y=tt(Y,Jt(a))),F=Tt(Y.length,F),V[S]=!u&&(a||g>=120&&Y.length>=120)?new io(S&&Y):n}Y=s[0];var J=-1,oe=V[0];e:for(;++J<g&&K.length<F;){var pe=Y[J],_e=a?a(pe):pe;if(pe=u||pe!==0?pe:0,!(oe?Ji(oe,_e):f(K,_e,u))){for(S=C;--S;){var De=V[S];if(!(De?Ji(De,_e):f(s[S],_e,u)))continue e}oe&&oe.push(_e),K.push(pe)}}return K}function jD(s,a,u,f){return Wn(s,function(g,C,S){a(f,u(g),C,S)}),f}function ss(s,a,u){a=Lr(a,s),s=Mm(s,a);var f=s==null?s:s[Hn(dn(a))];return f==null?n:Xt(f,s,u)}function Qf(s){return it(s)&&Ft(s)==qe}function HD(s){return it(s)&&Ft(s)==Xi}function qD(s){return it(s)&&Ft(s)==ji}function as(s,a,u,f,g){return s===a?!0:s==null||a==null||!it(s)&&!it(a)?s!==s&&a!==a:KD(s,a,u,f,as,g)}function KD(s,a,u,f,g,C){var S=Ne(s),V=Ne(a),F=S?Zn:Nt(s),K=V?Zn:Nt(a);F=F==qe?er:F,K=K==qe?er:K;var Y=F==er,J=K==er,oe=F==K;if(oe&&Mr(s)){if(!Mr(a))return!1;S=!0,Y=!1}if(oe&&!Y)return C||(C=new Bn),S||Ko(s)?Pm(s,a,u,f,g,C):bI(s,a,F,u,f,g,C);if(!(u&E)){var pe=Y&&He.call(s,"__wrapped__"),_e=J&&He.call(a,"__wrapped__");if(pe||_e){var De=pe?s.value():s,Ce=_e?a.value():a;return C||(C=new Bn),g(De,Ce,u,f,C)}}return oe?(C||(C=new Bn),xI(s,a,u,f,g,C)):!1}function YD(s){return it(s)&&Nt(s)==Nn}function id(s,a,u,f){var g=u.length,C=g,S=!f;if(s==null)return!C;for(s=Ke(s);g--;){var V=u[g];if(S&&V[2]?V[1]!==s[V[0]]:!(V[0]in s))return!1}for(;++g<C;){V=u[g];var F=V[0],K=s[F],Y=V[1];if(S&&V[2]){if(K===n&&!(F in s))return!1}else{var J=new Bn;if(f)var oe=f(K,Y,F,s,a,J);if(!(oe===n?as(Y,K,E|$,f,J):oe))return!1}}return!0}function em(s){if(!ot(s)||PI(s))return!1;var a=ar(s)?YR:GP;return a.test(co(s))}function XD(s){return it(s)&&Ft(s)==qi}function JD(s){return it(s)&&Nt(s)==Vn}function QD(s){return it(s)&&ja(s.length)&&!!Qe[Ft(s)]}function tm(s){return typeof s=="function"?s:s==null?Zt:typeof s=="object"?Ne(s)?om(s[0],s[1]):rm(s):xg(s)}function sd(s){if(!ds(s))return nD(s);var a=[];for(var u in Ke(s))He.call(s,u)&&u!="constructor"&&a.push(u);return a}function eI(s){if(!ot(s))return FI(s);var a=ds(s),u=[];for(var f in s)f=="constructor"&&(a||!He.call(s,f))||u.push(f);return u}function ad(s,a){return s<a}function nm(s,a){var u=-1,f=zt(s)?W(s.length):[];return Ir(s,function(g,C,S){f[++u]=a(g,C,S)}),f}function rm(s){var a=bd(s);return a.length==1&&a[0][2]?Lm(a[0][0],a[0][1]):function(u){return u===s||id(u,s,a)}}function om(s,a){return kd(s)&&Fm(a)?Lm(Hn(s),a):function(u){var f=Dd(u,s);return f===n&&f===a?Id(u,s):as(a,f,E|$)}}function Aa(s,a,u,f,g){s!==a&&td(a,function(C,S){if(g||(g=new Bn),ot(C))tI(s,a,S,u,Aa,f,g);else{var V=f?f(Sd(s,S),C,S+"",s,a,g):n;V===n&&(V=C),Qc(s,S,V)}},Ut)}function tI(s,a,u,f,g,C,S){var V=Sd(s,u),F=Sd(a,u),K=S.get(F);if(K){Qc(s,u,K);return}var Y=C?C(V,F,u+"",s,a,S):n,J=Y===n;if(J){var oe=Ne(F),pe=!oe&&Mr(F),_e=!oe&&!pe&&Ko(F);Y=F,oe||pe||_e?Ne(V)?Y=V:at(V)?Y=$t(V):pe?(J=!1,Y=gm(F,!0)):_e?(J=!1,Y=ym(F,!0)):Y=[]:ps(F)||uo(F)?(Y=V,uo(V)?Y=hg(V):(!ot(V)||ar(V))&&(Y=Im(F))):J=!1}J&&(S.set(F,Y),g(Y,F,f,C,S),S.delete(F)),Qc(s,u,Y)}function im(s,a){var u=s.length;if(u)return a+=a<0?u:0,sr(a,u)?s[a]:n}function sm(s,a,u){a.length?a=tt(a,function(C){return Ne(C)?function(S){return ao(S,C.length===1?C[0]:C)}:C}):a=[Zt];var f=-1;a=tt(a,Jt(ge()));var g=nm(s,function(C,S,V){var F=tt(a,function(K){return K(C)});return{criteria:F,index:++f,value:C}});return NR(g,function(C,S){return fI(C,S,u)})}function nI(s,a){return am(s,a,function(u,f){return Id(s,f)})}function am(s,a,u){for(var f=-1,g=a.length,C={};++f<g;){var S=a[f],V=ao(s,S);u(V,S)&&ls(C,Lr(S,s),V)}return C}function rI(s){return function(a){return ao(a,s)}}function ld(s,a,u,f){var g=f?TR:Oo,C=-1,S=a.length,V=s;for(s===a&&(a=$t(a)),u&&(V=tt(s,Jt(u)));++C<S;)for(var F=0,K=a[C],Y=u?u(K):K;(F=g(V,Y,F,f))>-1;)V!==s&&va.call(V,F,1),va.call(s,F,1);return s}function lm(s,a){for(var u=s?a.length:0,f=u-1;u--;){var g=a[u];if(u==f||g!==C){var C=g;sr(g)?va.call(s,g,1):pd(s,g)}}return s}function cd(s,a){return s+xa(zf()*(a-s+1))}function oI(s,a,u,f){for(var g=-1,C=ht(ba((a-s)/(u||1)),0),S=W(C);C--;)S[f?C:++g]=s,s+=u;return S}function dd(s,a){var u="";if(!s||a<1||a>ne)return u;do a%2&&(u+=s),a=xa(a/2),a&&(s+=s);while(a);return u}function Ie(s,a){return Td(Om(s,a,Zt),s+"")}function iI(s){return Wf(Yo(s))}function sI(s,a){var u=Yo(s);return Ga(u,so(a,0,u.length))}function ls(s,a,u,f){if(!ot(s))return s;a=Lr(a,s);for(var g=-1,C=a.length,S=C-1,V=s;V!=null&&++g<C;){var F=Hn(a[g]),K=u;if(F==="__proto__"||F==="constructor"||F==="prototype")return s;if(g!=S){var Y=V[F];K=f?f(Y,F,V):n,K===n&&(K=ot(Y)?Y:sr(a[g+1])?[]:{})}os(V,F,K),V=V[F]}return s}var cm=ka?function(s,a){return ka.set(s,a),s}:Zt,aI=wa?function(s,a){return wa(s,"toString",{configurable:!0,enumerable:!1,value:Ld(a),writable:!0})}:Zt;function lI(s){return Ga(Yo(s))}function cn(s,a,u){var f=-1,g=s.length;a<0&&(a=-a>g?0:g+a),u=u>g?g:u,u<0&&(u+=g),g=a>u?0:u-a>>>0,a>>>=0;for(var C=W(g);++f<g;)C[f]=s[f+a];return C}function cI(s,a){var u;return Ir(s,function(f,g,C){return u=a(f,g,C),!u}),!!u}function Ba(s,a,u){var f=0,g=s==null?f:s.length;if(typeof a=="number"&&a===a&&g<=je){for(;f<g;){var C=f+g>>>1,S=s[C];S!==null&&!en(S)&&(u?S<=a:S<a)?f=C+1:g=C}return g}return ud(s,a,Zt,u)}function ud(s,a,u,f){var g=0,C=s==null?0:s.length;if(C===0)return 0;a=u(a);for(var S=a!==a,V=a===null,F=en(a),K=a===n;g<C;){var Y=xa((g+C)/2),J=u(s[Y]),oe=J!==n,pe=J===null,_e=J===J,De=en(J);if(S)var Ce=f||_e;else K?Ce=_e&&(f||oe):V?Ce=_e&&oe&&(f||!pe):F?Ce=_e&&oe&&!pe&&(f||!De):pe||De?Ce=!1:Ce=f?J<=a:J<a;Ce?g=Y+1:C=Y}return Tt(C,Ee)}function dm(s,a){for(var u=-1,f=s.length,g=0,C=[];++u<f;){var S=s[u],V=a?a(S):S;if(!u||!Pn(V,F)){var F=V;C[g++]=S===0?0:S}}return C}function um(s){return typeof s=="number"?s:en(s)?me:+s}function Qt(s){if(typeof s=="string")return s;if(Ne(s))return tt(s,Qt)+"";if(en(s))return Uf?Uf.call(s):"";var a=s+"";return a=="0"&&1/s==-X?"-0":a}function Fr(s,a,u){var f=-1,g=da,C=s.length,S=!0,V=[],F=V;if(u)S=!1,g=Gc;else if(C>=i){var K=a?null:vI(s);if(K)return pa(K);S=!1,g=Ji,F=new io}else F=a?[]:V;e:for(;++f<C;){var Y=s[f],J=a?a(Y):Y;if(Y=u||Y!==0?Y:0,S&&J===J){for(var oe=F.length;oe--;)if(F[oe]===J)continue e;a&&F.push(J),V.push(Y)}else g(F,J,u)||(F!==V&&F.push(J),V.push(Y))}return V}function pd(s,a){return a=Lr(a,s),s=Mm(s,a),s==null||delete s[Hn(dn(a))]}function pm(s,a,u,f){return ls(s,a,u(ao(s,a)),f)}function Pa(s,a,u,f){for(var g=s.length,C=f?g:-1;(f?C--:++C<g)&&a(s[C],C,s););return u?cn(s,f?0:C,f?C+1:g):cn(s,f?C+1:0,f?g:C)}function hm(s,a){var u=s;return u instanceof Le&&(u=u.value()),$c(a,function(f,g){return g.func.apply(g.thisArg,Pr([f],g.args))},u)}function hd(s,a,u){var f=s.length;if(f<2)return f?Fr(s[0]):[];for(var g=-1,C=W(f);++g<f;)for(var S=s[g],V=-1;++V<f;)V!=g&&(C[g]=is(C[g]||S,s[V],a,u));return Fr(wt(C,1),a,u)}function fm(s,a,u){for(var f=-1,g=s.length,C=a.length,S={};++f<g;){var V=f<C?a[f]:n;u(S,s[f],V)}return S}function fd(s){return at(s)?s:[]}function md(s){return typeof s=="function"?s:Zt}function Lr(s,a){return Ne(s)?s:kd(s,a)?[s]:Um(We(s))}var dI=Ie;function Or(s,a,u){var f=s.length;return u=u===n?f:u,!a&&u>=f?s:cn(s,a,u)}var mm=XR||function(s){return vt.clearTimeout(s)};function gm(s,a){if(a)return s.slice();var u=s.length,f=Lf?Lf(u):new s.constructor(u);return s.copy(f),f}function gd(s){var a=new s.constructor(s.byteLength);return new _a(a).set(new _a(s)),a}function uI(s,a){var u=a?gd(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.byteLength)}function pI(s){var a=new s.constructor(s.source,Jh.exec(s));return a.lastIndex=s.lastIndex,a}function hI(s){return rs?Ke(rs.call(s)):{}}function ym(s,a){var u=a?gd(s.buffer):s.buffer;return new s.constructor(u,s.byteOffset,s.length)}function _m(s,a){if(s!==a){var u=s!==n,f=s===null,g=s===s,C=en(s),S=a!==n,V=a===null,F=a===a,K=en(a);if(!V&&!K&&!C&&s>a||C&&S&&F&&!V&&!K||f&&S&&F||!u&&F||!g)return 1;if(!f&&!C&&!K&&s<a||K&&u&&g&&!f&&!C||V&&u&&g||!S&&g||!F)return-1}return 0}function fI(s,a,u){for(var f=-1,g=s.criteria,C=a.criteria,S=g.length,V=u.length;++f<S;){var F=_m(g[f],C[f]);if(F){if(f>=V)return F;var K=u[f];return F*(K=="desc"?-1:1)}}return s.index-a.index}function Cm(s,a,u,f){for(var g=-1,C=s.length,S=u.length,V=-1,F=a.length,K=ht(C-S,0),Y=W(F+K),J=!f;++V<F;)Y[V]=a[V];for(;++g<S;)(J||g<C)&&(Y[u[g]]=s[g]);for(;K--;)Y[V++]=s[g++];return Y}function vm(s,a,u,f){for(var g=-1,C=s.length,S=-1,V=u.length,F=-1,K=a.length,Y=ht(C-V,0),J=W(Y+K),oe=!f;++g<Y;)J[g]=s[g];for(var pe=g;++F<K;)J[pe+F]=a[F];for(;++S<V;)(oe||g<C)&&(J[pe+u[S]]=s[g++]);return J}function $t(s,a){var u=-1,f=s.length;for(a||(a=W(f));++u<f;)a[u]=s[u];return a}function jn(s,a,u,f){var g=!u;u||(u={});for(var C=-1,S=a.length;++C<S;){var V=a[C],F=f?f(u[V],s[V],V,u,s):n;F===n&&(F=s[V]),g?rr(u,V,F):os(u,V,F)}return u}function mI(s,a){return jn(s,xd(s),a)}function gI(s,a){return jn(s,Rm(s),a)}function Ra(s,a){return function(u,f){var g=Ne(u)?wR:OD,C=a?a():{};return g(u,s,ge(f,2),C)}}function jo(s){return Ie(function(a,u){var f=-1,g=u.length,C=g>1?u[g-1]:n,S=g>2?u[2]:n;for(C=s.length>3&&typeof C=="function"?(g--,C):n,S&&Lt(u[0],u[1],S)&&(C=g<3?n:C,g=1),a=Ke(a);++f<g;){var V=u[f];V&&s(a,V,f,C)}return a})}function wm(s,a){return function(u,f){if(u==null)return u;if(!zt(u))return s(u,f);for(var g=u.length,C=a?g:-1,S=Ke(u);(a?C--:++C<g)&&f(S[C],C,S)!==!1;);return u}}function bm(s){return function(a,u,f){for(var g=-1,C=Ke(a),S=f(a),V=S.length;V--;){var F=S[s?V:++g];if(u(C[F],F,C)===!1)break}return a}}function yI(s,a,u){var f=a&O,g=cs(s);function C(){var S=this&&this!==vt&&this instanceof C?g:s;return S.apply(f?u:this,arguments)}return C}function xm(s){return function(a){a=We(a);var u=Mo(a)?An(a):n,f=u?u[0]:a.charAt(0),g=u?Or(u,1).join(""):a.slice(1);return f[s]()+g}}function Ho(s){return function(a){return $c(wg(vg(a).replace(aR,"")),s,"")}}function cs(s){return function(){var a=arguments;switch(a.length){case 0:return new s;case 1:return new s(a[0]);case 2:return new s(a[0],a[1]);case 3:return new s(a[0],a[1],a[2]);case 4:return new s(a[0],a[1],a[2],a[3]);case 5:return new s(a[0],a[1],a[2],a[3],a[4]);case 6:return new s(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new s(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var u=Wo(s.prototype),f=s.apply(u,a);return ot(f)?f:u}}function _I(s,a,u){var f=cs(s);function g(){for(var C=arguments.length,S=W(C),V=C,F=qo(g);V--;)S[V]=arguments[V];var K=C<3&&S[0]!==F&&S[C-1]!==F?[]:Rr(S,F);if(C-=K.length,C<u)return Nm(s,a,Da,g.placeholder,n,S,K,n,n,u-C);var Y=this&&this!==vt&&this instanceof g?f:s;return Xt(Y,this,S)}return g}function km(s){return function(a,u,f){var g=Ke(a);if(!zt(a)){var C=ge(u,3);a=yt(a),u=function(V){return C(g[V],V,g)}}var S=s(a,u,f);return S>-1?g[C?a[S]:S]:n}}function Em(s){return ir(function(a){var u=a.length,f=u,g=an.prototype.thru;for(s&&a.reverse();f--;){var C=a[f];if(typeof C!="function")throw new sn(c);if(g&&!S&&Oa(C)=="wrapper")var S=new an([],!0)}for(f=S?f:u;++f<u;){C=a[f];var V=Oa(C),F=V=="wrapper"?wd(C):n;F&&Ed(F[0])&&F[1]==(L|R|N|U)&&!F[4].length&&F[9]==1?S=S[Oa(F[0])].apply(S,F[3]):S=C.length==1&&Ed(C)?S[V]():S.thru(C)}return function(){var K=arguments,Y=K[0];if(S&&K.length==1&&Ne(Y))return S.plant(Y).value();for(var J=0,oe=u?a[J].apply(this,K):Y;++J<u;)oe=a[J].call(this,oe);return oe}})}function Da(s,a,u,f,g,C,S,V,F,K){var Y=a&L,J=a&O,oe=a&T,pe=a&(R|j),_e=a&Q,De=oe?n:cs(s);function Ce(){for(var Fe=arguments.length,Oe=W(Fe),tn=Fe;tn--;)Oe[tn]=arguments[tn];if(pe)var Ot=qo(Ce),nn=AR(Oe,Ot);if(f&&(Oe=Cm(Oe,f,g,pe)),C&&(Oe=vm(Oe,C,S,pe)),Fe-=nn,pe&&Fe<K){var lt=Rr(Oe,Ot);return Nm(s,a,Da,Ce.placeholder,u,Oe,lt,V,F,K-Fe)}var Rn=J?u:this,cr=oe?Rn[s]:s;return Fe=Oe.length,V?Oe=OI(Oe,V):_e&&Fe>1&&Oe.reverse(),Y&&F<Fe&&(Oe.length=F),this&&this!==vt&&this instanceof Ce&&(cr=De||cs(cr)),cr.apply(Rn,Oe)}return Ce}function Sm(s,a){return function(u,f){return jD(u,s,a(f),{})}}function Ia(s,a){return function(u,f){var g;if(u===n&&f===n)return a;if(u!==n&&(g=u),f!==n){if(g===n)return f;typeof u=="string"||typeof f=="string"?(u=Qt(u),f=Qt(f)):(u=um(u),f=um(f)),g=s(u,f)}return g}}function yd(s){return ir(function(a){return a=tt(a,Jt(ge())),Ie(function(u){var f=this;return s(a,function(g){return Xt(g,f,u)})})})}function Fa(s,a){a=a===n?" ":Qt(a);var u=a.length;if(u<2)return u?dd(a,s):a;var f=dd(a,ba(s/Go(a)));return Mo(a)?Or(An(f),0,s).join(""):f.slice(0,s)}function CI(s,a,u,f){var g=a&O,C=cs(s);function S(){for(var V=-1,F=arguments.length,K=-1,Y=f.length,J=W(Y+F),oe=this&&this!==vt&&this instanceof S?C:s;++K<Y;)J[K]=f[K];for(;F--;)J[K++]=arguments[++V];return Xt(oe,g?u:this,J)}return S}function Tm(s){return function(a,u,f){return f&&typeof f!="number"&&Lt(a,u,f)&&(u=f=n),a=lr(a),u===n?(u=a,a=0):u=lr(u),f=f===n?a<u?1:-1:lr(f),oI(a,u,f,s)}}function La(s){return function(a,u){return typeof a=="string"&&typeof u=="string"||(a=un(a),u=un(u)),s(a,u)}}function Nm(s,a,u,f,g,C,S,V,F,K){var Y=a&R,J=Y?S:n,oe=Y?n:S,pe=Y?C:n,_e=Y?n:C;a|=Y?N:v,a&=~(Y?v:N),a&P||(a&=~(O|T));var De=[s,a,g,pe,J,_e,oe,V,F,K],Ce=u.apply(n,De);return Ed(s)&&Gm(Ce,De),Ce.placeholder=f,$m(Ce,s,a)}function _d(s){var a=pt[s];return function(u,f){if(u=un(u),f=f==null?0:Tt(Be(f),292),f&&$f(u)){var g=(We(u)+"e").split("e"),C=a(g[0]+"e"+(+g[1]+f));return g=(We(C)+"e").split("e"),+(g[0]+"e"+(+g[1]-f))}return a(u)}}var vI=Uo&&1/pa(new Uo([,-0]))[1]==X?function(s){return new Uo(s)}:Gd;function Vm(s){return function(a){var u=Nt(a);return u==Nn?qc(a):u==Vn?LR(a):VR(a,s(a))}}function or(s,a,u,f,g,C,S,V){var F=a&T;if(!F&&typeof s!="function")throw new sn(c);var K=f?f.length:0;if(K||(a&=~(N|v),f=g=n),S=S===n?S:ht(Be(S),0),V=V===n?V:Be(V),K-=g?g.length:0,a&v){var Y=f,J=g;f=g=n}var oe=F?n:wd(s),pe=[s,a,u,f,g,Y,J,C,S,V];if(oe&&II(pe,oe),s=pe[0],a=pe[1],u=pe[2],f=pe[3],g=pe[4],V=pe[9]=pe[9]===n?F?0:s.length:ht(pe[9]-K,0),!V&&a&(R|j)&&(a&=~(R|j)),!a||a==O)var _e=yI(s,a,u);else a==R||a==j?_e=_I(s,a,V):(a==N||a==(O|N))&&!g.length?_e=CI(s,a,u,f):_e=Da.apply(n,pe);var De=oe?cm:Gm;return $m(De(_e,pe),s,a)}function Am(s,a,u,f){return s===n||Pn(s,zo[u])&&!He.call(f,u)?a:s}function Bm(s,a,u,f,g,C){return ot(s)&&ot(a)&&(C.set(a,s),Aa(s,a,n,Bm,C),C.delete(a)),s}function wI(s){return ps(s)?n:s}function Pm(s,a,u,f,g,C){var S=u&E,V=s.length,F=a.length;if(V!=F&&!(S&&F>V))return!1;var K=C.get(s),Y=C.get(a);if(K&&Y)return K==a&&Y==s;var J=-1,oe=!0,pe=u&$?new io:n;for(C.set(s,a),C.set(a,s);++J<V;){var _e=s[J],De=a[J];if(f)var Ce=S?f(De,_e,J,a,s,C):f(_e,De,J,s,a,C);if(Ce!==n){if(Ce)continue;oe=!1;break}if(pe){if(!zc(a,function(Fe,Oe){if(!Ji(pe,Oe)&&(_e===Fe||g(_e,Fe,u,f,C)))return pe.push(Oe)})){oe=!1;break}}else if(!(_e===De||g(_e,De,u,f,C))){oe=!1;break}}return C.delete(s),C.delete(a),oe}function bI(s,a,u,f,g,C,S){switch(u){case Fo:if(s.byteLength!=a.byteLength||s.byteOffset!=a.byteOffset)return!1;s=s.buffer,a=a.buffer;case Xi:return!(s.byteLength!=a.byteLength||!C(new _a(s),new _a(a)));case Wi:case ji:case Hi:return Pn(+s,+a);case oa:return s.name==a.name&&s.message==a.message;case qi:case Ki:return s==a+"";case Nn:var V=qc;case Vn:var F=f&E;if(V||(V=pa),s.size!=a.size&&!F)return!1;var K=S.get(s);if(K)return K==a;f|=$,S.set(s,a);var Y=Pm(V(s),V(a),f,g,C,S);return S.delete(s),Y;case sa:if(rs)return rs.call(s)==rs.call(a)}return!1}function xI(s,a,u,f,g,C){var S=u&E,V=Cd(s),F=V.length,K=Cd(a),Y=K.length;if(F!=Y&&!S)return!1;for(var J=F;J--;){var oe=V[J];if(!(S?oe in a:He.call(a,oe)))return!1}var pe=C.get(s),_e=C.get(a);if(pe&&_e)return pe==a&&_e==s;var De=!0;C.set(s,a),C.set(a,s);for(var Ce=S;++J<F;){oe=V[J];var Fe=s[oe],Oe=a[oe];if(f)var tn=S?f(Oe,Fe,oe,a,s,C):f(Fe,Oe,oe,s,a,C);if(!(tn===n?Fe===Oe||g(Fe,Oe,u,f,C):tn)){De=!1;break}Ce||(Ce=oe=="constructor")}if(De&&!Ce){var Ot=s.constructor,nn=a.constructor;Ot!=nn&&"constructor"in s&&"constructor"in a&&!(typeof Ot=="function"&&Ot instanceof Ot&&typeof nn=="function"&&nn instanceof nn)&&(De=!1)}return C.delete(s),C.delete(a),De}function ir(s){return Td(Om(s,n,Hm),s+"")}function Cd(s){return Jf(s,yt,xd)}function vd(s){return Jf(s,Ut,Rm)}var wd=ka?function(s){return ka.get(s)}:Gd;function Oa(s){for(var a=s.name+"",u=Zo[a],f=He.call(Zo,a)?u.length:0;f--;){var g=u[f],C=g.func;if(C==null||C==s)return g.name}return a}function qo(s){var a=He.call(_,"placeholder")?_:s;return a.placeholder}function ge(){var s=_.iteratee||Od;return s=s===Od?tm:s,arguments.length?s(arguments[0],arguments[1]):s}function Ma(s,a){var u=s.__data__;return BI(a)?u[typeof a=="string"?"string":"hash"]:u.map}function bd(s){for(var a=yt(s),u=a.length;u--;){var f=a[u],g=s[f];a[u]=[f,g,Fm(g)]}return a}function lo(s,a){var u=DR(s,a);return em(u)?u:n}function kI(s){var a=He.call(s,ro),u=s[ro];try{s[ro]=n;var f=!0}catch{}var g=ga.call(s);return f&&(a?s[ro]=u:delete s[ro]),g}var xd=Yc?function(s){return s==null?[]:(s=Ke(s),Br(Yc(s),function(a){return Mf.call(s,a)}))}:$d,Rm=Yc?function(s){for(var a=[];s;)Pr(a,xd(s)),s=Ca(s);return a}:$d,Nt=Ft;(Xc&&Nt(new Xc(new ArrayBuffer(1)))!=Fo||es&&Nt(new es)!=Nn||Jc&&Nt(Jc.resolve())!=qh||Uo&&Nt(new Uo)!=Vn||ts&&Nt(new ts)!=Yi)&&(Nt=function(s){var a=Ft(s),u=a==er?s.constructor:n,f=u?co(u):"";if(f)switch(f){case sD:return Fo;case aD:return Nn;case lD:return qh;case cD:return Vn;case dD:return Yi}return a});function EI(s,a,u){for(var f=-1,g=u.length;++f<g;){var C=u[f],S=C.size;switch(C.type){case"drop":s+=S;break;case"dropRight":a-=S;break;case"take":a=Tt(a,s+S);break;case"takeRight":s=ht(s,a-S);break}}return{start:s,end:a}}function SI(s){var a=s.match(PP);return a?a[1].split(RP):[]}function Dm(s,a,u){a=Lr(a,s);for(var f=-1,g=a.length,C=!1;++f<g;){var S=Hn(a[f]);if(!(C=s!=null&&u(s,S)))break;s=s[S]}return C||++f!=g?C:(g=s==null?0:s.length,!!g&&ja(g)&&sr(S,g)&&(Ne(s)||uo(s)))}function TI(s){var a=s.length,u=new s.constructor(a);return a&&typeof s[0]=="string"&&He.call(s,"index")&&(u.index=s.index,u.input=s.input),u}function Im(s){return typeof s.constructor=="function"&&!ds(s)?Wo(Ca(s)):{}}function NI(s,a,u){var f=s.constructor;switch(a){case Xi:return gd(s);case Wi:case ji:return new f(+s);case Fo:return uI(s,u);case bc:case xc:case kc:case Ec:case Sc:case Tc:case Nc:case Vc:case Ac:return ym(s,u);case Nn:return new f;case Hi:case Ki:return new f(s);case qi:return pI(s);case Vn:return new f;case sa:return hI(s)}}function VI(s,a){var u=a.length;if(!u)return s;var f=u-1;return a[f]=(u>1?"& ":"")+a[f],a=a.join(u>2?", ":" "),s.replace(BP,`{
|
|
73
73
|
/* [wrapped with `+a+`] */
|
|
74
|
-
`)}function vI(s){return Ne(s)||uo(s)||!!(Mf&&s&&s[Mf])}function sr(s,a){var u=typeof s;return a=a??ne,!!a&&(u=="number"||u!="symbol"&&PP.test(s))&&s>-1&&s%1==0&&s<a}function Lt(s,a,u){if(!ot(u))return!1;var f=typeof a;return(f=="number"?zt(u)&&sr(a,u.length):f=="string"&&a in u)?Pn(u[a],s):!1}function xd(s,a){if(Ne(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||en(s)?!0:yP.test(s)||!gP.test(s)||a!=null&&s in Ke(a)}function wI(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function kd(s){var a=Oa(s),u=_[a];if(typeof u!="function"||!(a in Le.prototype))return!1;if(s===u)return!0;var f=vd(u);return!!f&&s===f[0]}function bI(s){return!!If&&If in s}var xI=fa?ar:$d;function cs(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||zo;return s===u}function Im(s){return s===s&&!ot(s)}function Fm(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==n||s in Ke(u))}}function kI(s){var a=Za(s,function(f){return u.size===h&&u.clear(),f}),u=a.cache;return a}function SI(s,a){var u=s[1],f=a[1],g=u|f,C=g<($|S|j),k=f==j&&u==D||f==j&&u==J&&s[7].length<=a[8]||f==(j|J)&&a[7].length<=a[8]&&u==D;if(!(C||k))return s;f&$&&(s[2]=a[2],g|=u&$?0:B);var V=a[3];if(V){var L=s[3];s[3]=L?_m(L,V,a[4]):V,s[4]=L?Pr(s[3],m):a[4]}return V=a[5],V&&(L=s[5],s[5]=L?Cm(L,V,a[6]):V,s[6]=L?Pr(s[5],m):a[6]),V=a[7],V&&(s[7]=V),f&j&&(s[8]=s[8]==null?a[8]:Tt(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=g,s}function EI(s){var a=[];if(s!=null)for(var u in Ke(s))a.push(u);return a}function TI(s){return ga.call(s)}function Lm(s,a,u){return a=ht(a===n?s.length-1:a,0),function(){for(var f=arguments,g=-1,C=ht(f.length-a,0),k=W(C);++g<C;)k[g]=f[a+g];g=-1;for(var V=W(a+1);++g<a;)V[g]=f[g];return V[a]=u(k),Xt(s,this,V)}}function Om(s,a){return a.length<2?s:ao(s,cn(a,0,-1))}function NI(s,a){for(var u=s.length,f=Tt(a.length,u),g=$t(s);f--;){var C=a[f];s[f]=sr(C,u)?g[C]:n}return s}function Sd(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var Mm=$m(lm),ds=UR||function(s,a){return vt.setTimeout(s,a)},Ed=$m(XD);function Gm(s,a,u){var f=a+"";return Ed(s,CI(f,VI(gI(f),u)))}function $m(s){var a=0,u=0;return function(){var f=HR(),g=P-(f-u);if(u=f,g>0){if(++a>=G)return arguments[0]}else a=0;return s.apply(n,arguments)}}function Ga(s,a){var u=-1,f=s.length,g=f-1;for(a=a===n?f:a;++u<a;){var C=ld(u,g),k=s[C];s[C]=s[u],s[u]=k}return s.length=a,s}var zm=kI(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(_P,function(u,f,g,C){a.push(g?C.replace(EP,"$1"):f||u)}),a});function Hn(s){if(typeof s=="string"||en(s))return s;var a=s+"";return a=="0"&&1/s==-X?"-0":a}function co(s){if(s!=null){try{return ma.call(s)}catch{}try{return s+""}catch{}}return""}function VI(s,a){return on(It,function(u){var f="_."+u[0];a&u[1]&&!da(s,f)&&s.push(f)}),s.sort()}function Um(s){if(s instanceof Le)return s.clone();var a=new an(s.__wrapped__,s.__chain__);return a.__actions__=$t(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function AI(s,a,u){(u?Lt(s,a,u):a===n)?a=1:a=ht(Be(a),0);var f=s==null?0:s.length;if(!f||a<1)return[];for(var g=0,C=0,k=W(ba(f/a));g<f;)k[C++]=cn(s,g,g+=a);return k}function BI(s){for(var a=-1,u=s==null?0:s.length,f=0,g=[];++a<u;){var C=s[a];C&&(g[f++]=C)}return g}function PI(){var s=arguments.length;if(!s)return[];for(var a=W(s-1),u=arguments[0],f=s;f--;)a[f-1]=arguments[f];return Br(Ne(u)?$t(u):[u],wt(a,1))}var RI=Ie(function(s,a){return at(s)?os(s,wt(a,1,at,!0)):[]}),DI=Ie(function(s,a){var u=dn(a);return at(u)&&(u=n),at(s)?os(s,wt(a,1,at,!0),ge(u,2)):[]}),II=Ie(function(s,a){var u=dn(a);return at(u)&&(u=n),at(s)?os(s,wt(a,1,at,!0),n,u):[]});function FI(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),cn(s,a<0?0:a,f)):[]}function LI(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),a=f-a,cn(s,0,a<0?0:a)):[]}function OI(s,a){return s&&s.length?Pa(s,ge(a,3),!0,!0):[]}function MI(s,a){return s&&s.length?Pa(s,ge(a,3),!0):[]}function GI(s,a,u,f){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&Lt(s,a,u)&&(u=0,f=g),PD(s,a,u,f)):[]}function Zm(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=u==null?0:Be(u);return g<0&&(g=ht(f+g,0)),ua(s,ge(a,3),g)}function Wm(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=f-1;return u!==n&&(g=Be(u),g=u<0?ht(f+g,0):Tt(g,f-1)),ua(s,ge(a,3),g,!0)}function jm(s){var a=s==null?0:s.length;return a?wt(s,1):[]}function $I(s){var a=s==null?0:s.length;return a?wt(s,X):[]}function zI(s,a){var u=s==null?0:s.length;return u?(a=a===n?1:Be(a),wt(s,a)):[]}function UI(s){for(var a=-1,u=s==null?0:s.length,f={};++a<u;){var g=s[a];f[g[0]]=g[1]}return f}function Hm(s){return s&&s.length?s[0]:n}function ZI(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=u==null?0:Be(u);return g<0&&(g=ht(f+g,0)),Oo(s,a,g)}function WI(s){var a=s==null?0:s.length;return a?cn(s,0,-1):[]}var jI=Ie(function(s){var a=tt(s,hd);return a.length&&a[0]===s[0]?rd(a):[]}),HI=Ie(function(s){var a=dn(s),u=tt(s,hd);return a===dn(u)?a=n:u.pop(),u.length&&u[0]===s[0]?rd(u,ge(a,2)):[]}),qI=Ie(function(s){var a=dn(s),u=tt(s,hd);return a=typeof a=="function"?a:n,a&&u.pop(),u.length&&u[0]===s[0]?rd(u,n,a):[]});function KI(s,a){return s==null?"":WR.call(s,a)}function dn(s){var a=s==null?0:s.length;return a?s[a-1]:n}function YI(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=f;return u!==n&&(g=Be(u),g=g<0?ht(f+g,0):Tt(g,f-1)),a===a?VR(s,a,g):ua(s,Tf,g,!0)}function XI(s,a){return s&&s.length?om(s,Be(a)):n}var JI=Ie(qm);function qm(s,a){return s&&s.length&&a&&a.length?ad(s,a):s}function QI(s,a,u){return s&&s.length&&a&&a.length?ad(s,a,ge(u,2)):s}function eF(s,a,u){return s&&s.length&&a&&a.length?ad(s,a,n,u):s}var tF=ir(function(s,a){var u=s==null?0:s.length,f=Qc(s,a);return am(s,tt(a,function(g){return sr(g,u)?+g:g}).sort(ym)),f});function nF(s,a){var u=[];if(!(s&&s.length))return u;var f=-1,g=[],C=s.length;for(a=ge(a,3);++f<C;){var k=s[f];a(k,f,s)&&(u.push(k),g.push(f))}return am(s,g),u}function Td(s){return s==null?s:KR.call(s)}function rF(s,a,u){var f=s==null?0:s.length;return f?(u&&typeof u!="number"&&Lt(s,a,u)?(a=0,u=f):(a=a==null?0:Be(a),u=u===n?f:Be(u)),cn(s,a,u)):[]}function oF(s,a){return Ba(s,a)}function iF(s,a,u){return dd(s,a,ge(u,2))}function sF(s,a){var u=s==null?0:s.length;if(u){var f=Ba(s,a);if(f<u&&Pn(s[f],a))return f}return-1}function aF(s,a){return Ba(s,a,!0)}function lF(s,a,u){return dd(s,a,ge(u,2),!0)}function cF(s,a){var u=s==null?0:s.length;if(u){var f=Ba(s,a,!0)-1;if(Pn(s[f],a))return f}return-1}function dF(s){return s&&s.length?cm(s):[]}function uF(s,a){return s&&s.length?cm(s,ge(a,2)):[]}function pF(s){var a=s==null?0:s.length;return a?cn(s,1,a):[]}function hF(s,a,u){return s&&s.length?(a=u||a===n?1:Be(a),cn(s,0,a<0?0:a)):[]}function fF(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),a=f-a,cn(s,a<0?0:a,f)):[]}function mF(s,a){return s&&s.length?Pa(s,ge(a,3),!1,!0):[]}function gF(s,a){return s&&s.length?Pa(s,ge(a,3)):[]}var yF=Ie(function(s){return Ir(wt(s,1,at,!0))}),_F=Ie(function(s){var a=dn(s);return at(a)&&(a=n),Ir(wt(s,1,at,!0),ge(a,2))}),CF=Ie(function(s){var a=dn(s);return a=typeof a=="function"?a:n,Ir(wt(s,1,at,!0),n,a)});function vF(s){return s&&s.length?Ir(s):[]}function wF(s,a){return s&&s.length?Ir(s,ge(a,2)):[]}function bF(s,a){return a=typeof a=="function"?a:n,s&&s.length?Ir(s,n,a):[]}function Nd(s){if(!(s&&s.length))return[];var a=0;return s=Ar(s,function(u){if(at(u))return a=ht(u.length,a),!0}),Wc(a,function(u){return tt(s,zc(u))})}function Km(s,a){if(!(s&&s.length))return[];var u=Nd(s);return a==null?u:tt(u,function(f){return Xt(a,n,f)})}var xF=Ie(function(s,a){return at(s)?os(s,a):[]}),kF=Ie(function(s){return pd(Ar(s,at))}),SF=Ie(function(s){var a=dn(s);return at(a)&&(a=n),pd(Ar(s,at),ge(a,2))}),EF=Ie(function(s){var a=dn(s);return a=typeof a=="function"?a:n,pd(Ar(s,at),n,a)}),TF=Ie(Nd);function NF(s,a){return hm(s||[],a||[],rs)}function VF(s,a){return hm(s||[],a||[],as)}var AF=Ie(function(s){var a=s.length,u=a>1?s[a-1]:n;return u=typeof u=="function"?(s.pop(),u):n,Km(s,u)});function Ym(s){var a=_(s);return a.__chain__=!0,a}function BF(s,a){return a(s),s}function $a(s,a){return a(s)}var PF=ir(function(s){var a=s.length,u=a?s[0]:0,f=this.__wrapped__,g=function(C){return Qc(C,s)};return a>1||this.__actions__.length||!(f instanceof Le)||!sr(u)?this.thru(g):(f=f.slice(u,+u+(a?1:0)),f.__actions__.push({func:$a,args:[g],thisArg:n}),new an(f,this.__chain__).thru(function(C){return a&&!C.length&&C.push(n),C}))});function RF(){return Ym(this)}function DF(){return new an(this.value(),this.__chain__)}function IF(){this.__values__===n&&(this.__values__=dg(this.value()));var s=this.__index__>=this.__values__.length,a=s?n:this.__values__[this.__index__++];return{done:s,value:a}}function FF(){return this}function LF(s){for(var a,u=this;u instanceof Ea;){var f=Um(u);f.__index__=0,f.__values__=n,a?g.__wrapped__=f:a=f;var g=f;u=u.__wrapped__}return g.__wrapped__=s,a}function OF(){var s=this.__wrapped__;if(s instanceof Le){var a=s;return this.__actions__.length&&(a=new Le(this)),a=a.reverse(),a.__actions__.push({func:$a,args:[Td],thisArg:n}),new an(a,this.__chain__)}return this.thru(Td)}function MF(){return pm(this.__wrapped__,this.__actions__)}var GF=Ra(function(s,a,u){He.call(s,u)?++s[u]:rr(s,u,1)});function $F(s,a,u){var f=Ne(s)?Sf:BD;return u&&Lt(s,a,u)&&(a=n),f(s,ge(a,3))}function zF(s,a){var u=Ne(s)?Ar:Kf;return u(s,ge(a,3))}var UF=xm(Zm),ZF=xm(Wm);function WF(s,a){return wt(za(s,a),1)}function jF(s,a){return wt(za(s,a),X)}function HF(s,a,u){return u=u===n?1:Be(u),wt(za(s,a),u)}function Xm(s,a){var u=Ne(s)?on:Dr;return u(s,ge(a,3))}function Jm(s,a){var u=Ne(s)?pR:qf;return u(s,ge(a,3))}var qF=Ra(function(s,a,u){He.call(s,u)?s[u].push(a):rr(s,u,[a])});function KF(s,a,u,f){s=zt(s)?s:Yo(s),u=u&&!f?Be(u):0;var g=s.length;return u<0&&(u=ht(g+u,0)),Ha(s)?u<=g&&s.indexOf(a,u)>-1:!!g&&Oo(s,a,u)>-1}var YF=Ie(function(s,a,u){var f=-1,g=typeof a=="function",C=zt(s)?W(s.length):[];return Dr(s,function(k){C[++f]=g?Xt(a,k,u):is(k,a,u)}),C}),XF=Ra(function(s,a,u){rr(s,u,a)});function za(s,a){var u=Ne(s)?tt:tm;return u(s,ge(a,3))}function JF(s,a,u,f){return s==null?[]:(Ne(a)||(a=a==null?[]:[a]),u=f?n:u,Ne(u)||(u=u==null?[]:[u]),im(s,a,u))}var QF=Ra(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function eL(s,a,u){var f=Ne(s)?Gc:Vf,g=arguments.length<3;return f(s,ge(a,4),u,g,Dr)}function tL(s,a,u){var f=Ne(s)?hR:Vf,g=arguments.length<3;return f(s,ge(a,4),u,g,qf)}function nL(s,a){var u=Ne(s)?Ar:Kf;return u(s,Wa(ge(a,3)))}function rL(s){var a=Ne(s)?Zf:KD;return a(s)}function oL(s,a,u){(u?Lt(s,a,u):a===n)?a=1:a=Be(a);var f=Ne(s)?ED:YD;return f(s,a)}function iL(s){var a=Ne(s)?TD:JD;return a(s)}function sL(s){if(s==null)return 0;if(zt(s))return Ha(s)?Go(s):s.length;var a=Nt(s);return a==Nn||a==Vn?s.size:id(s).length}function aL(s,a,u){var f=Ne(s)?$c:QD;return u&&Lt(s,a,u)&&(a=n),f(s,ge(a,3))}var lL=Ie(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Lt(s,a[0],a[1])?a=[]:u>2&&Lt(a[0],a[1],a[2])&&(a=[a[0]]),im(s,wt(a,1),[])}),Ua=zR||function(){return vt.Date.now()};function cL(s,a){if(typeof a!="function")throw new sn(c);return s=Be(s),function(){if(--s<1)return a.apply(this,arguments)}}function Qm(s,a,u){return a=u?n:a,a=s&&a==null?s.length:a,or(s,j,n,n,n,n,a)}function eg(s,a){var u;if(typeof a!="function")throw new sn(c);return s=Be(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=n),u}}var Vd=Ie(function(s,a,u){var f=$;if(u.length){var g=Pr(u,qo(Vd));f|=A}return or(s,f,a,u,g)}),tg=Ie(function(s,a,u){var f=$|S;if(u.length){var g=Pr(u,qo(tg));f|=A}return or(a,f,s,u,g)});function ng(s,a,u){a=u?n:a;var f=or(s,D,n,n,n,n,n,a);return f.placeholder=ng.placeholder,f}function rg(s,a,u){a=u?n:a;var f=or(s,H,n,n,n,n,n,a);return f.placeholder=rg.placeholder,f}function og(s,a,u){var f,g,C,k,V,L,K=0,Y=!1,Q=!1,oe=!0;if(typeof s!="function")throw new sn(c);a=un(a)||0,ot(u)&&(Y=!!u.leading,Q="maxWait"in u,C=Q?ht(un(u.maxWait)||0,a):C,oe="trailing"in u?!!u.trailing:oe);function pe(lt){var Rn=f,cr=g;return f=g=n,K=lt,k=s.apply(cr,Rn),k}function _e(lt){return K=lt,V=ds(Fe,a),Y?pe(lt):k}function De(lt){var Rn=lt-L,cr=lt-K,xg=a-Rn;return Q?Tt(xg,C-cr):xg}function Ce(lt){var Rn=lt-L,cr=lt-K;return L===n||Rn>=a||Rn<0||Q&&cr>=C}function Fe(){var lt=Ua();if(Ce(lt))return Oe(lt);V=ds(Fe,De(lt))}function Oe(lt){return V=n,oe&&f?pe(lt):(f=g=n,k)}function tn(){V!==n&&fm(V),K=0,f=L=g=V=n}function Ot(){return V===n?k:Oe(Ua())}function nn(){var lt=Ua(),Rn=Ce(lt);if(f=arguments,g=this,L=lt,Rn){if(V===n)return _e(L);if(Q)return fm(V),V=ds(Fe,a),pe(L)}return V===n&&(V=ds(Fe,a)),k}return nn.cancel=tn,nn.flush=Ot,nn}var dL=Ie(function(s,a){return Hf(s,1,a)}),uL=Ie(function(s,a,u){return Hf(s,un(a)||0,u)});function pL(s){return or(s,Z)}function Za(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new sn(c);var u=function(){var f=arguments,g=a?a.apply(this,f):f[0],C=u.cache;if(C.has(g))return C.get(g);var k=s.apply(this,f);return u.cache=C.set(g,k)||C,k};return u.cache=new(Za.Cache||nr),u}Za.Cache=nr;function Wa(s){if(typeof s!="function")throw new sn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function hL(s){return eg(2,s)}var fL=eI(function(s,a){a=a.length==1&&Ne(a[0])?tt(a[0],Jt(ge())):tt(wt(a,1),Jt(ge()));var u=a.length;return Ie(function(f){for(var g=-1,C=Tt(f.length,u);++g<C;)f[g]=a[g].call(this,f[g]);return Xt(s,this,f)})}),Ad=Ie(function(s,a){var u=Pr(a,qo(Ad));return or(s,A,n,a,u)}),ig=Ie(function(s,a){var u=Pr(a,qo(ig));return or(s,N,n,a,u)}),mL=ir(function(s,a){return or(s,J,n,n,n,a)});function gL(s,a){if(typeof s!="function")throw new sn(c);return a=a===n?a:Be(a),Ie(s,a)}function yL(s,a){if(typeof s!="function")throw new sn(c);return a=a==null?0:ht(Be(a),0),Ie(function(u){var f=u[a],g=Lr(u,0,a);return f&&Br(g,f),Xt(s,this,g)})}function _L(s,a,u){var f=!0,g=!0;if(typeof s!="function")throw new sn(c);return ot(u)&&(f="leading"in u?!!u.leading:f,g="trailing"in u?!!u.trailing:g),og(s,a,{leading:f,maxWait:a,trailing:g})}function CL(s){return Qm(s,1)}function vL(s,a){return Ad(fd(a),s)}function wL(){if(!arguments.length)return[];var s=arguments[0];return Ne(s)?s:[s]}function bL(s){return ln(s,v)}function xL(s,a){return a=typeof a=="function"?a:n,ln(s,v,a)}function kL(s){return ln(s,y|v)}function SL(s,a){return a=typeof a=="function"?a:n,ln(s,y|v,a)}function EL(s,a){return a==null||jf(s,a,yt(a))}function Pn(s,a){return s===a||s!==s&&a!==a}var TL=La(nd),NL=La(function(s,a){return s>=a}),uo=Jf(function(){return arguments}())?Jf:function(s){return it(s)&&He.call(s,"callee")&&!Of.call(s,"callee")},Ne=W.isArray,VL=Cf?Jt(Cf):LD;function zt(s){return s!=null&&ja(s.length)&&!ar(s)}function at(s){return it(s)&&zt(s)}function AL(s){return s===!0||s===!1||it(s)&&Ft(s)==Zi}var Or=ZR||$d,BL=vf?Jt(vf):OD;function PL(s){return it(s)&&s.nodeType===1&&!us(s)}function RL(s){if(s==null)return!0;if(zt(s)&&(Ne(s)||typeof s=="string"||typeof s.splice=="function"||Or(s)||Ko(s)||uo(s)))return!s.length;var a=Nt(s);if(a==Nn||a==Vn)return!s.size;if(cs(s))return!id(s).length;for(var u in s)if(He.call(s,u))return!1;return!0}function DL(s,a){return ss(s,a)}function IL(s,a,u){u=typeof u=="function"?u:n;var f=u?u(s,a):n;return f===n?ss(s,a,n,u):!!f}function Bd(s){if(!it(s))return!1;var a=Ft(s);return a==oa||a==oP||typeof s.message=="string"&&typeof s.name=="string"&&!us(s)}function FL(s){return typeof s=="number"&&Gf(s)}function ar(s){if(!ot(s))return!1;var a=Ft(s);return a==ia||a==jh||a==rP||a==sP}function sg(s){return typeof s=="number"&&s==Be(s)}function ja(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=ne}function ot(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function it(s){return s!=null&&typeof s=="object"}var ag=wf?Jt(wf):GD;function LL(s,a){return s===a||od(s,a,wd(a))}function OL(s,a,u){return u=typeof u=="function"?u:n,od(s,a,wd(a),u)}function ML(s){return lg(s)&&s!=+s}function GL(s){if(xI(s))throw new Ee(l);return Qf(s)}function $L(s){return s===null}function zL(s){return s==null}function lg(s){return typeof s=="number"||it(s)&&Ft(s)==ji}function us(s){if(!it(s)||Ft(s)!=er)return!1;var a=Ca(s);if(a===null)return!0;var u=He.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&ma.call(u)==OR}var Pd=bf?Jt(bf):$D;function UL(s){return sg(s)&&s>=-ne&&s<=ne}var cg=xf?Jt(xf):zD;function Ha(s){return typeof s=="string"||!Ne(s)&&it(s)&&Ft(s)==qi}function en(s){return typeof s=="symbol"||it(s)&&Ft(s)==sa}var Ko=kf?Jt(kf):UD;function ZL(s){return s===n}function WL(s){return it(s)&&Nt(s)==Ki}function jL(s){return it(s)&&Ft(s)==lP}var HL=La(sd),qL=La(function(s,a){return s<=a});function dg(s){if(!s)return[];if(zt(s))return Ha(s)?An(s):$t(s);if(Ji&&s[Ji])return ER(s[Ji]());var a=Nt(s),u=a==Nn?Hc:a==Vn?pa:Yo;return u(s)}function lr(s){if(!s)return s===0?s:0;if(s=un(s),s===X||s===-X){var a=s<0?-1:1;return a*de}return s===s?s:0}function Be(s){var a=lr(s),u=a%1;return a===a?u?a-u:a:0}function ug(s){return s?so(Be(s),0,Te):0}function un(s){if(typeof s=="number")return s;if(en(s))return me;if(ot(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=ot(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=Af(s);var u=VP.test(s);return u||BP.test(s)?cR(s.slice(2),u?2:8):NP.test(s)?me:+s}function pg(s){return jn(s,Ut(s))}function KL(s){return s?so(Be(s),-ne,ne):s===0?s:0}function We(s){return s==null?"":Qt(s)}var YL=jo(function(s,a){if(cs(a)||zt(a)){jn(a,yt(a),s);return}for(var u in a)He.call(a,u)&&rs(s,u,a[u])}),hg=jo(function(s,a){jn(a,Ut(a),s)}),qa=jo(function(s,a,u,f){jn(a,Ut(a),s,f)}),XL=jo(function(s,a,u,f){jn(a,yt(a),s,f)}),JL=ir(Qc);function QL(s,a){var u=Wo(s);return a==null?u:Wf(u,a)}var eO=Ie(function(s,a){s=Ke(s);var u=-1,f=a.length,g=f>2?a[2]:n;for(g&&Lt(a[0],a[1],g)&&(f=1);++u<f;)for(var C=a[u],k=Ut(C),V=-1,L=k.length;++V<L;){var K=k[V],Y=s[K];(Y===n||Pn(Y,zo[K])&&!He.call(s,K))&&(s[K]=C[K])}return s}),tO=Ie(function(s){return s.push(n,Am),Xt(fg,n,s)});function nO(s,a){return Ef(s,ge(a,3),Wn)}function rO(s,a){return Ef(s,ge(a,3),td)}function oO(s,a){return s==null?s:ed(s,ge(a,3),Ut)}function iO(s,a){return s==null?s:Yf(s,ge(a,3),Ut)}function sO(s,a){return s&&Wn(s,ge(a,3))}function aO(s,a){return s&&td(s,ge(a,3))}function lO(s){return s==null?[]:Va(s,yt(s))}function cO(s){return s==null?[]:Va(s,Ut(s))}function Rd(s,a,u){var f=s==null?n:ao(s,a);return f===n?u:f}function dO(s,a){return s!=null&&Rm(s,a,RD)}function Dd(s,a){return s!=null&&Rm(s,a,DD)}var uO=Sm(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=ga.call(a)),s[a]=u},Fd(Zt)),pO=Sm(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=ga.call(a)),He.call(s,a)?s[a].push(u):s[a]=[u]},ge),hO=Ie(is);function yt(s){return zt(s)?Uf(s):id(s)}function Ut(s){return zt(s)?Uf(s,!0):ZD(s)}function fO(s,a){var u={};return a=ge(a,3),Wn(s,function(f,g,C){rr(u,a(f,g,C),f)}),u}function mO(s,a){var u={};return a=ge(a,3),Wn(s,function(f,g,C){rr(u,g,a(f,g,C))}),u}var gO=jo(function(s,a,u){Aa(s,a,u)}),fg=jo(function(s,a,u,f){Aa(s,a,u,f)}),yO=ir(function(s,a){var u={};if(s==null)return u;var f=!1;a=tt(a,function(C){return C=Fr(C,s),f||(f=C.length>1),C}),jn(s,Cd(s),u),f&&(u=ln(u,y|w|v,uI));for(var g=a.length;g--;)ud(u,a[g]);return u});function _O(s,a){return mg(s,Wa(ge(a)))}var CO=ir(function(s,a){return s==null?{}:jD(s,a)});function mg(s,a){if(s==null)return{};var u=tt(Cd(s),function(f){return[f]});return a=ge(a),sm(s,u,function(f,g){return a(f,g[0])})}function vO(s,a,u){a=Fr(a,s);var f=-1,g=a.length;for(g||(g=1,s=n);++f<g;){var C=s==null?n:s[Hn(a[f])];C===n&&(f=g,C=u),s=ar(C)?C.call(s):C}return s}function wO(s,a,u){return s==null?s:as(s,a,u)}function bO(s,a,u,f){return f=typeof f=="function"?f:n,s==null?s:as(s,a,u,f)}var gg=Nm(yt),yg=Nm(Ut);function xO(s,a,u){var f=Ne(s),g=f||Or(s)||Ko(s);if(a=ge(a,4),u==null){var C=s&&s.constructor;g?u=f?new C:[]:ot(s)?u=ar(C)?Wo(Ca(s)):{}:u={}}return(g?on:Wn)(s,function(k,V,L){return a(u,k,V,L)}),u}function kO(s,a){return s==null?!0:ud(s,a)}function SO(s,a,u){return s==null?s:um(s,a,fd(u))}function EO(s,a,u,f){return f=typeof f=="function"?f:n,s==null?s:um(s,a,fd(u),f)}function Yo(s){return s==null?[]:jc(s,yt(s))}function TO(s){return s==null?[]:jc(s,Ut(s))}function NO(s,a,u){return u===n&&(u=a,a=n),u!==n&&(u=un(u),u=u===u?u:0),a!==n&&(a=un(a),a=a===a?a:0),so(un(s),a,u)}function VO(s,a,u){return a=lr(a),u===n?(u=a,a=0):u=lr(u),s=un(s),ID(s,a,u)}function AO(s,a,u){if(u&&typeof u!="boolean"&&Lt(s,a,u)&&(a=u=n),u===n&&(typeof a=="boolean"?(u=a,a=n):typeof s=="boolean"&&(u=s,s=n)),s===n&&a===n?(s=0,a=1):(s=lr(s),a===n?(a=s,s=0):a=lr(a)),s>a){var f=s;s=a,a=f}if(u||s%1||a%1){var g=$f();return Tt(s+g*(a-s+lR("1e-"+((g+"").length-1))),a)}return ld(s,a)}var BO=Ho(function(s,a,u){return a=a.toLowerCase(),s+(u?_g(a):a)});function _g(s){return Id(We(s).toLowerCase())}function Cg(s){return s=We(s),s&&s.replace(RP,wR).replace(JP,"")}function PO(s,a,u){s=We(s),a=Qt(a);var f=s.length;u=u===n?f:so(Be(u),0,f);var g=u;return u-=a.length,u>=0&&s.slice(u,g)==a}function RO(s){return s=We(s),s&&hP.test(s)?s.replace(Kh,bR):s}function DO(s){return s=We(s),s&&CP.test(s)?s.replace(Ac,"\\$&"):s}var IO=Ho(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),FO=Ho(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),LO=bm("toLowerCase");function OO(s,a,u){s=We(s),a=Be(a);var f=a?Go(s):0;if(!a||f>=a)return s;var g=(a-f)/2;return Fa(xa(g),u)+s+Fa(ba(g),u)}function MO(s,a,u){s=We(s),a=Be(a);var f=a?Go(s):0;return a&&f<a?s+Fa(a-f,u):s}function GO(s,a,u){s=We(s),a=Be(a);var f=a?Go(s):0;return a&&f<a?Fa(a-f,u)+s:s}function $O(s,a,u){return u||a==null?a=0:a&&(a=+a),qR(We(s).replace(Bc,""),a||0)}function zO(s,a,u){return(u?Lt(s,a,u):a===n)?a=1:a=Be(a),cd(We(s),a)}function UO(){var s=arguments,a=We(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var ZO=Ho(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function WO(s,a,u){return u&&typeof u!="number"&&Lt(s,a,u)&&(a=u=n),u=u===n?Te:u>>>0,u?(s=We(s),s&&(typeof a=="string"||a!=null&&!Pd(a))&&(a=Qt(a),!a&&Mo(s))?Lr(An(s),0,u):s.split(a,u)):[]}var jO=Ho(function(s,a,u){return s+(u?" ":"")+Id(a)});function HO(s,a,u){return s=We(s),u=u==null?0:so(Be(u),0,s.length),a=Qt(a),s.slice(u,u+a.length)==a}function qO(s,a,u){var f=_.templateSettings;u&&Lt(s,a,u)&&(a=n),s=We(s),a=qa({},a,f,Vm);var g=qa({},a.imports,f.imports,Vm),C=yt(g),k=jc(g,C),V,L,K=0,Y=a.interpolate||aa,Q="__p += '",oe=qc((a.escape||aa).source+"|"+Y.source+"|"+(Y===Yh?TP:aa).source+"|"+(a.evaluate||aa).source+"|$","g"),pe="//# sourceURL="+(He.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rR+"]")+`
|
|
75
|
-
`;s.replace(oe,function(Ce,Fe,Oe,tn,Ot,nn){return Oe||(Oe=tn),
|
|
74
|
+
`)}function AI(s){return Ne(s)||uo(s)||!!(Gf&&s&&s[Gf])}function sr(s,a){var u=typeof s;return a=a??ne,!!a&&(u=="number"||u!="symbol"&&zP.test(s))&&s>-1&&s%1==0&&s<a}function Lt(s,a,u){if(!ot(u))return!1;var f=typeof a;return(f=="number"?zt(u)&&sr(a,u.length):f=="string"&&a in u)?Pn(u[a],s):!1}function kd(s,a){if(Ne(s))return!1;var u=typeof s;return u=="number"||u=="symbol"||u=="boolean"||s==null||en(s)?!0:TP.test(s)||!SP.test(s)||a!=null&&s in Ke(a)}function BI(s){var a=typeof s;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?s!=="__proto__":s===null}function Ed(s){var a=Oa(s),u=_[a];if(typeof u!="function"||!(a in Le.prototype))return!1;if(s===u)return!0;var f=wd(u);return!!f&&s===f[0]}function PI(s){return!!Ff&&Ff in s}var RI=fa?ar:zd;function ds(s){var a=s&&s.constructor,u=typeof a=="function"&&a.prototype||zo;return s===u}function Fm(s){return s===s&&!ot(s)}function Lm(s,a){return function(u){return u==null?!1:u[s]===a&&(a!==n||s in Ke(u))}}function DI(s){var a=Za(s,function(f){return u.size===h&&u.clear(),f}),u=a.cache;return a}function II(s,a){var u=s[1],f=a[1],g=u|f,C=g<(O|T|L),S=f==L&&u==R||f==L&&u==U&&s[7].length<=a[8]||f==(L|U)&&a[7].length<=a[8]&&u==R;if(!(C||S))return s;f&O&&(s[2]=a[2],g|=u&O?0:P);var V=a[3];if(V){var F=s[3];s[3]=F?Cm(F,V,a[4]):V,s[4]=F?Rr(s[3],m):a[4]}return V=a[5],V&&(F=s[5],s[5]=F?vm(F,V,a[6]):V,s[6]=F?Rr(s[5],m):a[6]),V=a[7],V&&(s[7]=V),f&L&&(s[8]=s[8]==null?a[8]:Tt(s[8],a[8])),s[9]==null&&(s[9]=a[9]),s[0]=a[0],s[1]=g,s}function FI(s){var a=[];if(s!=null)for(var u in Ke(s))a.push(u);return a}function LI(s){return ga.call(s)}function Om(s,a,u){return a=ht(a===n?s.length-1:a,0),function(){for(var f=arguments,g=-1,C=ht(f.length-a,0),S=W(C);++g<C;)S[g]=f[a+g];g=-1;for(var V=W(a+1);++g<a;)V[g]=f[g];return V[a]=u(S),Xt(s,this,V)}}function Mm(s,a){return a.length<2?s:ao(s,cn(a,0,-1))}function OI(s,a){for(var u=s.length,f=Tt(a.length,u),g=$t(s);f--;){var C=a[f];s[f]=sr(C,u)?g[C]:n}return s}function Sd(s,a){if(!(a==="constructor"&&typeof s[a]=="function")&&a!="__proto__")return s[a]}var Gm=zm(cm),us=QR||function(s,a){return vt.setTimeout(s,a)},Td=zm(aI);function $m(s,a,u){var f=a+"";return Td(s,VI(f,MI(SI(f),u)))}function zm(s){var a=0,u=0;return function(){var f=rD(),g=B-(f-u);if(u=f,g>0){if(++a>=z)return arguments[0]}else a=0;return s.apply(n,arguments)}}function Ga(s,a){var u=-1,f=s.length,g=f-1;for(a=a===n?f:a;++u<a;){var C=cd(u,g),S=s[C];s[C]=s[u],s[u]=S}return s.length=a,s}var Um=DI(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(NP,function(u,f,g,C){a.push(g?C.replace(FP,"$1"):f||u)}),a});function Hn(s){if(typeof s=="string"||en(s))return s;var a=s+"";return a=="0"&&1/s==-X?"-0":a}function co(s){if(s!=null){try{return ma.call(s)}catch{}try{return s+""}catch{}}return""}function MI(s,a){return on(It,function(u){var f="_."+u[0];a&u[1]&&!da(s,f)&&s.push(f)}),s.sort()}function Zm(s){if(s instanceof Le)return s.clone();var a=new an(s.__wrapped__,s.__chain__);return a.__actions__=$t(s.__actions__),a.__index__=s.__index__,a.__values__=s.__values__,a}function GI(s,a,u){(u?Lt(s,a,u):a===n)?a=1:a=ht(Be(a),0);var f=s==null?0:s.length;if(!f||a<1)return[];for(var g=0,C=0,S=W(ba(f/a));g<f;)S[C++]=cn(s,g,g+=a);return S}function $I(s){for(var a=-1,u=s==null?0:s.length,f=0,g=[];++a<u;){var C=s[a];C&&(g[f++]=C)}return g}function zI(){var s=arguments.length;if(!s)return[];for(var a=W(s-1),u=arguments[0],f=s;f--;)a[f-1]=arguments[f];return Pr(Ne(u)?$t(u):[u],wt(a,1))}var UI=Ie(function(s,a){return at(s)?is(s,wt(a,1,at,!0)):[]}),ZI=Ie(function(s,a){var u=dn(a);return at(u)&&(u=n),at(s)?is(s,wt(a,1,at,!0),ge(u,2)):[]}),WI=Ie(function(s,a){var u=dn(a);return at(u)&&(u=n),at(s)?is(s,wt(a,1,at,!0),n,u):[]});function jI(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),cn(s,a<0?0:a,f)):[]}function HI(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),a=f-a,cn(s,0,a<0?0:a)):[]}function qI(s,a){return s&&s.length?Pa(s,ge(a,3),!0,!0):[]}function KI(s,a){return s&&s.length?Pa(s,ge(a,3),!0):[]}function YI(s,a,u,f){var g=s==null?0:s.length;return g?(u&&typeof u!="number"&&Lt(s,a,u)&&(u=0,f=g),zD(s,a,u,f)):[]}function Wm(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=u==null?0:Be(u);return g<0&&(g=ht(f+g,0)),ua(s,ge(a,3),g)}function jm(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=f-1;return u!==n&&(g=Be(u),g=u<0?ht(f+g,0):Tt(g,f-1)),ua(s,ge(a,3),g,!0)}function Hm(s){var a=s==null?0:s.length;return a?wt(s,1):[]}function XI(s){var a=s==null?0:s.length;return a?wt(s,X):[]}function JI(s,a){var u=s==null?0:s.length;return u?(a=a===n?1:Be(a),wt(s,a)):[]}function QI(s){for(var a=-1,u=s==null?0:s.length,f={};++a<u;){var g=s[a];f[g[0]]=g[1]}return f}function qm(s){return s&&s.length?s[0]:n}function eF(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=u==null?0:Be(u);return g<0&&(g=ht(f+g,0)),Oo(s,a,g)}function tF(s){var a=s==null?0:s.length;return a?cn(s,0,-1):[]}var nF=Ie(function(s){var a=tt(s,fd);return a.length&&a[0]===s[0]?od(a):[]}),rF=Ie(function(s){var a=dn(s),u=tt(s,fd);return a===dn(u)?a=n:u.pop(),u.length&&u[0]===s[0]?od(u,ge(a,2)):[]}),oF=Ie(function(s){var a=dn(s),u=tt(s,fd);return a=typeof a=="function"?a:n,a&&u.pop(),u.length&&u[0]===s[0]?od(u,n,a):[]});function iF(s,a){return s==null?"":tD.call(s,a)}function dn(s){var a=s==null?0:s.length;return a?s[a-1]:n}function sF(s,a,u){var f=s==null?0:s.length;if(!f)return-1;var g=f;return u!==n&&(g=Be(u),g=g<0?ht(f+g,0):Tt(g,f-1)),a===a?MR(s,a,g):ua(s,Nf,g,!0)}function aF(s,a){return s&&s.length?im(s,Be(a)):n}var lF=Ie(Km);function Km(s,a){return s&&s.length&&a&&a.length?ld(s,a):s}function cF(s,a,u){return s&&s.length&&a&&a.length?ld(s,a,ge(u,2)):s}function dF(s,a,u){return s&&s.length&&a&&a.length?ld(s,a,n,u):s}var uF=ir(function(s,a){var u=s==null?0:s.length,f=ed(s,a);return lm(s,tt(a,function(g){return sr(g,u)?+g:g}).sort(_m)),f});function pF(s,a){var u=[];if(!(s&&s.length))return u;var f=-1,g=[],C=s.length;for(a=ge(a,3);++f<C;){var S=s[f];a(S,f,s)&&(u.push(S),g.push(f))}return lm(s,g),u}function Nd(s){return s==null?s:iD.call(s)}function hF(s,a,u){var f=s==null?0:s.length;return f?(u&&typeof u!="number"&&Lt(s,a,u)?(a=0,u=f):(a=a==null?0:Be(a),u=u===n?f:Be(u)),cn(s,a,u)):[]}function fF(s,a){return Ba(s,a)}function mF(s,a,u){return ud(s,a,ge(u,2))}function gF(s,a){var u=s==null?0:s.length;if(u){var f=Ba(s,a);if(f<u&&Pn(s[f],a))return f}return-1}function yF(s,a){return Ba(s,a,!0)}function _F(s,a,u){return ud(s,a,ge(u,2),!0)}function CF(s,a){var u=s==null?0:s.length;if(u){var f=Ba(s,a,!0)-1;if(Pn(s[f],a))return f}return-1}function vF(s){return s&&s.length?dm(s):[]}function wF(s,a){return s&&s.length?dm(s,ge(a,2)):[]}function bF(s){var a=s==null?0:s.length;return a?cn(s,1,a):[]}function xF(s,a,u){return s&&s.length?(a=u||a===n?1:Be(a),cn(s,0,a<0?0:a)):[]}function kF(s,a,u){var f=s==null?0:s.length;return f?(a=u||a===n?1:Be(a),a=f-a,cn(s,a<0?0:a,f)):[]}function EF(s,a){return s&&s.length?Pa(s,ge(a,3),!1,!0):[]}function SF(s,a){return s&&s.length?Pa(s,ge(a,3)):[]}var TF=Ie(function(s){return Fr(wt(s,1,at,!0))}),NF=Ie(function(s){var a=dn(s);return at(a)&&(a=n),Fr(wt(s,1,at,!0),ge(a,2))}),VF=Ie(function(s){var a=dn(s);return a=typeof a=="function"?a:n,Fr(wt(s,1,at,!0),n,a)});function AF(s){return s&&s.length?Fr(s):[]}function BF(s,a){return s&&s.length?Fr(s,ge(a,2)):[]}function PF(s,a){return a=typeof a=="function"?a:n,s&&s.length?Fr(s,n,a):[]}function Vd(s){if(!(s&&s.length))return[];var a=0;return s=Br(s,function(u){if(at(u))return a=ht(u.length,a),!0}),jc(a,function(u){return tt(s,Uc(u))})}function Ym(s,a){if(!(s&&s.length))return[];var u=Vd(s);return a==null?u:tt(u,function(f){return Xt(a,n,f)})}var RF=Ie(function(s,a){return at(s)?is(s,a):[]}),DF=Ie(function(s){return hd(Br(s,at))}),IF=Ie(function(s){var a=dn(s);return at(a)&&(a=n),hd(Br(s,at),ge(a,2))}),FF=Ie(function(s){var a=dn(s);return a=typeof a=="function"?a:n,hd(Br(s,at),n,a)}),LF=Ie(Vd);function OF(s,a){return fm(s||[],a||[],os)}function MF(s,a){return fm(s||[],a||[],ls)}var GF=Ie(function(s){var a=s.length,u=a>1?s[a-1]:n;return u=typeof u=="function"?(s.pop(),u):n,Ym(s,u)});function Xm(s){var a=_(s);return a.__chain__=!0,a}function $F(s,a){return a(s),s}function $a(s,a){return a(s)}var zF=ir(function(s){var a=s.length,u=a?s[0]:0,f=this.__wrapped__,g=function(C){return ed(C,s)};return a>1||this.__actions__.length||!(f instanceof Le)||!sr(u)?this.thru(g):(f=f.slice(u,+u+(a?1:0)),f.__actions__.push({func:$a,args:[g],thisArg:n}),new an(f,this.__chain__).thru(function(C){return a&&!C.length&&C.push(n),C}))});function UF(){return Xm(this)}function ZF(){return new an(this.value(),this.__chain__)}function WF(){this.__values__===n&&(this.__values__=ug(this.value()));var s=this.__index__>=this.__values__.length,a=s?n:this.__values__[this.__index__++];return{done:s,value:a}}function jF(){return this}function HF(s){for(var a,u=this;u instanceof Sa;){var f=Zm(u);f.__index__=0,f.__values__=n,a?g.__wrapped__=f:a=f;var g=f;u=u.__wrapped__}return g.__wrapped__=s,a}function qF(){var s=this.__wrapped__;if(s instanceof Le){var a=s;return this.__actions__.length&&(a=new Le(this)),a=a.reverse(),a.__actions__.push({func:$a,args:[Nd],thisArg:n}),new an(a,this.__chain__)}return this.thru(Nd)}function KF(){return hm(this.__wrapped__,this.__actions__)}var YF=Ra(function(s,a,u){He.call(s,u)?++s[u]:rr(s,u,1)});function XF(s,a,u){var f=Ne(s)?Sf:$D;return u&&Lt(s,a,u)&&(a=n),f(s,ge(a,3))}function JF(s,a){var u=Ne(s)?Br:Yf;return u(s,ge(a,3))}var QF=km(Wm),eL=km(jm);function tL(s,a){return wt(za(s,a),1)}function nL(s,a){return wt(za(s,a),X)}function rL(s,a,u){return u=u===n?1:Be(u),wt(za(s,a),u)}function Jm(s,a){var u=Ne(s)?on:Ir;return u(s,ge(a,3))}function Qm(s,a){var u=Ne(s)?bR:Kf;return u(s,ge(a,3))}var oL=Ra(function(s,a,u){He.call(s,u)?s[u].push(a):rr(s,u,[a])});function iL(s,a,u,f){s=zt(s)?s:Yo(s),u=u&&!f?Be(u):0;var g=s.length;return u<0&&(u=ht(g+u,0)),Ha(s)?u<=g&&s.indexOf(a,u)>-1:!!g&&Oo(s,a,u)>-1}var sL=Ie(function(s,a,u){var f=-1,g=typeof a=="function",C=zt(s)?W(s.length):[];return Ir(s,function(S){C[++f]=g?Xt(a,S,u):ss(S,a,u)}),C}),aL=Ra(function(s,a,u){rr(s,u,a)});function za(s,a){var u=Ne(s)?tt:nm;return u(s,ge(a,3))}function lL(s,a,u,f){return s==null?[]:(Ne(a)||(a=a==null?[]:[a]),u=f?n:u,Ne(u)||(u=u==null?[]:[u]),sm(s,a,u))}var cL=Ra(function(s,a,u){s[u?0:1].push(a)},function(){return[[],[]]});function dL(s,a,u){var f=Ne(s)?$c:Af,g=arguments.length<3;return f(s,ge(a,4),u,g,Ir)}function uL(s,a,u){var f=Ne(s)?xR:Af,g=arguments.length<3;return f(s,ge(a,4),u,g,Kf)}function pL(s,a){var u=Ne(s)?Br:Yf;return u(s,Wa(ge(a,3)))}function hL(s){var a=Ne(s)?Wf:iI;return a(s)}function fL(s,a,u){(u?Lt(s,a,u):a===n)?a=1:a=Be(a);var f=Ne(s)?FD:sI;return f(s,a)}function mL(s){var a=Ne(s)?LD:lI;return a(s)}function gL(s){if(s==null)return 0;if(zt(s))return Ha(s)?Go(s):s.length;var a=Nt(s);return a==Nn||a==Vn?s.size:sd(s).length}function yL(s,a,u){var f=Ne(s)?zc:cI;return u&&Lt(s,a,u)&&(a=n),f(s,ge(a,3))}var _L=Ie(function(s,a){if(s==null)return[];var u=a.length;return u>1&&Lt(s,a[0],a[1])?a=[]:u>2&&Lt(a[0],a[1],a[2])&&(a=[a[0]]),sm(s,wt(a,1),[])}),Ua=JR||function(){return vt.Date.now()};function CL(s,a){if(typeof a!="function")throw new sn(c);return s=Be(s),function(){if(--s<1)return a.apply(this,arguments)}}function eg(s,a,u){return a=u?n:a,a=s&&a==null?s.length:a,or(s,L,n,n,n,n,a)}function tg(s,a){var u;if(typeof a!="function")throw new sn(c);return s=Be(s),function(){return--s>0&&(u=a.apply(this,arguments)),s<=1&&(a=n),u}}var Ad=Ie(function(s,a,u){var f=O;if(u.length){var g=Rr(u,qo(Ad));f|=N}return or(s,f,a,u,g)}),ng=Ie(function(s,a,u){var f=O|T;if(u.length){var g=Rr(u,qo(ng));f|=N}return or(a,f,s,u,g)});function rg(s,a,u){a=u?n:a;var f=or(s,R,n,n,n,n,n,a);return f.placeholder=rg.placeholder,f}function og(s,a,u){a=u?n:a;var f=or(s,j,n,n,n,n,n,a);return f.placeholder=og.placeholder,f}function ig(s,a,u){var f,g,C,S,V,F,K=0,Y=!1,J=!1,oe=!0;if(typeof s!="function")throw new sn(c);a=un(a)||0,ot(u)&&(Y=!!u.leading,J="maxWait"in u,C=J?ht(un(u.maxWait)||0,a):C,oe="trailing"in u?!!u.trailing:oe);function pe(lt){var Rn=f,cr=g;return f=g=n,K=lt,S=s.apply(cr,Rn),S}function _e(lt){return K=lt,V=us(Fe,a),Y?pe(lt):S}function De(lt){var Rn=lt-F,cr=lt-K,kg=a-Rn;return J?Tt(kg,C-cr):kg}function Ce(lt){var Rn=lt-F,cr=lt-K;return F===n||Rn>=a||Rn<0||J&&cr>=C}function Fe(){var lt=Ua();if(Ce(lt))return Oe(lt);V=us(Fe,De(lt))}function Oe(lt){return V=n,oe&&f?pe(lt):(f=g=n,S)}function tn(){V!==n&&mm(V),K=0,f=F=g=V=n}function Ot(){return V===n?S:Oe(Ua())}function nn(){var lt=Ua(),Rn=Ce(lt);if(f=arguments,g=this,F=lt,Rn){if(V===n)return _e(F);if(J)return mm(V),V=us(Fe,a),pe(F)}return V===n&&(V=us(Fe,a)),S}return nn.cancel=tn,nn.flush=Ot,nn}var vL=Ie(function(s,a){return qf(s,1,a)}),wL=Ie(function(s,a,u){return qf(s,un(a)||0,u)});function bL(s){return or(s,Q)}function Za(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new sn(c);var u=function(){var f=arguments,g=a?a.apply(this,f):f[0],C=u.cache;if(C.has(g))return C.get(g);var S=s.apply(this,f);return u.cache=C.set(g,S)||C,S};return u.cache=new(Za.Cache||nr),u}Za.Cache=nr;function Wa(s){if(typeof s!="function")throw new sn(c);return function(){var a=arguments;switch(a.length){case 0:return!s.call(this);case 1:return!s.call(this,a[0]);case 2:return!s.call(this,a[0],a[1]);case 3:return!s.call(this,a[0],a[1],a[2])}return!s.apply(this,a)}}function xL(s){return tg(2,s)}var kL=dI(function(s,a){a=a.length==1&&Ne(a[0])?tt(a[0],Jt(ge())):tt(wt(a,1),Jt(ge()));var u=a.length;return Ie(function(f){for(var g=-1,C=Tt(f.length,u);++g<C;)f[g]=a[g].call(this,f[g]);return Xt(s,this,f)})}),Bd=Ie(function(s,a){var u=Rr(a,qo(Bd));return or(s,N,n,a,u)}),sg=Ie(function(s,a){var u=Rr(a,qo(sg));return or(s,v,n,a,u)}),EL=ir(function(s,a){return or(s,U,n,n,n,a)});function SL(s,a){if(typeof s!="function")throw new sn(c);return a=a===n?a:Be(a),Ie(s,a)}function TL(s,a){if(typeof s!="function")throw new sn(c);return a=a==null?0:ht(Be(a),0),Ie(function(u){var f=u[a],g=Or(u,0,a);return f&&Pr(g,f),Xt(s,this,g)})}function NL(s,a,u){var f=!0,g=!0;if(typeof s!="function")throw new sn(c);return ot(u)&&(f="leading"in u?!!u.leading:f,g="trailing"in u?!!u.trailing:g),ig(s,a,{leading:f,maxWait:a,trailing:g})}function VL(s){return eg(s,1)}function AL(s,a){return Bd(md(a),s)}function BL(){if(!arguments.length)return[];var s=arguments[0];return Ne(s)?s:[s]}function PL(s){return ln(s,b)}function RL(s,a){return a=typeof a=="function"?a:n,ln(s,b,a)}function DL(s){return ln(s,y|b)}function IL(s,a){return a=typeof a=="function"?a:n,ln(s,y|b,a)}function FL(s,a){return a==null||Hf(s,a,yt(a))}function Pn(s,a){return s===a||s!==s&&a!==a}var LL=La(rd),OL=La(function(s,a){return s>=a}),uo=Qf(function(){return arguments}())?Qf:function(s){return it(s)&&He.call(s,"callee")&&!Mf.call(s,"callee")},Ne=W.isArray,ML=vf?Jt(vf):HD;function zt(s){return s!=null&&ja(s.length)&&!ar(s)}function at(s){return it(s)&&zt(s)}function GL(s){return s===!0||s===!1||it(s)&&Ft(s)==Wi}var Mr=eD||zd,$L=wf?Jt(wf):qD;function zL(s){return it(s)&&s.nodeType===1&&!ps(s)}function UL(s){if(s==null)return!0;if(zt(s)&&(Ne(s)||typeof s=="string"||typeof s.splice=="function"||Mr(s)||Ko(s)||uo(s)))return!s.length;var a=Nt(s);if(a==Nn||a==Vn)return!s.size;if(ds(s))return!sd(s).length;for(var u in s)if(He.call(s,u))return!1;return!0}function ZL(s,a){return as(s,a)}function WL(s,a,u){u=typeof u=="function"?u:n;var f=u?u(s,a):n;return f===n?as(s,a,n,u):!!f}function Pd(s){if(!it(s))return!1;var a=Ft(s);return a==oa||a==fP||typeof s.message=="string"&&typeof s.name=="string"&&!ps(s)}function jL(s){return typeof s=="number"&&$f(s)}function ar(s){if(!ot(s))return!1;var a=Ft(s);return a==ia||a==Hh||a==hP||a==gP}function ag(s){return typeof s=="number"&&s==Be(s)}function ja(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=ne}function ot(s){var a=typeof s;return s!=null&&(a=="object"||a=="function")}function it(s){return s!=null&&typeof s=="object"}var lg=bf?Jt(bf):YD;function HL(s,a){return s===a||id(s,a,bd(a))}function qL(s,a,u){return u=typeof u=="function"?u:n,id(s,a,bd(a),u)}function KL(s){return cg(s)&&s!=+s}function YL(s){if(RI(s))throw new Se(l);return em(s)}function XL(s){return s===null}function JL(s){return s==null}function cg(s){return typeof s=="number"||it(s)&&Ft(s)==Hi}function ps(s){if(!it(s)||Ft(s)!=er)return!1;var a=Ca(s);if(a===null)return!0;var u=He.call(a,"constructor")&&a.constructor;return typeof u=="function"&&u instanceof u&&ma.call(u)==qR}var Rd=xf?Jt(xf):XD;function QL(s){return ag(s)&&s>=-ne&&s<=ne}var dg=kf?Jt(kf):JD;function Ha(s){return typeof s=="string"||!Ne(s)&&it(s)&&Ft(s)==Ki}function en(s){return typeof s=="symbol"||it(s)&&Ft(s)==sa}var Ko=Ef?Jt(Ef):QD;function eO(s){return s===n}function tO(s){return it(s)&&Nt(s)==Yi}function nO(s){return it(s)&&Ft(s)==_P}var rO=La(ad),oO=La(function(s,a){return s<=a});function ug(s){if(!s)return[];if(zt(s))return Ha(s)?An(s):$t(s);if(Qi&&s[Qi])return FR(s[Qi]());var a=Nt(s),u=a==Nn?qc:a==Vn?pa:Yo;return u(s)}function lr(s){if(!s)return s===0?s:0;if(s=un(s),s===X||s===-X){var a=s<0?-1:1;return a*de}return s===s?s:0}function Be(s){var a=lr(s),u=a%1;return a===a?u?a-u:a:0}function pg(s){return s?so(Be(s),0,Te):0}function un(s){if(typeof s=="number")return s;if(en(s))return me;if(ot(s)){var a=typeof s.valueOf=="function"?s.valueOf():s;s=ot(a)?a+"":a}if(typeof s!="string")return s===0?s:+s;s=Bf(s);var u=MP.test(s);return u||$P.test(s)?CR(s.slice(2),u?2:8):OP.test(s)?me:+s}function hg(s){return jn(s,Ut(s))}function iO(s){return s?so(Be(s),-ne,ne):s===0?s:0}function We(s){return s==null?"":Qt(s)}var sO=jo(function(s,a){if(ds(a)||zt(a)){jn(a,yt(a),s);return}for(var u in a)He.call(a,u)&&os(s,u,a[u])}),fg=jo(function(s,a){jn(a,Ut(a),s)}),qa=jo(function(s,a,u,f){jn(a,Ut(a),s,f)}),aO=jo(function(s,a,u,f){jn(a,yt(a),s,f)}),lO=ir(ed);function cO(s,a){var u=Wo(s);return a==null?u:jf(u,a)}var dO=Ie(function(s,a){s=Ke(s);var u=-1,f=a.length,g=f>2?a[2]:n;for(g&&Lt(a[0],a[1],g)&&(f=1);++u<f;)for(var C=a[u],S=Ut(C),V=-1,F=S.length;++V<F;){var K=S[V],Y=s[K];(Y===n||Pn(Y,zo[K])&&!He.call(s,K))&&(s[K]=C[K])}return s}),uO=Ie(function(s){return s.push(n,Bm),Xt(mg,n,s)});function pO(s,a){return Tf(s,ge(a,3),Wn)}function hO(s,a){return Tf(s,ge(a,3),nd)}function fO(s,a){return s==null?s:td(s,ge(a,3),Ut)}function mO(s,a){return s==null?s:Xf(s,ge(a,3),Ut)}function gO(s,a){return s&&Wn(s,ge(a,3))}function yO(s,a){return s&&nd(s,ge(a,3))}function _O(s){return s==null?[]:Va(s,yt(s))}function CO(s){return s==null?[]:Va(s,Ut(s))}function Dd(s,a,u){var f=s==null?n:ao(s,a);return f===n?u:f}function vO(s,a){return s!=null&&Dm(s,a,UD)}function Id(s,a){return s!=null&&Dm(s,a,ZD)}var wO=Sm(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=ga.call(a)),s[a]=u},Ld(Zt)),bO=Sm(function(s,a,u){a!=null&&typeof a.toString!="function"&&(a=ga.call(a)),He.call(s,a)?s[a].push(u):s[a]=[u]},ge),xO=Ie(ss);function yt(s){return zt(s)?Zf(s):sd(s)}function Ut(s){return zt(s)?Zf(s,!0):eI(s)}function kO(s,a){var u={};return a=ge(a,3),Wn(s,function(f,g,C){rr(u,a(f,g,C),f)}),u}function EO(s,a){var u={};return a=ge(a,3),Wn(s,function(f,g,C){rr(u,g,a(f,g,C))}),u}var SO=jo(function(s,a,u){Aa(s,a,u)}),mg=jo(function(s,a,u,f){Aa(s,a,u,f)}),TO=ir(function(s,a){var u={};if(s==null)return u;var f=!1;a=tt(a,function(C){return C=Lr(C,s),f||(f=C.length>1),C}),jn(s,vd(s),u),f&&(u=ln(u,y|w|b,wI));for(var g=a.length;g--;)pd(u,a[g]);return u});function NO(s,a){return gg(s,Wa(ge(a)))}var VO=ir(function(s,a){return s==null?{}:nI(s,a)});function gg(s,a){if(s==null)return{};var u=tt(vd(s),function(f){return[f]});return a=ge(a),am(s,u,function(f,g){return a(f,g[0])})}function AO(s,a,u){a=Lr(a,s);var f=-1,g=a.length;for(g||(g=1,s=n);++f<g;){var C=s==null?n:s[Hn(a[f])];C===n&&(f=g,C=u),s=ar(C)?C.call(s):C}return s}function BO(s,a,u){return s==null?s:ls(s,a,u)}function PO(s,a,u,f){return f=typeof f=="function"?f:n,s==null?s:ls(s,a,u,f)}var yg=Vm(yt),_g=Vm(Ut);function RO(s,a,u){var f=Ne(s),g=f||Mr(s)||Ko(s);if(a=ge(a,4),u==null){var C=s&&s.constructor;g?u=f?new C:[]:ot(s)?u=ar(C)?Wo(Ca(s)):{}:u={}}return(g?on:Wn)(s,function(S,V,F){return a(u,S,V,F)}),u}function DO(s,a){return s==null?!0:pd(s,a)}function IO(s,a,u){return s==null?s:pm(s,a,md(u))}function FO(s,a,u,f){return f=typeof f=="function"?f:n,s==null?s:pm(s,a,md(u),f)}function Yo(s){return s==null?[]:Hc(s,yt(s))}function LO(s){return s==null?[]:Hc(s,Ut(s))}function OO(s,a,u){return u===n&&(u=a,a=n),u!==n&&(u=un(u),u=u===u?u:0),a!==n&&(a=un(a),a=a===a?a:0),so(un(s),a,u)}function MO(s,a,u){return a=lr(a),u===n?(u=a,a=0):u=lr(u),s=un(s),WD(s,a,u)}function GO(s,a,u){if(u&&typeof u!="boolean"&&Lt(s,a,u)&&(a=u=n),u===n&&(typeof a=="boolean"?(u=a,a=n):typeof s=="boolean"&&(u=s,s=n)),s===n&&a===n?(s=0,a=1):(s=lr(s),a===n?(a=s,s=0):a=lr(a)),s>a){var f=s;s=a,a=f}if(u||s%1||a%1){var g=zf();return Tt(s+g*(a-s+_R("1e-"+((g+"").length-1))),a)}return cd(s,a)}var $O=Ho(function(s,a,u){return a=a.toLowerCase(),s+(u?Cg(a):a)});function Cg(s){return Fd(We(s).toLowerCase())}function vg(s){return s=We(s),s&&s.replace(UP,BR).replace(lR,"")}function zO(s,a,u){s=We(s),a=Qt(a);var f=s.length;u=u===n?f:so(Be(u),0,f);var g=u;return u-=a.length,u>=0&&s.slice(u,g)==a}function UO(s){return s=We(s),s&&xP.test(s)?s.replace(Yh,PR):s}function ZO(s){return s=We(s),s&&VP.test(s)?s.replace(Bc,"\\$&"):s}var WO=Ho(function(s,a,u){return s+(u?"-":"")+a.toLowerCase()}),jO=Ho(function(s,a,u){return s+(u?" ":"")+a.toLowerCase()}),HO=xm("toLowerCase");function qO(s,a,u){s=We(s),a=Be(a);var f=a?Go(s):0;if(!a||f>=a)return s;var g=(a-f)/2;return Fa(xa(g),u)+s+Fa(ba(g),u)}function KO(s,a,u){s=We(s),a=Be(a);var f=a?Go(s):0;return a&&f<a?s+Fa(a-f,u):s}function YO(s,a,u){s=We(s),a=Be(a);var f=a?Go(s):0;return a&&f<a?Fa(a-f,u)+s:s}function XO(s,a,u){return u||a==null?a=0:a&&(a=+a),oD(We(s).replace(Pc,""),a||0)}function JO(s,a,u){return(u?Lt(s,a,u):a===n)?a=1:a=Be(a),dd(We(s),a)}function QO(){var s=arguments,a=We(s[0]);return s.length<3?a:a.replace(s[1],s[2])}var eM=Ho(function(s,a,u){return s+(u?"_":"")+a.toLowerCase()});function tM(s,a,u){return u&&typeof u!="number"&&Lt(s,a,u)&&(a=u=n),u=u===n?Te:u>>>0,u?(s=We(s),s&&(typeof a=="string"||a!=null&&!Rd(a))&&(a=Qt(a),!a&&Mo(s))?Or(An(s),0,u):s.split(a,u)):[]}var nM=Ho(function(s,a,u){return s+(u?" ":"")+Fd(a)});function rM(s,a,u){return s=We(s),u=u==null?0:so(Be(u),0,s.length),a=Qt(a),s.slice(u,u+a.length)==a}function oM(s,a,u){var f=_.templateSettings;u&&Lt(s,a,u)&&(a=n),s=We(s),a=qa({},a,f,Am);var g=qa({},a.imports,f.imports,Am),C=yt(g),S=Hc(g,C),V,F,K=0,Y=a.interpolate||aa,J="__p += '",oe=Kc((a.escape||aa).source+"|"+Y.source+"|"+(Y===Xh?LP:aa).source+"|"+(a.evaluate||aa).source+"|$","g"),pe="//# sourceURL="+(He.call(a,"sourceURL")?(a.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++hR+"]")+`
|
|
75
|
+
`;s.replace(oe,function(Ce,Fe,Oe,tn,Ot,nn){return Oe||(Oe=tn),J+=s.slice(K,nn).replace(ZP,RR),Fe&&(V=!0,J+=`' +
|
|
76
76
|
__e(`+Fe+`) +
|
|
77
|
-
'`),Ot&&(
|
|
77
|
+
'`),Ot&&(F=!0,J+=`';
|
|
78
78
|
`+Ot+`;
|
|
79
|
-
__p += '`),Oe&&(
|
|
79
|
+
__p += '`),Oe&&(J+=`' +
|
|
80
80
|
((__t = (`+Oe+`)) == null ? '' : __t) +
|
|
81
|
-
'`),K=nn+Ce.length,Ce}),
|
|
82
|
-
`;var _e=He.call(a,"variable")&&a.variable;if(!_e)
|
|
83
|
-
`+
|
|
81
|
+
'`),K=nn+Ce.length,Ce}),J+=`';
|
|
82
|
+
`;var _e=He.call(a,"variable")&&a.variable;if(!_e)J=`with (obj) {
|
|
83
|
+
`+J+`
|
|
84
84
|
}
|
|
85
|
-
`;else if(
|
|
85
|
+
`;else if(IP.test(_e))throw new Se(d);J=(F?J.replace(CP,""):J).replace(vP,"$1").replace(wP,"$1;"),J="function("+(_e||"obj")+`) {
|
|
86
86
|
`+(_e?"":`obj || (obj = {});
|
|
87
|
-
`)+"var __t, __p = ''"+(V?", __e = _.escape":"")+(
|
|
87
|
+
`)+"var __t, __p = ''"+(V?", __e = _.escape":"")+(F?`, __j = Array.prototype.join;
|
|
88
88
|
function print() { __p += __j.call(arguments, '') }
|
|
89
89
|
`:`;
|
|
90
|
-
`)+
|
|
91
|
-
}`;var De=wg(function(){return Ue(C,pe+"return "+Q).apply(n,k)});if(De.source=Q,Bd(De))throw De;return De}function KO(s){return We(s).toLowerCase()}function YO(s){return We(s).toUpperCase()}function XO(s,a,u){if(s=We(s),s&&(u||a===n))return Af(s);if(!s||!(a=Qt(a)))return s;var f=An(s),g=An(a),C=Bf(f,g),k=Pf(f,g)+1;return Lr(f,C,k).join("")}function JO(s,a,u){if(s=We(s),s&&(u||a===n))return s.slice(0,Df(s)+1);if(!s||!(a=Qt(a)))return s;var f=An(s),g=Pf(f,An(a))+1;return Lr(f,0,g).join("")}function QO(s,a,u){if(s=We(s),s&&(u||a===n))return s.replace(Bc,"");if(!s||!(a=Qt(a)))return s;var f=An(s),g=Bf(f,An(a));return Lr(f,g).join("")}function eM(s,a){var u=R,f=O;if(ot(a)){var g="separator"in a?a.separator:g;u="length"in a?Be(a.length):u,f="omission"in a?Qt(a.omission):f}s=We(s);var C=s.length;if(Mo(s)){var k=An(s);C=k.length}if(u>=C)return s;var V=u-Go(f);if(V<1)return f;var L=k?Lr(k,0,V).join(""):s.slice(0,V);if(g===n)return L+f;if(k&&(V+=L.length-V),Pd(g)){if(s.slice(V).search(g)){var K,Y=L;for(g.global||(g=qc(g.source,We(Xh.exec(g))+"g")),g.lastIndex=0;K=g.exec(Y);)var Q=K.index;L=L.slice(0,Q===n?V:Q)}}else if(s.indexOf(Qt(g),V)!=V){var oe=L.lastIndexOf(g);oe>-1&&(L=L.slice(0,oe))}return L+f}function tM(s){return s=We(s),s&&pP.test(s)?s.replace(qh,AR):s}var nM=Ho(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),Id=bm("toUpperCase");function vg(s,a,u){return s=We(s),a=u?n:a,a===n?SR(s)?RR(s):gR(s):s.match(a)||[]}var wg=Ie(function(s,a){try{return Xt(s,n,a)}catch(u){return Bd(u)?u:new Ee(u)}}),rM=ir(function(s,a){return on(a,function(u){u=Hn(u),rr(s,u,Vd(s[u],s))}),s});function oM(s){var a=s==null?0:s.length,u=ge();return s=a?tt(s,function(f){if(typeof f[1]!="function")throw new sn(c);return[u(f[0]),f[1]]}):[],Ie(function(f){for(var g=-1;++g<a;){var C=s[g];if(Xt(C[0],this,f))return Xt(C[1],this,f)}})}function iM(s){return AD(ln(s,y))}function Fd(s){return function(){return s}}function sM(s,a){return s==null||s!==s?a:s}var aM=km(),lM=km(!0);function Zt(s){return s}function Ld(s){return em(typeof s=="function"?s:ln(s,y))}function cM(s){return nm(ln(s,y))}function dM(s,a){return rm(s,ln(a,y))}var uM=Ie(function(s,a){return function(u){return is(u,s,a)}}),pM=Ie(function(s,a){return function(u){return is(s,u,a)}});function Od(s,a,u){var f=yt(a),g=Va(a,f);u==null&&!(ot(a)&&(g.length||!f.length))&&(u=a,a=s,s=this,g=Va(a,yt(a)));var C=!(ot(u)&&"chain"in u)||!!u.chain,k=ar(s);return on(g,function(V){var L=a[V];s[V]=L,k&&(s.prototype[V]=function(){var K=this.__chain__;if(C||K){var Y=s(this.__wrapped__),Q=Y.__actions__=$t(this.__actions__);return Q.push({func:L,args:arguments,thisArg:s}),Y.__chain__=K,Y}return L.apply(s,Br([this.value()],arguments))})}),s}function hM(){return vt._===this&&(vt._=MR),this}function Md(){}function fM(s){return s=Be(s),Ie(function(a){return om(a,s)})}var mM=gd(tt),gM=gd(Sf),yM=gd($c);function bg(s){return xd(s)?zc(Hn(s)):HD(s)}function _M(s){return function(a){return s==null?n:ao(s,a)}}var CM=Em(),vM=Em(!0);function Gd(){return[]}function $d(){return!1}function wM(){return{}}function bM(){return""}function xM(){return!0}function kM(s,a){if(s=Be(s),s<1||s>ne)return[];var u=Te,f=Tt(s,Te);a=ge(a),s-=Te;for(var g=Wc(f,a);++u<s;)a(u);return g}function SM(s){return Ne(s)?tt(s,Hn):en(s)?[s]:$t(zm(We(s)))}function EM(s){var a=++LR;return We(s)+a}var TM=Ia(function(s,a){return s+a},0),NM=yd("ceil"),VM=Ia(function(s,a){return s/a},1),AM=yd("floor");function BM(s){return s&&s.length?Na(s,Zt,nd):n}function PM(s,a){return s&&s.length?Na(s,ge(a,2),nd):n}function RM(s){return Nf(s,Zt)}function DM(s,a){return Nf(s,ge(a,2))}function IM(s){return s&&s.length?Na(s,Zt,sd):n}function FM(s,a){return s&&s.length?Na(s,ge(a,2),sd):n}var LM=Ia(function(s,a){return s*a},1),OM=yd("round"),MM=Ia(function(s,a){return s-a},0);function GM(s){return s&&s.length?Zc(s,Zt):0}function $M(s,a){return s&&s.length?Zc(s,ge(a,2)):0}return _.after=cL,_.ary=Qm,_.assign=YL,_.assignIn=hg,_.assignInWith=qa,_.assignWith=XL,_.at=JL,_.before=eg,_.bind=Vd,_.bindAll=rM,_.bindKey=tg,_.castArray=wL,_.chain=Ym,_.chunk=AI,_.compact=BI,_.concat=PI,_.cond=oM,_.conforms=iM,_.constant=Fd,_.countBy=GF,_.create=QL,_.curry=ng,_.curryRight=rg,_.debounce=og,_.defaults=eO,_.defaultsDeep=tO,_.defer=dL,_.delay=uL,_.difference=RI,_.differenceBy=DI,_.differenceWith=II,_.drop=FI,_.dropRight=LI,_.dropRightWhile=OI,_.dropWhile=MI,_.fill=GI,_.filter=zF,_.flatMap=WF,_.flatMapDeep=jF,_.flatMapDepth=HF,_.flatten=jm,_.flattenDeep=$I,_.flattenDepth=zI,_.flip=pL,_.flow=aM,_.flowRight=lM,_.fromPairs=UI,_.functions=lO,_.functionsIn=cO,_.groupBy=qF,_.initial=WI,_.intersection=jI,_.intersectionBy=HI,_.intersectionWith=qI,_.invert=uO,_.invertBy=pO,_.invokeMap=YF,_.iteratee=Ld,_.keyBy=XF,_.keys=yt,_.keysIn=Ut,_.map=za,_.mapKeys=fO,_.mapValues=mO,_.matches=cM,_.matchesProperty=dM,_.memoize=Za,_.merge=gO,_.mergeWith=fg,_.method=uM,_.methodOf=pM,_.mixin=Od,_.negate=Wa,_.nthArg=fM,_.omit=yO,_.omitBy=_O,_.once=hL,_.orderBy=JF,_.over=mM,_.overArgs=fL,_.overEvery=gM,_.overSome=yM,_.partial=Ad,_.partialRight=ig,_.partition=QF,_.pick=CO,_.pickBy=mg,_.property=bg,_.propertyOf=_M,_.pull=JI,_.pullAll=qm,_.pullAllBy=QI,_.pullAllWith=eF,_.pullAt=tF,_.range=CM,_.rangeRight=vM,_.rearg=mL,_.reject=nL,_.remove=nF,_.rest=gL,_.reverse=Td,_.sampleSize=oL,_.set=wO,_.setWith=bO,_.shuffle=iL,_.slice=rF,_.sortBy=lL,_.sortedUniq=dF,_.sortedUniqBy=uF,_.split=WO,_.spread=yL,_.tail=pF,_.take=hF,_.takeRight=fF,_.takeRightWhile=mF,_.takeWhile=gF,_.tap=BF,_.throttle=_L,_.thru=$a,_.toArray=dg,_.toPairs=gg,_.toPairsIn=yg,_.toPath=SM,_.toPlainObject=pg,_.transform=xO,_.unary=CL,_.union=yF,_.unionBy=_F,_.unionWith=CF,_.uniq=vF,_.uniqBy=wF,_.uniqWith=bF,_.unset=kO,_.unzip=Nd,_.unzipWith=Km,_.update=SO,_.updateWith=EO,_.values=Yo,_.valuesIn=TO,_.without=xF,_.words=vg,_.wrap=vL,_.xor=kF,_.xorBy=SF,_.xorWith=EF,_.zip=TF,_.zipObject=NF,_.zipObjectDeep=VF,_.zipWith=AF,_.entries=gg,_.entriesIn=yg,_.extend=hg,_.extendWith=qa,Od(_,_),_.add=TM,_.attempt=wg,_.camelCase=BO,_.capitalize=_g,_.ceil=NM,_.clamp=NO,_.clone=bL,_.cloneDeep=kL,_.cloneDeepWith=SL,_.cloneWith=xL,_.conformsTo=EL,_.deburr=Cg,_.defaultTo=sM,_.divide=VM,_.endsWith=PO,_.eq=Pn,_.escape=RO,_.escapeRegExp=DO,_.every=$F,_.find=UF,_.findIndex=Zm,_.findKey=nO,_.findLast=ZF,_.findLastIndex=Wm,_.findLastKey=rO,_.floor=AM,_.forEach=Xm,_.forEachRight=Jm,_.forIn=oO,_.forInRight=iO,_.forOwn=sO,_.forOwnRight=aO,_.get=Rd,_.gt=TL,_.gte=NL,_.has=dO,_.hasIn=Dd,_.head=Hm,_.identity=Zt,_.includes=KF,_.indexOf=ZI,_.inRange=VO,_.invoke=hO,_.isArguments=uo,_.isArray=Ne,_.isArrayBuffer=VL,_.isArrayLike=zt,_.isArrayLikeObject=at,_.isBoolean=AL,_.isBuffer=Or,_.isDate=BL,_.isElement=PL,_.isEmpty=RL,_.isEqual=DL,_.isEqualWith=IL,_.isError=Bd,_.isFinite=FL,_.isFunction=ar,_.isInteger=sg,_.isLength=ja,_.isMap=ag,_.isMatch=LL,_.isMatchWith=OL,_.isNaN=ML,_.isNative=GL,_.isNil=zL,_.isNull=$L,_.isNumber=lg,_.isObject=ot,_.isObjectLike=it,_.isPlainObject=us,_.isRegExp=Pd,_.isSafeInteger=UL,_.isSet=cg,_.isString=Ha,_.isSymbol=en,_.isTypedArray=Ko,_.isUndefined=ZL,_.isWeakMap=WL,_.isWeakSet=jL,_.join=KI,_.kebabCase=IO,_.last=dn,_.lastIndexOf=YI,_.lowerCase=FO,_.lowerFirst=LO,_.lt=HL,_.lte=qL,_.max=BM,_.maxBy=PM,_.mean=RM,_.meanBy=DM,_.min=IM,_.minBy=FM,_.stubArray=Gd,_.stubFalse=$d,_.stubObject=wM,_.stubString=bM,_.stubTrue=xM,_.multiply=LM,_.nth=XI,_.noConflict=hM,_.noop=Md,_.now=Ua,_.pad=OO,_.padEnd=MO,_.padStart=GO,_.parseInt=$O,_.random=AO,_.reduce=eL,_.reduceRight=tL,_.repeat=zO,_.replace=UO,_.result=vO,_.round=OM,_.runInContext=I,_.sample=rL,_.size=sL,_.snakeCase=ZO,_.some=aL,_.sortedIndex=oF,_.sortedIndexBy=iF,_.sortedIndexOf=sF,_.sortedLastIndex=aF,_.sortedLastIndexBy=lF,_.sortedLastIndexOf=cF,_.startCase=jO,_.startsWith=HO,_.subtract=MM,_.sum=GM,_.sumBy=$M,_.template=qO,_.times=kM,_.toFinite=lr,_.toInteger=Be,_.toLength=ug,_.toLower=KO,_.toNumber=un,_.toSafeInteger=KL,_.toString=We,_.toUpper=YO,_.trim=XO,_.trimEnd=JO,_.trimStart=QO,_.truncate=eM,_.unescape=tM,_.uniqueId=EM,_.upperCase=nM,_.upperFirst=Id,_.each=Xm,_.eachRight=Jm,_.first=Hm,Od(_,function(){var s={};return Wn(_,function(a,u){He.call(_.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),_.VERSION=o,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){_[s].placeholder=_}),on(["drop","take"],function(s,a){Le.prototype[s]=function(u){u=u===n?1:ht(Be(u),0);var f=this.__filtered__&&!a?new Le(this):this.clone();return f.__filtered__?f.__takeCount__=Tt(u,f.__takeCount__):f.__views__.push({size:Tt(u,Te),type:s+(f.__dir__<0?"Right":"")}),f},Le.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),on(["filter","map","takeWhile"],function(s,a){var u=a+1,f=u==T||u==U;Le.prototype[s]=function(g){var C=this.clone();return C.__iteratees__.push({iteratee:ge(g,3),type:u}),C.__filtered__=C.__filtered__||f,C}}),on(["head","last"],function(s,a){var u="take"+(a?"Right":"");Le.prototype[s]=function(){return this[u](1).value()[0]}}),on(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");Le.prototype[s]=function(){return this.__filtered__?new Le(this):this[u](1)}}),Le.prototype.compact=function(){return this.filter(Zt)},Le.prototype.find=function(s){return this.filter(s).head()},Le.prototype.findLast=function(s){return this.reverse().find(s)},Le.prototype.invokeMap=Ie(function(s,a){return typeof s=="function"?new Le(this):this.map(function(u){return is(u,s,a)})}),Le.prototype.reject=function(s){return this.filter(Wa(ge(s)))},Le.prototype.slice=function(s,a){s=Be(s);var u=this;return u.__filtered__&&(s>0||a<0)?new Le(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==n&&(a=Be(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},Le.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Le.prototype.toArray=function(){return this.take(Te)},Wn(Le.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),f=/^(?:head|last)$/.test(a),g=_[f?"take"+(a=="last"?"Right":""):a],C=f||/^find/.test(a);g&&(_.prototype[a]=function(){var k=this.__wrapped__,V=f?[1]:arguments,L=k instanceof Le,K=V[0],Y=L||Ne(k),Q=function(Fe){var Oe=g.apply(_,Br([Fe],V));return f&&oe?Oe[0]:Oe};Y&&u&&typeof K=="function"&&K.length!=1&&(L=Y=!1);var oe=this.__chain__,pe=!!this.__actions__.length,_e=C&&!oe,De=L&&!pe;if(!C&&Y){k=De?k:new Le(this);var Ce=s.apply(k,V);return Ce.__actions__.push({func:$a,args:[Q],thisArg:n}),new an(Ce,oe)}return _e&&De?s.apply(this,V):(Ce=this.thru(Q),_e?f?Ce.value()[0]:Ce.value():Ce)})}),on(["pop","push","shift","sort","splice","unshift"],function(s){var a=ha[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",f=/^(?:pop|shift)$/.test(s);_.prototype[s]=function(){var g=arguments;if(f&&!this.__chain__){var C=this.value();return a.apply(Ne(C)?C:[],g)}return this[u](function(k){return a.apply(Ne(k)?k:[],g)})}}),Wn(Le.prototype,function(s,a){var u=_[a];if(u){var f=u.name+"";He.call(Zo,f)||(Zo[f]=[]),Zo[f].push({name:a,func:u})}}),Zo[Da(n,S).name]=[{name:"wrapper",func:n}],Le.prototype.clone=tD,Le.prototype.reverse=nD,Le.prototype.value=rD,_.prototype.at=PF,_.prototype.chain=RF,_.prototype.commit=DF,_.prototype.next=IF,_.prototype.plant=LF,_.prototype.reverse=OF,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=MF,_.prototype.first=_.prototype.head,Ji&&(_.prototype[Ji]=FF),_},$o=DR();no?((no.exports=$o)._=$o,Lc._=$o):vt._=$o}).call(Xo)}(Zs,Zs.exports);var Ye=Zs.exports;const XN={class:"grid-overlay-container"},Yp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",XN,[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"},"No datasource",-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))]))}}),JN={},QN={class:"grid-overlay-container"};function eV(t,e){return r.openBlock(),r.createElementBlock("div",QN,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Xp=Ql(JN,[["render",eV]]);async function tV(t,e){throw Error("not implemented")}function nV(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function rV(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const i=nV(t[o].spec);for(const l of i){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=jr(l),d=t.findIndex(p=>Ye.isEqual(p.id,c));if(d===-1)throw console.error("axis not found",o,c,t),Error("axis not found");n.push({columnIdx:o,axisIdx:d})}}return n}const Jp=(t,e)=>(t+e).toString();function oV(t,e,n,o,i,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let d=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===c.axisIdx&&(d=y),l[y]===c.columnIdx&&(p=y);const h=(()=>{const w=o[d].data.filter(v=>v!==null);return Array.from(new Set(w))})();h.sort(),p>d?(n.splice(p,1),n.splice(d,1)):(n.splice(d,1),n.splice(p,1));const m=iV(i,o,d,p,h,e.rows);for(let y=0;y<h.length;++y){const w=h[y],v=zr(w+"@"+y);n.push({colId:v,field:Jp(o.length,y),headerName:w,valueFormatter:ih})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function iV(t,e,n,o,i,l){const c=new Map;let d=0;for(let h=0;h<l;h++){const m={};for(let z=0;z<e.length;++z){if(z===n||z===o)continue;const $=t[z].toString();m[$]=e[z].data[h]}let y;const w=zr(Object.values(m))??"";c.has(w)?y=c.get(w):(c.set(w,m),y=m,y.id=d.toString(),d++);const v=i.indexOf(e[n].data[h]);if(v===-1)throw Error("index not found");const E=Jp(e.length,v);y[E]=e[o].data[h]}return Array.from(c.values())}const Un='"##RowNumberColumnId##"',Qp=45;function eh(){return{colId:Un,headerName:"#",valueGetter:t=>t.node===null||t.node.rowIndex===null?null:t.node.rowIndex+1,headerClass:"pl-ag-header-align-center",suppressNavigable:!0,suppressMovable:!0,mainMenuItems:[],contextMenuItems:[],lockPosition:"left",pinned:"left",lockPinned:!0,width:Qp,suppressSizeToFit:!0,suppressAutoSize:!0,cellStyle:{color:"var(--txt-03)","background-color":"var(--bg-base-light)",overflow:"visible !important","text-align":"center"},sortable:!1,resizable:!1}}function sV(){const t=document.createElement("div");return t.style.visibility="hidden",t.style.position="absolute",t.style.boxSizing="border-box",t.style.padding="15.5px",t.style.border="1px solid",t.style.width="auto",document.body.appendChild(t),t}function Ws(t,e,n){const o=t.getCellValue({rowNode:t.getDisplayedRowAtIndex(t.getLastDisplayedRowIndex()),colKey:Un});if(typeof o!="number")return;const i=o.toString().length;if(!n&&e.innerHTML.length===i)return;const l="5";e.innerHTML=l.repeat(i),r.nextTick(()=>{t.applyColumnState({state:[{colId:Un,pinned:"left",width:Math.max(Qp,e.offsetWidth)}]})})}function aV(t){document.body.removeChild(t)}function th(t){const e=sV();t.addEventListener("viewportChanged",()=>{Ws(t,e)}),t.addEventListener("columnVisible",n=>{n.columns&&n.columns.some(o=>o.isVisible()&&o.getColId()===Un)&&Ws(t,e)}),t.addEventListener("columnResized",n=>{var o;n.finished&&n.source==="autosizeColumns"&&((o=n.columns)!=null&&o.some(i=>i.isVisible()&&i.getColId()===Un))&&Ws(t,e,!0)}),t.addEventListener("gridPreDestroyed",()=>{aV(e)}),Ws(t,e)}const lV={class:"pl-ag-column-header__title d-flex align-center gap-6 flex-grow-1"},nh=r.defineComponent({__name:"PlAgColumnHeader",props:{params:{}},setup(t){const e=t,n=r.computed(()=>{var m,y;const h=(y=(m=e.params.column.getUserProvidedColDef())==null?void 0:m.headerComponentParams)==null?void 0:y.type;switch(h){case void 0:case"Text":return"cell-type-txt";case"Number":return"cell-type-num";case"File":return"paper-clip";case"Date":return"calendar";case"Duration":return"time";default:throw Error(`unsupported data type: ${h} for PlAgColumnHeader component. Column ${e.params.column.getColId()}`)}}),o=r.ref(null),i=()=>o.value=e.params.column.getSort()??null;r.onMounted(()=>i());function l(){e.params.column.isSortable()&&(e.params.progressSort(),i())}const c=r.computed(()=>{const h=o.value;switch(h){case"asc":return"arrow-up";case"desc":return"arrow-down";case null:return null;default:throw Error(`unsupported sort direction: ${h}. Column ${e.params.column.getColId()}`)}}),d=r.ref();function p(){const h=d.value;h&&e.params.showColumnMenu(h)}return(h,m)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-ag-column-header d-flex align-center gap-6",onClick:l},[r.createElementVNode("div",lV,[r.createVNode(r.unref(At),{name:n.value,class:"pl-ag-column-header__type-icon"},null,8,["name"]),r.createElementVNode("span",null,r.toDisplayString(h.params.displayName),1),c.value?(r.openBlock(),r.createBlock(r.unref(At),{key:0,name:c.value},null,8,["name"])):r.createCommentVNode("",!0)]),h.params.enableMenu?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuActivatorBtn",ref:d,class:"pl-ag-column-header__menu-icon",onClick:r.withModifiers(p,["stop"])},[r.createVNode(r.unref(At),{name:"more"})],512)):r.createCommentVNode("",!0)]))}}),cV={class:"pl-ag-grid-open-cell d-flex"},dV={class:"pl-ag-grid-open-cell__value"},rh=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;function n(){var o,i;if(e.params.invokeRowsOnDoubleClick){const l=e.params.api,c={rowPinned:e.params.node.rowPinned,api:l,rowIndex:e.params.node.rowIndex,context:l,type:"rowDoubleClicked",node:e.params.node,data:e.params.data,event:null};l.dispatchEvent(c)}else(i=(o=e.params).onClick)==null||i.call(o,e.params)}return(o,i)=>(r.openBlock(),r.createElementBlock("div",cV,[r.createElementVNode("div",dV,r.toDisplayString(o.params.value),1),r.createElementVNode("div",{class:"pl-ag-grid-open-cell__activator text-caps11 align-center",onClick:r.withModifiers(n,["stop"])},[r.createVNode(r.unref(At),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}});function uV(t){return zr(t)}function oh(t){return JSON.parse(t)}const ih=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function pV(t,e,n,o){var c,d,p;const i=uV(e),l=e.type==="axis"?e.spec.type:e.spec.valueType;return{colId:i,context:e,field:t.toString(),headerName:((d=(c=e.spec.annotations)==null?void 0:c["pl7.app/label"])==null?void 0:d.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(i))??((p=e.spec.annotations)==null?void 0:p["pl7.app/table/visibility"])==="optional",valueFormatter:ih,headerComponent:nh,cellRendererSelector:o?h=>{var y,w;if(e.type!=="axis")return;const m=(w=(y=h.colDef)==null?void 0:y.context)==null?void 0:w.id;if(Ye.isEqual(m,o))return{component:rh}}:void 0,cellRendererParams:o?{invokeRowsOnDoubleClick:!0}:void 0,headerComponentParams:{type:(()=>{switch(l){case"Int":case"Long":case"Float":case"Double":return"Number";case"String":case"Bytes":return"Text";default:throw Error(`unsupported data type: ${l}`)}})()},cellDataType:(()=>{switch(l){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${l}`)}})()}}function hV(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 fV(t,e,n,o){const i=t.length,l=[];for(let c=0;c<e[0].data.length;++c){const d=[],p=(o++).toString();for(const m of n)d.push(e[m].data[c]);const h={key:d,id:p};for(let m=0;m<i;++m){const y=t[m].toString(),w=e[m].data[c],v=e[m].type;Ky(e[m].absent,c)?h[y]=void 0:qy(w,v)||w===null?h[y]=null:h[y]=hV(w,v)}l.push(h)}return l}const mV=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function gV(t,e,n,o,i){const l=await t.getSpec(e);let c=l.findIndex(B=>B.type==="column");c===-1&&(c=l.length);const d=[...l.keys()].filter(B=>!Ye.some(n,D=>Ye.isEqual(jr(D.axis),l[B].id)||l[B].type==="column"&&l[B].spec.name==="pl7.app/label"&&l[B].spec.axesSpec.length===1&&Ye.isEqual(jr(D.axis),jr(l[B].spec.axesSpec[0])))).sort((B,D)=>{var N,j;if(l[B].type!==l[D].type)return l[B].type==="axis"?-1:1;const H=(N=l[B].spec.annotations)==null?void 0:N["pl7.app/table/orderPriority"],A=(j=l[D].spec.annotations)==null?void 0:j["pl7.app/table/orderPriority"];return H===void 0?A===void 0?0:1:A===void 0?-1:Number(A)-Number(H)}),p=Ye.cloneDeep(d),h=rV(l,d);for(let B=d.length-1;B>=0;--B){const D=d[B];if(!mV(l[D]))continue;const H=jr(l[D].spec.axesSpec[0]),A=Ye.findIndex(d,N=>Ye.isEqual(l[N].id,H));if(A===-1&&Ye.findIndex(n,j=>Ye.isEqual(jr(j.axis),H))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${H}`);continue}d[A]=D;for(const N of h)N.axisIdx===D&&(N.axisIdx=A);d.splice(B,1),p.splice(B,1)}const m=await t.getShape(e),y=m.rows,w=[eh(),...p.map(B=>pV(B,l[B],o,i))];if(h.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",h.length," transposition will not be applied."),h.length===1)return oV(h,m,w,await t.getData(e,d),p,d);const v=[...d],E=new Map;for(let B=0;B<c;++B)E.set(B,-1);for(let B=0;B<v.length;++B){const D=v[B];E.has(D)&&E.set(D,B)}for(const[B,D]of E)D===-1&&(E.set(B,v.length),v.push(B));const z=[];for(let B=0;B<c;++B){const D=E.get(B);if(D===void 0||D===-1)throw new Error("assertion exception");z.push(D)}let $;return{rowModelType:"serverSide",columnDefs:w,serverSideDatasource:{getRows:async B=>{try{if(y==0){B.success({rowData:[],rowCount:y}),B.api.setGridOption("loading",!1),B.api.showNoRowsOverlay();return}if($&&!Ye.isEqual($.request.sortModel,B.request.sortModel)){$=void 0,B.api.setGridOption("loading",!0),B.success({rowData:[],rowCount:0});return}$=B;let D=0,H=[];if(y>0&&B.request.startRow!==void 0&&B.request.endRow!==void 0&&(D=Math.min(y,B.request.endRow)-B.request.startRow,D>0)){const A=await t.getData(e,v,{offset:B.request.startRow,length:D});H=fV(p,A,z,B.request.startRow)}B.success({rowData:H,rowCount:y}),B.api.autoSizeColumns(B.api.getAllDisplayedColumns().filter(A=>A.getColId()!==Un)),B.api.setGridOption("loading",!1)}catch(D){B.api.setGridOption("loading",!0),B.fail(),console.trace(D)}}}}}const ec=Fg(),yV=["onClick"],_V={key:0,class:"pl-ag-columns__pin"},sh=r.defineComponent({__name:"PlAgGridColumnManager",props:{api:{}},setup(t){const e=t,{api:n}=r.toRefs(e),o=r.ref([]),i=r.ref(),l=r.ref(!1),c=r.ref(0);function d(h){const m=h.findIndex(y=>y.getId()===Un);if(m!==0){const[y]=h.splice(m,1);return h.splice(0,0,y)}return h}Kp(i,{handle:".handle",onChange(h){n.value.moveColumns(d(h.map(m=>o.value[m])),0)}});function p(h){n.value.setColumnsVisible([h],!h.isVisible())}return r.watch(()=>n.value,h=>{o.value=d(h.getAllGridColumns()),o.value.length>0&&h.moveColumns(o.value,0),h.addEventListener("displayedColumnsChanged",m=>{o.value=m.api.getAllGridColumns(),c.value++})},{immediate:!0}),(h,m)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(r.Teleport,{to:`#${r.unref(ec)}`},[r.createVNode(r.unref(wo),{onClick:m[0]||(m[0]=r.withModifiers(y=>l.value=!l.value,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(xt),{name:"columns"})]),default:r.withCtx(()=>[m[2]||(m[2]=r.createTextVNode(" Columns "))]),_:1})],8,["to"])),r.createVNode(r.unref(Rs),{modelValue:l.value,"onUpdate:modelValue":m[1]||(m[1]=y=>l.value=y),width:"368px","close-on-outside-click":""},{title:r.withCtx(()=>m[3]||(m[3]=[r.createTextVNode("Columns")])),default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("div",{ref_key:"listRef",ref:i,key:c.value,class:"pl-ag-columns"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,y=>(r.openBlock(),r.createElementBlock("div",{key:y.getId(),class:"pl-ag-columns__item"},[r.createElementVNode("div",{class:r.normalizeClass([{handle:!y.getColDef().lockPosition},"pl-ag-columns__drag"])},[r.createVNode(r.unref(At),{name:"drag-dots"})],2),r.createElementVNode("div",{class:r.normalizeClass([{visible:y.isVisible()},"pl-ag-columns__title text-s-btn"])},r.toDisplayString(y.getColDef().headerName),3),r.createElementVNode("div",{class:"pl-ag-columns__visibility",onClick:w=>p(y)},[r.createVNode(r.unref(Ct),{"close-delay":500,position:"top"},{tooltip:r.withCtx(()=>m[4]||(m[4]=[r.createTextVNode("Show/Hide")])),default:r.withCtx(()=>[r.createVNode(r.unref(xt),{name:y.isVisible()?"view-show":"view-hide"},null,8,["name"])]),_:2},1024)],8,yV),y.getColDef().lockPosition?(r.openBlock(),r.createElementBlock("div",_V,[r.createVNode(r.unref(xt),{name:"pin"})])):r.createCommentVNode("",!0)]))),128))]))]),_:1},8,["modelValue"])]))}}),CV=["id"],vV=r.defineComponent({__name:"PlAgDataTableToolsPanel",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(ec),class:"d-flex gap-6"},[r.renderSlot(e.$slots,"default")],8,CV))}}),wV={class:"ap-ag-data-table-container"},bV={key:1,class:"ap-ag-data-table-sheets"},xV=Ql(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{},showColumnsPanel:{type:Boolean},showCellButtonForAxisId:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{expose:e,emit:n}){x.ModuleRegistry.registerModules([hs.ClientSideRowModelModule,qd.ClipboardModule,Hd.ServerSideRowModelModule,Kd.RangeSelectionModule,ml,Lu]);const o=r.useModel(t,"modelValue"),i=t,{settings:l}=r.toRefs(i),c=n;o.value.pTableParams||(o.value.pTableParams={});function d(Z){return(Z==null?void 0:Z.sortModel.map(R=>{const{spec:O,...G}=oh(R.colId);return{column:G,ascending:R.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const p=r.computed({get:()=>{const Z=o.value;return{columnOrder:Z.gridState.columnOrder,sort:Z.gridState.sort,columnVisibility:Z.gridState.columnVisibility}},set:Z=>{var G;const R=((G=l.value)==null?void 0:G.sourceType)!=="ptable"||v.value.rowModelType==="clientSide"?void 0:d(Z.sort),O=o.value;o.value={...O,gridState:{...O.gridState,...Z},pTableParams:{...O.pTableParams,sorting:R}}}}),h=Z=>zr(jr(Z));function m(Z){var R,O;if(((R=l.value)==null?void 0:R.sourceType)==="ptable")return((O=l.value.sheets)==null?void 0:O.map(G=>({type:"bySingleColumnV2",column:{type:"axis",id:G.axis},predicate:{operator:"Equal",reference:Z[h(G.axis)]}})))??[]}const y=r.computed({get:()=>o.value.gridState.sheets??{},set:Z=>{const R=m(Z),O=o.value;o.value={...O,gridState:{...O.gridState,sheets:Z},pTableParams:{...O.pTableParams,filters:R}}}});r.watch(()=>l.value,(Z,R)=>{if((Z==null?void 0:Z.sourceType)!=="ptable"||!Z.sheets){y.value={};return}if(R&&R.sourceType==="ptable"&&Ye.isEqual(Z.sheets,R.sheets))return;const O=y.value,G={};for(const P of Z.sheets){const T=h(P.axis);G[T]=O[T]??P.defaultValue??P.options[0].value}y.value=G},{immediate:!0});const w=r.shallowRef(),v=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:p.value,autoSizeStrategy:{type:"fitCellContents"},onRowDoubleClicked:Z=>{Z.data&&c("onRowDoubleClicked",Z.data.key)},onSortChanged:Z=>{Z.api.refreshCells()},onFilterChanged:Z=>{Z.api.refreshCells()},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:Z=>Z.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Yp,noRowsOverlayComponent:Xp,defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),E=Z=>{const R=Z.api;th(R),w.value=new Proxy(R,{get(O,G,P){switch(G){case"setGridOption":return(T,M)=>{const U=v.value;U[T]=M,v.value=U,R.setGridOption(T,M)};case"updateGridOptions":return T=>{v.value={...v.value,...T},R.updateGridOptions(T)};default:return Reflect.get(O,G,P)}}})},z=Z=>({columnOrder:Z.columnOrder,sort:Z.sort,columnVisibility:Z.columnVisibility??(Z.columnOrder?{hiddenColIds:[]}:void 0)}),$=Z=>{v.value.initialState=p.value=z(Z.state),Z.api.autoSizeColumns(Z.api.getAllDisplayedColumns().filter(R=>R.getColId()!==Un))},S=()=>{v.value.initialState=p.value=z(w.value.getState()),w.value=void 0};let B=!1;const D=()=>{if(!B)return;const Z=w.value;Z!==void 0&&(Z.exportDataAsCsv(),B=!1,Z.setGridOption("cacheBlockSize",100))},H=()=>{if(!B)return;const Z=w.value;if(Z===void 0)return;const R=Z.getServerSideGroupLevelState()[0];R.cacheBlockSize===R.rowCount&&Z.refreshServerSide({route:R.route,purge:!1})};e({exportCsv:async()=>{const Z=w.value;if(Z!==void 0){if(v.value.rowModelType==="clientSide"){Z.exportDataAsCsv();return}if(v.value.rowModelType==="serverSide"){const R=Z.getServerSideGroupLevelState()[0];if(R.rowCount<=R.cacheBlockSize){Z.exportDataAsCsv();return}B||(B=!0,Z.setGridOption("cacheBlockSize",R.rowCount))}}}});const N=r.ref(0);r.watch(()=>[w.value,p.value],(Z,R)=>{if(Ye.isEqual(Z,R))return;const[O,G]=Z;if(!O)return;const P=z(O.getState());Ye.isEqual(G,P)||(v.value.initialState=G,++N.value)}),r.watch(()=>v.value,(Z,R)=>{var O,G;if(R){if(Z.rowModelType!=R.rowModelType&&++N.value,!Ye.isEqual(Z.columnDefs,R.columnDefs)&&Z.columnDefs){const P=U=>!("children"in U),M=(((O=Z.columnDefs)==null?void 0:O.filter(P))??[]).map(U=>U.colId).filter(U=>U!==void 0).filter(U=>U!==Un).map(U=>oh(U))??[];c("columnsChanged",M)}!Ye.isEqual(Z.loadingOverlayComponentParams,R.loadingOverlayComponentParams)&&Z.loading&&((G=w.value)==null||G.setGridOption("loading",!1),r.nextTick(()=>{var P;return(P=w.value)==null?void 0:P.setGridOption("loading",!0)}))}},{immediate:!0});const j=(Z,R)=>{var G;const O=y.value;if(O[Z]!==R)return O[Z]=R,y.value=O,(G=w.value)==null?void 0:G.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}})};let J;return r.watch(()=>[w.value,l.value],async Z=>{var P,T;const[R,O]=Z;if(!R||Ye.isEqual(O,J))return;J=O;const G=O==null?void 0:O.sourceType;switch(G){case void 0:return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:void 0,datasource:void 0});case"ptable":{if(!(O!=null&&O.pTable))return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},columnDefs:[],rowData:void 0,datasource:void 0});const M=xs().pFrameDriver,U=(T=(P=p.value)==null?void 0:P.columnVisibility)==null?void 0:T.hiddenColIds,X=await gV(M,O.pTable,O.sheets??[],U,i.showCellButtonForAxisId);return R.updateGridOptions({loading:!1,loadingOverlayComponentParams:{notReady:!1},...X})}case"xsv":{if(!(O==null?void 0:O.xsvFile))return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},columnDefs:[],rowData:void 0,datasource:void 0});xs().blobDriver;const U=await tV();return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...U})}default:throw Error(`unsupported source type: ${G}`)}}),(Z,R)=>{var O;return r.openBlock(),r.createElementBlock("div",wV,[w.value&&Z.showColumnsPanel?(r.openBlock(),r.createBlock(r.unref(sh),{key:0,api:w.value},null,8,["api"])):r.createCommentVNode("",!0),((O=r.unref(l))==null?void 0:O.sourceType)==="ptable"&&r.unref(l).sheets&&r.unref(l).sheets.length>0?(r.openBlock(),r.createElementBlock("div",bV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l).sheets,(G,P)=>{var T,M;return r.openBlock(),r.createBlock(r.unref(vp),{key:P,"model-value":y.value[h(G.axis)],options:G.options,prefix:(((M=(T=G.axis.annotations)==null?void 0:T["pl7.app/label"])==null?void 0:M.trim())??`Unlabeled axis ${P}`)+":","onUpdate:modelValue":U=>j(h(G.axis),U)},null,8,["model-value","options","prefix","onUpdate:modelValue"])}),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(Pg.AgGridVue),{key:N.value,theme:r.unref(Mu),class:"ap-ag-data-table-grid","grid-options":v.value,onGridReady:E,onStateUpdated:$,onGridPreDestroyed:S,onStoreRefreshed:D,onModelUpdated:H},null,8,["theme","grid-options"]))])}}}),[["__scopeId","data-v-6bef98d8"]]),kV={key:1,class:"alert-error"},SV={key:2},EV=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),i=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",kV,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),i.value?(r.openBlock(),r.createElementBlock("div",SV,"Unresolved")):r.createCommentVNode("",!0)]))}}),TV={style:{height:"100%"}},NV=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function i(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(c,d)=>(r.openBlock(),r.createElementBlock("div",TV,[r.createVNode(r.unref(Zp),{"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":i},null,8,["placeholder","extensions","model-value","progress"])]))}});var tc={exports:{}};const VV="2.0.0",ah=256,AV=Number.MAX_SAFE_INTEGER||9007199254740991,BV=16,PV=ah-6;var js={MAX_LENGTH:ah,MAX_SAFE_COMPONENT_LENGTH:BV,MAX_SAFE_BUILD_LENGTH:PV,MAX_SAFE_INTEGER:AV,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:VV,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Hs=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=js,l=Hs;e=t.exports={};const c=e.re=[],d=e.safeRe=[],p=e.src=[],h=e.t={};let m=0;const y="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",i],[y,o]],v=z=>{for(const[$,S]of w)z=z.split(`${$}*`).join(`${$}{0,${S}}`).split(`${$}+`).join(`${$}{1,${S}}`);return z},E=(z,$,S)=>{const B=v($),D=m++;l(z,D,$),h[z]=D,p[D]=$,c[D]=new RegExp($,S?"g":void 0),d[D]=new RegExp(B,S?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),E("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${p[h.NUMERICIDENTIFIER]}|${p[h.NONNUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NUMERICIDENTIFIERLOOSE]}|${p[h.NONNUMERICIDENTIFIER]})`),E("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${y}+`),E("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`),E("FULL",`^${p[h.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`),E("LOOSE",`^${p[h.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`),E("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),E("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",p[h.COERCE],!0),E("COERCERTLFULL",p[h.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",E("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",E("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(tc,tc.exports);var Gi=tc.exports;const RV=Object.freeze({loose:!0}),DV=Object.freeze({});var nc=t=>t?typeof t!="object"?RV:t:DV;const lh=/^[0-9]+$/,ch=(t,e)=>{const n=lh.test(t),o=lh.test(e);return n&&o&&(t=+t,e=+e),t===e?0:n&&!o?-1:o&&!n?1:t<e?-1:1};var dh={compareIdentifiers:ch,rcompareIdentifiers:(t,e)=>ch(e,t)};const qs=Hs,{MAX_LENGTH:uh,MAX_SAFE_INTEGER:Ks}=js,{safeRe:ph,t:hh}=Gi,IV=nc,{compareIdentifiers:Vo}=dh;var Pt=class qn{constructor(e,n){if(n=IV(n),e instanceof qn){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>uh)throw new TypeError(`version is longer than ${uh} characters`);qs("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const o=e.trim().match(n.loose?ph[hh.LOOSE]:ph[hh.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Ks||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ks||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ks||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const l=+i;if(l>=0&&l<Ks)return l}return i}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(qs("SemVer.compare",this.version,this.options,e),!(e instanceof qn)){if(typeof e=="string"&&e===this.version)return 0;e=new qn(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof qn||(e=new qn(e,this.options)),Vo(this.major,e.major)||Vo(this.minor,e.minor)||Vo(this.patch,e.patch)}comparePre(e){if(e instanceof qn||(e=new qn(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const o=this.prerelease[n],i=e.prerelease[n];if(qs("prerelease compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return Vo(o,i)}while(++n)}compareBuild(e){e instanceof qn||(e=new qn(e,this.options));let n=0;do{const o=this.build[n],i=e.build[n];if(qs("build compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return Vo(o,i)}while(++n)}inc(e,n,o){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,o),this.inc("pre",n,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,o),this.inc("pre",n,o);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(o)?1:0;if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let l=[n,i];o===!1&&(l=[n]),Vo(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=l):this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const fh=Pt;var Ao=(t,e,n=!1)=>{if(t instanceof fh)return t;try{return new fh(t,e)}catch(o){if(!n)return null;throw o}};const FV=Ao;var LV=(t,e)=>{const n=FV(t,e);return n?n.version:null};const OV=Ao;var MV=(t,e)=>{const n=OV(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};const mh=Pt;var GV=(t,e,n,o,i)=>{typeof n=="string"&&(i=o,o=n,n=void 0);try{return new mh(t instanceof mh?t.version:t,n).inc(e,o,i).version}catch{return null}};const gh=Ao;var $V=(t,e)=>{const n=gh(t,null,!0),o=gh(e,null,!0),i=n.compare(o);if(i===0)return null;const l=i>0,c=l?n:o,d=l?o:n,p=!!c.prerelease.length;if(!!d.prerelease.length&&!p)return!d.patch&&!d.minor?"major":c.patch?"patch":c.minor?"minor":"major";const m=p?"pre":"";return n.major!==o.major?m+"major":n.minor!==o.minor?m+"minor":n.patch!==o.patch?m+"patch":"prerelease"};const zV=Pt;var UV=(t,e)=>new zV(t,e).major;const ZV=Pt;var WV=(t,e)=>new ZV(t,e).minor;const jV=Pt;var HV=(t,e)=>new jV(t,e).patch;const qV=Ao;var KV=(t,e)=>{const n=qV(t,e);return n&&n.prerelease.length?n.prerelease:null};const yh=Pt;var _n=(t,e,n)=>new yh(t,n).compare(new yh(e,n));const YV=_n;var XV=(t,e,n)=>YV(e,t,n);const JV=_n;var QV=(t,e)=>JV(t,e,!0);const _h=Pt;var rc=(t,e,n)=>{const o=new _h(t,n),i=new _h(e,n);return o.compare(i)||o.compareBuild(i)};const eA=rc;var tA=(t,e)=>t.sort((n,o)=>eA(n,o,e));const nA=rc;var rA=(t,e)=>t.sort((n,o)=>nA(o,n,e));const oA=_n;var Ys=(t,e,n)=>oA(t,e,n)>0;const iA=_n;var oc=(t,e,n)=>iA(t,e,n)<0;const sA=_n;var Ch=(t,e,n)=>sA(t,e,n)===0;const aA=_n;var vh=(t,e,n)=>aA(t,e,n)!==0;const lA=_n;var ic=(t,e,n)=>lA(t,e,n)>=0;const cA=_n;var sc=(t,e,n)=>cA(t,e,n)<=0;const dA=Ch,uA=vh,pA=Ys,hA=ic,fA=oc,mA=sc;var wh=(t,e,n,o)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return dA(t,n,o);case"!=":return uA(t,n,o);case">":return pA(t,n,o);case">=":return hA(t,n,o);case"<":return fA(t,n,o);case"<=":return mA(t,n,o);default:throw new TypeError(`Invalid operator: ${e}`)}};const gA=Pt,yA=Ao,{safeRe:Xs,t:Js}=Gi;var _A=(t,e)=>{if(t instanceof gA)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Xs[Js.COERCEFULL]:Xs[Js.COERCE]);else{const p=e.includePrerelease?Xs[Js.COERCERTLFULL]:Xs[Js.COERCERTL];let h;for(;(h=p.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||h.index+h[0].length!==n.index+n[0].length)&&(n=h),p.lastIndex=h.index+h[1].length+h[2].length;p.lastIndex=-1}if(n===null)return null;const o=n[2],i=n[3]||"0",l=n[4]||"0",c=e.includePrerelease&&n[5]?`-${n[5]}`:"",d=e.includePrerelease&&n[6]?`+${n[6]}`:"";return yA(`${o}.${i}.${l}${c}${d}`,e)},CA=class{constructor(){this.max=1e3,this.map=new Map}get(e){const n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,n)}return this}},ac,bh;function Cn(){if(bh)return ac;bh=1;const t=/\s+/g;class e{constructor(M,U){if(U=i(U),M instanceof e)return M.loose===!!U.loose&&M.includePrerelease===!!U.includePrerelease?M:new e(M.raw,U);if(M instanceof l)return this.raw=M.value,this.set=[[M]],this.formatted=void 0,this;if(this.options=U,this.loose=!!U.loose,this.includePrerelease=!!U.includePrerelease,this.raw=M.trim().replace(t," "),this.set=this.raw.split("||").map(X=>this.parseRange(X.trim())).filter(X=>X.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const X=this.set[0];if(this.set=this.set.filter(ne=>!z(ne[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(const ne of this.set)if(ne.length===1&&$(ne[0])){this.set=[ne];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const U=this.set[M];for(let X=0;X<U.length;X++)X>0&&(this.formatted+=" "),this.formatted+=U[X].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const X=((this.options.includePrerelease&&v)|(this.options.loose&&E))+":"+M,ne=o.get(X);if(ne)return ne;const de=this.options.loose,me=de?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];M=M.replace(me,G(this.options.includePrerelease)),c("hyphen replace",M),M=M.replace(p[h.COMPARATORTRIM],m),c("comparator trim",M),M=M.replace(p[h.TILDETRIM],y),c("tilde trim",M),M=M.replace(p[h.CARETTRIM],w),c("caret trim",M);let Te=M.split(" ").map(qe=>B(qe,this.options)).join(" ").split(/\s+/).map(qe=>O(qe,this.options));de&&(Te=Te.filter(qe=>(c("loose invalid filter",qe,this.options),!!qe.match(p[h.COMPARATORLOOSE])))),c("range list",Te);const Se=new Map,je=Te.map(qe=>new l(qe,this.options));for(const qe of je){if(z(qe))return[qe];Se.set(qe.value,qe)}Se.size>1&&Se.has("")&&Se.delete("");const It=[...Se.values()];return o.set(X,It),It}intersects(M,U){if(!(M instanceof e))throw new TypeError("a Range is required");return this.set.some(X=>S(X,U)&&M.set.some(ne=>S(ne,U)&&X.every(de=>ne.every(me=>de.intersects(me,U)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new d(M,this.options)}catch{return!1}for(let U=0;U<this.set.length;U++)if(P(this.set[U],M,this.options))return!0;return!1}}ac=e;const n=CA,o=new n,i=nc,l=Qs(),c=Hs,d=Pt,{safeRe:p,t:h,comparatorTrimReplace:m,tildeTrimReplace:y,caretTrimReplace:w}=Gi,{FLAG_INCLUDE_PRERELEASE:v,FLAG_LOOSE:E}=js,z=T=>T.value==="<0.0.0-0",$=T=>T.value==="",S=(T,M)=>{let U=!0;const X=T.slice();let ne=X.pop();for(;U&&X.length;)U=X.every(de=>ne.intersects(de,M)),ne=X.pop();return U},B=(T,M)=>(c("comp",T,M),T=N(T,M),c("caret",T),T=H(T,M),c("tildes",T),T=J(T,M),c("xrange",T),T=R(T,M),c("stars",T),T),D=T=>!T||T.toLowerCase()==="x"||T==="*",H=(T,M)=>T.trim().split(/\s+/).map(U=>A(U,M)).join(" "),A=(T,M)=>{const U=M.loose?p[h.TILDELOOSE]:p[h.TILDE];return T.replace(U,(X,ne,de,me,Te)=>{c("tilde",T,X,ne,de,me,Te);let Se;return D(ne)?Se="":D(de)?Se=`>=${ne}.0.0 <${+ne+1}.0.0-0`:D(me)?Se=`>=${ne}.${de}.0 <${ne}.${+de+1}.0-0`:Te?(c("replaceTilde pr",Te),Se=`>=${ne}.${de}.${me}-${Te} <${ne}.${+de+1}.0-0`):Se=`>=${ne}.${de}.${me} <${ne}.${+de+1}.0-0`,c("tilde return",Se),Se})},N=(T,M)=>T.trim().split(/\s+/).map(U=>j(U,M)).join(" "),j=(T,M)=>{c("caret",T,M);const U=M.loose?p[h.CARETLOOSE]:p[h.CARET],X=M.includePrerelease?"-0":"";return T.replace(U,(ne,de,me,Te,Se)=>{c("caret",T,ne,de,me,Te,Se);let je;return D(de)?je="":D(me)?je=`>=${de}.0.0${X} <${+de+1}.0.0-0`:D(Te)?de==="0"?je=`>=${de}.${me}.0${X} <${de}.${+me+1}.0-0`:je=`>=${de}.${me}.0${X} <${+de+1}.0.0-0`:Se?(c("replaceCaret pr",Se),de==="0"?me==="0"?je=`>=${de}.${me}.${Te}-${Se} <${de}.${me}.${+Te+1}-0`:je=`>=${de}.${me}.${Te}-${Se} <${de}.${+me+1}.0-0`:je=`>=${de}.${me}.${Te}-${Se} <${+de+1}.0.0-0`):(c("no pr"),de==="0"?me==="0"?je=`>=${de}.${me}.${Te}${X} <${de}.${me}.${+Te+1}-0`:je=`>=${de}.${me}.${Te}${X} <${de}.${+me+1}.0-0`:je=`>=${de}.${me}.${Te} <${+de+1}.0.0-0`),c("caret return",je),je})},J=(T,M)=>(c("replaceXRanges",T,M),T.split(/\s+/).map(U=>Z(U,M)).join(" ")),Z=(T,M)=>{T=T.trim();const U=M.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return T.replace(U,(X,ne,de,me,Te,Se)=>{c("xRange",T,X,ne,de,me,Te,Se);const je=D(de),It=je||D(me),qe=It||D(Te),Zn=qe;return ne==="="&&Zn&&(ne=""),Se=M.includePrerelease?"-0":"",je?ne===">"||ne==="<"?X="<0.0.0-0":X="*":ne&&Zn?(It&&(me=0),Te=0,ne===">"?(ne=">=",It?(de=+de+1,me=0,Te=0):(me=+me+1,Te=0)):ne==="<="&&(ne="<",It?de=+de+1:me=+me+1),ne==="<"&&(Se="-0"),X=`${ne+de}.${me}.${Te}${Se}`):It?X=`>=${de}.0.0${Se} <${+de+1}.0.0-0`:qe&&(X=`>=${de}.${me}.0${Se} <${de}.${+me+1}.0-0`),c("xRange return",X),X})},R=(T,M)=>(c("replaceStars",T,M),T.trim().replace(p[h.STAR],"")),O=(T,M)=>(c("replaceGTE0",T,M),T.trim().replace(p[M.includePrerelease?h.GTE0PRE:h.GTE0],"")),G=T=>(M,U,X,ne,de,me,Te,Se,je,It,qe,Zn)=>(D(X)?U="":D(ne)?U=`>=${X}.0.0${T?"-0":""}`:D(de)?U=`>=${X}.${ne}.0${T?"-0":""}`:me?U=`>=${U}`:U=`>=${U}${T?"-0":""}`,D(je)?Se="":D(It)?Se=`<${+je+1}.0.0-0`:D(qe)?Se=`<${je}.${+It+1}.0-0`:Zn?Se=`<=${je}.${It}.${qe}-${Zn}`:T?Se=`<${je}.${It}.${+qe+1}-0`:Se=`<=${Se}`,`${U} ${Se}`.trim()),P=(T,M,U)=>{for(let X=0;X<T.length;X++)if(!T[X].test(M))return!1;if(M.prerelease.length&&!U.includePrerelease){for(let X=0;X<T.length;X++)if(c(T[X].semver),T[X].semver!==l.ANY&&T[X].semver.prerelease.length>0){const ne=T[X].semver;if(ne.major===M.major&&ne.minor===M.minor&&ne.patch===M.patch)return!0}return!1}return!0};return ac}var lc,xh;function Qs(){if(xh)return lc;xh=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(m,y){if(y=n(y),m instanceof e){if(m.loose===!!y.loose)return m;m=m.value}m=m.trim().split(/\s+/).join(" "),c("comparator",m,y),this.options=y,this.loose=!!y.loose,this.parse(m),this.semver===t?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(m){const y=this.options.loose?o[i.COMPARATORLOOSE]:o[i.COMPARATOR],w=m.match(y);if(!w)throw new TypeError(`Invalid comparator: ${m}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new d(w[2],this.options.loose):this.semver=t}toString(){return this.value}test(m){if(c("Comparator.test",m,this.options.loose),this.semver===t||m===t)return!0;if(typeof m=="string")try{m=new d(m,this.options)}catch{return!1}return l(m,this.operator,this.semver,this.options)}intersects(m,y){if(!(m instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new p(m.value,y).test(this.value):m.operator===""?m.value===""?!0:new p(this.value,y).test(m.semver):(y=n(y),y.includePrerelease&&(this.value==="<0.0.0-0"||m.value==="<0.0.0-0")||!y.includePrerelease&&(this.value.startsWith("<0.0.0")||m.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&m.operator.startsWith(">")||this.operator.startsWith("<")&&m.operator.startsWith("<")||this.semver.version===m.semver.version&&this.operator.includes("=")&&m.operator.includes("=")||l(this.semver,"<",m.semver,y)&&this.operator.startsWith(">")&&m.operator.startsWith("<")||l(this.semver,">",m.semver,y)&&this.operator.startsWith("<")&&m.operator.startsWith(">")))}}lc=e;const n=nc,{safeRe:o,t:i}=Gi,l=wh,c=Hs,d=Pt,p=Cn();return lc}const vA=Cn();var ea=(t,e,n)=>{try{e=new vA(e,n)}catch{return!1}return e.test(t)};const wA=Cn();var bA=(t,e)=>new wA(t,e).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));const xA=Pt,kA=Cn();var SA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new kA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===-1)&&(o=c,i=new xA(o,n))}),o};const EA=Pt,TA=Cn();var NA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new TA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===1)&&(o=c,i=new EA(o,n))}),o};const cc=Pt,VA=Cn(),kh=Ys;var AA=(t,e)=>{t=new VA(t,e);let n=new cc("0.0.0");if(t.test(n)||(n=new cc("0.0.0-0"),t.test(n)))return n;n=null;for(let o=0;o<t.set.length;++o){const i=t.set[o];let l=null;i.forEach(c=>{const d=new cc(c.semver.version);switch(c.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||kh(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),l&&(!n||kh(n,l))&&(n=l)}return n&&t.test(n)?n:null};const BA=Cn();var PA=(t,e)=>{try{return new BA(t,e).range||"*"}catch{return null}};const RA=Pt,Sh=Qs(),{ANY:DA}=Sh,IA=Cn(),FA=ea,Eh=Ys,Th=oc,LA=sc,OA=ic;var dc=(t,e,n,o)=>{t=new RA(t,o),e=new IA(e,o);let i,l,c,d,p;switch(n){case">":i=Eh,l=LA,c=Th,d=">",p=">=";break;case"<":i=Th,l=OA,c=Eh,d="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(FA(t,e,o))return!1;for(let h=0;h<e.set.length;++h){const m=e.set[h];let y=null,w=null;if(m.forEach(v=>{v.semver===DA&&(v=new Sh(">=0.0.0")),y=y||v,w=w||v,i(v.semver,y.semver,o)?y=v:c(v.semver,w.semver,o)&&(w=v)}),y.operator===d||y.operator===p||(!w.operator||w.operator===d)&&l(t,w.semver))return!1;if(w.operator===p&&c(t,w.semver))return!1}return!0};const MA=dc;var GA=(t,e,n)=>MA(t,e,">",n);const $A=dc;var zA=(t,e,n)=>$A(t,e,"<",n);const Nh=Cn();var UA=(t,e,n)=>(t=new Nh(t,n),e=new Nh(e,n),t.intersects(e,n));const ZA=ea,WA=_n;var jA=(t,e,n)=>{const o=[];let i=null,l=null;const c=t.sort((m,y)=>WA(m,y,n));for(const m of c)ZA(m,e,n)?(l=m,i||(i=m)):(l&&o.push([i,l]),l=null,i=null);i&&o.push([i,null]);const d=[];for(const[m,y]of o)m===y?d.push(m):!y&&m===c[0]?d.push("*"):y?m===c[0]?d.push(`<=${y}`):d.push(`${m} - ${y}`):d.push(`>=${m}`);const p=d.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return p.length<h.length?p:e};const Vh=Cn(),uc=Qs(),{ANY:pc}=uc,$i=ea,hc=_n,HA=(t,e,n={})=>{if(t===e)return!0;t=new Vh(t,n),e=new Vh(e,n);let o=!1;e:for(const i of t.set){for(const l of e.set){const c=KA(i,l,n);if(o=o||c!==null,c)continue e}if(o)return!1}return!0},qA=[new uc(">=0.0.0-0")],Ah=[new uc(">=0.0.0")],KA=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===pc){if(e.length===1&&e[0].semver===pc)return!0;n.includePrerelease?t=qA:t=Ah}if(e.length===1&&e[0].semver===pc){if(n.includePrerelease)return!0;e=Ah}const o=new Set;let i,l;for(const v of t)v.operator===">"||v.operator===">="?i=Bh(i,v,n):v.operator==="<"||v.operator==="<="?l=Ph(l,v,n):o.add(v.semver);if(o.size>1)return null;let c;if(i&&l){if(c=hc(i.semver,l.semver,n),c>0)return null;if(c===0&&(i.operator!==">="||l.operator!=="<="))return null}for(const v of o){if(i&&!$i(v,String(i),n)||l&&!$i(v,String(l),n))return null;for(const E of e)if(!$i(v,String(E),n))return!1;return!0}let d,p,h,m,y=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1,w=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;y&&y.prerelease.length===1&&l.operator==="<"&&y.prerelease[0]===0&&(y=!1);for(const v of e){if(m=m||v.operator===">"||v.operator===">=",h=h||v.operator==="<"||v.operator==="<=",i){if(w&&v.semver.prerelease&&v.semver.prerelease.length&&v.semver.major===w.major&&v.semver.minor===w.minor&&v.semver.patch===w.patch&&(w=!1),v.operator===">"||v.operator===">="){if(d=Bh(i,v,n),d===v&&d!==i)return!1}else if(i.operator===">="&&!$i(i.semver,String(v),n))return!1}if(l){if(y&&v.semver.prerelease&&v.semver.prerelease.length&&v.semver.major===y.major&&v.semver.minor===y.minor&&v.semver.patch===y.patch&&(y=!1),v.operator==="<"||v.operator==="<="){if(p=Ph(l,v,n),p===v&&p!==l)return!1}else if(l.operator==="<="&&!$i(l.semver,String(v),n))return!1}if(!v.operator&&(l||i)&&c!==0)return!1}return!(i&&h&&!l&&c!==0||l&&m&&!i&&c!==0||w||y)},Bh=(t,e,n)=>{if(!t)return e;const o=hc(t.semver,e.semver,n);return o>0?t:o<0||e.operator===">"&&t.operator===">="?e:t},Ph=(t,e,n)=>{if(!t)return e;const o=hc(t.semver,e.semver,n);return o<0?t:o>0||e.operator==="<"&&t.operator==="<="?e:t};var YA=HA;const fc=Gi,Rh=js,XA=Pt,Dh=dh,JA=Ao,QA=LV,eB=MV,tB=GV,nB=$V,rB=UV,oB=WV,iB=HV,sB=KV,aB=_n,lB=XV,cB=QV,dB=rc,uB=tA,pB=rA,hB=Ys,fB=oc,mB=Ch,gB=vh,yB=ic,_B=sc,CB=wh,vB=_A,wB=Qs(),bB=Cn();var xB={parse:JA,valid:QA,clean:eB,inc:tB,diff:nB,major:rB,minor:oB,patch:iB,prerelease:sB,compare:aB,rcompare:lB,compareLoose:cB,compareBuild:dB,sort:uB,rsort:pB,gt:hB,lt:fB,eq:mB,neq:gB,gte:yB,lte:_B,cmp:CB,coerce:vB,Comparator:wB,Range:bB,satisfies:ea,toComparators:bA,maxSatisfying:SA,minSatisfying:NA,minVersion:AA,validRange:PA,outside:dc,gtr:GA,ltr:zA,intersects:UA,simplifyRange:jA,subset:YA,SemVer:XA,re:fc.re,src:fc.src,tokens:fc.t,SEMVER_SPEC_VERSION:Rh.SEMVER_SPEC_VERSION,RELEASE_TYPES:Rh.RELEASE_TYPES,compareIdentifiers:Dh.compareIdentifiers,rcompareIdentifiers:Dh.rcompareIdentifiers};const kB=eu(xB);function SB(t){return zr(t.id)}function EB(t){switch(t){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: ${t}`)}}const TB=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],NB=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"];function Ih(t,e){var n,o;return((o=(n=t.spec.annotations)==null?void 0:n["pl7.app/label"])==null?void 0:o.trim())??"Unlabeled "+t.type+" "+e.toString()}function VB(t){const e=t.type;switch(e){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return t.reference;case"number_between":return t.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return t.reference;default:throw Error(`unsupported filter type: ${e}`)}}function Fh(t,e){switch(t){case"isNotNA":case"isNA":return{type:t};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:t,reference:typeof e=="number"?e:0};case"number_between":return{type:t,lowerBound:typeof e=="number"?e: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:t,reference:typeof e=="string"?e:""};case"string_containsFuzzyMatch":return{type:t,reference:typeof e=="string"?e:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${t}`)}}function AB(t,e){return{columnId:t.columnId,filter:Fh(e,VB(t.filter)),disabled:t.disabled}}function mc(t,e){var c,d;const n=Number(e);if(!Number.isFinite(n))throw Error("Model value is not a number.");const o=t.type==="column"?t.spec.valueType:t.spec.type;if((o==="Int"||o==="Long")&&!Number.isInteger(n))throw Error("Model value is not an integer.");const i=(c=t.spec.annotations)==null?void 0:c["pl7.app/min"];if(i!==void 0){const p=Number(i);if(Number.isFinite(p)&&n<Number(i))throw Error("Model value is too low.")}const l=(d=t.spec.annotations)==null?void 0:d["pl7.app/max"];if(l!==void 0){const p=Number(l);if(Number.isFinite(p)&&n>Number(l))throw Error("Model value is too high.")}return n}function Lh(t,e){var o,i;const n=((o=t.spec.domain)==null?void 0:o["pl7.app/alphabet"])??((i=t.spec.annotations)==null?void 0:i["pl7.app/alphabet"]);if(n==="nucleotide"&&!/^[AaTtGgCcNn]+$/.test(e))throw Error("Model value is not a nucleotide.");if(n==="aminoacid"&&!/^[AaCcDdEeFfGgHhIiKkLlMmNnPpQqRrSsTtVvWwYyXx]+$/.test(e))throw Error("Model value is not an aminoacid.");return e}function BB(t){try{return new RegExp(t),t}catch(e){throw e instanceof SyntaxError?Error("Model value is not a regexp."):e}}function PB(t,e){var i,l;const n=((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]);if(n==="nucleotide")return[{value:"N",text:"N"}];if(n==="aminoacid")return[{value:"X",text:"X"}];const o=Ye.uniq(e);return o.sort(),o.map(c=>({value:c,text:c}))}function RB(t,e){var i,l;const n=kB.gt(xs().sdkInfo.sdkVersion,"1.14.0")&&(t.type==="column"?t.spec.valueType:t.spec.type)==="String"&&(((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]))!==void 0,o=e.type;switch(o){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":return{operator:"Equal",reference:e.reference};case"string_equals":return{operator:n?"IEqual":"Equal",reference:e.reference};case"number_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:e.reference}};case"string_notEquals":return{operator:"Not",operand:{operator:n?"IEqual":"Equal",reference:e.reference}};case"number_greaterThan":return{operator:"Greater",reference:e.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:e.reference};case"number_lessThan":return{operator:"Less",reference:e.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:e.reference};case"number_between":return{operator:"And",operands:[{operator:e.includeLowerBound?"GreaterOrEqual":"Greater",reference:e.lowerBound},{operator:e.includeUpperBound?"LessOrEqual":"Less",reference:e.upperBound}]};case"string_contains":return{operator:n?"StringIContains":"StringContains",substring:e.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:n?"StringIContains":"StringContains",substring:e.reference}};case"string_matches":return{operator:"Matches",regex:e.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:e.reference}};case"string_containsFuzzyMatch":return{operator:n?"StringIContainsFuzzy":"StringContainsFuzzy",reference:e.reference,maxEdits:e.maxEdits,substitutionsOnly:e.substitutionsOnly,wildcard:e.wildcard};default:throw Error(`unsupported filter type: ${o}`)}}const DB={class:"d-flex flex-column gap-24"},Oh=r.defineComponent({__name:"PlTableFilterEntry",props:r.mergeModels({column:{},options:{},disabled:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{column:o,options:i}=r.toRefs(n);return(l,c)=>(r.openBlock(),r.createElementBlock("div",DB,[r.createVNode(r.unref(bo),{"model-value":e.value.filter.type,options:r.unref(i),disabled:l.disabled,label:"Predicate","onUpdate:modelValue":c[0]||(c[0]=d=>e.value=r.unref(AB)(e.value,d))},null,8,["model-value","options","disabled"]),e.value.filter.type==="number_equals"||e.value.filter.type==="number_notEquals"||e.value.filter.type==="number_lessThan"||e.value.filter.type==="number_lessThanOrEqualTo"||e.value.filter.type==="number_greaterThan"||e.value.filter.type==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(qr),{key:0,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[1]||(c[1]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(mc)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(r.unref(qr),{modelValue:e.value.filter.lowerBound,"onUpdate:modelValue":c[2]||(c[2]=d=>e.value.filter.lowerBound=d),disabled:l.disabled,parse:d=>r.unref(mc)(r.unref(o),d),label:"Lower bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Ds),{modelValue:e.value.filter.includeLowerBound,"onUpdate:modelValue":c[3]||(c[3]=d=>e.value.filter.includeLowerBound=d),disabled:l.disabled,label:"Include lower bound"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(qr),{modelValue:e.value.filter.upperBound,"onUpdate:modelValue":c[4]||(c[4]=d=>e.value.filter.upperBound=d),disabled:l.disabled,parse:d=>r.unref(mc)(r.unref(o),d),label:"Upper bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Ds),{modelValue:e.value.filter.includeUpperBound,"onUpdate:modelValue":c[5]||(c[5]=d=>e.value.filter.includeUpperBound=d),disabled:l.disabled,label:"Include upper bound"},null,8,["modelValue","disabled"])],64)):r.createCommentVNode("",!0),e.value.filter.type==="string_equals"||e.value.filter.type==="string_notEquals"||e.value.filter.type==="string_contains"||e.value.filter.type==="string_doesNotContain"?(r.openBlock(),r.createBlock(r.unref(qr),{key:2,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[6]||(c[6]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Lh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_matches"||e.value.filter.type==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(qr),{key:3,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[7]||(c[7]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:r.unref(BB),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(qr),{modelValue:e.value.filter.reference,"onUpdate:modelValue":c[8]||(c[8]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Lh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(jp),{modelValue:e.value.filter.maxEdits,"onUpdate:modelValue":c[9]||(c[9]=d=>e.value.filter.maxEdits=d),max:5,disabled:l.disabled,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(Ds),{modelValue:e.value.filter.substitutionsOnly,"onUpdate:modelValue":c[10]||(c[10]=d=>e.value.filter.substitutionsOnly=d),disabled:l.disabled,label:"Substitutions only"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(bo),{modelValue:e.value.filter.wildcard,"onUpdate:modelValue":c[11]||(c[11]=d=>e.value.filter.wildcard=d),disabled:l.disabled,options:r.unref(PB)(r.unref(o),e.value.filter.reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","disabled","options"])],64)):r.createCommentVNode("",!0)]))}}),IB={class:"d-flex flex-column gap-24"},FB={key:0,class:"text-subtitle-m",style:{color:"var(--txt-mask)"}},LB=r.defineComponent({__name:"PlTableAddFilter",props:r.mergeModels({columnsById:{},columnOptions:{},filterOptions:{},makeFilter:{type:Function}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:r.mergeModels(["addFilter"],["update:modelValue"]),setup(t,{emit:e}){const n=r.useModel(t,"modelValue"),o=t,{columnsById:i,columnOptions:l,filterOptions:c}=r.toRefs(o),d=e,p=r.ref(),h=r.ref();r.watch(()=>p.value,w=>{w?h.value=o.makeFilter(w):h.value=void 0});const m=()=>{p.value=void 0,n.value=!1},y=()=>{h.value&&(d("addFilter",h.value),m())};return(w,v)=>(r.openBlock(),r.createBlock(r.unref(Rs),{modelValue:n.value,"onUpdate:modelValue":v[2]||(v[2]=E=>n.value=E),"close-on-outside-click":!1},{title:r.withCtx(()=>v[3]||(v[3]=[r.createTextVNode("Add Filter")])),actions:r.withCtx(()=>[r.createVNode(r.unref(Vs),{disabled:!h.value,onClick:y},{default:r.withCtx(()=>v[4]||(v[4]=[r.createTextVNode("Add Filter")])),_:1},8,["disabled"]),r.createVNode(r.unref(wo),{"justify-center":!1,onClick:m},{default:r.withCtx(()=>v[5]||(v[5]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",IB,[r.createVNode(r.unref(bo),{modelValue:p.value,"onUpdate:modelValue":v[0]||(v[0]=E=>p.value=E),options:r.unref(l),label:"Column",placeholder:"Choose..."},null,8,["modelValue","options"]),h.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",FB,"Choose a column to view and adjust its options")),h.value?(r.openBlock(),r.createBlock(Oh,{key:1,modelValue:h.value,"onUpdate:modelValue":v[1]||(v[1]=E=>h.value=E),column:r.unref(i)[h.value.columnId],options:r.unref(c)[h.value.columnId]},null,8,["modelValue","column","options"])):r.createCommentVNode("",!0)])]),_:1},8,["modelValue"]))}}),OB=["onClick"],MB={class:"pl-filter-manager__expand-icon"},GB={class:"pl-filter-manager__title flex-grow-1 text-s-btn"},$B={class:"pl-filter-manager__actions d-flex gap-12"},zB=["onClick"],UB=["onClick"],ZB={class:"pl-filter-manager__content d-flex gap-24 p-24 flex-column"},WB={class:"d-flex justify-center"},jB=["onClick"],HB={class:"pl-filter-manager__add-btn-icon"},qB={key:0},KB=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:i,defaults:l}=r.toRefs(n),c=r.computed(()=>{const R=o.value.filter(G=>{const P=G.type;switch(P){case"axis":return G.spec.type!=="Bytes";case"column":return G.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${P}`)}}),O={};for(const G of R)O[SB(G)]=G;return O}),d=r.computed(()=>{const R=i.value??[],O={};for(const[G,P]of Object.entries(c.value)){const T=Ye.find(R,M=>Ye.isEqual(M.column.id,P.id));T&&(O[G]=T.allowedFilterTypes)}return O}),p=r.computed(()=>{const R=l.value??[],O={};for(const[G,P]of Object.entries(c.value)){const T=Ye.find(R,M=>Ye.isEqual(M.column.id,P.id));T&&(O[G]={columnId:G,filter:T.default,disabled:!1})}return O});(()=>{const R=e.value.state;typeof R=="object"&&!Array.isArray(R)&&(e.value.state=Object.entries(R).map(([O,G])=>({columnId:O,filter:G,disabled:!1})))})();const h=R=>R??Object.values(p.value),m=r.reactive({state:h(e.value.state)});r.watch(()=>e.value,R=>{Ye.isEqual(m.state,R.state)||(m.state=h(R.state))}),r.watch(()=>m,R=>{Ye.isEqual(R.state,e.value.state)||(e.value={state:Ye.cloneDeep(R.state),filters:R.state.filter(O=>!O.disabled).map(O=>{const G=c.value[O.columnId],{spec:P,...T}=G;return{type:"bySingleColumnV2",column:T,predicate:RB(G,O.filter)}})})},{immediate:!0,deep:!0}),r.watch(()=>c.value,R=>{Object.keys(R).length===0&&m.state!==void 0||(m.state=m.state.filter(O=>!!R[O.columnId]))},{immediate:!0});const y=r.computed(()=>Object.keys(c).length>0&&m.state.length>0),w=r.computed(()=>{const R=d.value,O={};for(const[G,P]of Object.entries(c.value)){let M=(P.type==="column"?P.spec.valueType:P.spec.type)==="String"?NB:TB;const U=R[G];U&&(M=M.filter(X=>U.includes(X))),O[G]=M.map(X=>({value:X,text:EB(X)}))}return O}),v=r.computed(()=>Ye.some(Object.values(w.value),R=>R.length>0)),E=r.computed(()=>Object.entries(Object.entries(c.value)).filter(([R,[O,G]])=>w.value[O].length>0).filter(([R,[O,G]])=>!m.state.some(P=>P.columnId===O)).map(([R,[O,G]])=>({label:Ih(G,R),value:O}))),z=R=>p.value[R]??{columnId:R,filter:Fh(w.value[R][0].value),disabled:!1},$=R=>{m.state[R]=z(m.state[R].columnId)},S=R=>m.state.splice(R,1),B=r.ref(!1),D=r.ref(!1),H=r.ref(!1);r.onMounted(()=>{H.value=!0});const A=r.reactive({}),N=R=>{A[R]?delete A[R]:A[R]=!0},j=r.ref(!1),J=r.ref();let Z;return r.onMounted(()=>{Z=new ResizeObserver(()=>{var O;const R=(O=J.value)==null?void 0:O.parentElement;R&&(j.value=R.scrollHeight>R.clientHeight||R.scrollWidth>R.clientWidth)}),J.value&&J.value.parentElement&&Z.observe(J.value.parentElement)}),r.watch(J,(R,O)=>{O!=null&&O.parentElement&&Z.unobserve(O.parentElement),R!=null&&R.parentElement&&Z.observe(R.parentElement)}),r.onBeforeUnmount(()=>{Z!==void 0&&Z.disconnect()}),(R,O)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[H.value?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:`#${r.unref(ec)}`},[r.createVNode(r.unref(wo),{onClick:O[0]||(O[0]=r.withModifiers(G=>B.value=!0,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(Bs),{name:y.value?"filter-on":"filter"},null,8,["name"])]),default:r.withCtx(()=>[O[5]||(O[5]=r.createTextVNode(" Filters "))]),_:1})],8,["to"])):r.createCommentVNode("",!0),r.createVNode(r.unref(Rs),{modelValue:B.value,"onUpdate:modelValue":O[2]||(O[2]=G=>B.value=G),"close-on-outside-click":!1},{title:r.withCtx(()=>O[6]||(O[6]=[r.createTextVNode("Manage Filters")])),default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"filterManager",ref:J,class:"pl-filter-manager d-flex flex-column gap-6"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.state,(G,P)=>(r.openBlock(),r.createElementBlock("div",{key:G.columnId,class:r.normalizeClass([{open:A[G.columnId],disabled:G.disabled},"pl-filter-manager__filter"])},[r.createElementVNode("div",{class:"pl-filter-manager__header d-flex align-center gap-8",onClick:T=>N(G.columnId)},[r.createElementVNode("div",MB,[r.createVNode(r.unref(At),{name:"chevron-right"})]),r.createElementVNode("div",GB,r.toDisplayString(r.unref(Ih)(c.value[G.columnId],P)),1),r.createElementVNode("div",$B,[r.createElementVNode("div",{class:"pl-filter-manager__toggle",onClick:r.withModifiers(T=>G.disabled=!G.disabled,["stop"])},[r.createVNode(r.unref(xt),{name:G.disabled?"view-hide":"view-show"},null,8,["name"])],8,zB),r.createElementVNode("div",{class:"pl-filter-manager__delete",onClick:r.withModifiers(T=>S(P),["stop"])},[r.createVNode(r.unref(xt),{name:"close"})],8,UB)])],8,OB),r.createElementVNode("div",ZB,[r.createVNode(Oh,{modelValue:m.state[P],"onUpdate:modelValue":T=>m.state[P]=T,disabled:G.disabled,column:c.value[G.columnId],options:w.value[G.columnId]},null,8,["modelValue","onUpdate:modelValue","disabled","column","options"]),r.createElementVNode("div",WB,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:G.disabled},"pl-filter-manager__revert-btn text-s-btn d-flex align-center gap-8"]),onClick:T=>$(P)},[O[7]||(O[7]=r.createTextVNode(" Revert Settings to Default ")),r.createVNode(r.unref(xt),{name:"reverse"})],10,jB)])])],2))),128)),r.createElementVNode("div",{class:r.normalizeClass([{"pt-24":j.value},"pl-filter-manager__add-action-wrapper"])},[E.value.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-filter-manager__add-btn",onClick:O[1]||(O[1]=G=>D.value=!0)},[r.createElementVNode("div",HB,[r.createVNode(r.unref(At),{name:"add"})]),O[8]||(O[8]=r.createElementVNode("div",{class:"pl-filter-manager__add-btn-title text-s-btn"},"Add Filter",-1))])):r.createCommentVNode("",!0)],2),v.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",qB,"No filters applicable"))],512)]),_:1},8,["modelValue"]),r.createVNode(LB,{modelValue:D.value,"onUpdate:modelValue":O[3]||(O[3]=G=>D.value=G),"columns-by-id":c.value,"column-options":E.value,"filter-options":w.value,"make-filter":z,onAddFilter:O[4]||(O[4]=G=>m.state.push(G))},null,8,["modelValue","columns-by-id","column-options","filter-options"])],64))}}),ta=new Map;function YB(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{ta.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function XB(t){const e=Symbol();return()=>(ta.has(e)||ta.set(e,YB(e,t)),ta.get(e))}function JB(t){return r.computed(()=>{try{return nu(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function QB(t,e,n){const o=r.ref(0),i=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=Og(e);return r.watch(t,async c=>{i.error=void 0,o.value++,l(c).then(d=>{d.ok&&(i.value=d.value)}).catch(d=>{i.value=void 0,i.error=d}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),i}const Bo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Mh=new Set,gc=typeof process=="object"&&process?process:{},Gh=(t,e,n,o)=>{typeof gc.emitWarning=="function"?gc.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let na=globalThis.AbortController,$h=globalThis.AbortSignal;if(typeof na>"u"){$h=class{constructor(){Ze(this,"onabort");Ze(this,"_onabort",[]);Ze(this,"reason");Ze(this,"aborted",!1)}addEventListener(o,i){this._onabort.push(i)}},na=class{constructor(){Ze(this,"signal",new $h);e()}abort(o){var i,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const c of this.signal._onabort)c(o);(l=(i=this.signal).onabort)==null||l.call(i,o)}}};let t=((Uh=gc.env)==null?void 0:Uh.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,Gh("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 eP=t=>!Mh.has(t),Nr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),zh=t=>Nr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ra:null:null;class ra extends Array{constructor(e){super(e),this.fill(0)}}const Jr=class Jr{constructor(e,n){Ze(this,"heap");Ze(this,"length");if(!b(Jr,Po))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=zh(e);if(!n)return[];ye(Jr,Po,!0);const o=new Jr(e,n);return ye(Jr,Po,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Po=new WeakMap,ze(Jr,Po,!1);let yc=Jr;const vc=class vc{constructor(e){ze(this,re);ze(this,vn);ze(this,Ht);ze(this,wn);ze(this,bn);ze(this,Ro);ze(this,Do);Ze(this,"ttl");Ze(this,"ttlResolution");Ze(this,"ttlAutopurge");Ze(this,"updateAgeOnGet");Ze(this,"updateAgeOnHas");Ze(this,"allowStale");Ze(this,"noDisposeOnSet");Ze(this,"noUpdateTTL");Ze(this,"maxEntrySize");Ze(this,"sizeCalculation");Ze(this,"noDeleteOnFetchRejection");Ze(this,"noDeleteOnStaleGet");Ze(this,"allowStaleOnFetchAbort");Ze(this,"allowStaleOnFetchRejection");Ze(this,"ignoreFetchAbort");ze(this,ut);ze(this,xn);ze(this,dt);ze(this,Je);ze(this,ke);ze(this,Rt);ze(this,qt);ze(this,Et);ze(this,mt);ze(this,kn);ze(this,gt);ze(this,Sn);ze(this,En);ze(this,Kt);ze(this,Tn);ze(this,Vr);ze(this,Dt);ze(this,Qr,()=>{});ze(this,Qn,()=>{});ze(this,zi,()=>{});ze(this,Yt,()=>!1);ze(this,eo,e=>{});ze(this,Io,(e,n,o)=>{});ze(this,Ui,(e,n,o,i)=>{if(o||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ze(this,Zh,"LRUCache");const{max:n=0,ttl:o,ttlResolution:i=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:d,allowStale:p,dispose:h,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:w,maxSize:v=0,maxEntrySize:E=0,sizeCalculation:z,fetchMethod:$,memoMethod:S,noDeleteOnFetchRejection:B,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:H,allowStaleOnFetchAbort:A,ignoreFetchAbort:N}=e;if(n!==0&&!Nr(n))throw new TypeError("max option must be a nonnegative integer");const j=n?zh(n):Array;if(!j)throw new Error("invalid max value: "+n);if(ye(this,vn,n),ye(this,Ht,v),this.maxEntrySize=E||b(this,Ht),this.sizeCalculation=z,this.sizeCalculation){if(!b(this,Ht)&&!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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(ye(this,Do,S),$!==void 0&&typeof $!="function")throw new TypeError("fetchMethod must be a function if specified");if(ye(this,Ro,$),ye(this,Vr,!!$),ye(this,dt,new Map),ye(this,Je,new Array(n).fill(void 0)),ye(this,ke,new Array(n).fill(void 0)),ye(this,Rt,new j(n)),ye(this,qt,new j(n)),ye(this,Et,0),ye(this,mt,0),ye(this,kn,yc.create(n)),ye(this,ut,0),ye(this,xn,0),typeof h=="function"&&ye(this,wn,h),typeof m=="function"?(ye(this,bn,m),ye(this,gt,[])):(ye(this,bn,void 0),ye(this,gt,void 0)),ye(this,Tn,!!b(this,wn)),ye(this,Dt,!!b(this,bn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!w,this.noDeleteOnFetchRejection=!!B,this.allowStaleOnFetchRejection=!!H,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(b(this,Ht)!==0&&!Nr(b(this,Ht)))throw new TypeError("maxSize must be a positive integer if specified");if(!Nr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ue(this,re,Eg).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!d,this.ttlResolution=Nr(i)||i===0?i:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!Nr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ue(this,re,Ud).call(this)}if(b(this,vn)===0&&this.ttl===0&&b(this,Ht)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!b(this,vn)&&!b(this,Ht)){const J="LRU_CACHE_UNBOUNDED";eP(J)&&(Mh.add(J),Gh("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,vc))}}static unsafeExposeInternals(e){return{starts:b(e,En),ttls:b(e,Kt),sizes:b(e,Sn),keyMap:b(e,dt),keyList:b(e,Je),valList:b(e,ke),next:b(e,Rt),prev:b(e,qt),get head(){return b(e,Et)},get tail(){return b(e,mt)},free:b(e,kn),isBackgroundFetch:n=>{var o;return ue(o=e,re,et).call(o,n)},backgroundFetch:(n,o,i,l)=>{var c;return ue(c=e,re,Xa).call(c,n,o,i,l)},moveToTail:n=>{var o;return ue(o=e,re,ps).call(o,n)},indexes:n=>{var o;return ue(o=e,re,Mr).call(o,n)},rindexes:n=>{var o;return ue(o=e,re,Gr).call(o,n)},isStale:n=>{var o;return b(o=e,Yt).call(o,n)}}}get max(){return b(this,vn)}get maxSize(){return b(this,Ht)}get calculatedSize(){return b(this,xn)}get size(){return b(this,ut)}get fetchMethod(){return b(this,Ro)}get memoMethod(){return b(this,Do)}get dispose(){return b(this,wn)}get disposeAfter(){return b(this,bn)}getRemainingTTL(e){return b(this,dt).has(e)?1/0:0}*entries(){for(const e of ue(this,re,Mr).call(this))b(this,ke)[e]!==void 0&&b(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,b(this,ke)[e])&&(yield[b(this,Je)[e],b(this,ke)[e]])}*rentries(){for(const e of ue(this,re,Gr).call(this))b(this,ke)[e]!==void 0&&b(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,b(this,ke)[e])&&(yield[b(this,Je)[e],b(this,ke)[e]])}*keys(){for(const e of ue(this,re,Mr).call(this)){const n=b(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,b(this,ke)[e])&&(yield n)}}*rkeys(){for(const e of ue(this,re,Gr).call(this)){const n=b(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,b(this,ke)[e])&&(yield n)}}*values(){for(const e of ue(this,re,Mr).call(this))b(this,ke)[e]!==void 0&&!ue(this,re,et).call(this,b(this,ke)[e])&&(yield b(this,ke)[e])}*rvalues(){for(const e of ue(this,re,Gr).call(this))b(this,ke)[e]!==void 0&&!ue(this,re,et).call(this,b(this,ke)[e])&&(yield b(this,ke)[e])}[(Wh=Symbol.iterator,Zh=Symbol.toStringTag,Wh)](){return this.entries()}find(e,n={}){for(const o of ue(this,re,Mr).call(this)){const i=b(this,ke)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l!==void 0&&e(l,b(this,Je)[o],this))return this.get(b(this,Je)[o],n)}}forEach(e,n=this){for(const o of ue(this,re,Mr).call(this)){const i=b(this,ke)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,b(this,Je)[o],this)}}rforEach(e,n=this){for(const o of ue(this,re,Gr).call(this)){const i=b(this,ke)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,b(this,Je)[o],this)}}purgeStale(){let e=!1;for(const n of ue(this,re,Gr).call(this,{allowStale:!0}))b(this,Yt).call(this,n)&&(ue(this,re,$r).call(this,b(this,Je)[n],"expire"),e=!0);return e}info(e){const n=b(this,dt).get(e);if(n===void 0)return;const o=b(this,ke)[n],i=ue(this,re,et).call(this,o)?o.__staleWhileFetching:o;if(i===void 0)return;const l={value:i};if(b(this,Kt)&&b(this,En)){const c=b(this,Kt)[n],d=b(this,En)[n];if(c&&d){const p=c-(Bo.now()-d);l.ttl=p,l.start=Date.now()}}return b(this,Sn)&&(l.size=b(this,Sn)[n]),l}dump(){const e=[];for(const n of ue(this,re,Mr).call(this,{allowStale:!0})){const o=b(this,Je)[n],i=b(this,ke)[n],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l===void 0||o===void 0)continue;const c={value:l};if(b(this,Kt)&&b(this,En)){c.ttl=b(this,Kt)[n];const d=Bo.now()-b(this,En)[n];c.start=Math.floor(Date.now()-d)}b(this,Sn)&&(c.size=b(this,Sn)[n]),e.unshift([o,c])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const i=Date.now()-o.start;o.start=Bo.now()-i}this.set(n,o.value,o)}}set(e,n,o={}){var w,v,E,z,$;if(n===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:p}=o;let{noUpdateTTL:h=this.noUpdateTTL}=o;const m=b(this,Ui).call(this,e,n,o.size||0,d);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ue(this,re,$r).call(this,e,"set"),this;let y=b(this,ut)===0?void 0:b(this,dt).get(e);if(y===void 0)y=b(this,ut)===0?b(this,mt):b(this,kn).length!==0?b(this,kn).pop():b(this,ut)===b(this,vn)?ue(this,re,Ya).call(this,!1):b(this,ut),b(this,Je)[y]=e,b(this,ke)[y]=n,b(this,dt).set(e,y),b(this,Rt)[b(this,mt)]=y,b(this,qt)[y]=b(this,mt),ye(this,mt,y),Ka(this,ut)._++,b(this,Io).call(this,y,m,p),p&&(p.set="add"),h=!1;else{ue(this,re,ps).call(this,y);const S=b(this,ke)[y];if(n!==S){if(b(this,Vr)&&ue(this,re,et).call(this,S)){S.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:B}=S;B!==void 0&&!c&&(b(this,Tn)&&((w=b(this,wn))==null||w.call(this,B,e,"set")),b(this,Dt)&&((v=b(this,gt))==null||v.push([B,e,"set"])))}else c||(b(this,Tn)&&((E=b(this,wn))==null||E.call(this,S,e,"set")),b(this,Dt)&&((z=b(this,gt))==null||z.push([S,e,"set"])));if(b(this,eo).call(this,y),b(this,Io).call(this,y,m,p),b(this,ke)[y]=n,p){p.set="replace";const B=S&&ue(this,re,et).call(this,S)?S.__staleWhileFetching:S;B!==void 0&&(p.oldValue=B)}}else p&&(p.set="update")}if(i!==0&&!b(this,Kt)&&ue(this,re,Ud).call(this),b(this,Kt)&&(h||b(this,zi).call(this,y,i,l),p&&b(this,Qn).call(this,p,y)),!c&&b(this,Dt)&&b(this,gt)){const S=b(this,gt);let B;for(;B=S==null?void 0:S.shift();)($=b(this,bn))==null||$.call(this,...B)}return this}pop(){var e;try{for(;b(this,ut);){const n=b(this,ke)[b(this,Et)];if(ue(this,re,Ya).call(this,!0),ue(this,re,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(b(this,Dt)&&b(this,gt)){const n=b(this,gt);let o;for(;o=n==null?void 0:n.shift();)(e=b(this,bn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:i}=n,l=b(this,dt).get(e);if(l!==void 0){const c=b(this,ke)[l];if(ue(this,re,et).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(b(this,Yt).call(this,l))i&&(i.has="stale",b(this,Qn).call(this,i,l));else return o&&b(this,Qr).call(this,l),i&&(i.has="hit",b(this,Qn).call(this,i,l)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,i=b(this,dt).get(e);if(i===void 0||!o&&b(this,Yt).call(this,i))return;const l=b(this,ke)[i];return ue(this,re,et).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:p=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:z,forceRefresh:$=!1,status:S,signal:B}=n;if(!b(this,Vr))return S&&(S.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,status:S});const D={allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:d,size:p,sizeCalculation:h,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:E,ignoreFetchAbort:v,status:S,signal:B};let H=b(this,dt).get(e);if(H===void 0){S&&(S.fetch="miss");const A=ue(this,re,Xa).call(this,e,H,D,z);return A.__returned=A}else{const A=b(this,ke)[H];if(ue(this,re,et).call(this,A)){const R=o&&A.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",R&&(S.returnedStale=!0)),R?A.__staleWhileFetching:A.__returned=A}const N=b(this,Yt).call(this,H);if(!$&&!N)return S&&(S.fetch="hit"),ue(this,re,ps).call(this,H),i&&b(this,Qr).call(this,H),S&&b(this,Qn).call(this,S,H),A;const j=ue(this,re,Xa).call(this,e,H,D,z),Z=j.__staleWhileFetching!==void 0&&o;return S&&(S.fetch=N?"stale":"refresh",Z&&N&&(S.returnedStale=!0)),Z?j.__staleWhileFetching:j.__returned=j}}async forceFetch(e,n={}){const o=await this.fetch(e,n);if(o===void 0)throw new Error("fetch() returned undefined");return o}memo(e,n={}){const o=b(this,Do);if(!o)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:l,...c}=n,d=this.get(e,c);if(!l&&d!==void 0)return d;const p=o(e,d,{options:c,context:i});return this.set(e,p,c),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,d=b(this,dt).get(e);if(d!==void 0){const p=b(this,ke)[d],h=ue(this,re,et).call(this,p);return c&&b(this,Qn).call(this,c,d),b(this,Yt).call(this,d)?(c&&(c.get="stale"),h?(c&&o&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||ue(this,re,$r).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),h?p.__staleWhileFetching:(ue(this,re,ps).call(this,d),i&&b(this,Qr).call(this,d),p))}else c&&(c.get="miss")}delete(e){return ue(this,re,$r).call(this,e,"delete")}clear(){return ue(this,re,jd).call(this,"delete")}};vn=new WeakMap,Ht=new WeakMap,wn=new WeakMap,bn=new WeakMap,Ro=new WeakMap,Do=new WeakMap,ut=new WeakMap,xn=new WeakMap,dt=new WeakMap,Je=new WeakMap,ke=new WeakMap,Rt=new WeakMap,qt=new WeakMap,Et=new WeakMap,mt=new WeakMap,kn=new WeakMap,gt=new WeakMap,Sn=new WeakMap,En=new WeakMap,Kt=new WeakMap,Tn=new WeakMap,Vr=new WeakMap,Dt=new WeakMap,re=new WeakSet,Ud=function(){const e=new ra(b(this,vn)),n=new ra(b(this,vn));ye(this,Kt,e),ye(this,En,n),ye(this,zi,(l,c,d=Bo.now())=>{if(n[l]=c!==0?d:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{b(this,Yt).call(this,l)&&ue(this,re,$r).call(this,b(this,Je)[l],"expire")},c+1);p.unref&&p.unref()}}),ye(this,Qr,l=>{n[l]=e[l]!==0?Bo.now():0}),ye(this,Qn,(l,c)=>{if(e[c]){const d=e[c],p=n[c];if(!d||!p)return;l.ttl=d,l.start=p,l.now=o||i();const h=l.now-p;l.remainingTTL=d-h}});let o=0;const i=()=>{const l=Bo.now();if(this.ttlResolution>0){o=l;const c=setTimeout(()=>o=0,this.ttlResolution);c.unref&&c.unref()}return l};this.getRemainingTTL=l=>{const c=b(this,dt).get(l);if(c===void 0)return 0;const d=e[c],p=n[c];if(!d||!p)return 1/0;const h=(o||i())-p;return d-h},ye(this,Yt,l=>{const c=n[l],d=e[l];return!!d&&!!c&&(o||i())-c>d})},Qr=new WeakMap,Qn=new WeakMap,zi=new WeakMap,Yt=new WeakMap,Eg=function(){const e=new ra(b(this,vn));ye(this,xn,0),ye(this,Sn,e),ye(this,eo,n=>{ye(this,xn,b(this,xn)-e[n]),e[n]=0}),ye(this,Ui,(n,o,i,l)=>{if(ue(this,re,et).call(this,o))return 0;if(!Nr(i))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(i=l(o,n),!Nr(i))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 i}),ye(this,Io,(n,o,i)=>{if(e[n]=o,b(this,Ht)){const l=b(this,Ht)-e[n];for(;b(this,xn)>l;)ue(this,re,Ya).call(this,!0)}ye(this,xn,b(this,xn)+e[n]),i&&(i.entrySize=o,i.totalCalculatedSize=b(this,xn))})},eo=new WeakMap,Io=new WeakMap,Ui=new WeakMap,Mr=function*({allowStale:e=this.allowStale}={}){if(b(this,ut))for(let n=b(this,mt);!(!ue(this,re,Zd).call(this,n)||((e||!b(this,Yt).call(this,n))&&(yield n),n===b(this,Et)));)n=b(this,qt)[n]},Gr=function*({allowStale:e=this.allowStale}={}){if(b(this,ut))for(let n=b(this,Et);!(!ue(this,re,Zd).call(this,n)||((e||!b(this,Yt).call(this,n))&&(yield n),n===b(this,mt)));)n=b(this,Rt)[n]},Zd=function(e){return e!==void 0&&b(this,dt).get(b(this,Je)[e])===e},Ya=function(e){var l,c;const n=b(this,Et),o=b(this,Je)[n],i=b(this,ke)[n];return b(this,Vr)&&ue(this,re,et).call(this,i)?i.__abortController.abort(new Error("evicted")):(b(this,Tn)||b(this,Dt))&&(b(this,Tn)&&((l=b(this,wn))==null||l.call(this,i,o,"evict")),b(this,Dt)&&((c=b(this,gt))==null||c.push([i,o,"evict"]))),b(this,eo).call(this,n),e&&(b(this,Je)[n]=void 0,b(this,ke)[n]=void 0,b(this,kn).push(n)),b(this,ut)===1?(ye(this,Et,ye(this,mt,0)),b(this,kn).length=0):ye(this,Et,b(this,Rt)[n]),b(this,dt).delete(o),Ka(this,ut)._--,n},Xa=function(e,n,o,i){const l=n===void 0?void 0:b(this,ke)[n];if(ue(this,re,et).call(this,l))return l;const c=new na,{signal:d}=o;d==null||d.addEventListener("abort",()=>c.abort(d.reason),{signal:c.signal});const p={signal:c.signal,options:o,context:i},h=(z,$=!1)=>{const{aborted:S}=c.signal,B=o.ignoreFetchAbort&&z!==void 0;if(o.status&&(S&&!$?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,B&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),S&&!B&&!$)return y(c.signal.reason);const D=v;return b(this,ke)[n]===v&&(z===void 0?D.__staleWhileFetching?b(this,ke)[n]=D.__staleWhileFetching:ue(this,re,$r).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,z,p.options))),z},m=z=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=z),y(z)),y=z=>{const{aborted:$}=c.signal,S=$&&o.allowStaleOnFetchAbort,B=S||o.allowStaleOnFetchRejection,D=B||o.noDeleteOnFetchRejection,H=v;if(b(this,ke)[n]===v&&(!D||H.__staleWhileFetching===void 0?ue(this,re,$r).call(this,e,"fetch"):S||(b(this,ke)[n]=H.__staleWhileFetching)),B)return o.status&&H.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),H.__staleWhileFetching;if(H.__returned===H)throw z},w=(z,$)=>{var B;const S=(B=b(this,Ro))==null?void 0:B.call(this,e,l,p);S&&S instanceof Promise&&S.then(D=>z(D===void 0?void 0:D),$),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&(z(void 0),o.allowStaleOnFetchAbort&&(z=D=>h(D,!0)))})};o.status&&(o.status.fetchDispatched=!0);const v=new Promise(w).then(h,m),E=Object.assign(v,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,E,{...p.options,status:void 0}),n=b(this,dt).get(e)):b(this,ke)[n]=E,E},et=function(e){if(!b(this,Vr))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof na},Wd=function(e,n){b(this,qt)[n]=e,b(this,Rt)[e]=n},ps=function(e){e!==b(this,mt)&&(e===b(this,Et)?ye(this,Et,b(this,Rt)[e]):ue(this,re,Wd).call(this,b(this,qt)[e],b(this,Rt)[e]),ue(this,re,Wd).call(this,b(this,mt),e),ye(this,mt,e))},$r=function(e,n){var i,l,c,d;let o=!1;if(b(this,ut)!==0){const p=b(this,dt).get(e);if(p!==void 0)if(o=!0,b(this,ut)===1)ue(this,re,jd).call(this,n);else{b(this,eo).call(this,p);const h=b(this,ke)[p];if(ue(this,re,et).call(this,h)?h.__abortController.abort(new Error("deleted")):(b(this,Tn)||b(this,Dt))&&(b(this,Tn)&&((i=b(this,wn))==null||i.call(this,h,e,n)),b(this,Dt)&&((l=b(this,gt))==null||l.push([h,e,n]))),b(this,dt).delete(e),b(this,Je)[p]=void 0,b(this,ke)[p]=void 0,p===b(this,mt))ye(this,mt,b(this,qt)[p]);else if(p===b(this,Et))ye(this,Et,b(this,Rt)[p]);else{const m=b(this,qt)[p];b(this,Rt)[m]=b(this,Rt)[p];const y=b(this,Rt)[p];b(this,qt)[y]=b(this,qt)[p]}Ka(this,ut)._--,b(this,kn).push(p)}}if(b(this,Dt)&&((c=b(this,gt))!=null&&c.length)){const p=b(this,gt);let h;for(;h=p==null?void 0:p.shift();)(d=b(this,bn))==null||d.call(this,...h)}return o},jd=function(e){var n,o,i;for(const l of ue(this,re,Gr).call(this,{allowStale:!0})){const c=b(this,ke)[l];if(ue(this,re,et).call(this,c))c.__abortController.abort(new Error("deleted"));else{const d=b(this,Je)[l];b(this,Tn)&&((n=b(this,wn))==null||n.call(this,c,d,e)),b(this,Dt)&&((o=b(this,gt))==null||o.push([c,d,e]))}}if(b(this,dt).clear(),b(this,ke).fill(void 0),b(this,Je).fill(void 0),b(this,Kt)&&b(this,En)&&(b(this,Kt).fill(0),b(this,En).fill(0)),b(this,Sn)&&b(this,Sn).fill(0),ye(this,Et,0),ye(this,mt,0),b(this,kn).length=0,ye(this,xn,0),ye(this,ut,0),b(this,Dt)&&b(this,gt)){const l=b(this,gt);let c;for(;c=l==null?void 0:l.shift();)(i=b(this,bn))==null||i.call(this,...c)}};let _c=vc;const tP={cacheSize:15e6};class nP{constructor(e){Ze(this,"_str");Ze(this,"_rawJson");Ze(this,"_zodSchema");Ze(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const to=class to{constructor(e){Ze(this,"fileDataCache");Ze(this,"fileDataRefs",new Map);const n={...tP,...e??{}};this.fileDataCache=new _c({maxSize:n.cacheSize,fetchMethod:async o=>new nP(await xs().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,i)=>{this.fileDataRefs.delete(i)}})}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 i=await this.fileDataCache.fetch(e);o.value=i}catch(i){console.error(i)}})(),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 i,l;return n===void 0?(i=o==null?void 0:o.value)==null?void 0:i.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return to.globalInstance.getContentBytes(e)}static getContentString(e){return to.globalInstance.getContentString(e)}static getContentJson(e,n){return to.globalInstance.getContentJson(e,n)}};Ze(to,"globalInstance",new to);let Cc=to;F.AgGridTheme=Mu,F.BlockLayout=YN,F.ContextProvider=IE,F.DataTable=m0,F.DemoData=IN,F.DropdownListItem=vo,F.DropdownOverlay=zl,F.LongText=Gl,F.MultiError=fs,F.PlAccordion=Rk,F.PlAccordionSection=zk,F.PlAgCellFile=NV,F.PlAgColumnHeader=nh,F.PlAgDataTable=xV,F.PlAgDataTableRowNumberColId=Un,F.PlAgDataTableToolsPanel=vV,F.PlAgGridColumnManager=sh,F.PlAgOverlayLoading=Yp,F.PlAgOverlayNoRows=Xp,F.PlAgTextAndButtonCell=rh,F.PlAlert=j0,F.PlBlockPage=P0,F.PlBtnAccent=dw,F.PlBtnDanger=pw,F.PlBtnGhost=wo,F.PlBtnGroup=dp,F.PlBtnLink=gw,F.PlBtnPrimary=Vs,F.PlBtnSecondary=Dl,F.PlBtnSplit=iw,F.PlCheckbox=Ux,F.PlCheckboxGroup=Hx,F.PlChip=Ul,F.PlCloseModalBtn=wp,F.PlContainer=D0,F.PlDialogModal=Wl,F.PlDropdown=bo,F.PlDropdownLegacy=fx,F.PlDropdownLine=vp,F.PlDropdownMulti=$x,F.PlDropdownRef=Ub,F.PlEditableTitle=Gw,F.PlFileDialog=Np,F.PlFileInput=Zp,F.PlGrid=G0,F.PlIcon16=Hr,F.PlIcon24=Bs,F.PlLogView=xp,F.PlMaskIcon16=At,F.PlMaskIcon24=xt,F.PlNotificationAlert=Wp,F.PlNumberField=Ex,F.PlProgressBar=Cx,F.PlRow=F0,F.PlSearchField=gp,F.PlSectionSeparator=kp,F.PlSlideModal=Rs,F.PlSpacer=lp,F.PlTableFilters=KB,F.PlTabs=Tk,F.PlTextArea=Tb,F.PlTextField=qr,F.PlToggleSwitch=Ds,F.PlTooltip=Ct,F.ReactiveFileContent=Cc,F.Scrollable=k1,F.Slider=jp,F.SliderRange=v1,F.SliderRangeTriple=l1,F.ThemeSwitcher=S0,F.UnresolvedError=Qa,F.ValueOrErrorsComponent=EV,F.activateAgGrid=Ou,F.animate=np,F.animateInfinite=v0,F.autoSizeRowNumberColumn=th,F.call=Xu,F.computedResult=JB,F.createModel=il,F.debounce=rp,F.defineApp=ZC,F.defineStore=XB,F.delay=Ju,F.detectOutside=Nb,F.ensureError=nl,F.eventListener=$l,F.formatZodError=ol,F.getElementScrollPosition=Cp,F.identity=tl,F.isDefined=zg,F.isElementVisible=_p,F.isJsonEqual=el,F.isZodError=rl,F.listToOptions=w0,F.makeEaseInOut=C0,F.makeEaseOut=tp,F.makeRowNumberColDef=eh,F.maskIcons16=RN,F.maskIcons24=DN,F.normalizeListOptions=Cr,F.notEmpty=Vl,F.randomInt=ep,F.randomString=_0,F.requestTick=Al,F.scrollIntoView=Ps,F.showContextMenu=El,F.throttle=op,F.timeout=Qu,F.unwrapOptionalResult=$g,F.unwrapValueOrErrors=tu,F.useClickOutside=As,F.useDraggable=XE,F.useEventListener=st,F.useFormState=KE,F.useHover=Ku,F.useInterval=qE,F.useLabelNotch=Xn,F.useLocalStorage=ip,F.useMouse=qu,F.useMouseCapture=_r,F.usePosition=vi,F.useQuery=YE,F.useResizeObserver=Hp,F.useScroll=jE,F.useSdkPlugin=wl,F.useSortable=Kp,F.useTheme=ap,F.useWatchFetch=QB,F.wrapOptionalResult=nu,F.wrapValueOrErrors=Gg,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
|
|
90
|
+
`)+J+`return __p
|
|
91
|
+
}`;var De=bg(function(){return Ue(C,pe+"return "+J).apply(n,S)});if(De.source=J,Pd(De))throw De;return De}function iM(s){return We(s).toLowerCase()}function sM(s){return We(s).toUpperCase()}function aM(s,a,u){if(s=We(s),s&&(u||a===n))return Bf(s);if(!s||!(a=Qt(a)))return s;var f=An(s),g=An(a),C=Pf(f,g),S=Rf(f,g)+1;return Or(f,C,S).join("")}function lM(s,a,u){if(s=We(s),s&&(u||a===n))return s.slice(0,If(s)+1);if(!s||!(a=Qt(a)))return s;var f=An(s),g=Rf(f,An(a))+1;return Or(f,0,g).join("")}function cM(s,a,u){if(s=We(s),s&&(u||a===n))return s.replace(Pc,"");if(!s||!(a=Qt(a)))return s;var f=An(s),g=Pf(f,An(a));return Or(f,g).join("")}function dM(s,a){var u=M,f=Z;if(ot(a)){var g="separator"in a?a.separator:g;u="length"in a?Be(a.length):u,f="omission"in a?Qt(a.omission):f}s=We(s);var C=s.length;if(Mo(s)){var S=An(s);C=S.length}if(u>=C)return s;var V=u-Go(f);if(V<1)return f;var F=S?Or(S,0,V).join(""):s.slice(0,V);if(g===n)return F+f;if(S&&(V+=F.length-V),Rd(g)){if(s.slice(V).search(g)){var K,Y=F;for(g.global||(g=Kc(g.source,We(Jh.exec(g))+"g")),g.lastIndex=0;K=g.exec(Y);)var J=K.index;F=F.slice(0,J===n?V:J)}}else if(s.indexOf(Qt(g),V)!=V){var oe=F.lastIndexOf(g);oe>-1&&(F=F.slice(0,oe))}return F+f}function uM(s){return s=We(s),s&&bP.test(s)?s.replace(Kh,GR):s}var pM=Ho(function(s,a,u){return s+(u?" ":"")+a.toUpperCase()}),Fd=xm("toUpperCase");function wg(s,a,u){return s=We(s),a=u?n:a,a===n?IR(s)?UR(s):SR(s):s.match(a)||[]}var bg=Ie(function(s,a){try{return Xt(s,n,a)}catch(u){return Pd(u)?u:new Se(u)}}),hM=ir(function(s,a){return on(a,function(u){u=Hn(u),rr(s,u,Ad(s[u],s))}),s});function fM(s){var a=s==null?0:s.length,u=ge();return s=a?tt(s,function(f){if(typeof f[1]!="function")throw new sn(c);return[u(f[0]),f[1]]}):[],Ie(function(f){for(var g=-1;++g<a;){var C=s[g];if(Xt(C[0],this,f))return Xt(C[1],this,f)}})}function mM(s){return GD(ln(s,y))}function Ld(s){return function(){return s}}function gM(s,a){return s==null||s!==s?a:s}var yM=Em(),_M=Em(!0);function Zt(s){return s}function Od(s){return tm(typeof s=="function"?s:ln(s,y))}function CM(s){return rm(ln(s,y))}function vM(s,a){return om(s,ln(a,y))}var wM=Ie(function(s,a){return function(u){return ss(u,s,a)}}),bM=Ie(function(s,a){return function(u){return ss(s,u,a)}});function Md(s,a,u){var f=yt(a),g=Va(a,f);u==null&&!(ot(a)&&(g.length||!f.length))&&(u=a,a=s,s=this,g=Va(a,yt(a)));var C=!(ot(u)&&"chain"in u)||!!u.chain,S=ar(s);return on(g,function(V){var F=a[V];s[V]=F,S&&(s.prototype[V]=function(){var K=this.__chain__;if(C||K){var Y=s(this.__wrapped__),J=Y.__actions__=$t(this.__actions__);return J.push({func:F,args:arguments,thisArg:s}),Y.__chain__=K,Y}return F.apply(s,Pr([this.value()],arguments))})}),s}function xM(){return vt._===this&&(vt._=KR),this}function Gd(){}function kM(s){return s=Be(s),Ie(function(a){return im(a,s)})}var EM=yd(tt),SM=yd(Sf),TM=yd(zc);function xg(s){return kd(s)?Uc(Hn(s)):rI(s)}function NM(s){return function(a){return s==null?n:ao(s,a)}}var VM=Tm(),AM=Tm(!0);function $d(){return[]}function zd(){return!1}function BM(){return{}}function PM(){return""}function RM(){return!0}function DM(s,a){if(s=Be(s),s<1||s>ne)return[];var u=Te,f=Tt(s,Te);a=ge(a),s-=Te;for(var g=jc(f,a);++u<s;)a(u);return g}function IM(s){return Ne(s)?tt(s,Hn):en(s)?[s]:$t(Um(We(s)))}function FM(s){var a=++HR;return We(s)+a}var LM=Ia(function(s,a){return s+a},0),OM=_d("ceil"),MM=Ia(function(s,a){return s/a},1),GM=_d("floor");function $M(s){return s&&s.length?Na(s,Zt,rd):n}function zM(s,a){return s&&s.length?Na(s,ge(a,2),rd):n}function UM(s){return Vf(s,Zt)}function ZM(s,a){return Vf(s,ge(a,2))}function WM(s){return s&&s.length?Na(s,Zt,ad):n}function jM(s,a){return s&&s.length?Na(s,ge(a,2),ad):n}var HM=Ia(function(s,a){return s*a},1),qM=_d("round"),KM=Ia(function(s,a){return s-a},0);function YM(s){return s&&s.length?Wc(s,Zt):0}function XM(s,a){return s&&s.length?Wc(s,ge(a,2)):0}return _.after=CL,_.ary=eg,_.assign=sO,_.assignIn=fg,_.assignInWith=qa,_.assignWith=aO,_.at=lO,_.before=tg,_.bind=Ad,_.bindAll=hM,_.bindKey=ng,_.castArray=BL,_.chain=Xm,_.chunk=GI,_.compact=$I,_.concat=zI,_.cond=fM,_.conforms=mM,_.constant=Ld,_.countBy=YF,_.create=cO,_.curry=rg,_.curryRight=og,_.debounce=ig,_.defaults=dO,_.defaultsDeep=uO,_.defer=vL,_.delay=wL,_.difference=UI,_.differenceBy=ZI,_.differenceWith=WI,_.drop=jI,_.dropRight=HI,_.dropRightWhile=qI,_.dropWhile=KI,_.fill=YI,_.filter=JF,_.flatMap=tL,_.flatMapDeep=nL,_.flatMapDepth=rL,_.flatten=Hm,_.flattenDeep=XI,_.flattenDepth=JI,_.flip=bL,_.flow=yM,_.flowRight=_M,_.fromPairs=QI,_.functions=_O,_.functionsIn=CO,_.groupBy=oL,_.initial=tF,_.intersection=nF,_.intersectionBy=rF,_.intersectionWith=oF,_.invert=wO,_.invertBy=bO,_.invokeMap=sL,_.iteratee=Od,_.keyBy=aL,_.keys=yt,_.keysIn=Ut,_.map=za,_.mapKeys=kO,_.mapValues=EO,_.matches=CM,_.matchesProperty=vM,_.memoize=Za,_.merge=SO,_.mergeWith=mg,_.method=wM,_.methodOf=bM,_.mixin=Md,_.negate=Wa,_.nthArg=kM,_.omit=TO,_.omitBy=NO,_.once=xL,_.orderBy=lL,_.over=EM,_.overArgs=kL,_.overEvery=SM,_.overSome=TM,_.partial=Bd,_.partialRight=sg,_.partition=cL,_.pick=VO,_.pickBy=gg,_.property=xg,_.propertyOf=NM,_.pull=lF,_.pullAll=Km,_.pullAllBy=cF,_.pullAllWith=dF,_.pullAt=uF,_.range=VM,_.rangeRight=AM,_.rearg=EL,_.reject=pL,_.remove=pF,_.rest=SL,_.reverse=Nd,_.sampleSize=fL,_.set=BO,_.setWith=PO,_.shuffle=mL,_.slice=hF,_.sortBy=_L,_.sortedUniq=vF,_.sortedUniqBy=wF,_.split=tM,_.spread=TL,_.tail=bF,_.take=xF,_.takeRight=kF,_.takeRightWhile=EF,_.takeWhile=SF,_.tap=$F,_.throttle=NL,_.thru=$a,_.toArray=ug,_.toPairs=yg,_.toPairsIn=_g,_.toPath=IM,_.toPlainObject=hg,_.transform=RO,_.unary=VL,_.union=TF,_.unionBy=NF,_.unionWith=VF,_.uniq=AF,_.uniqBy=BF,_.uniqWith=PF,_.unset=DO,_.unzip=Vd,_.unzipWith=Ym,_.update=IO,_.updateWith=FO,_.values=Yo,_.valuesIn=LO,_.without=RF,_.words=wg,_.wrap=AL,_.xor=DF,_.xorBy=IF,_.xorWith=FF,_.zip=LF,_.zipObject=OF,_.zipObjectDeep=MF,_.zipWith=GF,_.entries=yg,_.entriesIn=_g,_.extend=fg,_.extendWith=qa,Md(_,_),_.add=LM,_.attempt=bg,_.camelCase=$O,_.capitalize=Cg,_.ceil=OM,_.clamp=OO,_.clone=PL,_.cloneDeep=DL,_.cloneDeepWith=IL,_.cloneWith=RL,_.conformsTo=FL,_.deburr=vg,_.defaultTo=gM,_.divide=MM,_.endsWith=zO,_.eq=Pn,_.escape=UO,_.escapeRegExp=ZO,_.every=XF,_.find=QF,_.findIndex=Wm,_.findKey=pO,_.findLast=eL,_.findLastIndex=jm,_.findLastKey=hO,_.floor=GM,_.forEach=Jm,_.forEachRight=Qm,_.forIn=fO,_.forInRight=mO,_.forOwn=gO,_.forOwnRight=yO,_.get=Dd,_.gt=LL,_.gte=OL,_.has=vO,_.hasIn=Id,_.head=qm,_.identity=Zt,_.includes=iL,_.indexOf=eF,_.inRange=MO,_.invoke=xO,_.isArguments=uo,_.isArray=Ne,_.isArrayBuffer=ML,_.isArrayLike=zt,_.isArrayLikeObject=at,_.isBoolean=GL,_.isBuffer=Mr,_.isDate=$L,_.isElement=zL,_.isEmpty=UL,_.isEqual=ZL,_.isEqualWith=WL,_.isError=Pd,_.isFinite=jL,_.isFunction=ar,_.isInteger=ag,_.isLength=ja,_.isMap=lg,_.isMatch=HL,_.isMatchWith=qL,_.isNaN=KL,_.isNative=YL,_.isNil=JL,_.isNull=XL,_.isNumber=cg,_.isObject=ot,_.isObjectLike=it,_.isPlainObject=ps,_.isRegExp=Rd,_.isSafeInteger=QL,_.isSet=dg,_.isString=Ha,_.isSymbol=en,_.isTypedArray=Ko,_.isUndefined=eO,_.isWeakMap=tO,_.isWeakSet=nO,_.join=iF,_.kebabCase=WO,_.last=dn,_.lastIndexOf=sF,_.lowerCase=jO,_.lowerFirst=HO,_.lt=rO,_.lte=oO,_.max=$M,_.maxBy=zM,_.mean=UM,_.meanBy=ZM,_.min=WM,_.minBy=jM,_.stubArray=$d,_.stubFalse=zd,_.stubObject=BM,_.stubString=PM,_.stubTrue=RM,_.multiply=HM,_.nth=aF,_.noConflict=xM,_.noop=Gd,_.now=Ua,_.pad=qO,_.padEnd=KO,_.padStart=YO,_.parseInt=XO,_.random=GO,_.reduce=dL,_.reduceRight=uL,_.repeat=JO,_.replace=QO,_.result=AO,_.round=qM,_.runInContext=D,_.sample=hL,_.size=gL,_.snakeCase=eM,_.some=yL,_.sortedIndex=fF,_.sortedIndexBy=mF,_.sortedIndexOf=gF,_.sortedLastIndex=yF,_.sortedLastIndexBy=_F,_.sortedLastIndexOf=CF,_.startCase=nM,_.startsWith=rM,_.subtract=KM,_.sum=YM,_.sumBy=XM,_.template=oM,_.times=DM,_.toFinite=lr,_.toInteger=Be,_.toLength=pg,_.toLower=iM,_.toNumber=un,_.toSafeInteger=iO,_.toString=We,_.toUpper=sM,_.trim=aM,_.trimEnd=lM,_.trimStart=cM,_.truncate=dM,_.unescape=uM,_.uniqueId=FM,_.upperCase=pM,_.upperFirst=Fd,_.each=Jm,_.eachRight=Qm,_.first=qm,Md(_,function(){var s={};return Wn(_,function(a,u){He.call(_.prototype,u)||(s[u]=a)}),s}(),{chain:!1}),_.VERSION=o,on(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){_[s].placeholder=_}),on(["drop","take"],function(s,a){Le.prototype[s]=function(u){u=u===n?1:ht(Be(u),0);var f=this.__filtered__&&!a?new Le(this):this.clone();return f.__filtered__?f.__takeCount__=Tt(u,f.__takeCount__):f.__views__.push({size:Tt(u,Te),type:s+(f.__dir__<0?"Right":"")}),f},Le.prototype[s+"Right"]=function(u){return this.reverse()[s](u).reverse()}}),on(["filter","map","takeWhile"],function(s,a){var u=a+1,f=u==A||u==H;Le.prototype[s]=function(g){var C=this.clone();return C.__iteratees__.push({iteratee:ge(g,3),type:u}),C.__filtered__=C.__filtered__||f,C}}),on(["head","last"],function(s,a){var u="take"+(a?"Right":"");Le.prototype[s]=function(){return this[u](1).value()[0]}}),on(["initial","tail"],function(s,a){var u="drop"+(a?"":"Right");Le.prototype[s]=function(){return this.__filtered__?new Le(this):this[u](1)}}),Le.prototype.compact=function(){return this.filter(Zt)},Le.prototype.find=function(s){return this.filter(s).head()},Le.prototype.findLast=function(s){return this.reverse().find(s)},Le.prototype.invokeMap=Ie(function(s,a){return typeof s=="function"?new Le(this):this.map(function(u){return ss(u,s,a)})}),Le.prototype.reject=function(s){return this.filter(Wa(ge(s)))},Le.prototype.slice=function(s,a){s=Be(s);var u=this;return u.__filtered__&&(s>0||a<0)?new Le(u):(s<0?u=u.takeRight(-s):s&&(u=u.drop(s)),a!==n&&(a=Be(a),u=a<0?u.dropRight(-a):u.take(a-s)),u)},Le.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Le.prototype.toArray=function(){return this.take(Te)},Wn(Le.prototype,function(s,a){var u=/^(?:filter|find|map|reject)|While$/.test(a),f=/^(?:head|last)$/.test(a),g=_[f?"take"+(a=="last"?"Right":""):a],C=f||/^find/.test(a);g&&(_.prototype[a]=function(){var S=this.__wrapped__,V=f?[1]:arguments,F=S instanceof Le,K=V[0],Y=F||Ne(S),J=function(Fe){var Oe=g.apply(_,Pr([Fe],V));return f&&oe?Oe[0]:Oe};Y&&u&&typeof K=="function"&&K.length!=1&&(F=Y=!1);var oe=this.__chain__,pe=!!this.__actions__.length,_e=C&&!oe,De=F&&!pe;if(!C&&Y){S=De?S:new Le(this);var Ce=s.apply(S,V);return Ce.__actions__.push({func:$a,args:[J],thisArg:n}),new an(Ce,oe)}return _e&&De?s.apply(this,V):(Ce=this.thru(J),_e?f?Ce.value()[0]:Ce.value():Ce)})}),on(["pop","push","shift","sort","splice","unshift"],function(s){var a=ha[s],u=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",f=/^(?:pop|shift)$/.test(s);_.prototype[s]=function(){var g=arguments;if(f&&!this.__chain__){var C=this.value();return a.apply(Ne(C)?C:[],g)}return this[u](function(S){return a.apply(Ne(S)?S:[],g)})}}),Wn(Le.prototype,function(s,a){var u=_[a];if(u){var f=u.name+"";He.call(Zo,f)||(Zo[f]=[]),Zo[f].push({name:a,func:u})}}),Zo[Da(n,T).name]=[{name:"wrapper",func:n}],Le.prototype.clone=uD,Le.prototype.reverse=pD,Le.prototype.value=hD,_.prototype.at=zF,_.prototype.chain=UF,_.prototype.commit=ZF,_.prototype.next=WF,_.prototype.plant=HF,_.prototype.reverse=qF,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=KF,_.prototype.first=_.prototype.head,Qi&&(_.prototype[Qi]=jF),_},$o=ZR();no?((no.exports=$o)._=$o,Oc._=$o):vt._=$o}).call(Xo)}(Ws,Ws.exports);var Ye=Ws.exports;const tV={class:"grid-overlay-container"},Yp=r.defineComponent({__name:"PlAgOverlayLoading",props:{params:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",tV,[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"},"No datasource",-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))]))}}),nV={},rV={class:"grid-overlay-container"};function oV(t,e){return r.openBlock(),r.createElementBlock("div",rV,e[0]||(e[0]=[r.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),r.createElementVNode("span",{class:"text-subtitle-m"},"Empty",-1)]))}const Xp=ec(nV,[["render",oV]]);async function iV(t,e){throw Error("not implemented")}function sV(t){return t.axesSpec.filter(e=>{var n;return((n=e.annotations)==null?void 0:n["pl7.app/axisNature"])==="heterogeneous"})}function aV(t,e){const n=[];for(const o of e)if(t[o].type==="column"){const i=sV(t[o].spec);for(const l of i){if(l.type!=="String"){console.warn("heterogeneous axis with string type expected, got",l,"skipping");continue}const c=jr(l),d=t.findIndex(p=>Ye.isEqual(p.id,c));if(d===-1)throw console.error("axis not found",o,c,t),Error("axis not found");n.push({columnIdx:o,axisIdx:d})}}return n}const Jp=(t,e)=>(t+e).toString();function lV(t,e,n,o,i,l){if(t.length>1)throw Error("hColumns.length > 1 is not supported");const c=t[0];let d=-1,p=-1;for(let y=0;y<l.length;++y)l[y]===c.axisIdx&&(d=y),l[y]===c.columnIdx&&(p=y);const h=(()=>{const w=o[d].data.filter(b=>b!==null);return Array.from(new Set(w))})();h.sort(),p>d?(n.splice(p,1),n.splice(d,1)):(n.splice(d,1),n.splice(p,1));const m=cV(i,o,d,p,h,e.rows);for(let y=0;y<h.length;++y){const w=h[y],b=dr(w+"@"+y);n.push({colId:b,field:Jp(o.length,y),headerName:w,valueFormatter:ih})}return{rowModelType:"clientSide",columnDefs:n,rowData:m}}function cV(t,e,n,o,i,l){const c=new Map;let d=0;for(let h=0;h<l;h++){const m={};for(let $=0;$<e.length;++$){if($===n||$===o)continue;const O=t[$].toString();m[O]=e[$].data[h]}let y;const w=dr(Object.values(m))??"";c.has(w)?y=c.get(w):(c.set(w,m),y=m,y.id=d.toString(),d++);const b=i.indexOf(e[n].data[h]);if(b===-1)throw Error("index not found");const E=Jp(e.length,b);y[E]=e[o].data[h]}return Array.from(c.values())}const Un='"##RowNumberColumnId##"',Qp=45;function eh(){return{colId:Un,headerName:"#",valueGetter:t=>t.node===null||t.node.rowIndex===null?null:t.node.rowIndex+1,headerClass:"pl-ag-header-align-center",suppressNavigable:!0,suppressMovable:!0,mainMenuItems:[],contextMenuItems:[],lockPosition:"left",pinned:"left",lockPinned:!0,width:Qp,suppressSizeToFit:!0,suppressAutoSize:!0,cellStyle:{color:"var(--txt-03)","background-color":"var(--bg-base-light)",overflow:"visible !important","text-align":"center"},sortable:!1,resizable:!1}}function dV(){const t=document.createElement("div");return t.style.visibility="hidden",t.style.position="absolute",t.style.boxSizing="border-box",t.style.padding="15.5px",t.style.border="1px solid",t.style.width="auto",document.body.appendChild(t),t}function Gi(t,e,n){const o=t.getCellValue({rowNode:t.getDisplayedRowAtIndex(t.getLastDisplayedRowIndex()),colKey:Un});if(typeof o!="number")return;const i=o.toString().length;if(!n&&e.innerHTML.length===i)return;const l="5";e.innerHTML=l.repeat(i),r.nextTick(()=>{t.applyColumnState({state:[{colId:Un,pinned:"left",width:Math.max(Qp,e.offsetWidth)}]})})}function uV(t){document.body.removeChild(t)}function th(t){const e=dV();t.addEventListener("firstDataRendered",n=>{Gi(n.api,e)}),t.addEventListener("viewportChanged",n=>{Gi(n.api,e)}),t.addEventListener("columnVisible",n=>{n.columns&&n.columns.some(o=>o.isVisible()&&o.getColId()===Un)&&Gi(n.api,e)}),t.addEventListener("columnResized",n=>{var o;n.finished&&n.source==="autosizeColumns"&&((o=n.columns)!=null&&o.some(i=>i.isVisible()&&i.getColId()===Un))&&Gi(n.api,e,!0)}),t.addEventListener("sortChanged",n=>{n.api.refreshCells()}),t.addEventListener("filterChanged",n=>{n.api.refreshCells()}),t.addEventListener("gridPreDestroyed",()=>{uV(e)}),Gi(t,e)}const pV={class:"pl-ag-column-header__title d-flex align-center gap-6 flex-grow-1"},nh=r.defineComponent({__name:"PlAgColumnHeader",props:{params:{}},setup(t){const e=t,n=r.computed(()=>{var m,y;const h=(y=(m=e.params.column.getUserProvidedColDef())==null?void 0:m.headerComponentParams)==null?void 0:y.type;switch(h){case void 0:case"Text":return"cell-type-txt";case"Number":return"cell-type-num";case"File":return"paper-clip";case"Date":return"calendar";case"Duration":return"time";default:throw Error(`unsupported data type: ${h} for PlAgColumnHeader component. Column ${e.params.column.getColId()}`)}}),o=r.ref(null),i=()=>o.value=e.params.column.getSort()??null;r.onMounted(()=>i());function l(){e.params.column.isSortable()&&(e.params.progressSort(),i())}const c=r.computed(()=>{const h=o.value;switch(h){case"asc":return"arrow-up";case"desc":return"arrow-down";case null:return null;default:throw Error(`unsupported sort direction: ${h}. Column ${e.params.column.getColId()}`)}}),d=r.ref();function p(){const h=d.value;h&&e.params.showColumnMenu(h)}return(h,m)=>(r.openBlock(),r.createElementBlock("div",{class:"pl-ag-column-header d-flex align-center gap-6",onClick:l},[r.createElementVNode("div",pV,[r.createVNode(r.unref(At),{name:n.value,class:"pl-ag-column-header__type-icon"},null,8,["name"]),r.createElementVNode("span",null,r.toDisplayString(h.params.displayName),1),c.value?(r.openBlock(),r.createBlock(r.unref(At),{key:0,name:c.value},null,8,["name"])):r.createCommentVNode("",!0)]),h.params.enableMenu?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuActivatorBtn",ref:d,class:"pl-ag-column-header__menu-icon",onClick:r.withModifiers(p,["stop"])},[r.createVNode(r.unref(At),{name:"more"})],512)):r.createCommentVNode("",!0)]))}}),hV={class:"pl-ag-grid-open-cell d-flex"},fV={class:"pl-ag-grid-open-cell__value"},rh=r.defineComponent({__name:"PlAgTextAndButtonCell",props:{params:{}},setup(t){const e=t;function n(){var o,i;if(e.params.invokeRowsOnDoubleClick){const l=e.params.api,c={rowPinned:e.params.node.rowPinned,api:l,rowIndex:e.params.node.rowIndex,context:l,type:"rowDoubleClicked",node:e.params.node,data:e.params.data,event:null};l.dispatchEvent(c)}else(i=(o=e.params).onClick)==null||i.call(o,e.params)}return(o,i)=>(r.openBlock(),r.createElementBlock("div",hV,[r.createElementVNode("div",fV,r.toDisplayString(o.params.value),1),r.createElementVNode("div",{class:"pl-ag-grid-open-cell__activator text-caps11 align-center",onClick:r.withModifiers(n,["stop"])},[r.createVNode(r.unref(At),{name:o.params.icon??"maximize"},null,8,["name"]),r.createTextVNode(" "+r.toDisplayString(o.params.btnLabel??"Open"),1)])]))}});function mV(t){return dr(t)}function oh(t){return JSON.parse(t)}const ih=t=>t?t.value===void 0?"NULL":t.value===null?"NA":t.value.toString():"ERROR";function gV(t,e,n,o){var c,d,p;const i=mV(e),l=e.type==="axis"?e.spec.type:e.spec.valueType;return{colId:i,context:e,field:t.toString(),headerName:((d=(c=e.spec.annotations)==null?void 0:c["pl7.app/label"])==null?void 0:d.trim())??"Unlabeled "+e.type+" "+t.toString(),lockPosition:e.type==="axis",hide:(n==null?void 0:n.includes(i))??((p=e.spec.annotations)==null?void 0:p["pl7.app/table/visibility"])==="optional",valueFormatter:ih,headerComponent:nh,cellRendererSelector:o?h=>{var y,w;if(e.type!=="axis")return;const m=(w=(y=h.colDef)==null?void 0:y.context)==null?void 0:w.id;if(Ye.isEqual(m,o))return{component:rh}}:void 0,cellRendererParams:o?{invokeRowsOnDoubleClick:!0}:void 0,headerComponentParams:{type:(()=>{switch(l){case"Int":case"Long":case"Float":case"Double":return"Number";case"String":case"Bytes":return"Text";default:throw Error(`unsupported data type: ${l}`)}})()},cellDataType:(()=>{switch(l){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${l}`)}})()}}function sh(t){return dr(t)}function yV(t,e,n){const o=[];for(let i=0;i<e[0].data.length;++i){const l=n.map(d=>gu(e[d],i)),c={id:sh(l),key:l};t.forEach((d,p)=>{c[d.toString()]=gu(e[p],i)}),o.push(c)}return o}const _V=t=>t.type==="column"&&t.spec.axesSpec.length===1&&t.spec.name==="pl7.app/label";async function CV(t,e,n,o,i){const l=await t.getSpec(e);let c=l.findIndex(P=>P.type==="column");c===-1&&(c=l.length);const d=[...l.keys()].filter(P=>!Ye.some(n,R=>Ye.isEqual(jr(R.axis),l[P].id)||l[P].type==="column"&&l[P].spec.name==="pl7.app/label"&&l[P].spec.axesSpec.length===1&&Ye.isEqual(jr(R.axis),jr(l[P].spec.axesSpec[0])))).sort((P,R)=>{var v,L;if(l[P].type!==l[R].type)return l[P].type==="axis"?-1:1;const j=(v=l[P].spec.annotations)==null?void 0:v["pl7.app/table/orderPriority"],N=(L=l[R].spec.annotations)==null?void 0:L["pl7.app/table/orderPriority"];return j===void 0?N===void 0?0:1:N===void 0?-1:Number(N)-Number(j)}),p=Ye.cloneDeep(d),h=aV(l,d);for(let P=d.length-1;P>=0;--P){const R=d[P];if(!_V(l[R]))continue;const j=jr(l[R].spec.axesSpec[0]),N=Ye.findIndex(d,v=>Ye.isEqual(l[v].id,j));if(N===-1&&Ye.findIndex(n,L=>Ye.isEqual(jr(L.axis),j))===-1){console.warn(`added label column, but the axis is not in the data; axisId: ${j}`);continue}d[N]=R;for(const v of h)v.axisIdx===R&&(v.axisIdx=N);d.splice(P,1),p.splice(P,1)}const m=await t.getShape(e),y=m.rows,w=[eh(),...p.map(P=>gV(P,l[P],o,i))];if(h.length>1&&console.warn("Currently, only one heterogeneous axis is supported in the table, got",h.length," transposition will not be applied."),h.length===1)return lV(h,m,w,await t.getData(e,d),p,d);const b=[...d],E=new Map;for(let P=0;P<c;++P)E.set(P,-1);for(let P=0;P<b.length;++P){const R=b[P];E.has(R)&&E.set(R,P)}for(const[P,R]of E)R===-1&&(E.set(P,b.length),b.push(P));const $=[];for(let P=0;P<c;++P){const R=E.get(P);if(R===void 0||R===-1)throw new Error("assertion exception");$.push(R)}let O;return{rowModelType:"serverSide",columnDefs:w,serverSideDatasource:{getRows:async P=>{try{if(y==0){P.success({rowData:[],rowCount:y}),P.api.setGridOption("loading",!1),P.api.showNoRowsOverlay();return}if(O&&!Ye.isEqual(O.request.sortModel,P.request.sortModel)){O=void 0,P.api.setGridOption("loading",!0),P.success({rowData:[],rowCount:0});return}O=P;let R=0,j=[];if(y>0&&P.request.startRow!==void 0&&P.request.endRow!==void 0&&(R=Math.min(y,P.request.endRow)-P.request.startRow,R>0)){const N=await t.getData(e,b,{offset:P.request.startRow,length:R});j=yV(p,N,$)}P.success({rowData:j,rowCount:y}),P.api.autoSizeColumns(P.api.getAllDisplayedColumns().filter(N=>N.getColId()!==Un)),P.api.setGridOption("loading",!1)}catch(R){P.api.setGridOption("loading",!0),P.fail(),console.trace(R)}}}}}const tc=Lg(),vV=["onClick"],wV={key:0,class:"pl-ag-columns__pin"},ah=r.defineComponent({__name:"PlAgGridColumnManager",props:{api:{}},setup(t){const e=t,{api:n}=r.toRefs(e),o=r.ref([]),i=r.ref(),l=r.ref(!1),c=r.ref(0);function d(h){const m=h.findIndex(y=>y.getId()===Un);if(m!==0){const[y]=h.splice(m,1);return h.splice(0,0,y)}return h}Kp(i,{handle:".handle",onChange(h){n.value.moveColumns(d(h.map(m=>o.value[m])),0)}});function p(h){n.value.setColumnsVisible([h],!h.isVisible())}return r.watch(()=>n.value,h=>{o.value=d(h.getAllGridColumns()),o.value.length>0&&h.moveColumns(o.value,0),h.addEventListener("displayedColumnsChanged",m=>{o.value=m.api.getAllGridColumns(),c.value++})},{immediate:!0}),(h,m)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(r.Teleport,{to:`#${r.unref(tc)}`},[r.createVNode(r.unref(wo),{onClick:m[0]||(m[0]=r.withModifiers(y=>l.value=!l.value,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(xt),{name:"columns"})]),default:r.withCtx(()=>[m[2]||(m[2]=r.createTextVNode(" Columns "))]),_:1})],8,["to"])),r.createVNode(r.unref(Ds),{modelValue:l.value,"onUpdate:modelValue":m[1]||(m[1]=y=>l.value=y),width:"368px","close-on-outside-click":""},{title:r.withCtx(()=>m[3]||(m[3]=[r.createTextVNode("Manage Columns")])),default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("div",{ref_key:"listRef",ref:i,key:c.value,class:"pl-ag-columns"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,y=>(r.openBlock(),r.createElementBlock("div",{key:y.getId(),class:"pl-ag-columns__item"},[r.createElementVNode("div",{class:r.normalizeClass([{handle:!y.getColDef().lockPosition},"pl-ag-columns__drag"])},[r.createVNode(r.unref(At),{name:"drag-dots"})],2),r.createElementVNode("div",{class:r.normalizeClass([{visible:y.isVisible()},"pl-ag-columns__title text-s-btn"])},r.toDisplayString(y.getColDef().headerName),3),r.createElementVNode("div",{class:"pl-ag-columns__visibility",onClick:w=>p(y)},[r.createVNode(r.unref(Ct),{"close-delay":500,position:"top"},{tooltip:r.withCtx(()=>m[4]||(m[4]=[r.createTextVNode("Show/Hide")])),default:r.withCtx(()=>[r.createVNode(r.unref(xt),{name:y.isVisible()?"view-show":"view-hide"},null,8,["name"])]),_:2},1024)],8,vV),y.getColDef().lockPosition?(r.openBlock(),r.createElementBlock("div",wV,[r.createVNode(r.unref(xt),{name:"pin"})])):r.createCommentVNode("",!0)]))),128))]))]),_:1},8,["modelValue"])]))}}),bV=["id"],xV=r.defineComponent({__name:"PlAgDataTableToolsPanel",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(tc),class:"d-flex gap-6"},[r.renderSlot(e.$slots,"default")],8,bV))}});function kV(){const t=document.createElement("div");return t.style.visibility="hidden",t.style.position="absolute",document.body.appendChild(t),t}function EV(t){document.body.removeChild(t)}async function SV(t){var n;if(!t)return;const e=t.getGridOption("rowModelType");switch(e){case"clientSide":return t.exportDataAsCsv();case"serverSide":{const o=t.getServerSideGroupLevelState();if(o.length===0)return;const i=o[0];if(i.rowCount<=i.cacheBlockSize)return t.exportDataAsCsv();const l=kV(),c={rowModelType:"serverSide",columnDefs:((n=t.getColumnDefs())==null?void 0:n.filter(d=>!("children"in d)).map(d=>({headerName:d.headerName,field:d.field,valueFormatter:d.valueFormatter,valueGetter:d.valueGetter})))??[],serverSideDatasource:t.getGridOption("serverSideDatasource"),cacheBlockSize:i.rowCount,onModelUpdated:d=>{const p=d.api.getServerSideGroupLevelState();if(p.length===0)return;const h=p[0];h.rowCount===h.cacheBlockSize&&(d.api.exportDataAsCsv(),EV(l))},defaultCsvExportParams:t.getGridOption("defaultCsvExportParams")};return k.createGrid(l,c,{modules:[Ja.ServerSideRowModelModule]})}default:throw Error(`exportCsv unsupported for rowModelType = ${e}`)}}function TV(){const t=r.shallowRef([!1,void 0]);return{track:i=>t.value=[!0,i],reset:()=>t.value=[!1,void 0],onceTracked:i=>{const{stop:l}=r.watchEffect(()=>{const[c,d]=t.value;c&&(i(d),l())});return l}}}function NV(t,e){t.addEventListener("firstDataRendered",n=>{n.api.getGridOption("rowModelType")==="clientSide"&&e.track(n.api)}),t.addEventListener("modelUpdated",n=>{const o=n.api.getServerSideGroupLevelState();o.length>0&&o[0].lastRowIndexKnown&&e.track(n.api)}),t.addEventListener("gridPreDestroyed",()=>e.reset())}function VV(t,e){let n=null;const o=i=>i.id===e?(n=i.rowIndex,!0):!1;if(t.ensureNodeVisible(o,"middle"),n){const i=t.getAllDisplayedColumns();i.length>0&&(t.ensureColumnVisible(i[0]),t.setFocusedCell(n,i[0]))}}function AV(t,e){r.nextTick(()=>e.onceTracked(n=>VV(n,t)))}const BV={class:"ap-ag-data-table-container"},PV={key:1,class:"ap-ag-data-table-sheets"},RV=ec(r.defineComponent({__name:"PlAgDataTable",props:r.mergeModels({settings:{},showColumnsPanel:{type:Boolean},showCellButtonForAxisId:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:r.mergeModels(["onRowDoubleClicked","columnsChanged"],["update:modelValue"]),setup(t,{expose:e,emit:n}){k.ModuleRegistry.registerModules([fs.ClientSideRowModelModule,qd.ClipboardModule,Ja.ServerSideRowModelModule,Kd.RangeSelectionModule,gl]);const o=r.useModel(t,"modelValue"),i=t,{settings:l}=r.toRefs(i),c=n;o.value.pTableParams||(o.value.pTableParams={});function d(v){return(v==null?void 0:v.sortModel.map(L=>{const{spec:U,...Q}=oh(L.colId);return{column:Q,ascending:L.sort==="asc",naAndAbsentAreLeastValues:!0}}))??[]}const p=r.computed({get:()=>{const v=o.value;return{columnOrder:v.gridState.columnOrder,sort:v.gridState.sort,columnVisibility:v.gridState.columnVisibility}},set:v=>{var Q;const L=((Q=l.value)==null?void 0:Q.sourceType)!=="ptable"||E.value.rowModelType==="clientSide"?void 0:d(v.sort),U=o.value;o.value={...U,gridState:{...U.gridState,...v},pTableParams:{...U.pTableParams,sorting:L}}}}),h=v=>dr(jr(v));function m(v){var L,U;if(((L=l.value)==null?void 0:L.sourceType)==="ptable")return((U=l.value.sheets)==null?void 0:U.map(Q=>({type:"bySingleColumnV2",column:{type:"axis",id:Q.axis},predicate:{operator:"Equal",reference:v[h(Q.axis)]}})))??[]}const y=r.computed({get:()=>o.value.gridState.sheets??{},set:v=>{const L=m(v),U=o.value;o.value={...U,gridState:{...U.gridState,sheets:v},pTableParams:{...U.pTableParams,filters:L}}}});r.watch(()=>l.value,(v,L)=>{if((v==null?void 0:v.sourceType)!=="ptable"||!v.sheets){y.value={};return}if(L&&L.sourceType==="ptable"&&Ye.isEqual(v.sheets,L.sheets))return;const U=y.value,Q={};for(const M of v.sheets){const Z=h(M.axis);Q[Z]=U[Z]??M.defaultValue??M.options[0].value}y.value=Q},{immediate:!0});const w=r.shallowRef(),b=TV(),E=r.shallowRef({animateRows:!1,suppressColumnMoveAnimation:!0,cellSelection:!0,initialState:p.value,autoSizeStrategy:{type:"fitCellContents"},onRowDoubleClicked:v=>{v.data&&c("onRowDoubleClicked",v.data.key)},defaultColDef:{suppressHeaderMenuButton:!0},maintainColumnOrder:!0,localeText:{loadingError:"..."},rowModelType:"clientSide",maxBlocksInCache:1e3,blockLoadDebounceMillis:500,serverSideSortAllLevels:!0,suppressServerSideFullWidthLoadingRow:!0,getRowId:v=>v.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:Yp,noRowsOverlayComponent:Xp,defaultCsvExportParams:{allColumns:!0,suppressQuotes:!0,fileName:"table.csv"}}),$=v=>{const L=v.api;NV(L,b),th(L),w.value=new Proxy(L,{get(U,Q,M){switch(Q){case"setGridOption":return(Z,z)=>{const B=E.value;B[Z]=z,E.value=B,L.setGridOption(Z,z)};case"updateGridOptions":return Z=>{E.value={...E.value,...Z},L.updateGridOptions(Z)};default:return Reflect.get(U,Q,M)}}})},O=v=>({columnOrder:v.columnOrder,sort:v.sort,columnVisibility:v.columnVisibility??(v.columnOrder?{hiddenColIds:[]}:void 0)}),T=v=>{E.value.initialState=p.value=O(v.state),v.api.autoSizeColumns(v.api.getAllDisplayedColumns().filter(L=>L.getColId()!==Un))},P=()=>{E.value.initialState=p.value=O(w.value.getState()),w.value=void 0};e({exportCsv:()=>SV(w.value),focusRow:v=>AV(sh(v),b)});const R=r.ref(0);r.watch(()=>[w.value,p.value],(v,L)=>{if(Ye.isEqual(v,L))return;const[U,Q]=v;if(!U)return;const M=O(U.getState());Ye.isEqual(Q,M)||(E.value.initialState=Q,++R.value)}),r.watch(()=>E.value,(v,L)=>{var U,Q;if(L){if(v.rowModelType!=L.rowModelType&&++R.value,v.columnDefs&&!Ye.isEqual(v.columnDefs,L.columnDefs)){const M=B=>!("children"in B),z=(((U=v.columnDefs)==null?void 0:U.filter(M))??[]).map(B=>B.colId).filter(B=>B!==void 0).filter(B=>B!==Un).map(B=>oh(B))??[];c("columnsChanged",z)}!Ye.isEqual(v.loadingOverlayComponentParams,L.loadingOverlayComponentParams)&&v.loading&&((Q=w.value)==null||Q.setGridOption("loading",!1),r.nextTick(()=>{var M;return(M=w.value)==null?void 0:M.setGridOption("loading",!0)}))}},{immediate:!0});const j=(v,L)=>{var Q;const U=y.value;if(U[v]!==L)return U[v]=L,y.value=U,(Q=w.value)==null?void 0:Q.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1}})};let N;return r.watch(()=>[w.value,l.value],async v=>{var M,Z;const[L,U]=v;if(!L||Ye.isEqual(U,N))return;N=U;const Q=U==null?void 0:U.sourceType;switch(Q){case void 0:return L.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:void 0,datasource:void 0});case"ptable":{if(!(U!=null&&U.pTable))return L.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},columnDefs:[],rowData:void 0,datasource:void 0});const z=ks().pFrameDriver,B=(Z=(M=p.value)==null?void 0:M.columnVisibility)==null?void 0:Z.hiddenColIds,A=await CV(z,U.pTable,U.sheets??[],B,i.showCellButtonForAxisId);return L.updateGridOptions({loading:!1,loadingOverlayComponentParams:{notReady:!1},...A})}case"xsv":{if(!(U==null?void 0:U.xsvFile))return L.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},columnDefs:[],rowData:void 0,datasource:void 0});ks().blobDriver;const B=await iV();return L.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...B})}default:throw Error(`unsupported source type: ${Q}`)}}),(v,L)=>{var U;return r.openBlock(),r.createElementBlock("div",BV,[w.value&&v.showColumnsPanel?(r.openBlock(),r.createBlock(r.unref(ah),{key:0,api:w.value},null,8,["api"])):r.createCommentVNode("",!0),((U=r.unref(l))==null?void 0:U.sourceType)==="ptable"&&r.unref(l).sheets&&r.unref(l).sheets.length>0?(r.openBlock(),r.createElementBlock("div",PV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l).sheets,(Q,M)=>{var Z,z;return r.openBlock(),r.createBlock(r.unref(vp),{key:M,"model-value":y.value[h(Q.axis)],options:Q.options,prefix:(((z=(Z=Q.axis.annotations)==null?void 0:Z["pl7.app/label"])==null?void 0:z.trim())??`Unlabeled axis ${M}`)+":","onUpdate:modelValue":B=>j(h(Q.axis),B)},null,8,["model-value","options","prefix","onUpdate:modelValue"])}),128))])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.unref(Rg.AgGridVue),{key:R.value,theme:r.unref(Mu),class:"ap-ag-data-table-grid","grid-options":E.value,onGridReady:$,onStateUpdated:T,onGridPreDestroyed:P},null,8,["theme","grid-options"]))])}}}),[["__scopeId","data-v-775a48df"]]),DV={key:1,class:"alert-error"},IV={key:2},FV=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),i=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",DV,r.toDisplayString(o.value),1)):r.createCommentVNode("",!0),i.value?(r.openBlock(),r.createElementBlock("div",IV,"Unresolved")):r.createCommentVNode("",!0)]))}}),LV={style:{height:"100%"}},OV=r.defineComponent({__name:"PlAgCellFile",props:{params:{}},setup(t){const e=t,n=r.computed(()=>e.params.extensions),o=r.computed(()=>e.params.value);function i(c){e.params.setValue(c)}const l=r.computed(()=>e.params.resolveProgress?e.params.resolveProgress(o.value):void 0);return(c,d)=>(r.openBlock(),r.createElementBlock("div",LV,[r.createVNode(r.unref(Zp),{"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":i},null,8,["placeholder","extensions","model-value","progress"])]))}});var nc={exports:{}};const MV="2.0.0",lh=256,GV=Number.MAX_SAFE_INTEGER||9007199254740991,$V=16,zV=lh-6;var js={MAX_LENGTH:lh,MAX_SAFE_COMPONENT_LENGTH:$V,MAX_SAFE_BUILD_LENGTH:zV,MAX_SAFE_INTEGER:GV,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:MV,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Hs=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=js,l=Hs;e=t.exports={};const c=e.re=[],d=e.safeRe=[],p=e.src=[],h=e.t={};let m=0;const y="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",i],[y,o]],b=$=>{for(const[O,T]of w)$=$.split(`${O}*`).join(`${O}{0,${T}}`).split(`${O}+`).join(`${O}{1,${T}}`);return $},E=($,O,T)=>{const P=b(O),R=m++;l($,R,O),h[$]=R,p[R]=O,c[R]=new RegExp(O,T?"g":void 0),d[R]=new RegExp(P,T?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y}*`),E("MAINVERSION",`(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})\\.(${p[h.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})\\.(${p[h.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${p[h.NUMERICIDENTIFIER]}|${p[h.NONNUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${p[h.NUMERICIDENTIFIERLOOSE]}|${p[h.NONNUMERICIDENTIFIER]})`),E("PRERELEASE",`(?:-(${p[h.PRERELEASEIDENTIFIER]}(?:\\.${p[h.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${p[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[h.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${y}+`),E("BUILD",`(?:\\+(${p[h.BUILDIDENTIFIER]}(?:\\.${p[h.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${p[h.MAINVERSION]}${p[h.PRERELEASE]}?${p[h.BUILD]}?`),E("FULL",`^${p[h.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${p[h.MAINVERSIONLOOSE]}${p[h.PRERELEASELOOSE]}?${p[h.BUILD]}?`),E("LOOSE",`^${p[h.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${p[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${p[h.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:\\.(${p[h.XRANGEIDENTIFIER]})(?:${p[h.PRERELEASE]})?${p[h.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[h.XRANGEIDENTIFIERLOOSE]})(?:${p[h.PRERELEASELOOSE]})?${p[h.BUILD]}?)?)?`),E("XRANGE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${p[h.GTLT]}\\s*${p[h.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),E("COERCE",`${p[h.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",p[h.COERCEPLAIN]+`(?:${p[h.PRERELEASE]})?(?:${p[h.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",p[h.COERCE],!0),E("COERCERTLFULL",p[h.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${p[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",E("TILDE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${p[h.LONETILDE]}${p[h.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${p[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",E("CARET",`^${p[h.LONECARET]}${p[h.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${p[h.LONECARET]}${p[h.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${p[h.GTLT]}\\s*(${p[h.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${p[h.GTLT]}\\s*(${p[h.LOOSEPLAIN]}|${p[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${p[h.XRANGEPLAIN]})\\s+-\\s+(${p[h.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${p[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[h.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(nc,nc.exports);var $i=nc.exports;const UV=Object.freeze({loose:!0}),ZV=Object.freeze({});var rc=t=>t?typeof t!="object"?UV:t:ZV;const ch=/^[0-9]+$/,dh=(t,e)=>{const n=ch.test(t),o=ch.test(e);return n&&o&&(t=+t,e=+e),t===e?0:n&&!o?-1:o&&!n?1:t<e?-1:1};var uh={compareIdentifiers:dh,rcompareIdentifiers:(t,e)=>dh(e,t)};const qs=Hs,{MAX_LENGTH:ph,MAX_SAFE_INTEGER:Ks}=js,{safeRe:hh,t:fh}=$i,WV=rc,{compareIdentifiers:Vo}=uh;var Pt=class qn{constructor(e,n){if(n=WV(n),e instanceof qn){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ph)throw new TypeError(`version is longer than ${ph} characters`);qs("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const o=e.trim().match(n.loose?hh[fh.LOOSE]:hh[fh.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Ks||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ks||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ks||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const l=+i;if(l>=0&&l<Ks)return l}return i}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(qs("SemVer.compare",this.version,this.options,e),!(e instanceof qn)){if(typeof e=="string"&&e===this.version)return 0;e=new qn(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof qn||(e=new qn(e,this.options)),Vo(this.major,e.major)||Vo(this.minor,e.minor)||Vo(this.patch,e.patch)}comparePre(e){if(e instanceof qn||(e=new qn(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const o=this.prerelease[n],i=e.prerelease[n];if(qs("prerelease compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return Vo(o,i)}while(++n)}compareBuild(e){e instanceof qn||(e=new qn(e,this.options));let n=0;do{const o=this.build[n],i=e.build[n];if(qs("build compare",n,o,i),o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(o===i)continue;return Vo(o,i)}while(++n)}inc(e,n,o){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,o),this.inc("pre",n,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,o),this.inc("pre",n,o);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(o)?1:0;if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let l=[n,i];o===!1&&(l=[n]),Vo(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=l):this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const mh=Pt;var Ao=(t,e,n=!1)=>{if(t instanceof mh)return t;try{return new mh(t,e)}catch(o){if(!n)return null;throw o}};const jV=Ao;var HV=(t,e)=>{const n=jV(t,e);return n?n.version:null};const qV=Ao;var KV=(t,e)=>{const n=qV(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};const gh=Pt;var YV=(t,e,n,o,i)=>{typeof n=="string"&&(i=o,o=n,n=void 0);try{return new gh(t instanceof gh?t.version:t,n).inc(e,o,i).version}catch{return null}};const yh=Ao;var XV=(t,e)=>{const n=yh(t,null,!0),o=yh(e,null,!0),i=n.compare(o);if(i===0)return null;const l=i>0,c=l?n:o,d=l?o:n,p=!!c.prerelease.length;if(!!d.prerelease.length&&!p)return!d.patch&&!d.minor?"major":c.patch?"patch":c.minor?"minor":"major";const m=p?"pre":"";return n.major!==o.major?m+"major":n.minor!==o.minor?m+"minor":n.patch!==o.patch?m+"patch":"prerelease"};const JV=Pt;var QV=(t,e)=>new JV(t,e).major;const eA=Pt;var tA=(t,e)=>new eA(t,e).minor;const nA=Pt;var rA=(t,e)=>new nA(t,e).patch;const oA=Ao;var iA=(t,e)=>{const n=oA(t,e);return n&&n.prerelease.length?n.prerelease:null};const _h=Pt;var _n=(t,e,n)=>new _h(t,n).compare(new _h(e,n));const sA=_n;var aA=(t,e,n)=>sA(e,t,n);const lA=_n;var cA=(t,e)=>lA(t,e,!0);const Ch=Pt;var oc=(t,e,n)=>{const o=new Ch(t,n),i=new Ch(e,n);return o.compare(i)||o.compareBuild(i)};const dA=oc;var uA=(t,e)=>t.sort((n,o)=>dA(n,o,e));const pA=oc;var hA=(t,e)=>t.sort((n,o)=>pA(o,n,e));const fA=_n;var Ys=(t,e,n)=>fA(t,e,n)>0;const mA=_n;var ic=(t,e,n)=>mA(t,e,n)<0;const gA=_n;var vh=(t,e,n)=>gA(t,e,n)===0;const yA=_n;var wh=(t,e,n)=>yA(t,e,n)!==0;const _A=_n;var sc=(t,e,n)=>_A(t,e,n)>=0;const CA=_n;var ac=(t,e,n)=>CA(t,e,n)<=0;const vA=vh,wA=wh,bA=Ys,xA=sc,kA=ic,EA=ac;var bh=(t,e,n,o)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return vA(t,n,o);case"!=":return wA(t,n,o);case">":return bA(t,n,o);case">=":return xA(t,n,o);case"<":return kA(t,n,o);case"<=":return EA(t,n,o);default:throw new TypeError(`Invalid operator: ${e}`)}};const SA=Pt,TA=Ao,{safeRe:Xs,t:Js}=$i;var NA=(t,e)=>{if(t instanceof SA)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Xs[Js.COERCEFULL]:Xs[Js.COERCE]);else{const p=e.includePrerelease?Xs[Js.COERCERTLFULL]:Xs[Js.COERCERTL];let h;for(;(h=p.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||h.index+h[0].length!==n.index+n[0].length)&&(n=h),p.lastIndex=h.index+h[1].length+h[2].length;p.lastIndex=-1}if(n===null)return null;const o=n[2],i=n[3]||"0",l=n[4]||"0",c=e.includePrerelease&&n[5]?`-${n[5]}`:"",d=e.includePrerelease&&n[6]?`+${n[6]}`:"";return TA(`${o}.${i}.${l}${c}${d}`,e)},VA=class{constructor(){this.max=1e3,this.map=new Map}get(e){const n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,n)}return this}},lc,xh;function Cn(){if(xh)return lc;xh=1;const t=/\s+/g;class e{constructor(G,H){if(H=i(H),G instanceof e)return G.loose===!!H.loose&&G.includePrerelease===!!H.includePrerelease?G:new e(G.raw,H);if(G instanceof l)return this.raw=G.value,this.set=[[G]],this.formatted=void 0,this;if(this.options=H,this.loose=!!H.loose,this.includePrerelease=!!H.includePrerelease,this.raw=G.trim().replace(t," "),this.set=this.raw.split("||").map(X=>this.parseRange(X.trim())).filter(X=>X.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const X=this.set[0];if(this.set=this.set.filter(ne=>!$(ne[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(const ne of this.set)if(ne.length===1&&O(ne[0])){this.set=[ne];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let G=0;G<this.set.length;G++){G>0&&(this.formatted+="||");const H=this.set[G];for(let X=0;X<H.length;X++)X>0&&(this.formatted+=" "),this.formatted+=H[X].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(G){const X=((this.options.includePrerelease&&b)|(this.options.loose&&E))+":"+G,ne=o.get(X);if(ne)return ne;const de=this.options.loose,me=de?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];G=G.replace(me,z(this.options.includePrerelease)),c("hyphen replace",G),G=G.replace(p[h.COMPARATORTRIM],m),c("comparator trim",G),G=G.replace(p[h.TILDETRIM],y),c("tilde trim",G),G=G.replace(p[h.CARETTRIM],w),c("caret trim",G);let Te=G.split(" ").map(qe=>P(qe,this.options)).join(" ").split(/\s+/).map(qe=>Z(qe,this.options));de&&(Te=Te.filter(qe=>(c("loose invalid filter",qe,this.options),!!qe.match(p[h.COMPARATORLOOSE])))),c("range list",Te);const Ee=new Map,je=Te.map(qe=>new l(qe,this.options));for(const qe of je){if($(qe))return[qe];Ee.set(qe.value,qe)}Ee.size>1&&Ee.has("")&&Ee.delete("");const It=[...Ee.values()];return o.set(X,It),It}intersects(G,H){if(!(G instanceof e))throw new TypeError("a Range is required");return this.set.some(X=>T(X,H)&&G.set.some(ne=>T(ne,H)&&X.every(de=>ne.every(me=>de.intersects(me,H)))))}test(G){if(!G)return!1;if(typeof G=="string")try{G=new d(G,this.options)}catch{return!1}for(let H=0;H<this.set.length;H++)if(B(this.set[H],G,this.options))return!0;return!1}}lc=e;const n=VA,o=new n,i=rc,l=Qs(),c=Hs,d=Pt,{safeRe:p,t:h,comparatorTrimReplace:m,tildeTrimReplace:y,caretTrimReplace:w}=$i,{FLAG_INCLUDE_PRERELEASE:b,FLAG_LOOSE:E}=js,$=A=>A.value==="<0.0.0-0",O=A=>A.value==="",T=(A,G)=>{let H=!0;const X=A.slice();let ne=X.pop();for(;H&&X.length;)H=X.every(de=>ne.intersects(de,G)),ne=X.pop();return H},P=(A,G)=>(c("comp",A,G),A=v(A,G),c("caret",A),A=j(A,G),c("tildes",A),A=U(A,G),c("xrange",A),A=M(A,G),c("stars",A),A),R=A=>!A||A.toLowerCase()==="x"||A==="*",j=(A,G)=>A.trim().split(/\s+/).map(H=>N(H,G)).join(" "),N=(A,G)=>{const H=G.loose?p[h.TILDELOOSE]:p[h.TILDE];return A.replace(H,(X,ne,de,me,Te)=>{c("tilde",A,X,ne,de,me,Te);let Ee;return R(ne)?Ee="":R(de)?Ee=`>=${ne}.0.0 <${+ne+1}.0.0-0`:R(me)?Ee=`>=${ne}.${de}.0 <${ne}.${+de+1}.0-0`:Te?(c("replaceTilde pr",Te),Ee=`>=${ne}.${de}.${me}-${Te} <${ne}.${+de+1}.0-0`):Ee=`>=${ne}.${de}.${me} <${ne}.${+de+1}.0-0`,c("tilde return",Ee),Ee})},v=(A,G)=>A.trim().split(/\s+/).map(H=>L(H,G)).join(" "),L=(A,G)=>{c("caret",A,G);const H=G.loose?p[h.CARETLOOSE]:p[h.CARET],X=G.includePrerelease?"-0":"";return A.replace(H,(ne,de,me,Te,Ee)=>{c("caret",A,ne,de,me,Te,Ee);let je;return R(de)?je="":R(me)?je=`>=${de}.0.0${X} <${+de+1}.0.0-0`:R(Te)?de==="0"?je=`>=${de}.${me}.0${X} <${de}.${+me+1}.0-0`:je=`>=${de}.${me}.0${X} <${+de+1}.0.0-0`:Ee?(c("replaceCaret pr",Ee),de==="0"?me==="0"?je=`>=${de}.${me}.${Te}-${Ee} <${de}.${me}.${+Te+1}-0`:je=`>=${de}.${me}.${Te}-${Ee} <${de}.${+me+1}.0-0`:je=`>=${de}.${me}.${Te}-${Ee} <${+de+1}.0.0-0`):(c("no pr"),de==="0"?me==="0"?je=`>=${de}.${me}.${Te}${X} <${de}.${me}.${+Te+1}-0`:je=`>=${de}.${me}.${Te}${X} <${de}.${+me+1}.0-0`:je=`>=${de}.${me}.${Te} <${+de+1}.0.0-0`),c("caret return",je),je})},U=(A,G)=>(c("replaceXRanges",A,G),A.split(/\s+/).map(H=>Q(H,G)).join(" ")),Q=(A,G)=>{A=A.trim();const H=G.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return A.replace(H,(X,ne,de,me,Te,Ee)=>{c("xRange",A,X,ne,de,me,Te,Ee);const je=R(de),It=je||R(me),qe=It||R(Te),Zn=qe;return ne==="="&&Zn&&(ne=""),Ee=G.includePrerelease?"-0":"",je?ne===">"||ne==="<"?X="<0.0.0-0":X="*":ne&&Zn?(It&&(me=0),Te=0,ne===">"?(ne=">=",It?(de=+de+1,me=0,Te=0):(me=+me+1,Te=0)):ne==="<="&&(ne="<",It?de=+de+1:me=+me+1),ne==="<"&&(Ee="-0"),X=`${ne+de}.${me}.${Te}${Ee}`):It?X=`>=${de}.0.0${Ee} <${+de+1}.0.0-0`:qe&&(X=`>=${de}.${me}.0${Ee} <${de}.${+me+1}.0-0`),c("xRange return",X),X})},M=(A,G)=>(c("replaceStars",A,G),A.trim().replace(p[h.STAR],"")),Z=(A,G)=>(c("replaceGTE0",A,G),A.trim().replace(p[G.includePrerelease?h.GTE0PRE:h.GTE0],"")),z=A=>(G,H,X,ne,de,me,Te,Ee,je,It,qe,Zn)=>(R(X)?H="":R(ne)?H=`>=${X}.0.0${A?"-0":""}`:R(de)?H=`>=${X}.${ne}.0${A?"-0":""}`:me?H=`>=${H}`:H=`>=${H}${A?"-0":""}`,R(je)?Ee="":R(It)?Ee=`<${+je+1}.0.0-0`:R(qe)?Ee=`<${je}.${+It+1}.0-0`:Zn?Ee=`<=${je}.${It}.${qe}-${Zn}`:A?Ee=`<${je}.${It}.${+qe+1}-0`:Ee=`<=${Ee}`,`${H} ${Ee}`.trim()),B=(A,G,H)=>{for(let X=0;X<A.length;X++)if(!A[X].test(G))return!1;if(G.prerelease.length&&!H.includePrerelease){for(let X=0;X<A.length;X++)if(c(A[X].semver),A[X].semver!==l.ANY&&A[X].semver.prerelease.length>0){const ne=A[X].semver;if(ne.major===G.major&&ne.minor===G.minor&&ne.patch===G.patch)return!0}return!1}return!0};return lc}var cc,kh;function Qs(){if(kh)return cc;kh=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(m,y){if(y=n(y),m instanceof e){if(m.loose===!!y.loose)return m;m=m.value}m=m.trim().split(/\s+/).join(" "),c("comparator",m,y),this.options=y,this.loose=!!y.loose,this.parse(m),this.semver===t?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(m){const y=this.options.loose?o[i.COMPARATORLOOSE]:o[i.COMPARATOR],w=m.match(y);if(!w)throw new TypeError(`Invalid comparator: ${m}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new d(w[2],this.options.loose):this.semver=t}toString(){return this.value}test(m){if(c("Comparator.test",m,this.options.loose),this.semver===t||m===t)return!0;if(typeof m=="string")try{m=new d(m,this.options)}catch{return!1}return l(m,this.operator,this.semver,this.options)}intersects(m,y){if(!(m instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new p(m.value,y).test(this.value):m.operator===""?m.value===""?!0:new p(this.value,y).test(m.semver):(y=n(y),y.includePrerelease&&(this.value==="<0.0.0-0"||m.value==="<0.0.0-0")||!y.includePrerelease&&(this.value.startsWith("<0.0.0")||m.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&m.operator.startsWith(">")||this.operator.startsWith("<")&&m.operator.startsWith("<")||this.semver.version===m.semver.version&&this.operator.includes("=")&&m.operator.includes("=")||l(this.semver,"<",m.semver,y)&&this.operator.startsWith(">")&&m.operator.startsWith("<")||l(this.semver,">",m.semver,y)&&this.operator.startsWith("<")&&m.operator.startsWith(">")))}}cc=e;const n=rc,{safeRe:o,t:i}=$i,l=bh,c=Hs,d=Pt,p=Cn();return cc}const AA=Cn();var ea=(t,e,n)=>{try{e=new AA(e,n)}catch{return!1}return e.test(t)};const BA=Cn();var PA=(t,e)=>new BA(t,e).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));const RA=Pt,DA=Cn();var IA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new DA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===-1)&&(o=c,i=new RA(o,n))}),o};const FA=Pt,LA=Cn();var OA=(t,e,n)=>{let o=null,i=null,l=null;try{l=new LA(e,n)}catch{return null}return t.forEach(c=>{l.test(c)&&(!o||i.compare(c)===1)&&(o=c,i=new FA(o,n))}),o};const dc=Pt,MA=Cn(),Eh=Ys;var GA=(t,e)=>{t=new MA(t,e);let n=new dc("0.0.0");if(t.test(n)||(n=new dc("0.0.0-0"),t.test(n)))return n;n=null;for(let o=0;o<t.set.length;++o){const i=t.set[o];let l=null;i.forEach(c=>{const d=new dc(c.semver.version);switch(c.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||Eh(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),l&&(!n||Eh(n,l))&&(n=l)}return n&&t.test(n)?n:null};const $A=Cn();var zA=(t,e)=>{try{return new $A(t,e).range||"*"}catch{return null}};const UA=Pt,Sh=Qs(),{ANY:ZA}=Sh,WA=Cn(),jA=ea,Th=Ys,Nh=ic,HA=ac,qA=sc;var uc=(t,e,n,o)=>{t=new UA(t,o),e=new WA(e,o);let i,l,c,d,p;switch(n){case">":i=Th,l=HA,c=Nh,d=">",p=">=";break;case"<":i=Nh,l=qA,c=Th,d="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(jA(t,e,o))return!1;for(let h=0;h<e.set.length;++h){const m=e.set[h];let y=null,w=null;if(m.forEach(b=>{b.semver===ZA&&(b=new Sh(">=0.0.0")),y=y||b,w=w||b,i(b.semver,y.semver,o)?y=b:c(b.semver,w.semver,o)&&(w=b)}),y.operator===d||y.operator===p||(!w.operator||w.operator===d)&&l(t,w.semver))return!1;if(w.operator===p&&c(t,w.semver))return!1}return!0};const KA=uc;var YA=(t,e,n)=>KA(t,e,">",n);const XA=uc;var JA=(t,e,n)=>XA(t,e,"<",n);const Vh=Cn();var QA=(t,e,n)=>(t=new Vh(t,n),e=new Vh(e,n),t.intersects(e,n));const eB=ea,tB=_n;var nB=(t,e,n)=>{const o=[];let i=null,l=null;const c=t.sort((m,y)=>tB(m,y,n));for(const m of c)eB(m,e,n)?(l=m,i||(i=m)):(l&&o.push([i,l]),l=null,i=null);i&&o.push([i,null]);const d=[];for(const[m,y]of o)m===y?d.push(m):!y&&m===c[0]?d.push("*"):y?m===c[0]?d.push(`<=${y}`):d.push(`${m} - ${y}`):d.push(`>=${m}`);const p=d.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return p.length<h.length?p:e};const Ah=Cn(),pc=Qs(),{ANY:hc}=pc,zi=ea,fc=_n,rB=(t,e,n={})=>{if(t===e)return!0;t=new Ah(t,n),e=new Ah(e,n);let o=!1;e:for(const i of t.set){for(const l of e.set){const c=iB(i,l,n);if(o=o||c!==null,c)continue e}if(o)return!1}return!0},oB=[new pc(">=0.0.0-0")],Bh=[new pc(">=0.0.0")],iB=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===hc){if(e.length===1&&e[0].semver===hc)return!0;n.includePrerelease?t=oB:t=Bh}if(e.length===1&&e[0].semver===hc){if(n.includePrerelease)return!0;e=Bh}const o=new Set;let i,l;for(const b of t)b.operator===">"||b.operator===">="?i=Ph(i,b,n):b.operator==="<"||b.operator==="<="?l=Rh(l,b,n):o.add(b.semver);if(o.size>1)return null;let c;if(i&&l){if(c=fc(i.semver,l.semver,n),c>0)return null;if(c===0&&(i.operator!==">="||l.operator!=="<="))return null}for(const b of o){if(i&&!zi(b,String(i),n)||l&&!zi(b,String(l),n))return null;for(const E of e)if(!zi(b,String(E),n))return!1;return!0}let d,p,h,m,y=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1,w=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;y&&y.prerelease.length===1&&l.operator==="<"&&y.prerelease[0]===0&&(y=!1);for(const b of e){if(m=m||b.operator===">"||b.operator===">=",h=h||b.operator==="<"||b.operator==="<=",i){if(w&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===w.major&&b.semver.minor===w.minor&&b.semver.patch===w.patch&&(w=!1),b.operator===">"||b.operator===">="){if(d=Ph(i,b,n),d===b&&d!==i)return!1}else if(i.operator===">="&&!zi(i.semver,String(b),n))return!1}if(l){if(y&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===y.major&&b.semver.minor===y.minor&&b.semver.patch===y.patch&&(y=!1),b.operator==="<"||b.operator==="<="){if(p=Rh(l,b,n),p===b&&p!==l)return!1}else if(l.operator==="<="&&!zi(l.semver,String(b),n))return!1}if(!b.operator&&(l||i)&&c!==0)return!1}return!(i&&h&&!l&&c!==0||l&&m&&!i&&c!==0||w||y)},Ph=(t,e,n)=>{if(!t)return e;const o=fc(t.semver,e.semver,n);return o>0?t:o<0||e.operator===">"&&t.operator===">="?e:t},Rh=(t,e,n)=>{if(!t)return e;const o=fc(t.semver,e.semver,n);return o<0?t:o>0||e.operator==="<"&&t.operator==="<="?e:t};var sB=rB;const mc=$i,Dh=js,aB=Pt,Ih=uh,lB=Ao,cB=HV,dB=KV,uB=YV,pB=XV,hB=QV,fB=tA,mB=rA,gB=iA,yB=_n,_B=aA,CB=cA,vB=oc,wB=uA,bB=hA,xB=Ys,kB=ic,EB=vh,SB=wh,TB=sc,NB=ac,VB=bh,AB=NA,BB=Qs(),PB=Cn();var RB={parse:lB,valid:cB,clean:dB,inc:uB,diff:pB,major:hB,minor:fB,patch:mB,prerelease:gB,compare:yB,rcompare:_B,compareLoose:CB,compareBuild:vB,sort:wB,rsort:bB,gt:xB,lt:kB,eq:EB,neq:SB,gte:TB,lte:NB,cmp:VB,coerce:AB,Comparator:BB,Range:PB,satisfies:ea,toComparators:PA,maxSatisfying:IA,minSatisfying:OA,minVersion:GA,validRange:zA,outside:uc,gtr:YA,ltr:JA,intersects:QA,simplifyRange:nB,subset:sB,SemVer:aB,re:mc.re,src:mc.src,tokens:mc.t,SEMVER_SPEC_VERSION:Dh.SEMVER_SPEC_VERSION,RELEASE_TYPES:Dh.RELEASE_TYPES,compareIdentifiers:Ih.compareIdentifiers,rcompareIdentifiers:Ih.rcompareIdentifiers};const DB=eu(RB);function IB(t){return dr(t.id)}function FB(t){switch(t){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: ${t}`)}}const LB=["isNotNA","isNA","number_equals","number_notEquals","number_greaterThan","number_greaterThanOrEqualTo","number_lessThan","number_lessThanOrEqualTo","number_between"],OB=["isNotNA","isNA","string_equals","string_notEquals","string_contains","string_doesNotContain","string_matches","string_doesNotMatch","string_containsFuzzyMatch"];function Fh(t,e){var n,o;return((o=(n=t.spec.annotations)==null?void 0:n["pl7.app/label"])==null?void 0:o.trim())??"Unlabeled "+t.type+" "+e.toString()}function MB(t){const e=t.type;switch(e){case"isNotNA":case"isNA":return;case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return t.reference;case"number_between":return t.lowerBound;case"string_equals":case"string_notEquals":case"string_contains":case"string_doesNotContain":case"string_matches":case"string_doesNotMatch":case"string_containsFuzzyMatch":return t.reference;default:throw Error(`unsupported filter type: ${e}`)}}function Lh(t,e){switch(t){case"isNotNA":case"isNA":return{type:t};case"number_equals":case"number_notEquals":case"number_greaterThan":case"number_greaterThanOrEqualTo":case"number_lessThan":case"number_lessThanOrEqualTo":return{type:t,reference:typeof e=="number"?e:0};case"number_between":return{type:t,lowerBound:typeof e=="number"?e: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:t,reference:typeof e=="string"?e:""};case"string_containsFuzzyMatch":return{type:t,reference:typeof e=="string"?e:"",maxEdits:2,substitutionsOnly:!1,wildcard:void 0};default:throw Error(`unsupported filter type: ${t}`)}}function GB(t,e){return{columnId:t.columnId,filter:Lh(e,MB(t.filter)),disabled:t.disabled}}function gc(t,e){var c,d;const n=Number(e);if(!Number.isFinite(n))throw Error("Model value is not a number.");const o=t.type==="column"?t.spec.valueType:t.spec.type;if((o==="Int"||o==="Long")&&!Number.isInteger(n))throw Error("Model value is not an integer.");const i=(c=t.spec.annotations)==null?void 0:c["pl7.app/min"];if(i!==void 0){const p=Number(i);if(Number.isFinite(p)&&n<Number(i))throw Error("Model value is too low.")}const l=(d=t.spec.annotations)==null?void 0:d["pl7.app/max"];if(l!==void 0){const p=Number(l);if(Number.isFinite(p)&&n>Number(l))throw Error("Model value is too high.")}return n}function Oh(t,e){var o,i;const n=((o=t.spec.domain)==null?void 0:o["pl7.app/alphabet"])??((i=t.spec.annotations)==null?void 0:i["pl7.app/alphabet"]);if(n==="nucleotide"&&!/^[AaTtGgCcNn]+$/.test(e))throw Error("Model value is not a nucleotide.");if(n==="aminoacid"&&!/^[AaCcDdEeFfGgHhIiKkLlMmNnPpQqRrSsTtVvWwYyXx]+$/.test(e))throw Error("Model value is not an aminoacid.");return e}function $B(t){try{return new RegExp(t),t}catch(e){throw e instanceof SyntaxError?Error("Model value is not a regexp."):e}}function zB(t,e){var i,l;const n=((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]);if(n==="nucleotide")return[{value:"N",text:"N"}];if(n==="aminoacid")return[{value:"X",text:"X"}];const o=Ye.uniq(e);return o.sort(),o.map(c=>({value:c,text:c}))}function UB(t,e){var i,l;const n=DB.gt(ks().sdkInfo.sdkVersion,"1.14.0")&&(t.type==="column"?t.spec.valueType:t.spec.type)==="String"&&(((i=t.spec.domain)==null?void 0:i["pl7.app/alphabet"])??((l=t.spec.annotations)==null?void 0:l["pl7.app/alphabet"]))!==void 0,o=e.type;switch(o){case"isNotNA":return{operator:"Not",operand:{operator:"IsNA"}};case"isNA":return{operator:"IsNA"};case"number_equals":return{operator:"Equal",reference:e.reference};case"string_equals":return{operator:n?"IEqual":"Equal",reference:e.reference};case"number_notEquals":return{operator:"Not",operand:{operator:"Equal",reference:e.reference}};case"string_notEquals":return{operator:"Not",operand:{operator:n?"IEqual":"Equal",reference:e.reference}};case"number_greaterThan":return{operator:"Greater",reference:e.reference};case"number_greaterThanOrEqualTo":return{operator:"GreaterOrEqual",reference:e.reference};case"number_lessThan":return{operator:"Less",reference:e.reference};case"number_lessThanOrEqualTo":return{operator:"LessOrEqual",reference:e.reference};case"number_between":return{operator:"And",operands:[{operator:e.includeLowerBound?"GreaterOrEqual":"Greater",reference:e.lowerBound},{operator:e.includeUpperBound?"LessOrEqual":"Less",reference:e.upperBound}]};case"string_contains":return{operator:n?"StringIContains":"StringContains",substring:e.reference};case"string_doesNotContain":return{operator:"Not",operand:{operator:n?"StringIContains":"StringContains",substring:e.reference}};case"string_matches":return{operator:"Matches",regex:e.reference};case"string_doesNotMatch":return{operator:"Not",operand:{operator:"Matches",regex:e.reference}};case"string_containsFuzzyMatch":return{operator:n?"StringIContainsFuzzy":"StringContainsFuzzy",reference:e.reference,maxEdits:e.maxEdits,substitutionsOnly:e.substitutionsOnly,wildcard:e.wildcard};default:throw Error(`unsupported filter type: ${o}`)}}const ZB={class:"d-flex flex-column gap-24"},Mh=r.defineComponent({__name:"PlTableFilterEntry",props:r.mergeModels({column:{},options:{},disabled:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=r.useModel(t,"modelValue"),n=t,{column:o,options:i}=r.toRefs(n);return(l,c)=>(r.openBlock(),r.createElementBlock("div",ZB,[r.createVNode(r.unref(bo),{"model-value":e.value.filter.type,options:r.unref(i),disabled:l.disabled,label:"Predicate","onUpdate:modelValue":c[0]||(c[0]=d=>e.value=r.unref(GB)(e.value,d))},null,8,["model-value","options","disabled"]),e.value.filter.type==="number_equals"||e.value.filter.type==="number_notEquals"||e.value.filter.type==="number_lessThan"||e.value.filter.type==="number_lessThanOrEqualTo"||e.value.filter.type==="number_greaterThan"||e.value.filter.type==="number_greaterThanOrEqualTo"?(r.openBlock(),r.createBlock(r.unref(qr),{key:0,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[1]||(c[1]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(gc)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="number_between"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createVNode(r.unref(qr),{modelValue:e.value.filter.lowerBound,"onUpdate:modelValue":c[2]||(c[2]=d=>e.value.filter.lowerBound=d),disabled:l.disabled,parse:d=>r.unref(gc)(r.unref(o),d),label:"Lower bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Is),{modelValue:e.value.filter.includeLowerBound,"onUpdate:modelValue":c[3]||(c[3]=d=>e.value.filter.includeLowerBound=d),disabled:l.disabled,label:"Include lower bound"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(qr),{modelValue:e.value.filter.upperBound,"onUpdate:modelValue":c[4]||(c[4]=d=>e.value.filter.upperBound=d),disabled:l.disabled,parse:d=>r.unref(gc)(r.unref(o),d),label:"Upper bound"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(Is),{modelValue:e.value.filter.includeUpperBound,"onUpdate:modelValue":c[5]||(c[5]=d=>e.value.filter.includeUpperBound=d),disabled:l.disabled,label:"Include upper bound"},null,8,["modelValue","disabled"])],64)):r.createCommentVNode("",!0),e.value.filter.type==="string_equals"||e.value.filter.type==="string_notEquals"||e.value.filter.type==="string_contains"||e.value.filter.type==="string_doesNotContain"?(r.openBlock(),r.createBlock(r.unref(qr),{key:2,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[6]||(c[6]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Oh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_matches"||e.value.filter.type==="string_doesNotMatch"?(r.openBlock(),r.createBlock(r.unref(qr),{key:3,modelValue:e.value.filter.reference,"onUpdate:modelValue":c[7]||(c[7]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:r.unref($B),label:"Reference value"},null,8,["modelValue","disabled","parse"])):r.createCommentVNode("",!0),e.value.filter.type==="string_containsFuzzyMatch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:4},[r.createVNode(r.unref(qr),{modelValue:e.value.filter.reference,"onUpdate:modelValue":c[8]||(c[8]=d=>e.value.filter.reference=d),disabled:l.disabled,parse:d=>r.unref(Oh)(r.unref(o),d),label:"Reference value"},null,8,["modelValue","disabled","parse"]),r.createVNode(r.unref(jp),{modelValue:e.value.filter.maxEdits,"onUpdate:modelValue":c[9]||(c[9]=d=>e.value.filter.maxEdits=d),max:5,disabled:l.disabled,breakpoints:"",label:"Maximum nuber of substitutions and indels"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(Is),{modelValue:e.value.filter.substitutionsOnly,"onUpdate:modelValue":c[10]||(c[10]=d=>e.value.filter.substitutionsOnly=d),disabled:l.disabled,label:"Substitutions only"},null,8,["modelValue","disabled"]),r.createVNode(r.unref(bo),{modelValue:e.value.filter.wildcard,"onUpdate:modelValue":c[11]||(c[11]=d=>e.value.filter.wildcard=d),disabled:l.disabled,options:r.unref(zB)(r.unref(o),e.value.filter.reference),clearable:"",label:"Wildcard symbol"},null,8,["modelValue","disabled","options"])],64)):r.createCommentVNode("",!0)]))}}),WB={class:"d-flex flex-column gap-24"},jB={key:0,class:"text-subtitle-m",style:{color:"var(--txt-mask)"}},HB=r.defineComponent({__name:"PlTableAddFilter",props:r.mergeModels({columnsById:{},columnOptions:{},filterOptions:{},makeFilter:{type:Function}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:r.mergeModels(["addFilter"],["update:modelValue"]),setup(t,{emit:e}){const n=r.useModel(t,"modelValue"),o=t,{columnsById:i,columnOptions:l,filterOptions:c}=r.toRefs(o),d=e,p=r.ref(),h=r.ref();r.watch(()=>p.value,w=>{w?h.value=o.makeFilter(w):h.value=void 0});const m=()=>{p.value=void 0,n.value=!1},y=()=>{h.value&&(d("addFilter",h.value),m())};return(w,b)=>(r.openBlock(),r.createBlock(r.unref(Ds),{modelValue:n.value,"onUpdate:modelValue":b[2]||(b[2]=E=>n.value=E),"close-on-outside-click":!1},{title:r.withCtx(()=>b[3]||(b[3]=[r.createTextVNode("Add Filter")])),actions:r.withCtx(()=>[r.createVNode(r.unref(As),{disabled:!h.value,onClick:y},{default:r.withCtx(()=>b[4]||(b[4]=[r.createTextVNode("Add Filter")])),_:1},8,["disabled"]),r.createVNode(r.unref(wo),{"justify-center":!1,onClick:m},{default:r.withCtx(()=>b[5]||(b[5]=[r.createTextVNode("Cancel")])),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",WB,[r.createVNode(r.unref(bo),{modelValue:p.value,"onUpdate:modelValue":b[0]||(b[0]=E=>p.value=E),options:r.unref(l),label:"Column",placeholder:"Choose..."},null,8,["modelValue","options"]),h.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",jB,"Choose a column to view and adjust its options")),h.value?(r.openBlock(),r.createBlock(Mh,{key:1,modelValue:h.value,"onUpdate:modelValue":b[1]||(b[1]=E=>h.value=E),column:r.unref(i)[h.value.columnId],options:r.unref(c)[h.value.columnId]},null,8,["modelValue","column","options"])):r.createCommentVNode("",!0)])]),_:1},8,["modelValue"]))}}),qB=["onClick"],KB={class:"pl-filter-manager__expand-icon"},YB={class:"pl-filter-manager__title flex-grow-1 text-s-btn"},XB={class:"pl-filter-manager__actions d-flex gap-12"},JB=["onClick"],QB=["onClick"],eP={class:"pl-filter-manager__content d-flex gap-24 p-24 flex-column"},tP={class:"d-flex justify-center"},nP=["onClick"],rP={class:"pl-filter-manager__add-btn-icon"},oP={key:0},iP=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:i,defaults:l}=r.toRefs(n),c=r.computed(()=>{const M=o.value.filter(z=>{const B=z.type;switch(B){case"axis":return z.spec.type!=="Bytes";case"column":return z.spec.valueType!=="Bytes";default:throw Error(`unsupported data type: ${B}`)}}),Z={};for(const z of M)Z[IB(z)]=z;return Z}),d=r.computed(()=>{const M=i.value??[],Z={};for(const[z,B]of Object.entries(c.value)){const A=Ye.find(M,G=>Ye.isEqual(G.column.id,B.id));A&&(Z[z]=A.allowedFilterTypes)}return Z}),p=r.computed(()=>{const M=l.value??[],Z={};for(const[z,B]of Object.entries(c.value)){const A=Ye.find(M,G=>Ye.isEqual(G.column.id,B.id));A&&(Z[z]={columnId:z,filter:A.default,disabled:!1})}return Z});(()=>{const M=e.value.state;typeof M=="object"&&!Array.isArray(M)&&(e.value.state=Object.entries(M).map(([Z,z])=>({columnId:Z,filter:z,disabled:!1})))})();const h=M=>M??Object.values(p.value),m=r.reactive({state:h(e.value.state)});r.watch(()=>e.value,M=>{Ye.isEqual(m.state,M.state)||(m.state=h(M.state))}),r.watch(()=>m,M=>{Ye.isEqual(M.state,e.value.state)||(e.value={state:Ye.cloneDeep(M.state),filters:M.state.filter(Z=>!Z.disabled).map(Z=>{const z=c.value[Z.columnId],{spec:B,...A}=z;return{type:"bySingleColumnV2",column:A,predicate:UB(z,Z.filter)}})})},{immediate:!0,deep:!0}),r.watch(()=>c.value,M=>{Object.keys(M).length===0&&m.state!==void 0||(m.state=m.state.filter(Z=>!!M[Z.columnId]))},{immediate:!0});const y=r.computed(()=>Object.keys(c).length>0&&m.state.length>0),w=r.computed(()=>{const M=d.value,Z={};for(const[z,B]of Object.entries(c.value)){let G=(B.type==="column"?B.spec.valueType:B.spec.type)==="String"?OB:LB;const H=M[z];H&&(G=G.filter(X=>H.includes(X))),Z[z]=G.map(X=>({value:X,text:FB(X)}))}return Z}),b=r.computed(()=>Ye.some(Object.values(w.value),M=>M.length>0)),E=r.computed(()=>Object.entries(Object.entries(c.value)).filter(([M,[Z,z]])=>w.value[Z].length>0).filter(([M,[Z,z]])=>!m.state.some(B=>B.columnId===Z)).map(([M,[Z,z]])=>({label:Fh(z,M),value:Z}))),$=M=>p.value[M]??{columnId:M,filter:Lh(w.value[M][0].value),disabled:!1},O=M=>{m.state[M]=$(m.state[M].columnId)},T=M=>m.state.splice(M,1),P=r.ref(!1),R=r.ref(!1),j=r.ref(!1);r.onMounted(()=>{j.value=!0});const N=r.reactive({}),v=M=>{N[M]?delete N[M]:N[M]=!0},L=r.ref(!1),U=r.ref();let Q;return r.onMounted(()=>{Q=new ResizeObserver(()=>{var Z;const M=(Z=U.value)==null?void 0:Z.parentElement;M&&(L.value=M.scrollHeight>M.clientHeight||M.scrollWidth>M.clientWidth)}),U.value&&U.value.parentElement&&Q.observe(U.value.parentElement)}),r.watch(U,(M,Z)=>{Z!=null&&Z.parentElement&&Q.unobserve(Z.parentElement),M!=null&&M.parentElement&&Q.observe(M.parentElement)}),r.onBeforeUnmount(()=>{Q!==void 0&&Q.disconnect()}),(M,Z)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[j.value?(r.openBlock(),r.createBlock(r.Teleport,{key:0,to:`#${r.unref(tc)}`},[r.createVNode(r.unref(wo),{onClick:Z[0]||(Z[0]=r.withModifiers(z=>P.value=!0,["stop"]))},{append:r.withCtx(()=>[r.createVNode(r.unref(Ps),{name:y.value?"filter-on":"filter"},null,8,["name"])]),default:r.withCtx(()=>[Z[5]||(Z[5]=r.createTextVNode(" Filters "))]),_:1})],8,["to"])):r.createCommentVNode("",!0),r.createVNode(r.unref(Ds),{modelValue:P.value,"onUpdate:modelValue":Z[2]||(Z[2]=z=>P.value=z),"close-on-outside-click":!1},{title:r.withCtx(()=>Z[6]||(Z[6]=[r.createTextVNode("Manage Filters")])),default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"filterManager",ref:U,class:"pl-filter-manager d-flex flex-column gap-6"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.state,(z,B)=>(r.openBlock(),r.createElementBlock("div",{key:z.columnId,class:r.normalizeClass([{open:N[z.columnId],disabled:z.disabled},"pl-filter-manager__filter"])},[r.createElementVNode("div",{class:"pl-filter-manager__header d-flex align-center gap-8",onClick:A=>v(z.columnId)},[r.createElementVNode("div",KB,[r.createVNode(r.unref(At),{name:"chevron-right"})]),r.createElementVNode("div",YB,r.toDisplayString(r.unref(Fh)(c.value[z.columnId],B)),1),r.createElementVNode("div",XB,[r.createElementVNode("div",{class:"pl-filter-manager__toggle",onClick:r.withModifiers(A=>z.disabled=!z.disabled,["stop"])},[r.createVNode(r.unref(xt),{name:z.disabled?"view-hide":"view-show"},null,8,["name"])],8,JB),r.createElementVNode("div",{class:"pl-filter-manager__delete",onClick:r.withModifiers(A=>T(B),["stop"])},[r.createVNode(r.unref(xt),{name:"close"})],8,QB)])],8,qB),r.createElementVNode("div",eP,[r.createVNode(Mh,{modelValue:m.state[B],"onUpdate:modelValue":A=>m.state[B]=A,disabled:z.disabled,column:c.value[z.columnId],options:w.value[z.columnId]},null,8,["modelValue","onUpdate:modelValue","disabled","column","options"]),r.createElementVNode("div",tP,[r.createElementVNode("div",{class:r.normalizeClass([{disabled:z.disabled},"pl-filter-manager__revert-btn text-s-btn d-flex align-center gap-8"]),onClick:A=>O(B)},[Z[7]||(Z[7]=r.createTextVNode(" Revert Settings to Default ")),r.createVNode(r.unref(xt),{name:"reverse"})],10,nP)])])],2))),128)),r.createElementVNode("div",{class:r.normalizeClass([{"pt-24":L.value},"pl-filter-manager__add-action-wrapper"])},[E.value.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:"pl-filter-manager__add-btn",onClick:Z[1]||(Z[1]=z=>R.value=!0)},[r.createElementVNode("div",rP,[r.createVNode(r.unref(At),{name:"add"})]),Z[8]||(Z[8]=r.createElementVNode("div",{class:"pl-filter-manager__add-btn-title text-s-btn"},"Add Filter",-1))])):r.createCommentVNode("",!0)],2),b.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",oP,"No filters applicable"))],512)]),_:1},8,["modelValue"]),r.createVNode(HB,{modelValue:R.value,"onUpdate:modelValue":Z[3]||(Z[3]=z=>R.value=z),"columns-by-id":c.value,"column-options":E.value,"filter-options":w.value,"make-filter":$,onAddFilter:Z[4]||(Z[4]=z=>m.state.push(z))},null,8,["modelValue","columns-by-id","column-options","filter-options"])],64))}}),ta=new Map;function sP(t,e){const n=r.getCurrentScope()??r.effectScope(),o=n.run(()=>(r.onScopeDispose(()=>{ta.delete(t)}),r.reactive(e())));return o[Symbol.dispose]=()=>{n.stop()},o}function aP(t){const e=Symbol();return()=>(ta.has(e)||ta.set(e,sP(e,t)),ta.get(e))}function lP(t){return r.computed(()=>{try{return nu(t())}catch(e){return{errors:[String(e)],value:void 0}}})}function cP(t,e,n){const o=r.ref(0),i=r.reactive({loading:r.computed(()=>o.value>0),loadingRef:o,value:void 0,error:void 0}),l=Mg(e);return r.watch(t,async c=>{i.error=void 0,o.value++,l(c).then(d=>{d.ok&&(i.value=d.value)}).catch(d=>{i.value=void 0,i.error=d}).finally(()=>{o.value--})},Object.assign({immediate:!0,deep:!0},n??{})),i}const Bo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Gh=new Set,yc=typeof process=="object"&&process?process:{},$h=(t,e,n,o)=>{typeof yc.emitWarning=="function"?yc.emitWarning(t,e,n,o):console.error(`[${n}] ${e}: ${t}`)};let na=globalThis.AbortController,zh=globalThis.AbortSignal;if(typeof na>"u"){zh=class{constructor(){Ze(this,"onabort");Ze(this,"_onabort",[]);Ze(this,"reason");Ze(this,"aborted",!1)}addEventListener(o,i){this._onabort.push(i)}},na=class{constructor(){Ze(this,"signal",new zh);e()}abort(o){var i,l;if(!this.signal.aborted){this.signal.reason=o,this.signal.aborted=!0;for(const c of this.signal._onabort)c(o);(l=(i=this.signal).onabort)==null||l.call(i,o)}}};let t=((Zh=yc.env)==null?void 0:Zh.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,$h("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 dP=t=>!Gh.has(t),Vr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Uh=t=>Vr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ra:null:null;class ra extends Array{constructor(e){super(e),this.fill(0)}}const Jr=class Jr{constructor(e,n){Ze(this,"heap");Ze(this,"length");if(!x(Jr,Po))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=Uh(e);if(!n)return[];ye(Jr,Po,!0);const o=new Jr(e,n);return ye(Jr,Po,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Po=new WeakMap,ze(Jr,Po,!1);let _c=Jr;const wc=class wc{constructor(e){ze(this,re);ze(this,vn);ze(this,Ht);ze(this,wn);ze(this,bn);ze(this,Ro);ze(this,Do);Ze(this,"ttl");Ze(this,"ttlResolution");Ze(this,"ttlAutopurge");Ze(this,"updateAgeOnGet");Ze(this,"updateAgeOnHas");Ze(this,"allowStale");Ze(this,"noDisposeOnSet");Ze(this,"noUpdateTTL");Ze(this,"maxEntrySize");Ze(this,"sizeCalculation");Ze(this,"noDeleteOnFetchRejection");Ze(this,"noDeleteOnStaleGet");Ze(this,"allowStaleOnFetchAbort");Ze(this,"allowStaleOnFetchRejection");Ze(this,"ignoreFetchAbort");ze(this,ut);ze(this,xn);ze(this,dt);ze(this,Je);ze(this,ke);ze(this,Rt);ze(this,qt);ze(this,St);ze(this,mt);ze(this,kn);ze(this,gt);ze(this,En);ze(this,Sn);ze(this,Kt);ze(this,Tn);ze(this,Ar);ze(this,Dt);ze(this,Qr,()=>{});ze(this,Qn,()=>{});ze(this,Ui,()=>{});ze(this,Yt,()=>!1);ze(this,eo,e=>{});ze(this,Io,(e,n,o)=>{});ze(this,Zi,(e,n,o,i)=>{if(o||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ze(this,Wh,"LRUCache");const{max:n=0,ttl:o,ttlResolution:i=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:d,allowStale:p,dispose:h,disposeAfter:m,noDisposeOnSet:y,noUpdateTTL:w,maxSize:b=0,maxEntrySize:E=0,sizeCalculation:$,fetchMethod:O,memoMethod:T,noDeleteOnFetchRejection:P,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:j,allowStaleOnFetchAbort:N,ignoreFetchAbort:v}=e;if(n!==0&&!Vr(n))throw new TypeError("max option must be a nonnegative integer");const L=n?Uh(n):Array;if(!L)throw new Error("invalid max value: "+n);if(ye(this,vn,n),ye(this,Ht,b),this.maxEntrySize=E||x(this,Ht),this.sizeCalculation=$,this.sizeCalculation){if(!x(this,Ht)&&!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(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(ye(this,Do,T),O!==void 0&&typeof O!="function")throw new TypeError("fetchMethod must be a function if specified");if(ye(this,Ro,O),ye(this,Ar,!!O),ye(this,dt,new Map),ye(this,Je,new Array(n).fill(void 0)),ye(this,ke,new Array(n).fill(void 0)),ye(this,Rt,new L(n)),ye(this,qt,new L(n)),ye(this,St,0),ye(this,mt,0),ye(this,kn,_c.create(n)),ye(this,ut,0),ye(this,xn,0),typeof h=="function"&&ye(this,wn,h),typeof m=="function"?(ye(this,bn,m),ye(this,gt,[])):(ye(this,bn,void 0),ye(this,gt,void 0)),ye(this,Tn,!!x(this,wn)),ye(this,Dt,!!x(this,bn)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!w,this.noDeleteOnFetchRejection=!!P,this.allowStaleOnFetchRejection=!!j,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(x(this,Ht)!==0&&!Vr(x(this,Ht)))throw new TypeError("maxSize must be a positive integer if specified");if(!Vr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ue(this,re,Tg).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!d,this.ttlResolution=Vr(i)||i===0?i:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!Vr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ue(this,re,Zd).call(this)}if(x(this,vn)===0&&this.ttl===0&&x(this,Ht)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!x(this,vn)&&!x(this,Ht)){const U="LRU_CACHE_UNBOUNDED";dP(U)&&(Gh.add(U),$h("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,wc))}}static unsafeExposeInternals(e){return{starts:x(e,Sn),ttls:x(e,Kt),sizes:x(e,En),keyMap:x(e,dt),keyList:x(e,Je),valList:x(e,ke),next:x(e,Rt),prev:x(e,qt),get head(){return x(e,St)},get tail(){return x(e,mt)},free:x(e,kn),isBackgroundFetch:n=>{var o;return ue(o=e,re,et).call(o,n)},backgroundFetch:(n,o,i,l)=>{var c;return ue(c=e,re,Xa).call(c,n,o,i,l)},moveToTail:n=>{var o;return ue(o=e,re,hs).call(o,n)},indexes:n=>{var o;return ue(o=e,re,Gr).call(o,n)},rindexes:n=>{var o;return ue(o=e,re,$r).call(o,n)},isStale:n=>{var o;return x(o=e,Yt).call(o,n)}}}get max(){return x(this,vn)}get maxSize(){return x(this,Ht)}get calculatedSize(){return x(this,xn)}get size(){return x(this,ut)}get fetchMethod(){return x(this,Ro)}get memoMethod(){return x(this,Do)}get dispose(){return x(this,wn)}get disposeAfter(){return x(this,bn)}getRemainingTTL(e){return x(this,dt).has(e)?1/0:0}*entries(){for(const e of ue(this,re,Gr).call(this))x(this,ke)[e]!==void 0&&x(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,x(this,ke)[e])&&(yield[x(this,Je)[e],x(this,ke)[e]])}*rentries(){for(const e of ue(this,re,$r).call(this))x(this,ke)[e]!==void 0&&x(this,Je)[e]!==void 0&&!ue(this,re,et).call(this,x(this,ke)[e])&&(yield[x(this,Je)[e],x(this,ke)[e]])}*keys(){for(const e of ue(this,re,Gr).call(this)){const n=x(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,x(this,ke)[e])&&(yield n)}}*rkeys(){for(const e of ue(this,re,$r).call(this)){const n=x(this,Je)[e];n!==void 0&&!ue(this,re,et).call(this,x(this,ke)[e])&&(yield n)}}*values(){for(const e of ue(this,re,Gr).call(this))x(this,ke)[e]!==void 0&&!ue(this,re,et).call(this,x(this,ke)[e])&&(yield x(this,ke)[e])}*rvalues(){for(const e of ue(this,re,$r).call(this))x(this,ke)[e]!==void 0&&!ue(this,re,et).call(this,x(this,ke)[e])&&(yield x(this,ke)[e])}[(jh=Symbol.iterator,Wh=Symbol.toStringTag,jh)](){return this.entries()}find(e,n={}){for(const o of ue(this,re,Gr).call(this)){const i=x(this,ke)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l!==void 0&&e(l,x(this,Je)[o],this))return this.get(x(this,Je)[o],n)}}forEach(e,n=this){for(const o of ue(this,re,Gr).call(this)){const i=x(this,ke)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,x(this,Je)[o],this)}}rforEach(e,n=this){for(const o of ue(this,re,$r).call(this)){const i=x(this,ke)[o],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;l!==void 0&&e.call(n,l,x(this,Je)[o],this)}}purgeStale(){let e=!1;for(const n of ue(this,re,$r).call(this,{allowStale:!0}))x(this,Yt).call(this,n)&&(ue(this,re,zr).call(this,x(this,Je)[n],"expire"),e=!0);return e}info(e){const n=x(this,dt).get(e);if(n===void 0)return;const o=x(this,ke)[n],i=ue(this,re,et).call(this,o)?o.__staleWhileFetching:o;if(i===void 0)return;const l={value:i};if(x(this,Kt)&&x(this,Sn)){const c=x(this,Kt)[n],d=x(this,Sn)[n];if(c&&d){const p=c-(Bo.now()-d);l.ttl=p,l.start=Date.now()}}return x(this,En)&&(l.size=x(this,En)[n]),l}dump(){const e=[];for(const n of ue(this,re,Gr).call(this,{allowStale:!0})){const o=x(this,Je)[n],i=x(this,ke)[n],l=ue(this,re,et).call(this,i)?i.__staleWhileFetching:i;if(l===void 0||o===void 0)continue;const c={value:l};if(x(this,Kt)&&x(this,Sn)){c.ttl=x(this,Kt)[n];const d=Bo.now()-x(this,Sn)[n];c.start=Math.floor(Date.now()-d)}x(this,En)&&(c.size=x(this,En)[n]),e.unshift([o,c])}return e}load(e){this.clear();for(const[n,o]of e){if(o.start){const i=Date.now()-o.start;o.start=Bo.now()-i}this.set(n,o.value,o)}}set(e,n,o={}){var w,b,E,$,O;if(n===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:p}=o;let{noUpdateTTL:h=this.noUpdateTTL}=o;const m=x(this,Zi).call(this,e,n,o.size||0,d);if(this.maxEntrySize&&m>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),ue(this,re,zr).call(this,e,"set"),this;let y=x(this,ut)===0?void 0:x(this,dt).get(e);if(y===void 0)y=x(this,ut)===0?x(this,mt):x(this,kn).length!==0?x(this,kn).pop():x(this,ut)===x(this,vn)?ue(this,re,Ya).call(this,!1):x(this,ut),x(this,Je)[y]=e,x(this,ke)[y]=n,x(this,dt).set(e,y),x(this,Rt)[x(this,mt)]=y,x(this,qt)[y]=x(this,mt),ye(this,mt,y),Ka(this,ut)._++,x(this,Io).call(this,y,m,p),p&&(p.set="add"),h=!1;else{ue(this,re,hs).call(this,y);const T=x(this,ke)[y];if(n!==T){if(x(this,Ar)&&ue(this,re,et).call(this,T)){T.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:P}=T;P!==void 0&&!c&&(x(this,Tn)&&((w=x(this,wn))==null||w.call(this,P,e,"set")),x(this,Dt)&&((b=x(this,gt))==null||b.push([P,e,"set"])))}else c||(x(this,Tn)&&((E=x(this,wn))==null||E.call(this,T,e,"set")),x(this,Dt)&&(($=x(this,gt))==null||$.push([T,e,"set"])));if(x(this,eo).call(this,y),x(this,Io).call(this,y,m,p),x(this,ke)[y]=n,p){p.set="replace";const P=T&&ue(this,re,et).call(this,T)?T.__staleWhileFetching:T;P!==void 0&&(p.oldValue=P)}}else p&&(p.set="update")}if(i!==0&&!x(this,Kt)&&ue(this,re,Zd).call(this),x(this,Kt)&&(h||x(this,Ui).call(this,y,i,l),p&&x(this,Qn).call(this,p,y)),!c&&x(this,Dt)&&x(this,gt)){const T=x(this,gt);let P;for(;P=T==null?void 0:T.shift();)(O=x(this,bn))==null||O.call(this,...P)}return this}pop(){var e;try{for(;x(this,ut);){const n=x(this,ke)[x(this,St)];if(ue(this,re,Ya).call(this,!0),ue(this,re,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(x(this,Dt)&&x(this,gt)){const n=x(this,gt);let o;for(;o=n==null?void 0:n.shift();)(e=x(this,bn))==null||e.call(this,...o)}}}has(e,n={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:i}=n,l=x(this,dt).get(e);if(l!==void 0){const c=x(this,ke)[l];if(ue(this,re,et).call(this,c)&&c.__staleWhileFetching===void 0)return!1;if(x(this,Yt).call(this,l))i&&(i.has="stale",x(this,Qn).call(this,i,l));else return o&&x(this,Qr).call(this,l),i&&(i.has="hit",x(this,Qn).call(this,i,l)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){const{allowStale:o=this.allowStale}=n,i=x(this,dt).get(e);if(i===void 0||!o&&x(this,Yt).call(this,i))return;const l=x(this,ke)[i];return ue(this,re,et).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:p=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:b=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:$,forceRefresh:O=!1,status:T,signal:P}=n;if(!x(this,Ar))return T&&(T.fetch="get"),this.get(e,{allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,status:T});const R={allowStale:o,updateAgeOnGet:i,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:d,size:p,sizeCalculation:h,noUpdateTTL:m,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:E,ignoreFetchAbort:b,status:T,signal:P};let j=x(this,dt).get(e);if(j===void 0){T&&(T.fetch="miss");const N=ue(this,re,Xa).call(this,e,j,R,$);return N.__returned=N}else{const N=x(this,ke)[j];if(ue(this,re,et).call(this,N)){const M=o&&N.__staleWhileFetching!==void 0;return T&&(T.fetch="inflight",M&&(T.returnedStale=!0)),M?N.__staleWhileFetching:N.__returned=N}const v=x(this,Yt).call(this,j);if(!O&&!v)return T&&(T.fetch="hit"),ue(this,re,hs).call(this,j),i&&x(this,Qr).call(this,j),T&&x(this,Qn).call(this,T,j),N;const L=ue(this,re,Xa).call(this,e,j,R,$),Q=L.__staleWhileFetching!==void 0&&o;return T&&(T.fetch=v?"stale":"refresh",Q&&v&&(T.returnedStale=!0)),Q?L.__staleWhileFetching:L.__returned=L}}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=x(this,Do);if(!o)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:l,...c}=n,d=this.get(e,c);if(!l&&d!==void 0)return d;const p=o(e,d,{options:c,context:i});return this.set(e,p,c),p}get(e,n={}){const{allowStale:o=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,d=x(this,dt).get(e);if(d!==void 0){const p=x(this,ke)[d],h=ue(this,re,et).call(this,p);return c&&x(this,Qn).call(this,c,d),x(this,Yt).call(this,d)?(c&&(c.get="stale"),h?(c&&o&&p.__staleWhileFetching!==void 0&&(c.returnedStale=!0),o?p.__staleWhileFetching:void 0):(l||ue(this,re,zr).call(this,e,"expire"),c&&o&&(c.returnedStale=!0),o?p:void 0)):(c&&(c.get="hit"),h?p.__staleWhileFetching:(ue(this,re,hs).call(this,d),i&&x(this,Qr).call(this,d),p))}else c&&(c.get="miss")}delete(e){return ue(this,re,zr).call(this,e,"delete")}clear(){return ue(this,re,Hd).call(this,"delete")}};vn=new WeakMap,Ht=new WeakMap,wn=new WeakMap,bn=new WeakMap,Ro=new WeakMap,Do=new WeakMap,ut=new WeakMap,xn=new WeakMap,dt=new WeakMap,Je=new WeakMap,ke=new WeakMap,Rt=new WeakMap,qt=new WeakMap,St=new WeakMap,mt=new WeakMap,kn=new WeakMap,gt=new WeakMap,En=new WeakMap,Sn=new WeakMap,Kt=new WeakMap,Tn=new WeakMap,Ar=new WeakMap,Dt=new WeakMap,re=new WeakSet,Zd=function(){const e=new ra(x(this,vn)),n=new ra(x(this,vn));ye(this,Kt,e),ye(this,Sn,n),ye(this,Ui,(l,c,d=Bo.now())=>{if(n[l]=c!==0?d:0,e[l]=c,c!==0&&this.ttlAutopurge){const p=setTimeout(()=>{x(this,Yt).call(this,l)&&ue(this,re,zr).call(this,x(this,Je)[l],"expire")},c+1);p.unref&&p.unref()}}),ye(this,Qr,l=>{n[l]=e[l]!==0?Bo.now():0}),ye(this,Qn,(l,c)=>{if(e[c]){const d=e[c],p=n[c];if(!d||!p)return;l.ttl=d,l.start=p,l.now=o||i();const h=l.now-p;l.remainingTTL=d-h}});let o=0;const i=()=>{const l=Bo.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=x(this,dt).get(l);if(c===void 0)return 0;const d=e[c],p=n[c];if(!d||!p)return 1/0;const h=(o||i())-p;return d-h},ye(this,Yt,l=>{const c=n[l],d=e[l];return!!d&&!!c&&(o||i())-c>d})},Qr=new WeakMap,Qn=new WeakMap,Ui=new WeakMap,Yt=new WeakMap,Tg=function(){const e=new ra(x(this,vn));ye(this,xn,0),ye(this,En,e),ye(this,eo,n=>{ye(this,xn,x(this,xn)-e[n]),e[n]=0}),ye(this,Zi,(n,o,i,l)=>{if(ue(this,re,et).call(this,o))return 0;if(!Vr(i))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(i=l(o,n),!Vr(i))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 i}),ye(this,Io,(n,o,i)=>{if(e[n]=o,x(this,Ht)){const l=x(this,Ht)-e[n];for(;x(this,xn)>l;)ue(this,re,Ya).call(this,!0)}ye(this,xn,x(this,xn)+e[n]),i&&(i.entrySize=o,i.totalCalculatedSize=x(this,xn))})},eo=new WeakMap,Io=new WeakMap,Zi=new WeakMap,Gr=function*({allowStale:e=this.allowStale}={}){if(x(this,ut))for(let n=x(this,mt);!(!ue(this,re,Wd).call(this,n)||((e||!x(this,Yt).call(this,n))&&(yield n),n===x(this,St)));)n=x(this,qt)[n]},$r=function*({allowStale:e=this.allowStale}={}){if(x(this,ut))for(let n=x(this,St);!(!ue(this,re,Wd).call(this,n)||((e||!x(this,Yt).call(this,n))&&(yield n),n===x(this,mt)));)n=x(this,Rt)[n]},Wd=function(e){return e!==void 0&&x(this,dt).get(x(this,Je)[e])===e},Ya=function(e){var l,c;const n=x(this,St),o=x(this,Je)[n],i=x(this,ke)[n];return x(this,Ar)&&ue(this,re,et).call(this,i)?i.__abortController.abort(new Error("evicted")):(x(this,Tn)||x(this,Dt))&&(x(this,Tn)&&((l=x(this,wn))==null||l.call(this,i,o,"evict")),x(this,Dt)&&((c=x(this,gt))==null||c.push([i,o,"evict"]))),x(this,eo).call(this,n),e&&(x(this,Je)[n]=void 0,x(this,ke)[n]=void 0,x(this,kn).push(n)),x(this,ut)===1?(ye(this,St,ye(this,mt,0)),x(this,kn).length=0):ye(this,St,x(this,Rt)[n]),x(this,dt).delete(o),Ka(this,ut)._--,n},Xa=function(e,n,o,i){const l=n===void 0?void 0:x(this,ke)[n];if(ue(this,re,et).call(this,l))return l;const c=new na,{signal:d}=o;d==null||d.addEventListener("abort",()=>c.abort(d.reason),{signal:c.signal});const p={signal:c.signal,options:o,context:i},h=($,O=!1)=>{const{aborted:T}=c.signal,P=o.ignoreFetchAbort&&$!==void 0;if(o.status&&(T&&!O?(o.status.fetchAborted=!0,o.status.fetchError=c.signal.reason,P&&(o.status.fetchAbortIgnored=!0)):o.status.fetchResolved=!0),T&&!P&&!O)return y(c.signal.reason);const R=b;return x(this,ke)[n]===b&&($===void 0?R.__staleWhileFetching?x(this,ke)[n]=R.__staleWhileFetching:ue(this,re,zr).call(this,e,"fetch"):(o.status&&(o.status.fetchUpdated=!0),this.set(e,$,p.options))),$},m=$=>(o.status&&(o.status.fetchRejected=!0,o.status.fetchError=$),y($)),y=$=>{const{aborted:O}=c.signal,T=O&&o.allowStaleOnFetchAbort,P=T||o.allowStaleOnFetchRejection,R=P||o.noDeleteOnFetchRejection,j=b;if(x(this,ke)[n]===b&&(!R||j.__staleWhileFetching===void 0?ue(this,re,zr).call(this,e,"fetch"):T||(x(this,ke)[n]=j.__staleWhileFetching)),P)return o.status&&j.__staleWhileFetching!==void 0&&(o.status.returnedStale=!0),j.__staleWhileFetching;if(j.__returned===j)throw $},w=($,O)=>{var P;const T=(P=x(this,Ro))==null?void 0:P.call(this,e,l,p);T&&T instanceof Promise&&T.then(R=>$(R===void 0?void 0:R),O),c.signal.addEventListener("abort",()=>{(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort)&&($(void 0),o.allowStaleOnFetchAbort&&($=R=>h(R,!0)))})};o.status&&(o.status.fetchDispatched=!0);const b=new Promise(w).then(h,m),E=Object.assign(b,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,E,{...p.options,status:void 0}),n=x(this,dt).get(e)):x(this,ke)[n]=E,E},et=function(e){if(!x(this,Ar))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof na},jd=function(e,n){x(this,qt)[n]=e,x(this,Rt)[e]=n},hs=function(e){e!==x(this,mt)&&(e===x(this,St)?ye(this,St,x(this,Rt)[e]):ue(this,re,jd).call(this,x(this,qt)[e],x(this,Rt)[e]),ue(this,re,jd).call(this,x(this,mt),e),ye(this,mt,e))},zr=function(e,n){var i,l,c,d;let o=!1;if(x(this,ut)!==0){const p=x(this,dt).get(e);if(p!==void 0)if(o=!0,x(this,ut)===1)ue(this,re,Hd).call(this,n);else{x(this,eo).call(this,p);const h=x(this,ke)[p];if(ue(this,re,et).call(this,h)?h.__abortController.abort(new Error("deleted")):(x(this,Tn)||x(this,Dt))&&(x(this,Tn)&&((i=x(this,wn))==null||i.call(this,h,e,n)),x(this,Dt)&&((l=x(this,gt))==null||l.push([h,e,n]))),x(this,dt).delete(e),x(this,Je)[p]=void 0,x(this,ke)[p]=void 0,p===x(this,mt))ye(this,mt,x(this,qt)[p]);else if(p===x(this,St))ye(this,St,x(this,Rt)[p]);else{const m=x(this,qt)[p];x(this,Rt)[m]=x(this,Rt)[p];const y=x(this,Rt)[p];x(this,qt)[y]=x(this,qt)[p]}Ka(this,ut)._--,x(this,kn).push(p)}}if(x(this,Dt)&&((c=x(this,gt))!=null&&c.length)){const p=x(this,gt);let h;for(;h=p==null?void 0:p.shift();)(d=x(this,bn))==null||d.call(this,...h)}return o},Hd=function(e){var n,o,i;for(const l of ue(this,re,$r).call(this,{allowStale:!0})){const c=x(this,ke)[l];if(ue(this,re,et).call(this,c))c.__abortController.abort(new Error("deleted"));else{const d=x(this,Je)[l];x(this,Tn)&&((n=x(this,wn))==null||n.call(this,c,d,e)),x(this,Dt)&&((o=x(this,gt))==null||o.push([c,d,e]))}}if(x(this,dt).clear(),x(this,ke).fill(void 0),x(this,Je).fill(void 0),x(this,Kt)&&x(this,Sn)&&(x(this,Kt).fill(0),x(this,Sn).fill(0)),x(this,En)&&x(this,En).fill(0),ye(this,St,0),ye(this,mt,0),x(this,kn).length=0,ye(this,xn,0),ye(this,ut,0),x(this,Dt)&&x(this,gt)){const l=x(this,gt);let c;for(;c=l==null?void 0:l.shift();)(i=x(this,bn))==null||i.call(this,...c)}};let Cc=wc;const uP={cacheSize:15e6};class pP{constructor(e){Ze(this,"_str");Ze(this,"_rawJson");Ze(this,"_zodSchema");Ze(this,"_validatedJson");this.bytes=e}get str(){return this._str===void 0&&(this._str=new TextDecoder().decode(this.bytes)),this._str}get rawJson(){return this._rawJson===void 0&&(this._rawJson=JSON.parse(this.str)),this._rawJson}validatedJson(e){return this._zodSchema!==e&&(this._validatedJson=e.parse(this.rawJson),this._zodSchema=e),this._validatedJson}}const to=class to{constructor(e){Ze(this,"fileDataCache");Ze(this,"fileDataRefs",new Map);const n={...uP,...e??{}};this.fileDataCache=new Cc({maxSize:n.cacheSize,fetchMethod:async o=>new pP(await ks().blobDriver.getContent(o)),sizeCalculation:o=>o.bytes.length,dispose:(o,i)=>{this.fileDataRefs.delete(i)}})}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 i=await this.fileDataCache.fetch(e);o.value=i}catch(i){console.error(i)}})(),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 i,l;return n===void 0?(i=o==null?void 0:o.value)==null?void 0:i.rawJson:(l=o==null?void 0:o.value)==null?void 0:l.validatedJson(n)})}static getContentBytes(e){return to.globalInstance.getContentBytes(e)}static getContentString(e){return to.globalInstance.getContentString(e)}static getContentJson(e,n){return to.globalInstance.getContentJson(e,n)}};Ze(to,"globalInstance",new to);let vc=to;I.AgGridTheme=Mu,I.BlockLayout=eV,I.ContextProvider=MS,I.DataTable=C0,I.DemoData=MN,I.DropdownListItem=vo,I.DropdownOverlay=Ul,I.LongText=$l,I.MultiError=ms,I.PlAccordion=Lk,I.PlAccordionSection=jk,I.PlAgCellFile=OV,I.PlAgColumnHeader=nh,I.PlAgDataTable=RV,I.PlAgDataTableRowNumberColId=Un,I.PlAgDataTableToolsPanel=xV,I.PlAgGridColumnManager=ah,I.PlAgOverlayLoading=Yp,I.PlAgOverlayNoRows=Xp,I.PlAgTextAndButtonCell=rh,I.PlAlert=Y0,I.PlBlockPage=F0,I.PlBtnAccent=fw,I.PlBtnDanger=gw,I.PlBtnGhost=wo,I.PlBtnGroup=dp,I.PlBtnLink=vw,I.PlBtnPrimary=As,I.PlBtnSecondary=Il,I.PlBtnSplit=cw,I.PlCheckbox=Hx,I.PlCheckboxGroup=Xx,I.PlChip=Zl,I.PlCloseModalBtn=wp,I.PlContainer=O0,I.PlDialogModal=jl,I.PlDropdown=bo,I.PlDropdownLegacy=_x,I.PlDropdownLine=vp,I.PlDropdownMulti=Wx,I.PlDropdownRef=Hb,I.PlEditableTitle=Zw,I.PlFileDialog=Np,I.PlFileInput=Zp,I.PlGrid=Z0,I.PlIcon16=Hr,I.PlIcon24=Ps,I.PlLogView=xp,I.PlMaskIcon16=At,I.PlMaskIcon24=xt,I.PlNotificationAlert=Wp,I.PlNumberField=Ax,I.PlProgressBar=xx,I.PlRow=G0,I.PlSearchField=gp,I.PlSectionSeparator=kp,I.PlSlideModal=Ds,I.PlSpacer=lp,I.PlTableFilters=iP,I.PlTabs=Bk,I.PlTextArea=Bb,I.PlTextField=qr,I.PlToggleSwitch=Is,I.PlTooltip=Ct,I.ReactiveFileContent=vc,I.Scrollable=N1,I.Slider=jp,I.SliderRange=k1,I.SliderRangeTriple=p1,I.ThemeSwitcher=V0,I.UnresolvedError=el,I.ValueOrErrorsComponent=FV,I.activateAgGrid=Ou,I.animate=np,I.animateInfinite=k0,I.autoSizeRowNumberColumn=th,I.call=Xu,I.computedResult=lP,I.createModel=sl,I.debounce=rp,I.defineApp=qC,I.defineStore=aP,I.delay=Ju,I.detectOutside=Pb,I.ensureError=rl,I.eventListener=zl,I.formatZodError=il,I.getElementScrollPosition=Cp,I.identity=nl,I.isDefined=Ug,I.isElementVisible=_p,I.isJsonEqual=tl,I.isZodError=ol,I.listToOptions=E0,I.makeEaseInOut=x0,I.makeEaseOut=tp,I.makeRowNumberColDef=eh,I.maskIcons16=LN,I.maskIcons24=ON,I.normalizeListOptions=vr,I.notEmpty=Al,I.randomInt=ep,I.randomString=b0,I.requestTick=Bl,I.scrollIntoView=Rs,I.showContextMenu=Tl,I.throttle=op,I.timeout=Qu,I.unwrapOptionalResult=zg,I.unwrapValueOrErrors=tu,I.useClickOutside=Bs,I.useDraggable=t1,I.useEventListener=st,I.useFormState=QS,I.useHover=Ku,I.useInterval=JS,I.useLabelNotch=Xn,I.useLocalStorage=ip,I.useMouse=qu,I.useMouseCapture=Cr,I.usePosition=vi,I.useQuery=e1,I.useResizeObserver=Hp,I.useScroll=YS,I.useSdkPlugin=bl,I.useSortable=Kp,I.useTheme=ap,I.useWatchFetch=cP,I.wrapOptionalResult=nu,I.wrapValueOrErrors=$g,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
|